Saravanan666/pypi-org huggingface dataset:
Package: py2opt
2-Opt Search AlgorithmIn optimization, 2-opt is a simple local search algorithm with a special swapping mechanism that suits well to solve the
traveling salesman problem. This algorithm is sensitive to the initial point of search, i.e., its final results get
changed by different initial points. 2-opt runs very fast such that a tsp with 120 cities can be solved in less than
5 sec on the intel core i7. To get a more reliable result, you should run the 2-opt with different randomized initial
points for enough number of times. One more thing, the travelling salesman problem has many applications in real world
such as logistic planning or DNA sequencing. So, having a fast and simple method to solve the TSP is valuable. For more
detailed description, you can read this article:How to Solve the Traveling Salesman Problem — A Comparative AnalysisInstallThe module requires the following libraries:numpyrandom2Then, it can be installed using pip:pipinstallpy2optUsageTo use this module, you must have a distance matrixdist_matshowing the pair distance among all nodes. Then, the
first thing to do is create an instance of theRouteFinderclass. When you call thesolvemethod, you will get thebest_routeandbest_distanceof this problem. Check out the example below.frompy2opt.routefinderimportRouteFindercities_names=['A','B','C','D']dist_mat=[[0,29,15,35],[29,0,57,42],[15,57,0,61],[35,42,61,0]]route_finder=RouteFinder(dist_mat,cities_names,iterations=5)best_distance,best_route=route_finder.solve()print(best_distance)114print(best_route)['A','C','B','D']The solver finds out the optimum order (re: minimum total distance traveled) in which the nodes must be visited along
with the total distance traveled. Note that the 2-opt algorithm doesn't guarantee the global optimum similar to other
heuristic search algorithms. So, the results can vary in each iteration.And that's pretty much it!
Package: py-2-oracle-sql-orm
python-oraclesql-ormPython to Oracle SQL Object Relationship Mapping(ORM)AuthorsAlexandra KmetStanislav DzundzaInstallPreinstallation:DownloadOracle Instant Clientfor your OSUnzip itCreate ORACLE_CLIENT environment variable with unzipped directory pathReload your machineInstallationProject can be downloaded or installed using PyPI
To install from PyPI:ensure you have already installed Python 3.7+ and pip on machineopen terminal and run commandpip install py-2-oracle-sql-ormDatabaseWe provide database deployed on AzureUser: lab3
Password: lab3
Host: 40.117.92.106/pdb1UsageRules:Types of attribule must be specifiedclassTest:int_attr=intstr_attr=strlist_attr=list()object_attr=TestAttrdef__init__(self,int_attr,str_attr,list_attr,object_attr):self.int_attr=int_attrself.str_attr=str_attrself.list_attr=list_attrself.object_attr=object_attrSupported types:int,float,str,list,tuple,dict,set,frozenset,objectCreate instanse ofDbCredentialsand set your database credentials>>>db_credentials=DbCredentials('lab3','lab3','40.117.92.106/pdb1')Create instanse ofPy2SQLand connect to database>>>orm=Py2SQL()>>>orm.db_connect(db_credentials)Use provided methodsDon't forget to disconnect>>>orm.db_disconnect()ExampleFor better understanding it is highly recommended to start from examples included in projectClasses for demonstration are located indemo_classes.pyRunmain.pyto start demonstration
Package: py2pack
This script allows to generate RPM spec or DEB dsc files from Python modules.
It allows to list Python modules or search for them on the Python Package Index
(PyPI). Conveniently, it can fetch tarballs and changelogs making it an
universal tool to package Python modules.InstallationTo install py2pack from thePython Package Index, simply:$python3-mpipinstallpy2packYou can also check your distro of choice if they provide packages.
For openSUSE Tumbleweed and Leap 15.X, you can$sudozypperinstallpython3-py2packUsageLets suppose you want to packagezope.interfaceand you don’t know how it is named
exactly. First of all, you can search for it and download the source tarball if
you found the correct module:$py2packsearchzope.interfacesearchingformodulezope.interface...foundzope.interface-3.6.1$py2packfetchzope.interfacedownloadingpackagezope.interface-3.6.1...fromhttp://pypi.python.org/packages/source/z/zope.interface/zope.interface-3.6.1.tar.gzAs a next step you may want to generate a package recipe for your distribution.
ForRPM-based distributions (let’s useopenSUSEas an example), you want to
generate a spec file (named ‘python-zope.interface.spec’):$py2packgeneratezope.interface-topensuse.spec-fpython-zope.interface.specThe source tarball and the package recipe is all you need to generate theRPM(orDEB) file.
This final step may depend on which distribution you use. Again,
foropenSUSE(and by using theOpen Build Service), the complete recipe is:$oscmkpacpython-zope.interface$cdpython-zope.interface$py2packfetchzope.interface$py2packgeneratezope.interface-fpython-zope.interface.spec$oscbuild...Depending on the module, you may have to adapt the resulting spec file slightly.
To get further help about py2pack usage, issue the following command:$py2packhelpHacking and contributingYou can test py2pack from your git checkout by executing the py2pack module.Editsetup.cfgfile changing the version number. Adding +1 to the revision
number is enough. This step is mandatory to install locally the py2pack module.From the py2pack directory, install the py2pack module locally.$pipinstall-e.Now you can run your hackish py2pack version. It is usually located in
$HOME/.local/bin/py2pack$py2packForkthe repositoryon Github to start making your changes to themasterbranch (or branch off of it). Don’t forget to write a test for fixed issues or
implemented features whenever appropriate. You can invoke the testsuite from
the repository root directory viatox:$toxTo run a single test class viatox, use i.e.:$tox-epy38test.test_py2pack:Py2packTestCaseYou can also runpytestdirectly:$pytestIt assumes you have the test dependencies installed (available on PYTHONPATH)
on your system.copyright:2013 Sascha Peilicke.license:Apache-2.0, see LICENSE for more details.
Package: py2-package-finder
Python 2 Package FinderIf you're unlucky enough to still work on a legacy Python 2 codebase you may have to add new packages to your project, however all maintained packages have dropped support for Python 2 years ago. This tool will automatically find the last version of a package that was flagged as supporting a specific version of Python.InstallThe recommended way to install is to usepipx:pipx install py2-package-finderUsagepy2-package-finder [PACKAGE_NAME]You can specify a different Python version usingpy2-package-finder --python 3.4 [PACKAGE_NAME]
Package: py2pdf
Descriptionpy2pdf has one simple purpose: It takes a string with python source
code and creates a nice looking pdf file. The library is simple and
self-contained. All pdf generation is done by py2pdf itself. No font
files are needed.Quick example>>> import py2pdf
>>> text = open('py2pdf.py').read()
>>> f = open('tmp.pdf', 'wb')
>>> py2pdf.create_pdf(
...    text, f,
...    title='py2pdf',
...    pagesize=py2pdf.A4,
...    printed_by='Printed by ME',
...    file_date='2020-08-01')
>>> py2pdf.startfile('tmp.pdf')
Package: py2pip
The py2pip module provides an api to get the latest package of the supported version.Master repo:https://github.com/krmanish/py2pipMotivationPython Package has started droppingPython 2.7support.
And It's quite obvious(at least happens in one of my project) that those packages are used (as part of
requirements.txt) without version. And when we install those package again, we experience the error likezipp requires Python '>=3.6' but the running Python is 2.7.13  # Zip with latest release drops Py2 supportTherefore, to get the right Py2.7 supported version, we used to visit the pypi site and browse all the released version
and scan through the page to get the support version of it. This is a tedious and time consuming process.
Hence I got this idea to write a small script to get rid of that manual effort.PurposeThis helps to those who are looking for the package of the supported Py version specially the old one.
since the Python packages has started dropping Py2.7 support with the latest release.This is the master package for Py2pip using Python3.It has the following functions:
1. Required to pass python version and 3rd party package name
2. Log will work only if executed as a standalone script.
3. Log path dir: ~/.local/py2pip/InstallationTo install py2pip, type::pip install py2pipDevelopmentThis package is an help to find the package that support python2 or python2.7 but it's not limited to.
It's capable of to search any versions of python.All Python dependent packages are part of py2pip dev env. Code is part of pip installable path.
Package is written in Python3.7 so needs System or virtual env to have these packages installed.Python3Python3 Develpython3-setuptoolssystemd-develbeautifulsoup4aiohttppackagingUsage>> import py2pip
>> py2pip.process.Py2PIPManager('Django', '2.7').run()

    Django==1.11.28Using CLI:>> python3 -m py2pip --py-version 2.7 -p mock

    Execution time: 2.062346935272217
    Supported Version: mock==3.0.5LinksPackage home page::http://pypi.python.org/pypi/py2pipChanges log1.0.1(Alpha)Package Initialized with below featureGet passed python version supported packageLog the progress report success/failure into the file[Manish]1.0.2Package modification with below featureAccept custom log path to log the messageAccept user input to enable/disable debug message[Manish]
Package: py2pyAnalysis
Polygon AnalysisOur aim is to build a module which is enough to analyze a polygon and return some fruitful information like an angle, slope, sides, corner coordinates etc. So we buildpy2pyAnalysis. Two line of code is sufficient to tear down a polygon of upto 15 sides. For overview of the module, consider this page is sufficient, if you are intrested in the working behind the program then visitpy2pyDocumentsLet's take a look at it,polygon_analysis(file_name,show_and_save_contour='yes',show_and_save_analysis='yes',show_sides='yes',show_angles='yes',show_slope='yes',show_name='yes',save_data_to_csv='yes',font=cv2.FONT_HERSHEY_PLAIN)file_name :as clear from the name, it takes a file name, if the file is in the same directory then you can simply type name, else type the full path to the file.show_and _save_contour :it allows you to see the various shapes that program detects in the image, it will also save the image file in a folder to Data/file_name_analysis/contour image.
Everything that saves during the program related to this file will save in this particular folder only.show_and_save_analysis :it allows you to see the numerical data on the image itself. the data includes Sides, Angles, and Slope. also, the name of an image will also be written there, The image will also save in the same directory as above.Show_angles :This will show the angles on the image, changing it to NO will result to not showing angles on the image.Show_slope :This will show the Slope on the image, changing it to NO will result to not showing Slope on the image.font :you can change the Font if you want, Here is the list of some fontscv2.FONT_HERSHEY_SIMPLEXcv2.FONT_HERSHEY_PLAIN,cv2.FONT_HERSHEY_DUPLEXcv2.FONT_HERSHEY_COMPLEXcv2.FONT_HERSHEY_TRIPLEXcv2.FONT_HERSHEY_COMPLEX_SMALLcv2.FONT_HERSHEY_SCRIPT_SIMPLEXcv2.FONT_HERSHEY_SCRIPT_COMPLEXThis program returnsreturn(len(sides),sides,distance,slope,angles,Name)len(sides): :Number of sides in a detected Polygon.Sides :Tit returns the coordinates of the shape. Side[0] is the first [x,y] set. Similarly side[0][0] & side[0][1] will give you first x and y point respectivelly.Distances :It returns the distance between two points in pixels.Slope :It returns back the slope values corresponds to each side.Angle :It returns back an array of angles.Name :It returns back the name of the shape.If anytime you forgot the which come after which then just typeimportpy2pyAnalysisaspypy.help()and it will bring you the code below#https://pypi.org/project/py2pyAnalysis/#https://github.com/Pushkar-Singh-14/Polygon-Analysis#http://py2py.com/polygon-analysis-overview-and-explanation/Number_of_sides,Coordinates,Distance_in_pixels,Slopes,Angles,Names=py.polygon_analysis(file_name,show_and_save_contour='yes',show_and_save_analysis='yes',show_sides='yes',show_angles='yes',show_slope='yes',show_name='yes',save_data_to_csv='yes',font=cv2.FONT_HERSHEY_PLAIN)
Package: py2pyrecruitment2
Recruitment-Prediction-SystemRecruitment is one of the most important task in studentâ€™s & also organizations point of view. If there could be a model such that, it can predict the possibility of student to get recruited or placed in an organization or not, that can save lots of time of HR Managers , staffs & placement commitee.Complete explanation is given in the blog.Link to blog:https://rb.gy/mm6ps8
Package: py2QAN
2QAN2QAN is a quantum compiler for 2-local qubit Hamiltonian simulation algorithms. 2QAN uses algorithm-specific routing and scheduling techniques and can target different device topologies, different gate sets (e.g., CNOT/CX, SYC, iSWAP, sqrt_iSWAP, etc.).A mappingalgorithmbased on quadratic assignment problem (QAP) is implemented in 2QAN for small benchmarks.
The QAP mapper could find good qubit initial placements for small circuits, but becomes very slow for large circuits. For fast compilation, especially for circuits with more than 40 qubits, we encourage users to use other different qubit mapping techniques such as the ones inQiskitandtket.Requirements2QAN is using Qiskit (0.36.0) circuit representationOther required python packages can be found in requirement.txtInstallationPy2QAN can be downloaded and installed fromPyPIwith the command:pip install py2qanNote that Py2QAN requires Python 3.ExampleCheck out the exampleshereAttributionWhen using 2QAN for research, please cite:@article{lao20212QAN,
  title={{2QAN}: A quantum compiler for 2-local qubit Hamiltonian simulation algorithms},
  author={Lao, Lingling},
  journal={arXiv preprint arXiv:2108.02099},
  year={2021}
}
Package: py2quantikz
py2quantikzA library to convert Quantum code to LaTeX quantikz circuit diagrams.InstallationInstall usingpip:pipinstallpy2quantikzUsageInitialize a circuit usingQuantumCircuit()and pass in the number of qubits in the system.Use theapply()method ofQuantumCircuitto pass in aGateApplicationor a list ofGateApplicationto it.Get the circuit diagram code with thequantikz()method ofQuantumCircuit.frompy2quantikz.py2quantikzimportQuantumCircuit,GateApplicationasgaimportpy2quantikz.gatesasqgcircuit=QuantumCircuit(4)circuit.apply([ga(qg.H,0),ga(qg.H,2)])circuit.apply([ga(qg.X,1,0),ga(qg.X,3,2)])circuit.apply([ga(qg.M,0),ga(qg.M,2)])quantikz_repr=circuit.quantikz()print(quantikz_repr)This will result inQ_0&\gate{H}&\ctrl{1}&\meter{}&\\Q_1&&\gate{X}&&\\Q_2&\gate{H}&\ctrl{1}&\meter{}&\\Q_3&&\gate{X}&&\\Thequantikz()method accepts a separation parametersep, which is used to separate the individual circuit elements.circuit.quantikz(sep="&[0.5em]")
Package: py2shpss
A python implementation of two-stage HPSS (a singing voice extraction method)Two-stage HPSS separates a music signal into harmonic, vocal, and percussive components.LicenseCopyright (c) 2020 Hideyuki Tachibana,MIT LicenseUsageInstallpipinstallpy2shpssCode Example# importimportnumpyasnpimportscipy.io.wavfileaswavfileimportpy2shpss# load musicsr,sig=wavfile.read("your_awesome_music.wav")iflen(sig.shape)==2:# mix left and right channels if stereosig=np.mean(sig,axis=1)sig=sig/np.max(sig)# process and savetwostageHPSS=py2shpss.twostageHPSS(samprate=sr)harmonic,vocal,percussive=twostageHPSS(sig)wavfile.write("vocal.wav",sr,vocal)CitationTwo-stage HPSS was proposed in following papers.[1]H. Tachibana, T. Ono, N. Ono, S.Sagayama,“Melody line estimation in homophonic music audio signals based on temporal-variability of melodic source,”inProc. ICASSP, pp.425–428, IEEE, 2010[2]H. Tachibana, N. Ono, S. Sagayama,“Singing voice enhancement in monaural music signals based on two-stage harmonic/percussive sound separation on multiple resolution spectrograms,”IEEE/ACM TASLP, vol. 22, no. 1, pp. 228–237, 2014[3]H. Tachibana, Y. Mizuno, N. Ono, S. Sagayama,“A real-time audio-to-audio karaoke generation system for monaural recordings based on singing voice suppression and key conversion techniques”,Journal of Information Processing, vol. 24, no. 3, pp. 470-482, Information Processing Society of Japan, 2016
Package: py2sms
<h1>Py2SMS</h1>Python code to send SMS with Way2SmsSend upto 100 free [SMS](http://site24.way2sms.com/content/index.html) within 10 seconds daily.[Way2Sms](http://site24.way2sms.com/content/index.html) provides free SMS service upto **100** messages daily with message length upto **139**.### Prerequisites* Install Python3.x from `here. <https://www.python.org/)>`* Create an account in `Way2SMS <www.way2sms.com/>```pythonimport py2sms```-  Sending message```pythons=py2sms.send(username,password,number,message)```* If message was sent successfully, py2sms.send() will return True, else False# DisclaimerThis code was inspired by [http://home.iitk.ac.in/~saiwal/productivity/send-sms-way2sms-python/](http://home.iitk.ac.in/~saiwal/productivity/send-sms-way2sms-python/)
Package: py2sqlite3
#Py2sqlite3Py2sqlite3 is a library that facilitates the communication between python objects and sqlite3 databasesInstallationhttps://pypi.org/project/py2sqlite3/pip install py2sqlite3Command line usage (only to run test):python -m py2sqlite3Usage as libraryExamplefrom py2sqlite3 import Py2sqlite3

class Foo:
    bar = 0

class Foo2(Foo):
    pass

py2sql = Py2sqlite3()

py2sql.db_connect('test.db')
py2sql.save_class(Foo)              # saves class Foo
py2sql.save_class_hierarchy(Foo)    # saves Foo and Foo2
py2sql.save_object(Foo())           # saves object of class Foo

py2sql.delete_class(Foo)            # deletes class Foo
py2sql.delete_class_hierarchy(Foo)  # deletes Foo and Foo2
py2sql.delete_object(Foo())         # deletes object of class Foo

py2sql.db_disconnect()
Package: py2srbcyr
py2srbcyrPython module that transliterates text from Latin toCyrillic alphabet.The module is Python implementation of great JavascriptЋирилизатор - Cyrillizer.Модул за пресловљавање латиничног текста на српску ћирилицу.Употребаfrom py2srbcyr import SerbCyr
...
cir = SerbCyr()
print(cir.text_to_cyrillic('Zdravo svete!'))ТестирањеДа бисте програм тестирали неопходно је да имате инсталиран модуоpytest. Пошто сте га инсталирали, на командној линији из коренског директоријума задајте:python -m pytest
Package: py2static
py2staticThis is a simple tool for building Linux static binaries (x64) from Python scripts.IntroductionIt usesPyinstallerto build a dynamic binary and  usesstaticxto make it static.Installationpipinstallpy2staticUsage# This will generate the binary "script"py2staticscript.pyLimitationsIt was developed and tested with single scripts using the standard python library. It may not work with more complex projects. Feel free to open an issue if you have more complex cases that would like to be supported.
Package: py2sterimol
py2sterimolUsing this template:Runstart_project.py, which will gather some info and rename everything.Add tests.Add your source code to your source directory.Add your requirements to./requirements.txt.Curate examples as python notebooks and add them to./examples/.Replace./py2sterimol_logo.pngwith your logo.Delete this line and everything above it, as well asstart_project.py.BlankPythonProjectThin client Python interface to the original Fortran implementation of Sterimol parameters.Online DocumentationClick here to read the documentation
Package: py2swagger
Python OpenAPI Specification generatorTool for automated or semi-automated generate aOpenAPI
Specification(aka
Swagger Specification) for Web APIs written with Python and famous
frameworks, such as:Django REST
Framework(DRF>=2; Django>=1.6)Falcon(falcon>=0.3)flaskbottleand ever you own frameworkSupported only v2 OpenAPI SpecificationWhy?This tool is written as part of our Documentation Toolkit which we use
in our job daily. The main idea of toolkit is to make a process of
creating and updating documentation able to be automatedOther parts of our toolkit is:py2swaggerswagger2rstsphinx-confluenceconfluence-publisherInstallInstall fromPyPIwith$ pip install py2swaggerUsageusage: py2swagger [-h] [-c CONFIG] [-r ROOT] [-o OUTPUT]
                  {falcon,drf,simple} ...

Swagger schema builder

optional arguments:
  -h, --help            show this help message and exit
  -c CONFIG, --config CONFIG
                        Path to config file
  -r ROOT, --root ROOT  Path to project root. Default is current directory or
                        configuration file location
  -o OUTPUT, --output OUTPUT
                        Output file (Default stdout)

plugins:
  {falcon,drf,simple}
    falcon
    drf
    simple              Plugin for all applicationsRun testspythonsetup.pytest
Package: py2terraform
PY2TerraformPrototype/concept for building terraform configs using python.May be useful for deploying flask/django apps by building the cloud configs also in python.UsageExtendingfrompy2terraform.typesimportTerraformBlockBaseclassAWSProvider(TerraformBlockBase):# Define constant values_block_category="provider"_block_type="aws"# Define defaultsdef__post_init__(self):self.set_params(region="us-east-1")self.add_child_blocks(...)ExamplesDesired Outputprovider"aws"{region="us-east-1"}resource"aws_instance""my_instance"{ami="my-ami"instance_type="t2.micro"network_interface{network_interface_id="my-interface-id"device_index=0}}Python Codeimportpy2terraformdoc=py2terraform.TerraformDocument()provider=py2terraform.blocks.TerraformProviderBlock(block_type="aws",params={"region":"us-east-1"})instance=py2terraform.blocks.TerraformResourceBlock(block_type="aws_instance",block_name="my_instance",params={"ami":"my-ami","instance_type":"t2.micro"})instance_network_interface=py2terraform.types.TerraformBlockBase(block_category="network_interface",params={"network_interface_id":"my-interface-id","device_index":0})instance.add_child_blocks(instance_network_interface)doc.add_blocks(provider,instance)print(doc)Console Outputprovider "aws" {
        region  = "us-east-1"
}

resource "aws_instance" "my_instance" {
        ami     = "my-ami"
        instance_type   = "t2.micro"

        network_interface {
                network_interface_id    = "my-interface-id"
                device_index    = 0
        }
}
Package: py2tf
Pydantic to TerraformThis library converts Pydantic Models into Terraform Variables.UsageThis needs to be installed in the same virtual environment as the Models that it is converting. Once installed a CLI tool,py2tf, will be available in the environment.For example, to generate a variables file for the RDS ParameterValidation class-robert@Roberts-MacBook-Proterraform-aws-core%py2tfmodules.rds.validation.parameters:ParameterValidationThe command will output the following to stdout:variable"type"{type=stringdefault=null}variable"pit_identifier"{type=stringdefault=null}variable"tags"{type=map(any)default={}}variable"name"{type=stringvalidation{# Automatically Generated from Rule: minlengthcondition=length(var.name)>=1error_message="Field should not be less than 1 characters"}validation{# Automatically Generated from Rule: maxlengthcondition=length(var.name)<=63error_message="Field should not be larger than 63 characters"}validation{# Automatically Generated from Rule: patterncondition=length(regexall("^(?!.*--)[a-zA-Z][A-Za-z0-9.-]+(?<!-)$",var.name))>0error_message="Field does not match regex pattern ^(?!.*--)[a-zA-Z][A-Za-z0-9.-]+(?<!-)$"}}variable"vpc_name"{type=string}variable"engine"{type=stringvalidation{# Automatically Generated from Rule: minlengthcondition=length(var.engine)>=1error_message="Field should not be less than 1 characters"}}variable"engine_version"{type=stringvalidation{# Automatically Generated from Rule: minlengthcondition=length(var.engine_version)>=1error_message="Field should not be less than 1 characters"}}variable"is_public"{type=booldefault=false}Next StepsAt the moment this does not generate validation rules (min/max length, regex, etc).