Saravanan666/pypi-org huggingface dataset:
Package: pysource-codegen
Introductionpysource_codegenis able to generate random python code which can be compiled.
The compiled code should not be executed.This is still a very early version, but it does its job.
It is general useful to test tools like formatters, linters or anything which operates on python code.Install:pipinstallpysource-codegenUsage:The tool can be used over the CLI:pysource-codegen--seed42or as a library:frompysource_codegenimportgenerateseed=42print(generate(seed))You might findpysource-minimizealso useful
to reduce the generated code which triggers your bug down to a minimal code snipped,
which can be used to fix the issue.frompysource_codegenimportgeneratefrompysource_minimizeimportminimizedefcontains_bug(code):"""returns True if the code triggers a bug and False otherwise"""try:test_something_with(code)# might throwif"bug"incode:# maybe other checksreturnTrueexcept:returnTruereturnFalsedeffind_issue():forseedinrange(0,10000):code=generate(seed)ifcontains_bug(code):new_code=minimize(code,contains_bug)print("the following code triggers a bug")print(new_code)returnfind_issue()Bugs found in other projects:blackhttps://github.com/psf/black/issues/3676https://github.com/psf/black/issues/3678https://github.com/psf/black/issues/3677cpythonhttps://github.com/python/cpython/issues/109219https://github.com/python/cpython/issues/109823https://github.com/python/cpython/issues/109719https://github.com/python/cpython/issues/109627https://github.com/python/cpython/issues/109219https://github.com/python/cpython/issues/109118https://github.com/python/cpython/issues/109114Todo:refactor the existing codeuse probabilities for the ast-nodes from existing python code (use markov chains)support older python versionsallow to customize the probabilities to generate code to test specific language featureshypothesissupport
Package: pysourceinfo
The ‘pysourceinfo’ package provides basic runtime information on executed
sourcefiles based on ‘inspect’, ‘sys’, ‘os’, and additional sources.
The covered objects include packages, modules/files and functions/methods/scripts.The supported platforms are:Linux, BSD, Unix, OS-X, Cygwin, and WindowsPython2.7+, Python3.5+Online documentation:https://pysourceinfo.sourceforge.io/Runtime-Repository:PyPI:https://pypi.org/project/pysourceinfo/Install:pip install pysourceinfo, see also ‘Install’.Downloads:sourceforge.net:https://sourceforge.net/projects/pysourceinfo/files/bitbucket.org:https://bitbucket.org/acue/pysourceinfogithub.com:https://github.com/ArnoCan/pysourceinfo/pypi.org:https://pypi.org/project/pysourceinfo/Project DataPROJECT: ‘pysourceinfo’MISSION: Support easy access to RTTI on Python source and binary files.VERSION: 00.01RELEASE: 00.01.032STATUS: alphaAUTHOR: Arno-Can UestuensoezCOPYRIGHT: Copyright (C) 2010,2011,2015-2017 Arno-Can Uestuensoez @Ingenieurbuero Arno-Can UestuensoezLICENSE: Artistic-License-2.0 + Forced-Fairplay-ConstraintsPython support:Standard Python(CPython) - Python2.7, and Python3.5+PyPy - 5.10+ - Python2.7+, and Python3.5+OS-Support:Linux: Fedora, CentOS, Debian, and RaspbianBSD: OpenBSD, FreeBSDOS-X: Snow LeopardWindows: Win7, Win10CygwinUNIX: SolarisCurrent ReleaseMajor Changes:Python2.6 support dropped.Python3.5+ support introduced.PyPy tests added.Changed module structure and fitting names into overall category based naming schema.Split more stack related parts into packagePyStackInfoAdded special support for decorators.Added support for some special cases of Python syntax elements, e.g. support of nested-classes.Added several new functions.Enhanced documentation
Package: py-sourcemap
py-sourcemapA tinysource-map-mappingsbindings for python usingPyO3Platform SupportOperating SystemsLinuxmacOSWindows x86Windows x64✓✓✓✓PythonPython3.5Python3.6Python3.7✓✓✓Usagefrompy_sourcemapimportSourcemapParsersourcemap_parser=SourcemapParser("./tests/index.js.map")# pass line, column in, start from 1sourcemap_parser.original_location_for(1,195303)# (original_line, original_column, source_file_name, function_name_in_source) start from 1
Package: pysource-minimize
pysource-minimizeIf you build a linter, formatter or any other tool which has to analyse python source code you might end up searching bugs in pretty large input files.pysource_minimizeis able to remove everything from the python source which is not related to the problem.CLIYou can usepysource-minimizefrom the command line like follow:pysource-minimize--filebug.py--track"Assertion"--pythonbug.pyThis will runpython bug.pyand try to find the string "Assertion" in the output.
The--file bug.pygets minimized as long as "Assertion" is part of the output of the command.[!WARNING]
Be careful when you execute code which gets minimized.
It might be that some combination of the code you minimize erases your hard drive
or does other unintended things.APIExample:>>>frompysource_minimizeimportminimize>>>source="""...def f():...print("bug"+"other string")...return 1+1...f()...""">>>print(minimize(source,lambdanew_source:"bug"innew_source))"""bug"""
Package: pysourcesearch
This package will allow you to create your own search engines for your packages and sets of packages.
It’s not perfect, but I find it useful. It’s really fast and easier to find what you’re looking for often.You can search specifically for methods, classes and filenames or just do a full text search.It’s built on repoze.bfg, repoze.catalog and pygments.InstallStart off with a virtualenv:>>> virtualenv pysourcesearch --no-site-packages
>>> cd pysourcesearch
>>> ./bin/easy_install pysourcesearch
>>> ./bin/easy_install PasteScriptThen you can use the ini WSGI configuration provided with the package or create your own similar to this:>>> [app:main]
>>> use = egg:pysourcesearch#app
>>> debug_notfound = false
>>> catalogs_location = %(here)s/catalogs
>>> reindex = False
>>> package_groups =
>>>     Plone:/Applications/Plone/buildout-cache/eggs
>>> skipped_paths =
>>>             tests
>>>
>>> [server:main]
>>> use = egg:Paste#http
>>> host = 0.0.0.0
>>> port = 6543Then run:>>> ./bin/paster serve pysourcesearch.iniThe first time it runs it will take some time to index everything. If you tail the catalog you’ll
be able to see the status of indexing.>>> tail -f pysourcesearch.logConfigurationHere are some of the WSGI configuration options:* catalogs_location = Location where the indexes are stored
* reindex = If you want to reindex every time it's run
* package_groups = a list of locations to egg packages. This is normally a `buildout-cache/eggs` direction or a `lib/python2.6/site-packages` directory
* skipped_paths = a list of folders that you'd rather not index the contents of0.1Initial version
Package: pysox
pysox - python bindings for libsoxInstallation from sourceRequired prerequisite are the development libraries of sox at version 14.3.x,
i.e. the header files and libraries to link against.
Specifically you need sox.h in your include path and libsox.so and libsox.a in your link path.
Pysox will not compile against any sox version prior to 14.3.0.Then simply run:python setup.py build

python setup.py installUsageSee the examples included in the source, or the api doc athttp://packages.python.org/pysox/import pysox

#open an audio file
testwav = pysox.CSoxStream("test.wav")
#create an audio file with the same parameters as the input file
out = pysox.CSoxStream('out.wav', 'w', testwav.get_signal())

#create an effects chain using the signal and encoding parameters of our files
chain = pysox.CEffectsChain(testwav, out)
chain.add_effect(pysox.CEffect("vol",[b'18db']))
chain.flow_effects()
#cleanup
out.close()Python 3This package is compatible with python 3, tested on 2.6.6, 2.7.1, 3.0.1, 3.1.3 and 3.2.
It is however not compatible with python 2.5 and prior.
Package: pyspace-api
PyspaceEasily access NASA, ESA and JAXA dataAboutYou can use this API to access and see statistics about NASA, JAXA and ESA datasets. Check the available datasets and how to use them bellow.Available DatasetsESAmortality and natality
coronavirus cases worldwideJAXAgreenhouse gases concentrationNASAlandslides
atmospherical dataMain FunctionsConstructorsInitialize an object with the required dataDescribeGenerete statistics about all the features in the dataset, such as mean, standard deviation and quartiles.Examplesfrompyspace.nasaimportLandslideLS=Landslide(subset=100,verbose=True)print(LS.summarize())print(LS.df.head())
Package: pySpacebroClient
pySpacebroClient🌟 Connect easily to a [spacebro server](https://github.com/spacebro/spacebro).a port of nodejsspacebro-clientWhyNo more custom socket.io server.Easily connect with socket.io to other clients.Spacebro offers an API to connect clients input and output together.InstallationpipinstallpySpacebroClientUsageConnectfrompySpacebroClientimportSpacebroClientsettings={'host':'spacebro.space','port':3333,'client':{'name':'python-bro'},'channelName':'mychannelname'}spacebroClient=SpacebroClient(settings)spacebroClient.wait()Emit a message for an app callednode-brofrompySpacebroClientimportSpacebroClientsettings={'host':'spacebro.space','port':3333,'client':{'name':'python-bro'},'channelName':'mychannelname','out':{'outMedia':{'eventName':'outMedia','description':'Output media','type':'all'}},'connection':'python-bro/outMedia => node-bro/inMedia'}spacebroClient=SpacebroClient(settings)spacebroClient.emit(settings.out.outMedia.eventName,{'value':5})spacebroClient.wait()Receive a message from an app calledchokibrofrompySpacebroClientimportSpacebroClientdefon_inMedia(self,args):print('received',args)settings={'host':'spacebro.space','port':3333,'client':{'name':'python-bro'},'channelName':'mychannelname','in':{'inMedia':{'eventName':'inMedia','description':'Input media','type':'all'}},'connection':'chokibro/outMedia => python-bro/inMedia'}spacebroClient=SpacebroClient(settings)spacebroClient.on(settings['in'].inMedia.eventName,self.on_inMedia)spacebroClient.wait()test commandpython-mtests.test
Package: pySpacell
pySpacellA Python package for single-cell spatial image analysis.AvailabilityIt runs with python3.6It is available throughpip install pySpacellor downloadable viagit clone https://github.com/biocompibens/pySpacell.gitNB: the git depot contains large data files. To download them correctly,git lfs clone https://github.com/biocompibens/pySpacell.git. The rest of the files are not impacted by a standard git clone.Usage examplesExample data are located indata/along with exemple scripts inexample/
Package: pyspaces
Works with Linux namespaces through glibc with pure pythondiscuss:reddit,habrahabrGoalsThere is so many beautiful tools likedocker,rocketandvaggawritten in go and rust,
but none in python. I think that is because there is no easy way to work
with linux namespaces in python:you can useasylum-
a project that looks dead and with a codebase hosted not on
mainstream hub like githubor you can use thepython-libvirtbindings with a big layer of abstractionor just use the native glibc library with ctypesotherwise subprocess.Popen – your choiceI want to change this: I want to create native python bindings to glibc
with interface of python multiprocessing.Process.PS: you can look atpython-nsentertoo, it’s
looks awesome.PPS: new project from author of asylum -butterExampleFirst simple example:importosfrompyspacesimportContainerdefexecute(argv):os.execvp(argv[0],argv)cmd="mount -t proc proc /proc; ps ax"c=Container(target=execute,args=(('bash','-c',cmd),),uid_map='0 1000 1',newpid=True,newuser=True,newns=True)c.start()print("PID of child created by clone() is%ld\n"%c.pid)c.join()print("Child returned: pid%s, status%s"%(c.pid,c.exitcode))output:PIDofchildcreatedbyclone()is15978PIDTTYSTATTIMECOMMAND1pts/19S+0:00bash-cmount-tprocproc/proc;psax3pts/19R+0:00psaxChildreturned:pid15978,status0CLIspaceexecute-v--pid--mnt--user--uid1000--gid1000bash-c'mount -t proc /proc; ps ax'spacechroot--pid--uid'0 1000 1'~/.local/share/lxc/ubuntu/rootfs//bin/ls/home/spaceinject--net--mnt19840bashNote: If the program you’re trying to exec is dynamically linked, and
the dynamic linker is not present in /lib in the chroot environment -
you will get the following error: “OSError: [Errno 2] No such file or
directory”. You need all the other files the dynamic-linked program
depends on, including shared libraries and any essential
configuration/tables/etc in the new root directories.srcSecurityReadthis
articlepleaseChangelogon
githubdigestTODO[x] namespaces: clone & Container[x] CLI[x] Chroot[x] setns & inject[ ] cgroups[ ] SCM: apparmor & selinux[ ] capabilities[ ] mount[ ] network[ ] move CLI to separate package[ ] addons[ ] container list[ ] support for lxc, vagga, rocket, docker, etc…[ ] …[ ] one tool for rule them all!!1
Package: pyspace-toolkit
pyspaceinstallationgit clone -b pyspace_resources https://github.com/sahinbatmaz/resources.git pyspace_resources
cd pyspace_resources
pip install .

pip install pyspace-toolkit# UPGRADE
pip install pyspace-toolkit --no-deps --force-reinstallrequirements'sklearn','pandas','numpy',
    'matplotlib','seaborn',
    'rasa>=1.10.3','tensorflow',
    'lightgbm','xgboost',
    'spacy>=2.3.0','spacymoji',
    'stanza','nlpcube',
    'fuzzywuzzy','jellyfish>=0.8.2','fuzzy_sequence_matcher','fastdtw',
    'tabulate','tqdm','jsonlines',
    'sklearn-hierarchical-classification','JPype1','MiniSom'text classificationfrom pyspace.data.analyse import get_cv_predictions
from pyspace.data.metrics import get_confusion_report

# train # pandas DataFrame # required columns : ['Text', 'Intent']
outdf_avg, y_prob_matrix_avg_df =  get_cv_predictions(train, mode='text', cv=5, model_repeat_count=3, n_jobs=5, verbose=11,)

# outdf_avg # required columns : ['Text', 'Intent', 'y_pred'], additional columns : ['y_prob', 'y_2nd_pred', ...] 
get_confusion_report(outdf_avg, excel_file_path='./dataset_analysis.xlsx', y_prob_matrix_df=None)text gcnimport pandas as pd
train = pd.read_csv('dataset.csv')
train.columns = ['text', 'label']

from sklearn.model_selection import StratifiedKFold
skf = StratifiedKFold(n_splits=5, shuffle=True, random_state=0)
train_idx, test_idx = list(skf.split(list(train.index), train['label'].values))[4]

train['tot'] = None
train.at[train_idx, 'tot'] = 'train'
train.at[test_idx, 'tot'] = 'test'from pyspace.nlp.models.text_gcn.text_gcn import TextGCN_TransductiveClassifier
from pyspace.nlp.models.text_gcn.fast_text_gcn_norank import FastTextGCN_InductiveClassifier

fasttextgcn = FastTextGCN_InductiveClassifier(verbose=1, )
fasttextgcn.train(train, validation_ratio=0.0, batch_size=256, epochs=80, learning_rate=0.01)future workmaxpumperla/hyperashttps://www.kaggle.com/baghern/a-deep-dive-into-sklearn-pipelineshttps://www.kaggle.com/graymant/pytorch-regression-with-sklearn-pipelineshttps://gist.github.com/MaxHalford/9bfaa8daf8b4bc17a7fb7ba58c880675
Package: pyspacewar
Two ships duel in a gravity field.   Gravity doesn’t affect
the ships themselves (which have spanking new anti-gravity
devices), but it affects missiles launced by the ships.You can play against the computer, or two players can play
with one keyboard.  There is also a Gravity Wars mode, where
the two ships do not move, and the players repeatedly
specify the direction and velocity of their missiles.Latest changesUnreleased:April 23, 2019: Released version 1.1.1:
Package: pySpaceX
PySpaceXEasily access SpaceX's APIpySpaceX is an open-source API wrapper to make it easier to access data from the unofficialv4 SpaceX APIDocs·Report a bug·PyPiInstallationTo install you can simply install the package by using:python3 -m pip install pySpaceXThe code can also be directly downloaded from the latest release:https://github.com/TwoSails/pySpaceX/releasesUsageTo get started with using this wrapper we need to start with the creation of an api instance:frompySpaceXimportSpaceapi=Space()To get information about the API use:info=api.get_info()# Returns the info objectprint(info.company())# Returns data about the SpaceX companyYou can also get information about a dragon capsule by using:dragon=api.get_dragon()# Returns the dragon objectprint(dragon.one_dragon('5e9d058859b1ffd8e2ad5f90'))DocumentationAvailable athttps://pypi.org/project/pySpaceXContributingFeel free to contribute by opening anissueor apull request.Any help is greatly appreciated.All contributors will be listed on this repository.
Package: pySpack
pySpackPython wrapper for few Spack's commandsTLDR;Before use, be sure that you've got a exportedSPACK_ROOTfrompySpackimportPySpackif__name__=="__main__":spack=PySpack()spack.install('py-json5')# spack install py-json5 -> return boolspack.find('py-json5')# spack find py-json5 -> return boolspack.is_installable('py-json5')# spack list py-json5 -> return bool if package is available to installspack.uninstall('py-json5')# spack uninstall py-json5 -> return boolKnown issuesFirst installation take a lot of the timeFirst, try of installation any package will trigger the additional download and build of the dependencies -- yes, it can take a lot of time...Error: Spack could not find any compilers!Message:==> Error: Spack could not find any compilers!Solution: Regarding to thehttps://spack.readthedocs.io/en/latest/getting_started.html, install additional dependencies
Package: pyspage
pyspageQuickly build open source web pages for academic purposes in a pythonic and elegant way.InstallationpipinstallpyspageAn ExampleGo to directorydemo/, there is already a scriptscatter_hist.py.pyspagescatter_hist.py-sbA file namedscatter_hist.htmlis generated, your browser opens a tab and show it.UsageStep 1Create a new file namedindex.pywhich consists of mainly two parts,layoutandscript.In the layout part, alayoutvariable should be defined, of which the contents are the page elements named in a way you like. The hierarchical relationships are expressed by indenting.layout='''row_aboxrow_bcol_abtn_acol_bbtn_b'''In the script part, all the elements above should be created.frompyspageimport*importmatplotlib.pyplotaspltrow_a=Row()row_b=Row()col_a=Column()col_b=Column()box=Column(class_='col-6')btn_a=Button('CLICK a')btn_b=Button('CLICK b')You can define a function and let an element run it on a certain event happens.btn_a.onclick=lambdae:print('a is clicked!')defclick_b(e):fig,ax=plt.subplots()fruits=['apple','blueberry','cherry','orange']counts=[40,100,30,55]ax.bar(fruits,counts)box.write(fig)btn_b.onclick=click_bdefcreate_box():row_a.classList.add('bg-warning')box.write('This is the content.')box.oncreate=create_boxYou can create a figure withmatplotliboraltair, and show it in an empty box(roworcolumn) bybox.write(fig).Step 2In your terminal, run as followpyspageindex.pyaindex.htmlin current directory is generated.If you use the arguments-s(for server) and-b(for browser), pyspage will start a server on 127.0.0.1:8000 and open browser automatically.pyspageindex.py-sbDeploymentThis page can then be deployed onGitHub Pages, you don't have to bother about anything with HTML, JS or backend APIs.馃帀馃帀馃帀Supported Elements (Todo List)RowColumnTextButtonInputTextareaSelectOneSelectMultiFileImageLicenseTheMIT License.
Package: pyspam-classifier
Spam ClassifierClassifier a text into Spam or HamProject Organization├── LICENSE
├── Makefile           <- Makefile with commands like `make data` or `make train`
├── README.md          <- The top-level README for developers using this project.
├── data
│   ├── external       <- Data from third party sources.
│   ├── interim        <- Intermediate data that has been transformed.
│   ├── processed      <- The final, canonical data sets for modeling.
│   └── raw            <- The original, immutable data dump.
│
├── docs               <- A default Sphinx project; see sphinx-doc.org for details
│
├── models             <- Trained and serialized models, model predictions, or model summaries
│
├── notebooks          <- Jupyter notebooks. Naming convention is a number (for ordering),
│                         the creator's initials, and a short `-` delimited description, e.g.
│                         `1.0-jqp-initial-data-exploration`.
│
├── references         <- Data dictionaries, manuals, and all other explanatory materials.
│
├── reports            <- Generated analysis as HTML, PDF, LaTeX, etc.
│   └── figures        <- Generated graphics and figures to be used in reporting
│
├── requirements.txt   <- The requirements file for reproducing the analysis environment, e.g.
│                         generated with `pip freeze > requirements.txt`
│
├── setup.py           <- makes project pip installable (pip install -e .) so src can be imported
├── src                <- Source code for use in this project.
│   ├── __init__.py    <- Makes src a Python module
│   │
│   ├── data           <- Scripts to download or generate data
│   │   └── make_dataset.py
│   │
│   ├── features       <- Scripts to turn raw data into features for modeling
│   │   └── build_features.py
│   │
│   ├── models         <- Scripts to train models and then use trained models to make
│   │   │                 predictions
│   │   ├── predict_model.py
│   │   └── train_model.py
│   │
│   └── visualization  <- Scripts to create exploratory and results oriented visualizations
│       └── visualize.py
│
└── tox.ini            <- tox file with settings for running tox; see tox.readthedocs.ioProject based on thecookiecutter data science project template. #cookiecutterdatascience
Package: pyspamsum
spamsum is a fuzzy hash specifically designed for hashing email messages
to detect if they are SPAM. The spamsum utility includes the ability to
generate the spamsum hash and check a new message against a existing set
of hashes to find a match.pyspamsum is a Python wrapper for the core API of spamsum.The original spamsum code has been licensed under the terms of the
the Perl Artistic License. It has been slightly modifiedThe original code is Copyright Andrew Tridgell <tridge@samba.org> 2002.
It forms part of Andrew’s junkcode, and is available here:http://www.samba.org/junkcode/#spamsumThe spamsum code in this project is derived from an updated version that
was published at Linux.conf.au 2004:http://linux.anu.edu.au/linux.conf.au/2004/papers/junkcode/spamsumFor details on spamsum itself, please see the spamsum README:http://samba.org/ftp/unpacked/junkcode/spamsum/READMEInstallationAt a prompt, run:$ python setup.py installUsageOnce installed, here are some examples of usage:# Import spamsum and set up some strings
>>> import spamsum
>>> s1 = "I am the very model of a modern Major-General, I've information animal and vegetable and mineral"
>>> s2 = "I am the very model of a modern Brigadier, I've information animal and vegetable and something else"
>>> s3 = "Huh? Gilbert and Who?"

# Evaluate the edit distance between two strings
>>> spamsum.edit_distance(s1, s2)
27

# Evaluate the spamsum of some strings
>>> sum1 = spamsum.spamsum(s1)
>>> sum2 = spamsum.spamsum(s2)
>>> sum3 = spamsum.spamsum(s2)
>>> print sum1
3:kEvyc/sFIKwYclQY4MKLFE4Igu0uLzIKygn:kE6Ai3KQ/MKOgDKZn

# Compare two spamsums. 0 = no match, 100 = perfect match.
>>> spamsum.match(sum1, sum1)
100
>>> spamsum.match(sum1, sum2)
72
>>> spamsum.match(sum1, sum3)
0
Package: pyspapi
pyspapiAPIwrapper for SP servers written in Python.InstallationRequires Python 3.8 or higherWindowspipinstallpyspapiLinux/macOSsudoaptpip3installpyspapiQuick exampleChecking the balanceimportpyspapiprint(pyspapi.SPAPI(card_id='card_id',token='token').balance)More examples can be found in theexamplesLinksDiscord serverpyspapi documentationPyPiAPI documentation for SP sites