Saravanan666/pypi-org huggingface dataset:
Package: tspgrasp
tsp-graspWelcome totsp-grasp! A Python package with Heuristics for solving the Traveling Salesman Problem (TSP).DocumentationInstallThe packagetspgraspis available on PyPI, so you can install it viapipby running the following command line:pip install tspgraspTo install the package in development versions, clone it from github using:git clone https://github.com/bruscalia/tsp-grasp.gitAnd run one of the two following commands:pip install .python setup.py installMake sure Cython and numpy are also available in your python environment.Alternatively, you can directly run:pip install git+https://github.com/bruscalia/tsp-grasp.gitHere is a minimum working example in which a symmetric distance matrix is produced from 2-dimensional coordinates.Use# Importsimportnumpyasnpfromscipy.spatial.distanceimportpdist,squareformfromtspgraspimportGrasp# Create distance matrixX=np.random.random((100,2))D=squareform(pdist(X))# Instantiate algorithm and solve problemgrasp=Grasp(seed=12)sol=grasp(D,time_limit=10,max_iter=100)# Display cost and tourprint(f"Cost:{sol.cost}")print(f"Tour:{sol.tour}")TheoryGreedy Randomized Adaptive Search Procedures (GRASP) are metaheuristics constituted by a hybridization of a semi-greedy procedure with a local search method. For more details please refer to Resende & Ribeiro (2016).Local search moves implemented were based on the work of Vidal (2022).ContactYou can reach out to me atbruscalia12@gmail.comReferencesResende, M. G., & Ribeiro, C. C. (2016). Optimization by GRASP. Springer Science+ Business Media New York.https://doi.org/10.1007/978-1-4939-6530-4Vidal, T. (2022). Hybrid genetic search for the CVRP: Open-source implementation and SWAP* neighborhood. Computers & Operations Research, 140, 105643.https://doi.org/10.1016/j.cor.2021.105643
Package: tspng
tspng: A Python package for Computer Vision and Machine Learning metadata manipulationA Python package for manipulating Portable Network Graphics (PNG) files with
embedded JavaScript Object Notation (JSON) metadata from Machine Learning (ML)
applications, such as the Theiascope™ platform for microscopy image
analysis and quantitation. These files have data embedded in the PNG in aCOCO
JSON formatcompatible form. This package provides extraction of the JSON data
and implantation of JSON data into existing PNGs.Quick StartCreate a virtual environment.python3-mvenv.venvActivate the virtual environment.source.venv/bin/activateInstall tspng.python3-mpipinstalltspngCreate apng_dump.pyscript to extract inference results from a PNG file,importjsonfromtspng.extractionimportextract_from_fileprint(json.dumps(extract_from_file(PATH_TO_FILE),indent=2))wherePATH_TO_FILEis replaced with the path to a.ts.pngfile on disk.Run thepng_dump.pyscript.$python3./png_dump.py{"info":{"description":"Theiascope image","url":"http://www.theiascientific.com","version":"1.0","year":2023,"contributor":"Theia Scientific, LLC","date_created":"2023-05-10 19:22:47.722802+00:00"},"licenses":{"url":"http://www.theiascientific.com","id":1,"name":"Proprietary"},"images":[{"license":1,"file_name":"20230510T192247Z.722_crimson-notebook (PML).ts.png","height":512,"width":512,"date_captured":"2023-05-10 19:22:47.722802+00:00","id":3783,"field_of_view":[0,0,512,512],"scale_bar":{"dimensions":[25,501,128,1],"length":100.0,"units_abbr":"nm","units_name":"nanometers"}}],"annotations":[...],//Omittedforclarity"models":[{"id":17,"configuration":{"image_processing":{"brightness":0,"clahe":false,"contrast":1.0,"gamma":1.0,"gray":false,"invert":false},"max_concurrency":2,"num_cpus":0,"num_gpus":1.0,"box_nms_thresh":0.7,"crop_n_layers":0,"crop_nms_thresh":0.7,"crop_overlap_ratio":0.3413333333333333,"crop_n_points_downscale_factor":1,"min_mask_region_area":0,"points_per_side":32,"points_per_batch":64,"pred_iou_thresh":0.88,"stability_score_thresh":0.95,"stability_score_offset":1.0,"weights_file":{"filename":"sam_vit_b_01ec64.pth","version":"default","path":"/sam/vit-b"}},"created":"2023-05-09 19:46:18.309323+00:00","family":"SAM","name":"vit-b","pid":1}],"categories":[{"supercategory":"defect","id":1,"name":""}]}ContributingCreate a virtual environment.python3-mvenv.venvActivate the virtual environment.source.venv/bin/activateClone this repository.gitclonehttps://github.com/Theia-Scientific/tspng.git&&cdtspngInstall the dependencies.python3-mpipinstall.[dev]Build the package.python3-mbuildTestingTesting is divided into unit and integration tests. Unit tests are located in
the package source code tree and are defined on a per-module basis with atest_<module>.pyformat, while the integration tests are defined in thetestsdirectory.LicenseLICENSE.AcknowledgmentsThis material is based upon work supported by the U.S. Department of Energy,
Office of Nuclear Energy under Award Number DE-SC0021529.
Package: tsp-rest-api-server
tsp-rest-api-serverTSP Rest Api Server - Rest Api Server using Dijsktra’s algorithm applied to travelling salesman problem.LicenseLicensed under the MIT License.InstallFollow the steps below to get everything up and running.pipCreate project folder:$mkdirtsp-rest-api-server&&cdtsp-rest-api-serverCreate virtualenv in the normal way:$virtualenvenv--python=pythonActive your new virtualenv:$sourceenv/bin/activateInstall tsp-rest-api-server:$pipinstalltsp-rest-api-serverCreate setting file:$tsp_rest_api_serversettingsSet EVE_SETTINGS:$exportEVE_SETTINGS=$PWD/settings.pyRun tsp rest api server:$tsp_rest_api_serverrunserverGitClone repository:$gitclonegit@github.com:caputomarcos/tsp_rest_api_server.gitGo to tsp_rest_api_server source folder:$cdtsp-rest-api-server/Create virtualenv in the normal way:$virtualenvenv--python=pythonActive your new virtualenv:$sourceenv/bin/activateCreate dev environment:$makedevelopUsageCreate routes:$curl-d"@map.json"-H"Content-Type: application/json"-XPOSThttp://0.0.0.0:5000/mapsor$curl-d'{ "title":"Sao Paulo", "routes":[{"origin":"A","destiny":"B","distance":10},{"origin":"B","destiny":"D","distance":15},{"origin":"A","destiny":"C","distance":20},{"origin":"C","destiny":"D","distance":30},{"origin":"B","destiny":"E","distance":50},{"origin":"D","destiny":"E","distance":30}]}'-H"Content-Type: application/json"-XPOSThttp://0.0.0.0:5000/mapsSearch shortest route:$curl'http://0.0.0.0:5000/maps/shortest?map=Sao%20Paulo&origin=A&destiny=D&price=2.50&autonomy=10'{"data":[{"Path":"['A', 'B', 'D']"},{"Total KM":"25.00"},{"Cost":"6.25"}]}Drop all mongodb databases#dropall.jsvardbs=db.getMongo().getDBNames()for(variindbs){db=db.getMongo().getDB(dbs[i]);print("dropping db "+db.getName());db.dropDatabase();}usagemongodropall.jsrefsDIJKSTRA’S SHORTEST PATH ALGORITHM
Package: tsprocess
tsprocessGround motion time series processing toolstsprocess is a Python3-based software program that facilitates processing 3D ground-motion simulation results. It provides a convenient interface for conducting different analyses on a series of simulated and observed earthquakes time series requiring the least effort from the researchers. By generating a unique hash value for data and actions on the data, it guarantees that each process is carried out once and stored once. As a result, it eliminates redundant processes and also redundant versions of processed data. Processed data are stored in a NoSQL key-value database, and an in-memory dictionary is used to reduce the amount of query to the database. The tsprocess library also provides codes for calculating ROTD50 so that a common implementation is used to process both 3D simulation seismograms and 1D broadband platform seismograms.These codes have been developed as part of earthquake ground motion research performed by the Southern California Earthquake Center (SCEC)www.scec.org.DocumentationDocumentation is hosted athttps://naeemkh.github.io/tsprocess/Primary Developers of tsprocess library:Naeem Khoshnevis - University of MemphisFabio Silva - Southern California Earthquake CenterRicardo Taborda - Universidad EAFIT Medellín ColombiaChristine Goulet - University of Southern CaliforniaSoftware support:software @ scec.org
Package: tsp-solutions
The code uses PuLP module to formulate the problem and CPLEX, GUROBI, COIN_CMD, and PULP_solver to find the exact solution of the TSP.
The module also includes heuristics and metaheuristics functions that can be used for large instances.
More functions will be added.
If you find an error or want to solve problems together write to me @shamikpushkar92@gmail.com.The module has two parts:1. Exact Solution
tsp_exact uses PuLP module to formulate the problem and CPLEX, GUROBI, COIN_CMD, and PULP_solver to find the exact solution of the TSP. To setup an external solver follow this link.2. Heuristics & Metaheuristics
heuristics & metaheuristic functions are local search algorithms that can be used for large instances.Dependencies include pulp, numpy, pandas, scipy, and copy.
Package: tspsolve
tspsolveAlgorithms for thetraveling salesman problem
(TSP)in Python.Implemented so far:Nearest neighbor algorithmimporttspsolve# Create matrix of distances dpath=tspsolve.nearest_neighbor(d)2-optimprovementimporttspsolve# Create matrix of distances d and an initial pathnew_path=tspsolve.two_opt(d,path,verbose=True)ForEuclidiean
TSP, the
distance matrix can be computed efficiently withdx=numpy.subtract.outer(x,x)dy=numpy.subtract.outer(y,y)d=numpy.sqrt(dx**2+dy**2)Installationtspsolve isavailable from the Python Package
Index, so simply typepip install -U tspsolveto install or upgrade.TestingTo run the tspsolve unit tests, check out this repository and typepytestDistributionTo create a new releasebump the__version__number,publish to PyPi and GitHub:make publishLicensetspsolve is published under theMIT license.
Package: tsp-tools
tsp-toolsis a package for Traveling Salesman Problem for Python.import tsp_tools
t = tsp_tools.tsp([(0,0), (0,1), (1,0), (1,1)])
print(t)  # distance, node index list
>>>
(4, [0, 2, 3, 1])

mat = [[  0,   1, 1, 1.5],
       [  1,   0, 1.5, 1],
       [  1, 1.5,   0, 1],
       [1.5,   1,   1, 0]]  # Distance Matrix
r = range(len(mat))
# Dictionary of distance
dist = {(i, j): mat[i][j] for i in r for j in r}
print(tsp_tools.tsp(r, dist))
>>>
(4, [0, 2, 3, 1])Note: When large size,ortoolpy.ortools_vrpmay be efficient.See alsohttps://pypi.org/project/ortoolpy/RequirementsPython 3more-itertoolsFeaturesnothingSetup$ pip install tsp-toolsHistory0.0.1 (2015-10-2)first release
Package: tspy
tspy: An optimization package for the traveling salesman problem.Thetspypackage gives a Python framework in which to study the famousTraveling Salesman Problem(TSP). In this package, one can work on specific instances of the TSP. Approximation methods and lower bounds are included by default. The structure of the package makes it easy to create and include your own methods.InstallationThetspypackage can be installed usingpip:pip install tspyHow to use tspyCreating an instanceTo create an instance of the TSP, use:fromtspyimportTSPtsp=TSP()Currently, data can be given to the instance in two ways: by giving it theNxNdistance matrixDor, in the case of an Euclidian TSP, aNxPdata matrixXand a distance function.# Using the distance matrixtsp.read_mat(D)# Using the data matrix and a distance functiontsp.read_data(X,dist)Computing approximate solutionsThe moduletsp.solverscontains several algorithms providing approximate solutions of TSP instances. For example, the2-optalgorithm gives good solutions rather quickly. Here is how it can be used in thetspypackage:fromtspy.solversimportTwoOpt_solvertwo_opt=TwoOpt_solver(initial_tour='NN',iter_num=100)two_opt_tour=tsp.get_approx_solution(two_opt)Other solvers are used similarly.Current solutions are stored in the dictionarytsp.tours. If a data matrix has been provided to the instance, a plot of the solution can be shown:tsp.plot_solution('TwoOpt_solver')At any point, the best solution that has been computed can be retrieved:best_tour=tsp.get_best_solution()Computing lower boundsThe TSP beingNP-hard, it is difficult to get exact solutions for large instances. However, by computing lower bounds we can know how good our approximations are. Thetspypackage provides several lower bounds methods. One example is given by theSimple_LP_boundwhich gives the optimal solution of theLP relaxationof the TSP:fromtspy.lower_boundsimportSimple_LP_boundlower_bound=tsp.get_lower_bound(Simple_LP_bound())At any point, the best lower bound that has been computed can be retrieved:best_lower_bound=tsp.get_best_lower_bound()FutureThe following features will be added soon:Genetic programmingAnt colony optimizationLin–Kernighan heuristicBetter LP lower boundsFeel free to contact me if you would like to contribute.Authortspywas written by William Borgeaud (williamborgeaud[at]gmail.com).
Package: tspydistributions
Welcome!The tspydistributions package implements a number of location-scale based statistical distributions parameterized in terms of their mean and standard deviation, in addition to the skew and shape parameters.InstallationCurrently, due to certain version requirements of the dependencies, it's best to create a new virtual environment with Python >=3.10 and <3.13, after which:pip install tspydistributionsDocumentationFull documentation availablehere.MIT LicenseCopyright (c) 2023 tspydistributionsPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Package: tsquery
TSQueryRunTree Sitterqueries from the command line.InstallationpipinstalltsqueryUsageParsers (.sofiles) should be installed somewhere in$XDG_DATA_HOMEor$XDG_DATA_DIRS. Use theofficial Tree Sitter CLI toolto compile a grammar to parser source.For example, this command prints the names of functions defined in a toy Python
program:# Write a toy Python programcat>example.py<<EOFdef baz():return 1def foo(bar):if bar:baz()EOF# Run a query against ittsquery'(function_definition name: (identifier) @func.name)'example.pySee alsoexample.shin this repository.
Package: tsr
# TSR on Command LineBrowse thestudentroom.co.uk from the command line. Almost as lightweight as a real browser, and as strong and stable as the British government.## Getting Started### Prerequisites#### Core```Python 3.5 or higher```#### OptionalPython libraries:```psutil (for displaying memory usage in non-POSIX operating systems)nltk,inflect (for word-crunching)tkinter (for matplotlib graphs - not pre-installed for Python 3 on some distros)```## Installation```pip install tsr```to use the PyPI repository version, or```pip install git+https://github.com/methmo/tsr```to use the latest version direct from this repository, replacing pip with pip3, depending on which version of python pip points to.## LicenseMIT
Package: tsrc
tsrc: manage groups of git repositoriesOverviewtsrc is a command-line tool that helps you manage groups of several git
repositories.It can beseen in action on asciinema.org.RequirementsPython3.7or laterInstallationUsepipx(recommended) orpip(ok, if you know what you're doing) to install.Please see theinstallation docsfor more info.Usage ExampleCreate amanifestrepository. (git@example.org/manifest.git)Add a file namedmanifest.ymlat the root of themanifestrepository.manifest.yml:repos:-url:git@example.com/foo.gitdest:foo-url:git@example.com/bar.gitdest:barIt is convenient while optional to include the manifest repository itself in yourmanifest.yml. It will allow you to have a local copy of you manifest repository to easily make changes to it in the future.commit yourmanifest.ymland push the changes to the manifest
repository.Create a new workspace with all the repositories listed in the
manifest:$tsrcinitgit@git.local/manifest.git:: Configuring workspace in /path/to/work...=> Cloning missing repos* (1/2) foo...* (2/2) bar...: Configuring remotesDone ✓Synchronize all the repositories in the workspace:$tsrcsync=> Updating manifest...:: Configuring remotes:: Synchronizing workspace* (1/2) foo=> Fetching origin=> Updating branchAlready up to date* (2/2) bar=> Updating branchUpdating 29ac0e1..b635a43Fast-forwardbar.txt | 1 +1 file changed, 1 insertion(+)create mode 100644 bar.txtDone ✓DocumentationFor more details and examples, please refer totsrc documentation.Release notesDetailed changes for each release are documented in thechangelog.ContributingWe welcome feedback,bug reports, and bug fixes in the form ofpull requests.Detailed instructions can be foundin the documentation.Licensetsrc is licensed under aBSD 3-Clause license.HistoryThis project was originally hosted on theTankerHQorganization, which wasdmerejkowsky's employer from 2016 to 2021. They kindly agreed to give back ownership of this project to Dimitri in 2021 - thanks! Dimitri later on shared this project even more by moving it to theyour-toolsorganization.
Package: tsresolve
# Tsresolve (Timestamp resolve)Timestamp generator for either "Point of time" or "Duration of time" from Text (string). This uses recurrent, parsedatetime libraries to detect dates from strings. However, there are lot of major updations in this library which will allow user to generate either point of time or duration between two point of times.## Usage:##### `pip install tsresolve``from tsresolve import point_of_time, period_of_time``point_of_time("tomorrow")``period_of_time("tomorrow")`#### Points to know:1. It generates time stamps in ISO format.2. When no ammod (last/previous/next..) is used before month/year, it detects the passed one.Ex: Show calls from December 5th. (If you are asking this before December 5th 2018, it detects December 5th 2017 else, December 5th 2018). Test it with and without ammods for better understanding.##### Examples:Point of time: Expected result will be (Timestamp, Bool). Bool is "True" if time detected in phrase. Else, "False"1. November 3rd at 3 p.m. | Result: (2019-11-03T15:00:00, True)2. next monday evening at 5 o'clock | Result: (2018-12-24T17:00:00, True)3. last saturday | Result: (2018-12-24T17:00:00, False)Period of time: Expected result will be (Start timestamp, End timestamp)1. from last tuesday till date | Result: ('2018-12-11T00:00:00', '2018-12-18T23:59:59')2. from last november 5th to december 15th | Result: ('2018-11-01T00:00:00', '2018-12-18T23:59:59')3. show something from november 5th 2017 | Result: ('2017-11-05T00:00:00', '2017-11-05T23:59:59')#### Not handled:1. Duration between two years. Ex: 2018-20192. Currently not handling "5th of January" format.3. Time level is currently handled only in point of time, yet to be handled in period of time.#### CreditsTsresolve is inspired by Recurrent. It also uses the parsedatetime library for creating timestamps.#### AuthorAkhil kumar D (akhilkumar.doppalapudi@gmail.com)
Package: tsru
TSRU (TSR Utils)A python library for doing various miscellaneous thingsFeaturestsru.printingLoadingSpinnerShows a spinner in the console while you can do something else in the background.
Has support for custom loading, done and failed messages. It comes with in-build colorama support for the default values.Example:fromtsru.printingimportLoadingSpinnerimporttimespinner=LoadingSpinner("Running message","Done msg","Failed msg")time.sleep(1)spinner.stop()# We are successfully donespinner=LoadingSpinner("Running message","Done msg","Failed msg")time.sleep(1)spinner.stop(False)# Something failed/ Running message\ Running message- Running message/ Running messageDone msg Running message/ Running message\ Running message- Running message/ Running messageFailed msg Running message
Package: tssc
tssc-python-packageTrusted Software Supply Chain (TSSC) implemented as a Python library.DocumentationPython Package DocumentationTrusted Software Supply Chain (TSSC) OverviewInstallLatest ReleasenotyetreleasedLatest Development Releasepipinstall--index-urlhttps://test.pypi.org/simple/--extra-index-urlhttps://pypi.org/simpletsscDevelopment:warning:If you are running RHEL7 or older versions of Python: This project will need Python 3.3 or better to run. If you are running on RHEL7, you can invokepython3in place ofpythonin the following commands.Set Up Development Environmentcdtssc-python-package
python-mvenv.venvs/tssc-devsource.venvs/tssc-dev/bin/activate
python-mpipinstall--upgradepip
python-mpipinstall-e'.[tests]'Run Testspython-mpytest--cov=tssc--cov-reportterm-missingtestsOr to run for just a particular implementer, and include the sections of code that you didn't coverpython3-mpytest--cov=tssc--cov-reportterm-missingtests/step_implementers/package/test_maven_package.pyRun linterpython-mpylint--rcfile=setup.cfgtsscGenerate the Documentation LocallyIf you are updating the python documentation and want to generate locally this is how you do it.pipinstallpdoc3
pdoc3--html--output-dirpdoc3-htmltssc/
Package: tssearch
Time Series Subsequence Search LibraryIntuitive time series subsequence searchThis repository hosts theTSSEARCH - Time Series Subsequence SearchPython package. TSSEARCH assists researchers in exploratory analysis for query search and time series segmentation without requiring significant programming effort.FunctionalitiesSearch: We provide methods for time series query search and segmentationWeights: The relative contribution of each point of the query to the overall distance can be expressed using a user-defined weight vector.Visualization: We provide visualizations to present the results of the
segmentation and query searchUnit tested: we provide unit tests for each featureEasily extended: adding new distances is easy, and we encourage you to contribute with your custom distances or search methodsGet startedInstallationTSSEARCH is available at PyPI:pipinstalltssearchExampleThe code below segments a 10 s electrocardiography record:importtssearch# Load the query, (optional) weight vector and sequencedata=tssearch.load_ecg_example()# Selects the Dynamic Time Warping (DTW) as the distance for the segmentationcfg=tssearch.get_distance_dict(["Dynamic Time Warping"])# Performs the segmentationout=tssearch.time_series_segmentation(cfg,data['query'],data['sequence'],data['weight'])DocumentationThe documentation is availablehere.Available distancesLockstepLp DistancesPearson Correlation DistanceShort Time Series Distance (STS)ElasticDynamic Time Warping (DTW)Longest Common Subsequence (LCSS)Time Warp Edit Distance (TWED)TimeTime Alignment Measurement (TAM)AcknowledgementsThis work is a result of the project ConnectedHealth (n.º 46858), supported by Competitiveness and Internationalisation Operational Programme (POCI) and Lisbon Regional Operational Programme (LISBOA 2020), under the PORTUGAL 2020 Partnership Agreement, through the European Regional Development Fund (ERDF)