This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
listStyleDict
=============
1.a list-like thing implemented via dict whose keys are continuous intergs
for exzample:
['a','b','c','d','e','f']
will be represented in
{0:'a',1:'b',2:'c',3:'d',4:'e',5:'f'}
2.provide similiar functions/methods just as list
3.you can assign the start index
4.if you need to creat/handle a very large list whose elemetns are big/long strings,
using a dict with continuous intergs keys will seem to be faster sometimes.
import cProfile
import string
string\_Element = string.printable * 1000
def creat\_Via\_List\_Append(string\_Element,size):
L =[]
for i in range(0,size):
L.append(string\_Element)
return(L)
def creat\_Via\_Dict(string\_Element,size):
D = {}
for i in range(0,size):
D[i] = string\_Element
return(D)
cProfile.run('creat\_Via\_List\_Append(string\_Element,1000000)')
1000004 function calls in 10.571 seconds=================================================

Ordered by: standard name

ncalls tottime percall cumtime percall filename:lineno(function)
1 8.155 8.155 10.530 10.530 <stdin:1(creat\_via\_list\_append) <br=""> 1 0.040 0.040 10.570 10.570 <string:1(<module) <br=""> 1 0.001 0.001 10.571 10.571 {built-in method exec}
1000000 2.375 0.000 2.375 0.000 {method 'append' of 'list' objects}
1 0.000 0.000 0.000 0.000 {method 'disable' of '\_lsprof.Profiler' objects}

cProfile.run('creat\_Via\_Dict(string\_Element,1000000)')
4 function calls in 3.796 seconds============================================================

Ordered by: standard name

ncalls tottime percall cumtime percall filename:lineno(function)
1 3.332 3.332 3.332 3.332 <stdin:1(creat\_via\_dict) <br=""> 1 0.463 0.463 3.795 3.795 <string:1(<module) <br=""> 1 0.001 0.001 3.796 3.796 {built-in method exec}
1 0.000 0.000 0.000 0.000 {method 'disable' of '\_lsprof.Profiler' objects}



How To Use It
=============
import list\_Style\_Dict as lsd
f = lsd.funcs()
te = lsd.test()
myLSD = lsd.listStyleDict()
dir(f)
['D\_To\_LSD', 'LSD\_From\_Tuple\_List', 'LSD\_To\_L', 'LSD\_To\_T', 'LSD\_To\_Tuple\_List', 'LT\_To\_LSD', 'concat\_LSD', 'get\_All\_Continuous\_Slices\_Via\_Value', 'get\_First\_Continuous\_Slices\_Via\_Value', 'get\_Last\_Continuous\_Slices\_Via\_Value', 'is\_LSD']
dir(te)
['random\_LSD\_Generator', 'random\_LSD\_tuple\_List\_Generator', 'random\_List\_Generator', 'random\_Numindex\_Dict\_Generator', 'random\_Tuple\_Generator', 'random\_Tuple\_List\_Generator']
dir(myLSD)
['append', 'append\_LSD', 'clear', 'copy', 'count', 'deepcopy', 'extend', 'index', 'insert', 'insert\_LSD', 'pop', 'prepend', 'prepend\_LSD', 'readme', 'remove', 'reverse']
for the exzamples , refer to the readme dict or help(only in lsd.listStyleDict):
myLSD.help('append')

myLSD.LSD
{0: 1000, 1: 3000, 2: 1000, 3: 5000, 4: 3000, 5: 2000, 6: 4000, 7: 2000, 8: 5000, 9: 3000}
myLSD.append(88)
myLSD.LSD
{0: 1000, 1: 3000, 2: 1000, 3: 5000, 4: 3000, 5: 2000, 6: 4000, 7: 2000, 8: 5000, 9: 3000, 10: 88}
myLSD.start\_Index
0


print(f.readme['get\_First\_Continuous\_Slices\_Via\_Value'])

get\_First\_Continuous\_Slices\_Via\_Value(LSD,value)
import list\_Style\_Dict as lsd
LSD = { 1:100,2:22,3:100,4:100,5:55,6:66,7:77,8:100,9:100,10:100}
f = lsd.funcs()
f.get\_First\_Continuous\_Slices\_Via\_Value(LSD,100)
LSD = { 1:100,2:22,3:100,4:100,5:55,6:66,7:77,8:100,9:100,10:100}
f = lsd.funcs()
f.get\_First\_Continuous\_Slices\_Via\_Value(LSD,100)
{1: {1: 1}}


print(te.readme['random\_LSD\_Generator'])

random\_LSD\_Generator(SI,EI,SL)
(SI,EI) is the range of keys
SL is the values list to select
import list\_Style\_Dict as lsd
te = lsd.test()
LSD = te.random\_LSD\_Generator(1,101,[1000,2000,3000,4000,5000])
LSD
{1: 4000, 2: 3000, 3: 1000, 4: 1000, 5: 1000, 6: 4000, 7: 1000, 8: 2000, 9: 3000, 10: 5000, 11: 1000, 12: 2000, 13: 3000, 14: 4000, 15: 2000, 16: 4000, 17: 3000, 18: 3000, 19: 2000, 20: 1000, 21: 2000, 22: 4000, 23: 4000, 24: 5000, 25: 5000, 26: 1000, 27: 5000, 28: 2000, 29: 4000, 30: 5000, 31: 5000, 32: 1000, 33: 2000, 34: 4000, 35: 4000, 36: 2000, 37: 2000, 38: 4000, 39: 5000, 40: 4000, 41: 5000, 42: 4000, 43: 5000, 44: 5000, 45: 5000, 46: 3000, 47: 1000, 48: 3000, 49: 1000, 50: 2000, 51: 3000, 52: 5000, 53: 4000, 54: 3000, 55: 3000, 56: 4000, 57: 1000, 58: 2000, 59: 1000, 60: 3000, 61: 3000, 62: 5000, 63: 4000, 64: 2000, 65: 5000, 66: 4000, 67: 5000, 68: 4000, 69: 3000, 70: 2000, 71: 2000, 72: 3000, 73: 3000, 74: 4000, 75: 1000, 76: 5000, 77: 4000, 78: 1000, 79: 5000, 80: 4000, 81: 1000, 82: 5000, 83: 3000, 84: 3000, 85: 5000, 86: 1000, 87: 3000, 88: 5000, 89: 3000, 90: 5000, 91: 1000, 92: 5000, 93: 3000, 94: 3000, 95: 4000, 96: 4000, 97: 3000, 98: 5000, 99: 1000, 100: 4000, 101: 4000}



see below for details

1.myLSD = lsd.listStyleDict(start_Index=1,DLT=None) : init the class
---------------------------------------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('\_\_init\_\_')

\_\_init\_\_(start\_Index=1,DLT=None)
start\_Index is the first numeric index of the LSD
DLT is a list or a tuple or a LSD dict
self.LSD is a copy (but NOT deepcopy) of the DLT
import list\_Style\_Dict as lsd
LSD = lsd.listStyleDict()
LSD.LSD
{}
LSD.start\_Index
1
LSD = lsd.listStyleDict(5)
LSD.LSD
{}
LSD.start\_Index
5
LSD = lsd.listStyleDict(0,['a','b','c'])
LSD.LSD
{0: 'a', 1: 'b', 2: 'c'}
LSD.start\_Index
0
LSD = lsd.listStyleDict(1,['a','b','c'])
LSD.LSD
{1: 'a', 2: 'b', 3: 'c'}
LSD.start\_Index
1
LSD = lsd.listStyleDict(-1,['a','b','c'])
LSD.LSD
{0: 'b', 1: 'c', -1: 'a'}
LSD.start\_Index
-1
LSD = lsd.listStyleDict(10,('a','b','c'))
LSD.LSD
{10: 'a', 11: 'b', 12: 'c'}
LSD.start\_Index
10
LSD = lsd.listStyleDict(10,())
LSD.LSD
{}
LSD.start\_Index
10
LSD = lsd.listStyleDict(10,{1:11,2:22,3:33})
LSD.LSD
{10: 11, 11: 22, 12: 33}
LSD.start\_Index
10
LSD = lsd.listStyleDict(10,{1:11,2:22,5:33})
LSD.LSD
{}
LSD.start\_Index
10



2.myLSD[i]: get element
-----------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('\_\_getitem\_\_')

import list\_Style\_Dict as lsd
T
(1000, 3000, 5000, 2000, 5000, 2000, 2000, 2000, 1000, 2000, 1000, 3000, 1000, 4000, 4000, 2000, 3000, 1000, 1000, 5000)
myLSD = lsd.listStyleDict(start\_Index=0,DLT=T)
myLSD.LSD
{0: 1000, 1: 3000, 2: 5000, 3: 2000, 4: 5000, 5: 2000, 6: 2000, 7: 2000, 8: 1000, 9: 2000, 10: 1000, 11: 3000, 12: 1000, 13: 4000, 14: 4000, 15: 2000, 16: 3000, 17: 1000, 18: 1000, 19: 5000}
myLSD.start\_Index
0

for i in range(myLSD.start\_Index,myLSD.start\_Index+myLSD.LSD.\_\_len\_\_()):
... print(myLSD[i])
1000
3000
5000
2000
5000
2000
2000
2000
1000
2000
1000
3000
1000
4000
4000
2000
3000
1000
1000
5000
myLSD.LSD[2000]
Traceback (most recent call last):
File "<stdin", line="" 1,="" in="" <module="" <br=""> KeyError: 2000


3.myLSD[i] = value : set element
---------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('\_\_setitem\_\_')

can only set the "exsits" elements
myLSD.LSD[0]
1000
myLSD[0]=1111
myLSD[0]
1111
myLSD.LSD
{0: 1111, 1: 1000, 2: 1000, 3: 3000, 4: 4000, 5: 3000, 6: 2000, 7: 1000, 8: 5000, 9: 4000, 10: 2000, 11: 5000, 12: 5000, 13: 4000, 14: 3000, 15: 4000, 16: 1000, 17: 2000, 18: 4000, 19: 2000}

myLSD[20]=111111111
myLSD.LSD
{0: 1111, 1: 1000, 2: 1000, 3: 3000, 4: 4000, 5: 3000, 6: 2000, 7: 1000, 8: 5000, 9: 4000, 10: 2000, 11: 5000, 12: 5000, 13: 4000, 14: 3000, 15: 4000, 16: 1000, 17: 2000, 18: 4000, 19: 2000}
myLSD.start\_Index
-1



4.print(myLSD) :the output string when print "myLSD"
----------------------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('\_\_str\_\_')

import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict(start\_Index=0,DLT={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000})
myLSD.LSD
{0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.start\_Index
0
print(myLSD)
start\_Index:0 {0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}



5.myLSD : the output string when directly type "myLSD"
------------------------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('\_\_repr\_\_')

import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict(start\_Index=0,DLT={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000})
myLSD.LSD
{0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.start\_Index
0
myLSD
{0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}


6. myLSD.clear() : reset the myLSD.LSD to {} and myLSD.start_Index to 1
-----------------------------------------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('clear')

myLSD.LSD
{0: 5000, 1: 3000, 2: 2000, 3: 1000, 4: 1000, 5: 1000, 6: 2000, 7: 2000, 8: 5000, 9: 3000, 10: 5000, 11: 4000, 12: 2000, 13: 5000, 14: 2000, 15: 4000, 16: 5000, 17: 4000, 18: 1000, 19: 1000, 20: 2000, -2: 5000, -11: 4000, -10: 4000, -9: 1000, -8: 3000, -7: 3000, -6: 4000, -5: 4000, -4: 3000, -3: 1000, -1: 2000}
myLSD.LSD.clear()
myLSD.LSD
{}
myLSD.start\_Index
1


7. myLSD.copy(): get a copy of myLSD.LSD
----------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('copy')

myLSD.LSD
{0: 5000, 1: 3000, 2: 2000, 3: 1000, 4: 1000, 5: 1000, 6: 2000, 7: 2000, 8: 5000, 9: 3000, -2: 5000, -11: 4000, -10: 4000, -9: 1000, -8: 3000, -7: 3000, -6: 4000, -5: 4000, -4: 3000, -3: 1000, -1: 2000}
myLSD.copy()
{0: 5000, 1: 3000, 2: 2000, 3: 1000, 4: 1000, 5: 1000, 6: 2000, 7: 2000, 8: 5000, 9: 3000, -1: 2000, -11: 4000, -10: 4000, -9: 1000, -8: 3000, -7: 3000, -6: 4000, -5: 4000, -4: 3000, -3: 1000, -2: 5000}


8. myLSD.deepcopy(): get a deepcopy of myLSD.LSD
------------------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('deepcopy')

myLSD.LSD
{0: 5000, 1: 3000, 2: 2000, 3: 1000, 4: 1000, 5: 1000, 6: 2000, 7: 2000, 8: 5000, 9: 3000, -2: 5000, -11: 4000, -10: 4000, -9: 1000, -8: 3000, -7: 3000, -6: 4000, -5: 4000, -4: 3000, -3: 1000, -1: 2000}
myLSD.deepcopy()
{0: 5000, 1: 3000, 2: 2000, 3: 1000, 4: 1000, 5: 1000, 6: 2000, 7: 2000, 8: 5000, 9: 3000, -1: 2000, -11: 4000, -10: 4000, -9: 1000, -8: 3000, -7: 3000, -6: 4000, -5: 4000, -4: 3000, -3: 1000, -2: 5000}

9.myLSD.prepend(value): prepend a element
-----------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('prepend')

myLSD.LSD
{0: 1111, 1: 1000, 2: 1000, 3: 3000, 4: 4000, 5: 3000, 6: 2000, 7: 1000, 8: 5000, 9: 4000, 10: 2000, 11: 5000, 12: 5000, 13: 4000, 14: 3000, 15: 4000, 16: 1000, 17: 2000, 18: 4000, 19: 2000}

myLSD.prepend(800)
myLSD.LSD
{0: 1111, 1: 1000, 2: 1000, 3: 3000, 4: 4000, 5: 3000, 6: 2000, 7: 1000, 8: 5000, 9: 4000, 10: 2000, 11: 5000, 12: 5000, 13: 4000, 14: 3000, 15: 4000, 16: 1000, 17: 2000, 18: 4000, 19: 2000, -1: 800}
myLSD[-1]
800


10.myLSD.prepend_LSD(LSD): prepend another LSD dict
---------------------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('prepend\_LSD')

import list\_Style\_Dict as lsd
L = te.random\_List\_Generator(10,[1000,2000,3000,4000,5000])
L
[5000, 1000, 4000, 5000, 2000, 1000, 3000, 3000, 5000, 5000]
myLSD = lsd.listStyleDict(start\_Index=0,DLT=L)
myLSD.LSD
{0: 5000, 1: 1000, 2: 4000, 3: 5000, 4: 2000, 5: 1000, 6: 3000, 7: 3000, 8: 5000, 9: 5000}
myLSD.start\_Index
0

te = lsd.test()
LSD = te.random\_LSD\_Generator(0,10,[1000,2000,3000,4000,5000])
LSD
{0: 3000, 1: 5000, 2: 2000, 3: 1000, 4: 1000, 5: 4000, 6: 2000, 7: 4000, 8: 3000, 9: 3000, 10: 1000}

11.myLSD.append(value): append a element
----------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('append')

myLSD.LSD
{0: 1000, 1: 3000, 2: 1000, 3: 5000, 4: 3000, 5: 2000, 6: 4000, 7: 2000, 8: 5000, 9: 3000}
myLSD.append(88)
myLSD.LSD
{0: 1000, 1: 3000, 2: 1000, 3: 5000, 4: 3000, 5: 2000, 6: 4000, 7: 2000, 8: 5000, 9: 3000, 10: 88}
myLSD.start\_Index
0


12.myLSD.append_LSD(LSD): append another LSD dict
---------------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('append\_LSD')

myLSD.LSD
{0: 5000, 1: 3000, 2: 2000, 3: 1000, 4: 1000, 5: 1000, 6: 2000, 7: 2000, 8: 5000, 9: 3000, -1: 2000, -11: 4000, -10: 4000, -9: 1000, -8: 3000, -7: 3000, -6: 4000, -5: 4000, -4: 3000, -3: 1000, -2: 5000}
te = lsd.test()
LSD = te.random\_LSD\_Generator(0,10,[1000,2000,3000,4000,5000])
LSD
{0: 5000, 1: 4000, 2: 2000, 3: 5000, 4: 2000, 5: 4000, 6: 5000, 7: 4000, 8: 1000, 9: 1000, 10: 2000}
myLSD.append\_LSD(LSD)
myLSD.LSD
{0: 5000, 1: 3000, 2: 2000, 3: 1000, 4: 1000, 5: 1000, 6: 2000, 7: 2000, 8: 5000, 9: 3000, 10: 5000, 11: 4000, 12: 2000, 13: 5000, 14: 2000, 15: 4000, 16: 5000, 17: 4000, 18: 1000, 19: 1000, 20: 2000, -2: 5000, -11: 4000, -10: 4000, -9: 1000, -8: 3000, -7: 3000, -6: 4000, -5: 4000, -4: 3000, -3: 1000, -1: 2000}



13.myLSD.insert(index,value): insert a element at the position of index
------------------------------------------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('insert')

myLSD.LSD
{0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.start\_Index
0
myLSD.insert(-2,-2)
myLSD.LSD
{0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.start\_Index
0
myLSD.insert(11,11)
myLSD.LSD
{0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.start\_Index
0

myLSD.insert(-1,-1)
myLSD.LSD
{0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000, -1: -1}
myLSD.start\_Index
-1
myLSD.insert(10,10)
myLSD.LSD
{0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000, 10: 10, -1: -1}
myLSD.start\_Index
-1
myLSD.insert(5,5555)
myLSD.LSD
{0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 5555, 6: 3000, 7: 1000, 8: 5000, 9: 5000, 10: 2000, 11: 10, -1: -1}
myLSD.start\_Index
-1
myLSD.insert(13,13)
myLSD.LSD
{0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 5555, 6: 3000, 7: 1000, 8: 5000, 9: 5000, 10: 2000, 11: 10, -1: -1}
myLSD.start\_Index
-1

14.myLSD.insert(index,LSD): insert a LSD from the position of index
-------------------------------------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('insert\_LSD')

import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()

LSD = {0: 3000, 1: 3000, 2: 1000, 3: 4000, 4: 5000, 5: 4000, 6: 1000, 7: 2000, 8: 3000, 9: 5000, 10: 2000}
myLSD.LSD={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.start\_Index = 0
myLSD.insert\_LSD(-12,LSD)
myLSD.LSD
{0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.start\_Index
0

LSD = {0: 3000, 1: 3000, 2: 1000, 3: 4000, 4: 5000, 5: 4000, 6: 1000, 7: 2000, 8: 3000, 9: 5000, 10: 2000}
myLSD.LSD={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.start\_Index = 0
myLSD.insert\_LSD(-11,LSD)
myLSD.LSD
{0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000, -1: 2000, -11: 3000, -10: 3000, -9: 1000, -8: 4000, -7: 5000, -6: 4000, -5: 1000, -4: 2000, -3: 3000, -2: 5000}
myLSD.start\_Index
-11


LSD = {0: 3000, 1: 3000, 2: 1000, 3: 4000, 4: 5000, 5: 4000, 6: 1000, 7: 2000, 8: 3000, 9: 5000, 10: 2000}
myLSD.LSD={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.start\_Index = 0
myLSD.insert\_LSD(-5,LSD)
myLSD.LSD
{0: 4000, 1: 1000, 2: 2000, 3: 3000, 4: 5000, 5: 2000, 6: 5000, 7: 4000, 8: 5000, 9: 4000, 10: 3000, 11: 3000, 12: 1000, 13: 5000, 14: 5000, 15: 2000, -2: 4000, -5: 3000, -4: 3000, -3: 1000, -1: 5000}
myLSD.start\_Index
-5


LSD = {0: 3000, 1: 3000, 2: 1000, 3: 4000, 4: 5000, 5: 4000, 6: 1000, 7: 2000, 8: 3000, 9: 5000, 10: 2000}
myLSD.LSD={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.start\_Index = 0
myLSD.insert\_LSD(0,LSD)
myLSD.LSD
{0: 3000, 1: 3000, 2: 1000, 3: 4000, 4: 5000, 5: 4000, 6: 1000, 7: 2000, 8: 3000, 9: 5000, 10: 2000, 11: 5000, 12: 4000, 13: 5000, 14: 4000, 15: 3000, 16: 3000, 17: 1000, 18: 5000, 19: 5000, 20: 2000}
myLSD.start\_Index
0

LSD = {0: 3000, 1: 3000, 2: 1000, 3: 4000, 4: 5000, 5: 4000, 6: 1000, 7: 2000, 8: 3000, 9: 5000, 10: 2000}
myLSD.LSD={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.start\_Index = 0
myLSD.insert\_LSD(5,LSD)
myLSD.LSD
{0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 3000, 7: 1000, 8: 4000, 9: 5000, 10: 4000, 11: 1000, 12: 2000, 13: 3000, 14: 5000, 15: 2000, 16: 3000, 17: 1000, 18: 5000, 19: 5000, 20: 2000}
myLSD.start\_Index
0

LSD = {0: 3000, 1: 3000, 2: 1000, 3: 4000, 4: 5000, 5: 4000, 6: 1000, 7: 2000, 8: 3000, 9: 5000, 10: 2000}
myLSD.LSD={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.start\_Index = 0
myLSD.insert\_LSD(9,LSD)
myLSD.LSD
{0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 3000, 10: 3000, 11: 1000, 12: 4000, 13: 5000, 14: 4000, 15: 1000, 16: 2000, 17: 3000, 18: 5000, 19: 2000, 20: 2000}
myLSD.start\_Index
0

LSD = {0: 3000, 1: 3000, 2: 1000, 3: 4000, 4: 5000, 5: 4000, 6: 1000, 7: 2000, 8: 3000, 9: 5000, 10: 2000}
myLSD.LSD={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.start\_Index = 0
myLSD.insert\_LSD(10,LSD)
myLSD.LSD
{0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000, 10: 3000, 11: 3000, 12: 1000, 13: 4000, 14: 5000, 15: 4000, 16: 1000, 17: 2000, 18: 3000, 19: 5000, 20: 2000}
myLSD.start\_Index
0

LSD = {0: 3000, 1: 3000, 2: 1000, 3: 4000, 4: 5000, 5: 4000, 6: 1000, 7: 2000, 8: 3000, 9: 5000, 10: 2000}
myLSD.LSD={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.start\_Index = 0
myLSD.insert\_LSD(11,LSD)
myLSD.LSD
{0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.start\_Index
0


myLSD = lsd.listStyleDict(start\_Index=4,DLT={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000})
LSD = {0: 3000, 1: 3000, 2: 1000, 3: 4000, 4: 5000, 5: 4000, 6: 1000, 7: 2000, 8: 3000, 9: 5000, 10: 2000}
myLSD.LSD
{4: 5000, 5: 4000, 6: 5000, 7: 4000, 8: 3000, 9: 3000, 10: 1000, 11: 5000, 12: 5000, 13: 2000}
myLSD.start\_Index
4
myLSD.insert\_LSD(11,LSD)
myLSD.LSD
{4: 5000, 5: 4000, 6: 5000, 7: 4000, 8: 3000, 9: 3000, 10: 1000, 11: 3000, 12: 3000, 13: 1000, 14: 4000, 15: 5000, 16: 4000, 17: 1000, 18: 2000, 19: 3000, 20: 5000, 21: 2000, 22: 5000, 23: 5000, 24: 2000}
myLSD.start\_Index
4

15. myLSD.count(value): return the counts of the value repeated times in the LSD
--------------------------------------------------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('count')

import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict(start\_Index=4,DLT={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000})
myLSD.LSD
{4: 5000, 5: 4000, 6: 5000, 7: 4000, 8: 3000, 9: 3000, 10: 1000, 11: 5000, 12: 5000, 13: 2000}
myLSD.start\_Index
4
myLSD.count(5000)
4
myLSD.count(4000)
2
myLSD.count(3000)
2
myLSD.count(1000)
1
myLSD.count(2000)
1

16. myLSD.extend(LSD):append another LSD dict,same as myLSD.append_LSD(LSD)
---------------------------------------------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('extend')

import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict(start\_Index=4,DLT={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000})
LSD = {0: 3000, 1: 3000, 2: 1000, 3: 4000, 4: 5000, 5: 4000, 6: 1000, 7: 2000, 8: 3000, 9: 5000, 10: 2000}
myLSD.LSD
{4: 5000, 5: 4000, 6: 5000, 7: 4000, 8: 3000, 9: 3000, 10: 1000, 11: 5000, 12: 5000, 13: 2000}
myLSD.start\_Index
4
myLSD.extend(LSD)
myLSD.LSD
{4: 5000, 5: 4000, 6: 5000, 7: 4000, 8: 3000, 9: 3000, 10: 1000, 11: 5000, 12: 5000, 13: 2000, 14: 3000, 15: 3000, 16: 1000, 17: 4000, 18: 5000, 19: 4000, 20: 1000, 21: 2000, 22: 3000, 23: 5000, 24: 2000}
myLSD.start\_Index
4


17. myLSD.index.first(value): return the index of the first element whose VALUE equal value
-------------------------------------------------------------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('index.first')

import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict(start\_Index=4,DLT={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000})
myLSD.LSD
{4: 5000, 5: 4000, 6: 5000, 7: 4000, 8: 3000, 9: 3000, 10: 1000, 11: 5000, 12: 5000, 13: 2000}
myLSD.start\_Index
4
myLSD.index.first(5000)
4
myLSD.index.first(4000)
5
myLSD.index.first(3000)
8
myLSD.index.first(2000)
13
myLSD.index.first(1000)
10



18. myLSD.index.last(value): return the index of the last element whose VALUE equal value
------------------------------------------------------------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('index.last')

import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict(start\_Index=4,DLT={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000})
myLSD.LSD
{4: 5000, 5: 4000, 6: 5000, 7: 4000, 8: 3000, 9: 3000, 10: 1000, 11: 5000, 12: 5000, 13: 2000}
myLSD.start\_Index
4
myLSD.index.last(5000)
12
myLSD.index.last(4000)
7
myLSD.index.last(3000)
9
myLSD.index.last(2000)
13
myLSD.index.last(1000)
10



19. myLSD.index.all(value):return the index of all the elements whose VALUE equal value,stored in a start-from-1 LSD
--------------------------------------------------------------------------------------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('index.all')

import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict(start\_Index=4,DLT={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000})
myLSD.LSD
{4: 5000, 5: 4000, 6: 5000, 7: 4000, 8: 3000, 9: 3000, 10: 1000, 11: 5000, 12: 5000, 13: 2000}
myLSD.start\_Index
4
myLSD.index.all(5000)
{1: 4, 2: 6, 3: 11, 4: 12}
myLSD.index.all(4000)
{1: 5, 2: 7}
myLSD.index.all(3000)
{1: 8, 2: 9}
myLSD.index.all(2000)
{1: 13}
myLSD.index.all(1000)
{1: 10}


20. myLSD.pop.index(index): remove the element myLSD.LSD[index] and return it
-----------------------------------------------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('pop.index')


import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict(start\_Index=4,DLT={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000})
myLSD.LSD
{4: 5000, 5: 4000, 6: 5000, 7: 4000, 8: 3000, 9: 3000, 10: 1000, 11: 5000, 12: 5000, 13: 2000}
myLSD.start\_Index
4
myLSD.pop.index(6)
5000
myLSD.LSD
{4: 5000, 5: 4000, 6: 4000, 7: 3000, 8: 3000, 9: 1000, 10: 5000, 11: 5000, 12: 2000}
myLSD.start\_Index
4



21. myLSD.pop.indexrange(SI,EI): remove the elements from myLSD.LSD[SI] to myLSD.LSD[EI] and return it in a start-from-1 LSD
----------------------------------------------------------------------------------------------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('pop.indexrange')


import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict(start\_Index=0,DLT={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000})
myLSD.LSD
{0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.start\_Index
0
myLSD.pop.indexrange(5,8)
{1: 3000, 2: 1000, 3: 5000, 4: 5000}
myLSD.LSD
{0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 2000}
myLSD.start\_Index
0




22. myLSD.pop.default(index): remove the element myLSD.LSD[index] and return it, same as myLSD.pop.index(index)
---------------------------------------------------------------------------------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('pop.default')


import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict(start\_Index=4,DLT={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000})
myLSD.LSD
{4: 5000, 5: 4000, 6: 5000, 7: 4000, 8: 3000, 9: 3000, 10: 1000, 11: 5000, 12: 5000, 13: 2000}
myLSD.start\_Index
4
myLSD.pop.default(6)
5000
myLSD.LSD
{4: 5000, 5: 4000, 6: 4000, 7: 3000, 8: 3000, 9: 1000, 10: 5000, 11: 5000, 12: 2000}
myLSD.start\_Index
4



23. myLSD.pop.value.first(value): remove the first element whose VALUE equal value and return it
------------------------------------------------------------------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('pop.value.first')

import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict(start\_Index=0,DLT={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000})
myLSD.LSD
{0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.start\_Index
0
myLSD.pop.value.first(4000)
4000
myLSD.LSD
{0: 5000, 1: 5000, 2: 4000, 3: 3000, 4: 3000, 5: 1000, 6: 5000, 7: 5000, 8: 2000}
myLSD.start\_Index
0



24. myLSD.pop.value.last(value): remove the last element whose VALUE equal value and return it
----------------------------------------------------------------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('pop.value.last')

import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict(start\_Index=0,DLT={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000})
myLSD.LSD
{0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.start\_Index
0
myLSD.pop.value.last(5000)
5000
myLSD.LSD
{0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 2000}
myLSD.start\_Index
0



25. myLSD.pop.value.all(value): remove all the elements whose VALUE equal value and return it in a start-from-1 LSD
-------------------------------------------------------------------------------------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('pop.value.all')


import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict(start\_Index=0,DLT={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000})
myLSD.LSD
{0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.start\_Index
0
myLSD.pop.value.all(5000)
{1: 5000, 2: 5000, 3: 5000, 4: 5000}
myLSD.LSD
{0: 4000, 1: 4000, 2: 3000, 3: 3000, 4: 1000, 5: 2000}
myLSD.start\_Index
0



26. myLSD.remove.index(index): remove the element myLSD.LSD[index]
------------------------------------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('remove.index')

import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict(start\_Index=0,DLT={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000})
myLSD.LSD
{0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.start\_Index
0
myLSD.remove.index(1)
myLSD.LSD
{0: 5000, 1: 5000, 2: 4000, 3: 3000, 4: 3000, 5: 1000, 6: 5000, 7: 5000, 8: 2000}
myLSD.start\_Index
0



27. myLSD.remove.indexrange(SI,EI): remove the elements from myLSD.LSD[SI] to myLSD.LSD[EI]
-------------------------------------------------------------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('remove.indexrange')

import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict(start\_Index=0,DLT={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000})
myLSD.LSD
{0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.start\_Index
0
myLSD.remove.indexrange(3,6)
myLSD.LSD
{0: 5000, 1: 4000, 2: 5000, 3: 5000, 4: 5000, 5: 2000}
myLSD.start\_Index
0

myLSD.help('remove.default')


28. myLSD.remove.default(index): remove the element myLSD.LSD[index] , same as myLSD.remove.index(index)
--------------------------------------------------------------------------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict(start\_Index=0,DLT={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000})
myLSD.LSD
{0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.start\_Index
0
myLSD.remove.default(1)
myLSD.LSD
{0: 5000, 1: 5000, 2: 4000, 3: 3000, 4: 3000, 5: 1000, 6: 5000, 7: 5000, 8: 2000}
myLSD.start\_Index
0



29. myLSD.remove.value.first(value): remove the first element whose VALUE equal value
-------------------------------------------------------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('remove.value.first')

import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict(start\_Index=0,DLT={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000})
myLSD
start\_Index:0 {0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.remove.value.first(4000)
myLSD
start\_Index:0 {0: 5000, 1: 5000, 2: 4000, 3: 3000, 4: 3000, 5: 1000, 6: 5000, 7: 5000, 8: 2000}



30. myLSD.remove.value.last(value): remove the last element whose VALUE equal value
-----------------------------------------------------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('remove.value.last')

import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict(start\_Index=0,DLT={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000})
myLSD
start\_Index:0 {0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.remove.value.last(5000)
myLSD
start\_Index:0 {0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 2000}



31. myLSD.remove.value.all(value): remove all the elements whose VALUE equal value in a start-from-1 LSD
--------------------------------------------------------------------------------------------------------
import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict()
myLSD.help('remove.value.all')

import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict(start\_Index=0,DLT={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000})
myLSD
start\_Index:0 {0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.remove.value.all(5000)
myLSD
start\_Index:0 {0: 4000, 1: 4000, 2: 3000, 3: 3000, 4: 1000, 5: 2000}



32.myLSD.reverse():
-------------------
myLSD.help('reverse')


import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict(start\_Index=0,DLT={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000})
myLSD
start\_Index:0 {0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.reverse()
myLSD
start\_Index:0 {0: 2000, 1: 5000, 2: 5000, 3: 1000, 4: 3000, 5: 3000, 6: 4000, 7: 5000, 8: 4000, 9: 5000}



33.myLSD.sort(inverse=False):
-----------------------------
myLSD.help('sort')


import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict(start\_Index=0,DLT={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000})
myLSD
start\_Index:0 {0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.sort()
myLSD myLSD
start\_Index:0 {0: 1000, 1: 2000, 2: 3000, 3: 3000, 4: 4000, 5: 4000, 6: 5000, 7: 5000, 8: 5000, 9: 5000}

import list\_Style\_Dict as lsd
myLSD = lsd.listStyleDict(start\_Index=0,DLT={0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000})
myLSD
start\_Index:0 {0: 5000, 1: 4000, 2: 5000, 3: 4000, 4: 3000, 5: 3000, 6: 1000, 7: 5000, 8: 5000, 9: 2000}
myLSD.sort(inverse=True)
myLSD
start\_Index:0 {0: 5000, 1: 5000, 2: 5000, 3: 5000, 4: 4000, 5: 4000, 6: 3000, 7: 3000, 8: 2000, 9: 1000}


Appendix:
=========
A1.class test
-------------
import list\_Style\_Dict as lsd
te = lsd.test()
dir(te)
['random\_LSD\_Generator', 'random\_LSD\_tuple\_List\_Generator', 'random\_List\_Generator', 'random\_Numindex\_Dict\_Generator', 'random\_Tuple\_Generator', 'random\_Tuple\_List\_Generator']
for each in te.readme:
... print(te.readme[each])
...

random\_Tuple\_List\_Generator(SI,EI,SL,size)
(SI,EI) is the range to select a tuple list element [0]
size si the len of the tuple list
SL is the values list to select a tuple list element [1]
import list\_Style\_Dict as lsd
te = lsd.test()
TL = te.random\_Tuple\_List\_Generator(30,80,[1000,2000,3000,4000,5000],12)
TL
[(64, 3000), (36, 3000), (71, 2000), (72, 3000), (31, 2000), (76, 2000), (80, 5000), (49, 3000), (54, 4000), (59, 2000), (30, 1000), (63, 1000)]



random\_LSD\_Generator(SI,EI,SL)
(SI,EI) is the range of keys
SL is the values list to select
import list\_Style\_Dict as lsd
te = lsd.test()
LSD = te.random\_LSD\_Generator(1,101,[1000,2000,3000,4000,5000])
LSD
{1: 4000, 2: 3000, 3: 1000, 4: 1000, 5: 1000, 6: 4000, 7: 1000, 8: 2000, 9: 3000, 10: 5000, 11: 1000, 12: 2000, 13: 3000, 14: 4000, 15: 2000, 16: 4000, 17: 3000, 18: 3000, 19: 2000, 20: 1000, 21: 2000, 22: 4000, 23: 4000, 24: 5000, 25: 5000, 26: 1000, 27: 5000, 28: 2000, 29: 4000, 30: 5000, 31: 5000, 32: 1000, 33: 2000, 34: 4000, 35: 4000, 36: 2000, 37: 2000, 38: 4000, 39: 5000, 40: 4000, 41: 5000, 42: 4000, 43: 5000, 44: 5000, 45: 5000, 46: 3000, 47: 1000, 48: 3000, 49: 1000, 50: 2000, 51: 3000, 52: 5000, 53: 4000, 54: 3000, 55: 3000, 56: 4000, 57: 1000, 58: 2000, 59: 1000, 60: 3000, 61: 3000, 62: 5000, 63: 4000, 64: 2000, 65: 5000, 66: 4000, 67: 5000, 68: 4000, 69: 3000, 70: 2000, 71: 2000, 72: 3000, 73: 3000, 74: 4000, 75: 1000, 76: 5000, 77: 4000, 78: 1000, 79: 5000, 80: 4000, 81: 1000, 82: 5000, 83: 3000, 84: 3000, 85: 5000, 86: 1000, 87: 3000, 88: 5000, 89: 3000, 90: 5000, 91: 1000, 92: 5000, 93: 3000, 94: 3000, 95: 4000, 96: 4000, 97: 3000, 98: 5000, 99: 1000, 100: 4000, 101: 4000}



random\_List\_Generator(size,SL)
size si the len of the list
SL is the values list to select
import list\_Style\_Dict as lsd
te = lsd.test()
L = te.random\_List\_Generator(20,[1000,2000,3000,4000,5000])
L
[3000, 4000, 3000, 4000, 4000, 5000, 4000, 3000, 1000, 4000, 1000, 2000, 2000, 1000, 4000, 1000, 5000, 1000, 1000, 1000]



random\_LSD\_tuple\_List\_Generator(SI,EI,SL)
(SI,EI) is the range of a tuple list elements [0]
SL is the values list to select a tuple list element [1]
import list\_Style\_Dict as lsd
te = lsd.test()
LSD\_TL = te.random\_LSD\_tuple\_List\_Generator(0,20,[1000,2000,3000,4000,5000])
LSD\_TL
[(0, 3000), (1, 4000), (2, 5000), (3, 1000), (4, 4000), (5, 5000), (6, 3000), (7, 3000), (8, 1000), (9, 1000), (10, 4000), (11, 5000), (12, 5000), (13, 2000), (14, 2000), (15, 3000), (16, 1000), (17, 5000), (18, 4000), (19, 5000), (20, 1000)]




random\_Numindex\_Dict\_Generator(SI,EI,SL,size)
(SI,EI) is the range to select a key
size si the len of the dict
SL is the values list to select
import list\_Style\_Dict as lsd
te = lsd.test()
NiD = te.random\_Numindex\_Dict\_Generator(30,80,[1000,2000,3000,4000,5000],12)
NiD
{64: 5000, 65: 3000, 67: 1000, 68: 4000, 37: 1000, 40: 5000, 48: 2000, 52: 4000, 53: 2000, 55: 2000, 60: 1000, 62: 3000}



random\_Tuple\_Generator(size,SL)
size si the len of the tuple
SL is the values list to select
import list\_Style\_Dict as lsd
te = lsd.test()
T = te.random\_Tuple\_Generator(20,[1000,2000,3000,4000,5000])
T
(4000, 3000, 4000, 1000, 5000, 1000, 4000, 1000, 4000, 1000, 3000, 1000, 1000, 3000, 4000, 1000, 1000, 4000, 5000, 2000)



A2.class funcs
--------------
import list\_Style\_Dict as lsd
f = lsd.funcs()
for each in f.readme:
... print(f.readme[each])
...

LSD\_To\_T(LSD)
import list\_Style\_Dict as lsd
te = lsd.test()
LSD = te.random\_LSD\_Generator(0,99,[1000,2000,3000,4000,5000])
LSD
{0: 1000, 1: 5000, 2: 1000, 3: 3000, 4: 4000, 5: 5000, 6: 4000, 7: 5000, 8: 1000, 9: 5000, 10: 4000, 11: 3000, 12: 4000, 13: 1000, 14: 1000, 15: 1000, 16: 4000, 17: 3000, 18: 4000, 19: 1000, 20: 3000, 21: 5000, 22: 5000, 23: 5000, 24: 5000, 25: 5000, 26: 3000, 27: 4000, 28: 5000, 29: 4000, 30: 3000, 31: 2000, 32: 1000, 33: 3000, 34: 2000, 35: 2000, 36: 3000, 37: 2000, 38: 2000, 39: 2000, 40: 4000, 41: 3000, 42: 1000, 43: 1000, 44: 5000, 45: 3000, 46: 3000, 47: 2000, 48: 2000, 49: 2000, 50: 2000, 51: 4000, 52: 1000, 53: 5000, 54: 1000, 55: 2000, 56: 2000, 57: 4000, 58: 4000, 59: 1000, 60: 3000, 61: 3000, 62: 1000, 63: 4000, 64: 1000, 65: 1000, 66: 2000, 67: 2000, 68: 5000, 69: 2000, 70: 3000, 71: 5000, 72: 5000, 73: 1000, 74: 3000, 75: 2000, 76: 3000, 77: 1000, 78: 5000, 79: 4000, 80: 1000, 81: 3000, 82: 4000, 83: 3000, 84: 4000, 85: 2000, 86: 2000, 87: 3000, 88: 4000, 89: 3000, 90: 4000, 91: 5000, 92: 1000, 93: 5000, 94: 2000, 95: 5000, 96: 5000, 97: 4000, 98: 5000, 99: 1000}
f.LSD\_To\_T(LSD)
(1000, 5000, 1000, 3000, 4000, 5000, 4000, 5000, 1000, 5000, 4000, 3000, 4000, 1000, 1000, 1000, 4000, 3000, 4000, 1000, 3000, 5000, 5000, 5000, 5000, 5000, 3000, 4000, 5000, 4000, 3000, 2000, 1000, 3000, 2000, 2000, 3000, 2000, 2000, 2000, 4000, 3000, 1000, 1000, 5000, 3000, 3000, 2000, 2000, 2000, 2000, 4000, 1000, 5000, 1000, 2000, 2000, 4000, 4000, 1000, 3000, 3000, 1000, 4000, 1000, 1000, 2000, 2000, 5000, 2000, 3000, 5000, 5000, 1000, 3000, 2000, 3000, 1000, 5000, 4000, 1000, 3000, 4000, 3000, 4000, 2000, 2000, 3000, 4000, 3000, 4000, 5000, 1000, 5000, 2000, 5000, 5000, 4000, 5000, 1000)



LSD\_To\_L(LSD)
import list\_Style\_Dict as lsd
te = lsd.test()
LSD = te.random\_LSD\_Generator(0,99,[1000,2000,3000,4000,5000])
LSD
{0: 1000, 1: 5000, 2: 1000, 3: 3000, 4: 4000, 5: 5000, 6: 4000, 7: 5000, 8: 1000, 9: 5000, 10: 4000, 11: 3000, 12: 4000, 13: 1000, 14: 1000, 15: 1000, 16: 4000, 17: 3000, 18: 4000, 19: 1000, 20: 3000, 21: 5000, 22: 5000, 23: 5000, 24: 5000, 25: 5000, 26: 3000, 27: 4000, 28: 5000, 29: 4000, 30: 3000, 31: 2000, 32: 1000, 33: 3000, 34: 2000, 35: 2000, 36: 3000, 37: 2000, 38: 2000, 39: 2000, 40: 4000, 41: 3000, 42: 1000, 43: 1000, 44: 5000, 45: 3000, 46: 3000, 47: 2000, 48: 2000, 49: 2000, 50: 2000, 51: 4000, 52: 1000, 53: 5000, 54: 1000, 55: 2000, 56: 2000, 57: 4000, 58: 4000, 59: 1000, 60: 3000, 61: 3000, 62: 1000, 63: 4000, 64: 1000, 65: 1000, 66: 2000, 67: 2000, 68: 5000, 69: 2000, 70: 3000, 71: 5000, 72: 5000, 73: 1000, 74: 3000, 75: 2000, 76: 3000, 77: 1000, 78: 5000, 79: 4000, 80: 1000, 81: 3000, 82: 4000, 83: 3000, 84: 4000, 85: 2000, 86: 2000, 87: 3000, 88: 4000, 89: 3000, 90: 4000, 91: 5000, 92: 1000, 93: 5000, 94: 2000, 95: 5000, 96: 5000, 97: 4000, 98: 5000, 99: 1000}
f.LSD\_To\_L(LSD)
[1000, 5000, 1000, 3000, 4000, 5000, 4000, 5000, 1000, 5000, 4000, 3000, 4000, 1000, 1000, 1000, 4000, 3000, 4000, 1000, 3000, 5000, 5000, 5000, 5000, 5000, 3000, 4000, 5000, 4000, 3000, 2000, 1000, 3000, 2000, 2000, 3000, 2000, 2000, 2000, 4000, 3000, 1000, 1000, 5000, 3000, 3000, 2000, 2000, 2000, 2000, 4000, 1000, 5000, 1000, 2000, 2000, 4000, 4000, 1000, 3000, 3000, 1000, 4000, 1000, 1000, 2000, 2000, 5000, 2000, 3000, 5000, 5000, 1000, 3000, 2000, 3000, 1000, 5000, 4000, 1000, 3000, 4000, 3000, 4000, 2000, 2000, 3000, 4000, 3000, 4000, 5000, 1000, 5000, 2000, 5000, 5000, 4000, 5000, 1000]



to judge id a dict is a LSD dict;
if the dict is a LSD dict ,return the start index;
else return None;

import list\_Style\_Dict as lsd
f = lsd.funcs()
D = {1:11,2:22,3:33}
f.is\_LSD(D)
1
D = {-1:11,0:22,1:33}
f.is\_LSD(D)
-1
D = {0:11,1:22,5:33}
f.is\_LSD(D)



LSD\_To\_Tuple\_List(LSD)
import list\_Style\_Dict as lsd
f=lsd.funcs()
D = {4:'a',5:'g',6:'x',7:'@'}
TL = f.LSD\_To\_Tuple\_List(D)
TL
[(4, 'a'), (5, 'g'), (6, 'x'), (7, '@')]



get\_All\_Continuous\_Slices\_Via\_Value(LSD,value)
import list\_Style\_Dict as lsd
LSD = { 1:100,2:22,3:100,4:100,5:55,6:66,7:77,8:100,9:100,10:100}
f = lsd.funcs()
f.get\_All\_Continuous\_Slices\_Via\_Value(LSD,100)
LSD = { 1:100,2:22,3:100,4:100,5:55,6:66,7:77,8:100,9:100,10:100}
f = lsd.funcs()
f.get\_All\_Continuous\_Slices\_Via\_Value(LSD,100)
{1: {1: 1}, 2: {1: 3, 2: 4}, 3: {1: 8, 2: 9, 3: 10}}



get\_First\_Continuous\_Slices\_Via\_Value(LSD,value)
import list\_Style\_Dict as lsd
LSD = { 1:100,2:22,3:100,4:100,5:55,6:66,7:77,8:100,9:100,10:100}
f = lsd.funcs()
f.get\_First\_Continuous\_Slices\_Via\_Value(LSD,100)
LSD = { 1:100,2:22,3:100,4:100,5:55,6:66,7:77,8:100,9:100,10:100}
f = lsd.funcs()
f.get\_First\_Continuous\_Slices\_Via\_Value(LSD,100)
{1: {1: 1}}



get\_Last\_Continuous\_Slices\_Via\_Value(LSD,value)
import list\_Style\_Dict as lsd
LSD = { 1:100,2:22,3:100,4:100,5:55,6:66,7:77,8:100,9:100,10:100}
f = lsd.funcs()
f.get\_Last\_Continuous\_Slices\_Via\_Value(LSD,100)
LSD = { 1:100,2:22,3:100,4:100,5:55,6:66,7:77,8:100,9:100,10:100}
f = lsd.funcs()
f.get\_Last\_Continuous\_Slices\_Via\_Value(LSD,100)
{1: 8, 2: 9, 3: 10}



convert a list or a tuple to a LSD,
if the start\_Index in paras is explicitly given,the new dict whose start\_Index equals the start\_Index in paras
if the start\_Index in paras is NOT explicitly given, the new dict whose start\_Index equals 0;
import list\_Style\_Dict as lsd
f = lsd.funcs()
L = [1,2,3]
new\_D = f.D\_To\_LSD(L,5)
new\_D
{5: 1, 6: 2, 7: 3}
T = (44,55,66)
new\_D = f.LT\_To\_LSD(T)
new\_D
{0: 44, 1: 55, 2: 66}



if a dict is a LSD , return a new dict which is a copy(but NOT deepcopy) of the original dict,
the new dict whose start\_Index equal the start\_Index in paras if it is explicitly given,
if the start\_Index in paras is NOT explicitly given,the new dict whose start\_Index equal the start\_Index of the LSD;
if a dict is NOT a LSD return None.
D\_To\_LSD(D,start\_Index=None)
import list\_Style\_Dict as lsd
f = lsd.funcs()
D = {1:11,2:22,3:33}
new\_D = f.D\_To\_LSD(D)
new\_D
{1: 11, 2: 22, 3: 33}
new\_D = f.D\_To\_LSD(D,5)
new\_D
{5: 11, 6: 22, 7: 33}
D
{1: 11, 2: 22, 3: 33}
D = {1:11,2:22,8:33}
new\_D = f.D\_To\_LSD(D,5)
new\_D



import list\_Style\_Dict as lsd
te = lsd.test()
LSD1 = te.random\_LSD\_Generator(0,20,[1000,2000,3000,4000,5000])
LSD2 = te.random\_LSD\_Generator(10,30,[1000,2000,3000,4000,5000])
LSD1
{0: 4000, 1: 2000, 2: 3000, 3: 2000, 4: 4000, 5: 2000, 6: 2000, 7: 4000, 8: 3000, 9: 1000, 10: 3000, 11: 5000, 12: 1000, 13: 1000, 14: 4000, 15: 5000, 16: 5000, 17: 1000, 18: 5000, 19: 1000, 20: 3000}
LSD2
{10: 1000, 11: 4000, 12: 3000, 13: 4000, 14: 5000, 15: 4000, 16: 4000, 17: 1000, 18: 2000, 19: 4000, 20: 5000, 21: 4000, 22: 2000, 23: 4000, 24: 4000, 25: 5000, 26: 5000, 27: 2000, 28: 2000, 29: 5000, 30: 5000}
f.concat\_LSD(LSD1,LSD2)
{0: 4000, 1: 2000, 2: 3000, 3: 2000, 4: 4000, 5: 2000, 6: 2000, 7: 4000, 8: 3000, 9: 1000, 10: 3000, 11: 5000, 12: 1000, 13: 1000, 14: 4000, 15: 5000, 16: 5000, 17: 1000, 18: 5000, 19: 1000, 20: 3000, 21: 1000, 22: 4000, 23: 3000, 24: 4000, 25: 5000, 26: 4000, 27: 4000, 28: 1000, 29: 2000, 30: 4000, 31: 5000, 32: 4000, 33: 2000, 34: 4000, 35: 4000, 36: 5000, 37: 5000, 38: 2000, 39: 2000, 40: 5000, 41: 5000}
f.concat\_LSD(LSD2,LSD1)
{10: 1000, 11: 4000, 12: 3000, 13: 4000, 14: 5000, 15: 4000, 16: 4000, 17: 1000, 18: 2000, 19: 4000, 20: 5000, 21: 4000, 22: 2000, 23: 4000, 24: 4000, 25: 5000, 26: 5000, 27: 2000, 28: 2000, 29: 5000, 30: 5000, 31: 4000, 32: 2000, 33: 3000, 34: 2000, 35: 4000, 36: 2000, 37: 2000, 38: 4000, 39: 3000, 40: 1000, 41: 3000, 42: 5000, 43: 1000, 44: 1000, 45: 4000, 46: 5000, 47: 5000, 48: 1000, 49: 5000, 50: 1000, 51: 3000}
LSD1
{0: 4000, 1: 2000, 2: 3000, 3: 2000, 4: 4000, 5: 2000, 6: 2000, 7: 4000, 8: 3000, 9: 1000, 10: 3000, 11: 5000, 12: 1000, 13: 1000, 14: 4000, 15: 5000, 16: 5000, 17: 1000, 18: 5000, 19: 1000, 20: 3000}
LSD2
{10: 1000, 11: 4000, 12: 3000, 13: 4000, 14: 5000, 15: 4000, 16: 4000, 17: 1000, 18: 2000, 19: 4000, 20: 5000, 21: 4000, 22: 2000, 23: 4000, 24: 4000, 25: 5000, 26: 5000, 27: 2000, 28: 2000, 29: 5000, 30: 5000}

D
{32: 5000, 70: 1000, 40: 3000, 41: 1000, 42: 5000, 43: 3000, 46: 4000, 47: 4000, 80: 5000, 51: 4000, 78: 5000, 79: 2000}

f.concat\_LSD(LSD1,D)

f.concat\_LSD(D,LSD2)

f.concat\_LSD(LSD1,{})
{0: 4000, 1: 2000, 2: 3000, 3: 2000, 4: 4000, 5: 2000, 6: 2000, 7: 4000, 8: 3000, 9: 1000, 10: 3000, 11: 5000, 12: 1000, 13: 1000, 14: 4000, 15: 5000, 16: 5000, 17: 1000, 18: 5000, 19: 1000, 20: 3000}

f.concat\_LSD({},LSD2)
{10: 1000, 11: 4000, 12: 3000, 13: 4000, 14: 5000, 15: 4000, 16: 4000, 17: 1000, 18: 2000, 19: 4000, 20: 5000, 21: 4000, 22: 2000, 23: 4000, 24: 4000, 25: 5000, 26: 5000, 27: 2000, 28: 2000, 29: 5000, 30: 5000}



import list\_Style\_Dict as lsd
f=lsd.funcs()
TL=[(4, 'a'), (5, 'g'), (6, 'x'), (7, '@')]
LSD = f.LSD\_From\_Tuple\_List(TL)
LSD
{4: 'a', 5: 'g', 6: 'x', 7: '@'}
Release History

Release History

0.00

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
list_Style_Dict-0.00.tar.gz (9.0 kB) Copy SHA256 Checksum SHA256 Source Dec 14, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting