Saravanan666/pypi-org huggingface dataset:
Package: listchaining
List chaining in PythonThe most commonly used methods of Javascript arrays and chaining in Python - just import the module!>>>importlistchaining>>>a=[1,2,3,4,5]>>>a.map(lambdax:x*2)[2,4,6,8,10]>>>b=a.map(lambdax:x*2)>>>a[1,2,3,4,5]>>>b[2,4,6,8,10]>>>nested=[1,2,[3,[4,5]]]>>>nested.flat(2).filter(lambdax:x>2).map(lambdax:x**2)[9,16,25]All functionality is taken from theMDN documentationand implemented in python by adding methods to the built-in class. All new methods do not directly modify class instances, but create copies (if required). All methods have chaining functionality, that is, they can be called sequentially, and at the same time the instance with which the next method works will be the value returned by the previous function (obviously apart from methods returning boolean or number).Differences from JavaScriptSome methods, due to the peculiarities of Python or the developer's ideas, have not been added or their functionality is slightly different from that described on MDN. Below is a list of them and a description of the differences.All methods:All camelCase functions are translated according to PEP 8 to snake_case: for exampleArray.lastIndexOf->list.last_index_ofAll methods that modify the object for which they are called have not been added, since such modifyings contradict the main idea of this libraryThe names of all methods of JavaScript objects that match the names of the built-in methods of the corresponding objects in Python have been changed because the library does not overwrite built-in methodsArray / List methods:Array.indexOfnot added because python has a built-in analog:list.indexArray.pop&Array.shiftandArray.push&Array.unshiftnot added because these methods modify the original object. In addition, there is a built-in analogue for any of these functions in python:list.pop&list.pop(0)andlist.append&list.insert(0, v), respectivelyArray.reverse->list.reversed, and now this method does not modify the array, but returns an reversed copyArray.sort->list.sorted, and now this method does not modify the array, but returns an sorted copy. In addition, the method takes as an argument not a function for comparison, but the standard arguments of thesortedbuilt-in function in Pythonlist.joinhas an additional argument thatArray.joindoes not have: a boolean parametercast_typesindicating whether non-string objects will be cast to string when concatenated, since the standard Python join function will simply throw an error if any of the being objects being merged have non-string typelist.concathas an additional argument thatArray.concatdoes not have: a boolean parameterexpand_stringsindicating if adding a string to the array needs to "expand" it as an array of individual characters or just add it to the array entirelyArray.splicenot added because this method changes the contents of an array in place
Package: list-cmath
introductionThis package(list_cmath 0.1)can save complex number by lists.Tips: Lists may like this:[0.125,0.625] is equivalent to 0.125+0.625i and python complex (0.125+0.625j).it will be call "complex list" after this tip.functionscAdd(a,b)introduction:cAdd(a,b)returns the sum of two complex numbers.argument:list(a): A complex list.list(b): Another complex list.outputlist(<re>): A complex list.Notes:<re>means a representation.cMult(u,v)introduction:cMult(u,v)returns the product of two complex numbers.argument:list(u): A complex list.list(v): Another complex list.outputlist(<re>): A complex list.cPow(x,n)introduction:cPow(x,n)returns the n-th power of complex number x.argument:list(x): A complex list.int(n): Power ofx.outputlist(t): A complex list.listToComplex(z)introduction:listToComplex(z)returns a python buit-incomplexthat equal to the input complex list.argument:list(x): A complex list.outputlist(<re>): A complex equal tox.complexToList(z)introduction:complexToList(z)returns a complex list that equal to the input python buit-incomplex.argument:complex(x): A complex.outputlist(<re>): A complex list equal tox.listsToComplexes(lists)introduction:listsToComplexes(lists)returns a list of complex.argument:list(lists): A list of list complex.Notes: example of "list of list complex":[[0.125,0.75],[0.625,0.25],[1.525,25.5]]outputlist(complexes): A list of complex,ietms in it are all equal to items inlists.complexesToLists(complexes)introduction:complexesToLists(complexes)returns a list of list complex.argument:list(complexes): A list of complex.outputlist(lists): A list of list complex,ietms in it are all equal to items incomplexes.lcSum(clist)introduction:lSum(clist)returns the sum of one-list of complex numbers.argument:list(clist): A list of list complex.outputlist(<re>): A list complex.lcMult(clist)introduction:lcMult(clist)returns the product of one-list of complex numbers.argument:list(clist): A list of list complex.outputlist(s): A list complex.lmagnitude(clist)introduction:lmagnitude(clist)returns the absolute value of one-list of complex number.argument:list(clist): A list of list complex.outputlist(r): A list complex.mandelbrot.mandelbrot(z,num)mandelbrot.mandelbrot_p(z,num,n)mandelbrot.mandelbrot_e(z,num,a)introduction:These funcions retuun the process num times and return the number of diverging times.argument:list(z): A list of list complex.int(num): A list of list complex.int(n): A list of list complex.string(a): A re.outputint(count): The number of diverging times.othersThis is the first version of 'list_complex' package,so it may be some bugs.Plese visitREADME.htmlin the package to get colorful options.
Package: listcolouring
listcolouringList colouring in Python with NetworkX.importnetworkxasnximportmatplotlib.pyplotaspltimportlistcolouringfromlistcolouringimportlist_init,greedy_list_edge_colouring,print_list_edge_colouringG=nx.petersen_graph()G=list_init(G,range(0,10),3,0)G=greedy_list_edge_colouring(G)options={'with_labels':True,'node_color':"white"}colors=nx.get_edge_attributes(G,'colour').values()nx.draw_shell(G,nlist=[range(5,10),range(5)],edge_color=colors,**options)plt.savefig("img/petersen-shell.png",format="PNG"
Package: listcompare
This module provides support to compare two lists that have same or different types of data in it.ExamplesOpen the ipython3 shell and import the modules$ import listcompare as plc$ lis1 = [1, 2 ,3]$ lis2 = [2, 1]$ plc.compare_list(lis1, dlis2) # Frue$ lis1 = [1, 2, 3]$ lis2 = [2, 1, '3']$ plc.compare_list(lis1, lis2) # False$ lis1 = ['1', '2', '3']$ lis2 = ['2', '1']$ plc.compare_list(lis1, lis2) # False$ lis1 = [1, 2, 3]$ lis2 = [2, 1, 3]$ plc.compare_list(lis1, lis2) # True$ lis1 = [{1: 1, 2: 2}]$ lis2 = [{1: 1, 2: 2}]$ plc.compare_list(lis1, lis2) # True$ lis1 = 123$ lis2 = [{1: 1, 2: 2}]$ plc.compare_list(lis1, lis2) # Exception will be raised$ lis1 = [1, 'a', {1: 1, 2: 2}, 3]$ lis2 = [3, 1, {1: 1, 2: 2}, 'a']]$ plc.compare_list(lis1, lis2) # True
Package: listcondalic
List license information from package specification fileCondaFor Conda environment:Create an environment specification file. Please followthis guideto create this file.Edit the file and remove all unnecessary dependencies (very important, otherwise the
it is easy to get inundated with too many packages). For example, remove things likeipython,ipykernel, which are used for purpose other than the library itself.Install this package.Run:listcondaliccondaenvironment.yml>output.jsonHereenvironment.ymlshould be the environment specification file.
The package licence information will be saved atoutput.json.PipNote: We useliccheckinternally to produce the analysis.Create your package specification file (e.g.requirements.txt)
including all the packages required.pipreqsis a good helping tool for this as well.Install this packageRun:listcondalicpiprequirements.txt>output.jsonThe package licence information will be saved atoutput.json.Existing problemsThis packages isn't quite clever yet:It tries to skip a few packages such aspython,setuptools,wheelandpip.
Hopefully, we won't neglect any important packages.It only understand very basic package specifications in the conda environment file.
Complicated package sources will likely create bugs in the result. In particular,
it does not suppoprt:"." (dot) package, or in general, if you specify a path to a local python package,
this library will not attempt to analyze the packaged located in that folder. Instead,
it will be registered as a package named, e.g. ".", and therefore it will report the
package's licence asNotFound.GitHub URL package, for reasons mentioned above.GitHub action templateFor a pip-basedrequirements.txt:name:Report licence statuson:workflow_dispatch:jobs:check-using-pip:name:Report using a pip environmentruns-on:ubuntu-20.04steps:-uses:actions/checkout@master-name:Set up Python 3.7uses:actions/setup-python@v1with:python-version:3.7-name:Install packages and listcondalicrun:|pip install -r requirements.txtpip install listcondalic-name:Produce reportrun:listcondalic pip requirements.txtFor a conda producedenvironment.yml:name: Report licence status

on:
  workflow_dispatch:

jobs:
  check-using-conda:
    name: Report using a conda environment
    runs-on: ubuntu-20.04
    steps:
    - uses: actions/checkout@master
    - name: Install conda and prepare the environment
      uses: conda-incubator/setup-miniconda@v2
      with:
        activate-environment: YOUR_ENVIRONMENT_NAME
        environment-file: environment.yml
        python-version: 3.7
        auto-activate-base: false
    - name: Install listcondalic
      shell: 'bash -l {0}' # this is required by the conda action
      run: pip install listcondalic
    - name: Produce report
      shell: 'bash -l {0}' # this is required by the conda action
      run: listcondalic conda environment.yml
Package: listcord.py
Listcord.pyAn official wrapper for the listcord api!Viewhttps://listcord.xyz/apidocsto view the raw api documentation!Installationpipinstalllistcord.pyGetting startedGet your api token fromhttps://listcord.xyz/me. The Listcord api is currently only available only for those who have bots registered in our botlist! After getting your token, make sure your token is kept somewhere secret!importlistcordclient=listcord.Client("Replace this with your token!")print(client.get_bot('some bot id'))This package also supports asynchronous fetching too!importlistcordimportasyncioclient=listcord.Client("Replace this with your token!")@asyncio.coroutinedefmain():bot=yield fromclient.get_bot_async('some bot id')print(bot)loop=asyncio.get_event_loop()loop.run_until_complete(main())MethodsThere are only some methods with the asynchronous ones too!client.get_bot('801976787264471120')# Returns the information of the bot!awaitclient.get_bot_async('801976787264471120')# Returns the information of the bot asynchronously!client.get_bot_reviews('801976787264471120');# Returns the array of reviews of the bot!awaitclient.get_bot_reviews_async('801976787264471120');# Returns the array of reviews of the bot asynchronously!client.get_review('user id','bot id');# Returns the review details by the discord id of the reviewer and the bot which was reviewed!awaitclient.get_review_async('user id','bot id');# Returns the review details by the discord id of the reviewer and the bot which was reviewed asynchronously!client.has_voted('user id','bot id');# Verify if the particular user has voted a paticular bot by id!awaitclient.has_voted_async('user id','bot id');# Verify if the particular user has voted a paticular bot by id asynchronously!client.search('shaz');# Returns the array of the bots which matches your query!awaitclient.search_async('shaz');# Returns the array of the bots which matches your query aynchronously!ContactJoin our discord serverWebsite
Package: listcrunch
ListCrunchA simple human-readable way to compress redundant sequential data.Examplefromlistcrunchimportcrunchcompressed_string=crunch([1,1,1,1,1,1,1,1,1,2])# Returns '1:0-8;2:9', meaning 1 appears in indices 0-8 (inclusive),# and 2 occurs at index 9.To uncompress, use theuncrunchfunction.fromlistcrunchimportuncrunchuncrunch('50:0-1,3-4;3:2,5;60:6;70:7-8')# Returns ['50', '50', '3', '50', '50', '3', '60', '70', '70']
Package: listcrypt
ListCryptSymmetric cryptographic algorithm built in python3.8( ListCrypt is NOT intended for production use )Example Use>>>fromlistcryptimportencrypt,decrypt>>>>>>key="example key">>>data="testing 1.. 2.. 3..">>>>>>e=encrypt(key,data)>>>print(e)b'AV#\x18t*\x12\x1c@\x01\x1b%U4k>M*w z\x7f\x17]afh\x07\x04'>>>>>>d=decrypt(key,e)>>>print(d)testing1..2..3..Easily Encrypt and Decrypt Files with the 'encrypt_file' and 'decrypt_file' Functions>>>fromlistcryptimportencrypt_file,decrypt_file>>>>>>file_name="file.txt">>>key="example key">>>>>>encrypt_file(key,path)True>>>decrypt_file(key,path)TrueDocumentation'''Functions:sha256(data: str) -> str:Simple hashing function, utilizes the builtin hashlib moduledata_verification(key:str, data:str) -> bool:Verifies that your data will be encrypted and decrypted without errorconvert_data(key:str, data:'any data type') -> str and str:Converts the data to a string format for encryptionconvert_data_back(metadata: list) -> anyConverts the data back to its origional type as given by the 'origional_data_type' parameterin the 'metadata' list.  This is built to work seamlessly with the 'convert_data' function.range_finder(data:str or bytes) -> int:Finds the character with the largest integer equivalent in your datacreate_key(key:str, data_length:int) -> bytesUses the sha256 hash of the 'key' parameter to create and concatenate more keys (based upon the origional) to a newkey variable that is either the same size as or slighty larger than the length of the datasegment_data(data:str, segments:int) -> listSplits the data evenly amongst the amount of 'segments' requiredpull_metadata(key:str, data:bytes) -> dictPulls metadata from the encrypted bytes and puts it in a dictionary for easy readibilityencrypt(key:'any data type', data:'any data type', processes=cpu_count()) -> bytesEncrypts the data by adding each characters integer equivalent to the integer equivalent of the character inthe same position in the new key variable generated by the 'key parameter'Nested Function:multiprocess_decryption(data:str, segment:int, shared_dictionary:dict) -> boolTakes chuncks of data and adds them to a shared dictionary,with the keys being the segments origional position for concatenationafter encryptiondecrypt(key:"any data type", encrypted_data:bytes, processes=cpu_count()) -> "origional data"Encrypts the data by adding each characters integer equivalent to the integer equivalent of the character inthe same position in the new key variable generated by the 'key parameter'Nested_Function:multiprocess_encryption(data:str, segment:int, shared_dictionary:dict) -> boolTakes chuncks of data and adds them to a shared dictionary,with the keys being the segments origional position for concatenationafter decryptionremove_image_exif(path:str) -> boolRemoves the metadata from the provided image, which may causeunwanted effects like image rotating, but will reduce the file size greatlyencrypt_file(key:str, path:str, metadata_removal=True) -> boolThis function enables the easy encryption of filesdecrypt_file(key:str, path:str) -> boolThis function enables the easy decryption of files'''
Package: list-dataloaders
List dataloadersThis repository contains an hyper-simple wrapper class that allows to iterate over a list of dataloaders in a transparent way.Installationpipinstalllist-dataloadersor directly from the repository:pipinstallgit+https://github.com/MorenoLaQuatra/list-dataloaders.gitUsagefromlist_dataloadersimportListDataLoaderslist_dataloaders=[]train_dl1=DataLoader(...)train_dl2=DataLoader(...)train_dl3=DataLoader(...)list_dataloaders.append(train_dl1)list_dataloaders.append(train_dl2)list_dataloaders.append(train_dl3)train_dls=ListDataLoaders(list_dataloaders)forbatchintrain_dls:print(batch)Options and parametersThe main classListDataLoadershas the following parameters:dataloaders: the list of dataloaders to iterate oververbose: ifTrue, prints the number of samples in each dataloader (default:False)weight_by_num_samples: ifTrue, the probability of sampling a dataloader is proportional to the number of samples in the dataloader (default:True)LicenseThis project is licensed under the terms of the MIT license.IssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.
Package: listdbm
Explaining The Library:This Library is Useful, Why?Because This Library can be used for.JSONFormat DatabasesExamples:Creating a User:from listdbm import SetUser

user = SetUser('rose', 'rosesecretpass1234', 'rosemail@gmail.com')SetUser Args:name,passwordandemailResult:list: [202, True, {'uuid': '1d0552db-4280-4d7b-83e5-a97a825ba3f5', ...}]Changelog 0.0.3Added own file Name SupportIn the User() functions likename,passwordandemailhave changed to variablesUnderstand More by Exploring...
Package: listdiff
OverviewDiff 2 python lists using a given keyUsagelistA=[3,2,1]listB=[5,4,3]inA,inBoth,inB=DiffUnsortedLists(listA=listA,listB=listB,keyA=lambdax:x,keyB=lambdax:x)assertinA==[1,2]assertinBoth==[(3,3)]assertinB==[4,5]listA=[1,2,3]listB=[3,4,5]resultB=DiffListsByKey(iterA=iter(listA),iterB=iter(listB),keyA=lambdax:x,keyB=lambdax:x)assertinA==[1,2]assertinBoth==[(3,3)]assertinB==[4,5]
Package: listdiffer
List DifferVersion: 0.2.0Calculates longest common sequence on text, lists of numbers or characters, or lists of objects.When comparing objects, make sure that the objects are hashable, i.e. override the__hash()__method of the class.
It is also a good idea to override the__eq()__method if you have some custom logic for comparing items.
This could be the case if your business logic considers close values as similar.If you want to compare two strings ignoring casing, then simply callloweron each string before passing as argument.ExamplesExample 1 - StringsCalculate a diff between two stringsSame stringsfromlistdifferimportdifferfirst='string'second='string'diff=differ.diff_text(first,second,False,False)assertlen(diff)==0Different stringsfromlistdifferimportdifferfirst='first string'second='second string'diff=differ.diff_text(first,second,False,False)assertlen(diff)==1Example 2 - List of integersCalculate a diff between two stringsSame listsfromlistdifferimportdifferfirst=[1,2,3]second=[1,2,3]d=differ.diff(first,second)assertlen(d)==0Different listsfromlistdifferimportdifferfirst=[1,2,3]second=[1,2,4]d=differ.diff(first,second)assertlen(d)==1Example 3 - Lists of objectsSame listsfromlistdifferimportdiffer@dataclassclassTestItem:text:strvalue:intdef__eq__(self,other):returnself.text==other.textandself.value==other.valuedef__hash__(self):returnhash((self.text,self.value))source=[TestItem('test',1),TestItem('test',2),TestItem('test',3)]compare=[TestItem('test',1),TestItem('test',2),TestItem('test',3)]result=differ.diff(source,compare)assertlen(result)==0Different listsfromlistdifferimportdiffer@dataclassclassTestItem:text:strvalue:intdef__eq__(self,other):returnself.text==other.textandself.value==other.valuedef__hash__(self):returnhash((self.text,self.value))source=[TestItem('test',1),TestItem('test',2),TestItem('test',3)]compare=[TestItem('test',1),TestItem('test',2),TestItem('test',3),TestItem('test',4)]result=differ.diff(source,compare)assertlen(result)==1
Package: listdownloader
AboutThis program simply takes a list of files as argument and a directory to download the files, and it downloads them sequentially, or in parallel. The program gives the option to load the whole list, or do parts of the list at a time. An option also is provided for how many threads/processes to be used.Installation(Installation was prepared for and tested with Debian Jessie.)You can install the package with pip using# pip install listdownloaderOR you can use the scripts that are provided to do that (run_build, andrun_install), which are available in the repository.OR you can create the source installation package yourself usingpython3 setup.py sdistand then use pip to install the package that will be built in the directorydist:# pip3 install listdownloader-x.y.z.tar.gzwhere x.y.z is the current version of the program.The program installs the package listdownloader and a script file for usage.Running the script and using the packageThe script can be executed (globally) using:$ downloadlist.py -f file.txt -d destination -t threads -l lineswhere:file.txtis the file name/path with the list of URLs to be downloadeddestinationis the path, to which the files should be downloadedthreadsis the number of processes to be used to download the URLs simultaneouslylinesis the number of lines to read from the files and read simultaneously. 0 leads to reading the whole file.You may use the package in your own scripts by importing it:import listdownloaderthen you can download a list of files using:listdownloader.download_files(URLs, destination, num_threads)where:URLsis a list of the URLs to be downloadeddestinationis a string with the path, at which the files have to be savednum_threadsis the number of threads/processes to use for the download.You can also download a single file using the function:listdownloader.download_file(URL, destination)LicenseMPLAboutThis script was written by Samer Afach,samer@afach.defor test purposes.
Package: listen
listenSimple but powerful signal handling to process OS signals in python##Example Usage:import listen
import subprocessInstanciate SignalHandlersig_hand = listen.SignalHandler()Start external processexternal_process = subprocess.Popen(['sh', '-c', 'sleep 30'])Register some signal handlers to kill external process on SIGINT (ctrl-c)kill_event = sig_hand.reg_on_status(external_process.kill)Wait for external processexternal_process.wait()Press ctrl-c to send SIGINT or alternatively use the following to unregister the eventsig_hand.del_status_event(kill_event)For a more detailed example including interaction with bash please see
the tests/example.py and tests/external_process.bash
Package: listenbrainz-export
listenbrainz_exportExport your scrobbling history formListenBrainz. ListenBrainz is a public/open-source alternative to RateYourMusicSince the data is public, no API key/Authentication is required.InstallationRequirespython3.7+To install with pip, run:pip install git+https://github.com/seanbreckenridge/listenbrainz_exportUsageProvide your listenbrainz username -- prints results to STDOUTlistenbrainz_export export seanbreckenridge > ./data.jsonCan also only request a few pages:listenbrainz_export export seanbreckenridge --pages 3Or can request only recent listens:listenbrainz_export export seanbreckenridge --days 30listenbrainz_export.parseincludes a model of the data and some functions to parse them into python objects, like:>>>fromlistenbrainz_export.parseimportiter_listens>>>listens=list(iter_listens("data.json"))>>>listens[12]Listen(track_name='Skate',artist_name='Bruno Mars, Anderson .Paak & Silk Sonic',listened_at=datetime.datetime(2021,11,6,19,10,49),inserted_at=datetime.datetime(2021,11,7,2,12,31),recording_id='e60b9417-acfe-4796-a048-76208fb4a9ad',release_name='Skate - Single',metadata={'artist_msid':'df6f6937-5de3-4e3c-bd74-1991ed92abd5','recording_msid':'e60b9417-acfe-4796-a048-76208fb4a9ad','release_msid':'dcf6d703-1e95-4e9c-8218-bb7c3b3bfa0b'},username='seanbreckenridge')I use this almost exclusively through myHPI; that locates my exports on disks and removes any duplicate scrobblesThis also includes aplaying-nowcommand, which prints the currently playing track, if any:listenbrainz_export playing-now seanbreckenridgeThat returns a JSON list, since you can have multiple songs playing at the same time).The return code is 0 if there is a song playing, 1 if there is no song playing.Testsgitclone'https://github.com/seanbreckenridge/listenbrainz_export'cd./listenbrainz_export
pipinstall'.[testing]'mypy./listenbrainz_export
flake8./listenbrainz_export