Saravanan666/pypi-org huggingface dataset:
Package: pathtree.husky
pathtreepathtree implements a tree for fast path lookup.Build GuideHow to build
a package:https://packaging.python
.org/tutoria
ls/packaging
-projects/Make the
.whl:python
setup.py
sdist
bdist_wheelGet the .whl
in:./dist/patht
ree-0.0.7-py
2.py3-none-a
ny.whlInstallationFrom PyPIpip install pathtree.0.0.7.wheelFrom Anaconda (conda forge)none for nowFrom source codecd pathtree-source-code-path
python setup.py installUsagefrompathtreeimportTreeif__name__=='__main__':t=Tree()t.Add("/",1)t.Add("/a",2)t.Add("/a",3)t.Add("/a",4,extra_data={"test":"just a test"})t.Add("/a/b",5)t.Add("/a/b/c",6)leafs=t.Find("/a")ifleafs:print("found all leafs of path /a ->%s"%leafs)leaf=t.FindLeaf("/a",2)ifleaf:print("found leaf: /a ->%s"%leaf.value)leaf=t.FindLeaf("/a",4)ifleaf:print("found leaf: /a ->%s"%leaf.value)print("            /a -> leaf.extra_data"%leaf.extra_data)node=t.FindPath("/a/b")ifnode:print("found path /a/b ->%s"%node)t.DeleteLeaf("/a",2)leaf=t.FindLeaf("/a",2)ifnotleaf:print("leaf /a -> 2 has been deleted")t.DeletePath("/a/b")node=t.FindPath("/a/b")ifnotnode:print("path /a/b has been deleted")node=t.FindPath("/a/b/c")ifnotnode:print("path /a/b/c has been deleted")FeaturesRestrictionsTree(separate_char=’/’), split_char default to ‘/’, you can change
it any char you need but ‘%’.Use makepath(‘p1’, ‘p2’, ‘p3’) => “/p1/p2/p3”, the separate char isa
set by the parameter: separate_char.As default, paths must be a ‘/’-separated list of strings, like a URL
or Unix filesystem.As default, all paths must begin with a ‘/’.As default, path elements may not contain a ‘/’.Trailing slashes are inconsequential.AlgorithmPaths are mapped to the tree in the following way:As default, each ‘/’ is a Node in the tree. The root node is
the leading ‘/’.Each Node has edges to other nodes. The edges are named
according to the possible path elements at that depth in the
path.Any Node may have an associated Leaf. Leafs are terminals
containing the data associated with the path as traversed from
the root to that Node.Edges are implemented as a map from the path element name to the
next node in the path.Extra_data is an optional information for every edge or leaf
Package: pathtrees
pathtreesDefine your path structure at the top, then just fill in the variables later.InstallpipinstallpathtreesUsageimportpathtreesaspt# define your file structure.# a simple ML experiment structurepaths=Paths.define('./logs',{'{log_id}':{'model.h5':'model','model_spec.pkl':'model_spec','plots':{'epoch_{step:.4d}':{'{plot_name}.png':'plot','':'plot_dir',}},# a path join hack that gives you: log_dir > ./logs/{log_id}'','log_dir',}})paths.update(log_id='test1',step=-1)# for example, a keras callback that saves a matplotlib plot every epochclassMyCallback(Callback):defon_epoch_end(self,epoch,logs):# creates a copy of the path tree that has step_name=epochepoch_paths=paths.specify(step=epoch)...# save one plotplt.imsave(epoch_paths.plot.specify(plot_name='confusion_matrix'))...# save another plotplt.imsave(epoch_paths.plot.specify(plot_name='auc'))# you can glob over any missing data (e.g. step => '*')# equivalent to: glob("logs/test1/plots/{step}/auc.png")forpathinpaths.plot.specify(plot_name='auc').glob():print(path)Path Formattingpath=pathtrees.Path('data/{sensor_id}/raw/{date}/temperature_{file_id:04d}.csv')path.update(sensor_id='aaa')try:path.format()exceptKeyError:print("oops gotta provide more data!")assertpath.partial_format()=='data/aaa/raw/{date}/temperature_{file_id:04d}.csv'assertpath.glob_format()=='data/aaa/raw/*/temperature_*.csv'try:path.format(date='111')exceptKeyError:print("oops gotta provide more data!")assertpath.partial_format(date='111')=='data/aaa/raw/111/temperature_{file_id:04d}.csv'assertpath.glob_format(date='111')=='data/aaa/raw/111/temperature_*.csv'# fully specified path - all data providedassertpath.format(date='111',fild_id=2)=='data/aaa/raw/111/temperature_0002.csv'assertpath.partial_format(date='111',fild_id=2)=='data/aaa/raw/111/temperature_0002.csv'assertpath.glob_format(date='111',fild_id=2)=='data/aaa/raw/111/temperature_0002.csv'# passing arguments to format() doesn't update the original object.# you can either create a copy of the path and update it's datapath2=path.specify(date='111')# or you can update the data in place using update()path2.update(date='222',fild_id=2)# and now you don't need to pass that info to format()importosassertos.fspath(path)==path.format()assertstr(path)==path.partial_format()TODO:docstrings and examples !!!decide what I want to do aboutformat_path,partial_format_path, etc. (too verbose)publish RTD
Package: pathtub
🛁 pathtubReading and editingWindows PATH variablesand ensuring python finds your DLLs.✅Ensuringthat a folder exists in Path.🔗Ensuringthat DLL(s) are found by python.🧽Cleaningthe PATH (duplicates, removed folders, sorting)✏️Addingorremovingfolders to/from Path (temporary or permanently)Installingpip install pathtubUsageEnsuring folder is in PATHEnsuring that DLL(s) are foundCleaning PATHRest of the docsGetting path variablesAdding permanently to PATHRemoving permanently from PATHChecking if folder is in PATH✅ Ensuring folder is in PATHfrompathtubimportensurefolder_to_add=r'C:\something to add to path\folder'# 1) Check Process PATH# 2) Add to Process PATH if not found# 3) Add also to User PATH (permanent), if 2) happensensure(folder_to_add,permanent=True)What is ensure()?ensure(folder)checks iffolderis in Process PATHIffolderis in Process PATH, does nothingIffolderis not in Process PATH, adds it to Process PATHIffolderis not in Process PATHandpermanent=True, addsalsoto the User PATH or System PATH, depending on thepermanent_mode.⚠️ If you want to ensure aDLL folderis visible to python, useensure_dllinstead.🔗Ensuringthat DLL(s) are foundfrompathtubimportensure_dlldll_folder=r'C:\path to\libusb-1.0.21\MS32\dll'ensure_dll(dll_folder)ensure_dll()is for making sure that python finds needed DLL's (and the DLL's find their dependencies, if any.)You may useensure_dllandforget_dllfor adding and removing dll folder to/from search path.See also:Example of using ensure_dll and forget_dll🧽 Cleaning PATHfrompathtubimportclean# Default parameter values shownclean(sort=True,remove_non_existent=True,remove_user_duplicates=True)What does it doRemoves duplicates and empty entries (;;) from the "User PATH" and "System PATH" (trailing backslash neglected when comparing two folders). Editing "System PATH" needs that python is executed with Admin rights.Sorts PATH(s) alphabetically (optional, enabled by default). Controlled with thesortparameter.Removes folders from PATH(s) that do not exist on the filesystem (optional, enabled by default). Controlled with theremove_non_existent-parameter.Removing from "User PATH" the entries that are in the "System PATH" (optional, enabled by default). Controlled with theremove_user_duplicates-parameter.Screenshots of User PATH before and after clean:For more detailed example, seeFull example of pathtub.cleanFull documentation ofclean()is in the source code (pathtools.py).Rest of the docsDid not find what you were looking for? See theRest of the docs.
Package: pathutility
PathUtilsIntroductionPathUtils is a utility class for handling various path-related operations in Python. It provides methods for retrieving file information, checking file existence, creating directories, detecting file encoding, and listing files in a directory.InstallationTo install PathUtils, simply use pip:pipinstallpathutilityUsage ExampleHere's an example of how to use the PathUtils class:frompathutilityimportPathUtils# Create an instance of PathUtilspath_util=PathUtils()# Get file informationfile_path='/path/to/file.txt'print(f"File name:{path_util.get_filename(file_path)}")print(f"File size:{path_util.get_file_size(file_path)}bytes")print(f"File creation time:{path_util.get_file_creation_time(file_path)}")# List files in a directorydirectory_path='/path/to/directory'files_list=path_util.list_files_in_directory(directory_path)print(f"Files in directory:{files_list}")DocumentationThe Sphinx-generated documentation for PathUtils can be foundhere.ContributionFeel free to contribute by submitting issueshere.
Package: pathvalidate-cli
pathvalidate-cliSummaryInstallationUsageCommand HelpDependenciesSummarypathvalidate-cli is a command line interface forpathvalidatelibrary.Installationpip install pathvalidate-cliUsage$ pathvalidate sanitize 'fi:l*e/p"a?t>h|.t<xt'
file/path.txt
$ pathvalidate --filename sanitize 'fi:l*e/p"a?t>h|.t<xt'
filepath.txt

$ pathvalidate validate 'fi:l*e/p"a?t>h|.t<xt'
[PV1100] invalid characters found: invalids=(':', '*', '"', '?', '>', '|', '<'), value='fi:l*e/p"a?t>h|.t<xt', platform=WindowsCommand HelpUsage: pathvalidate [OPTIONS] COMMAND [ARGS]...

Options:
  --version                     Show the version and exit.
  --debug                       For debug print.
  -q, --quiet                   Suppress execution log messages.
  --filename                    Consider inputs as filenames.
  --max-len, --max-bytes BYTES  Maximum byte counts of file paths. -1: same
                                value with the platform limitation.  [default:
                                -1]
  --platform PLATFORM           Execution platform name (case-insensitive).
                                Valid platform specifiers are
                                Linux/Windows/macOS. Valid special values are:
                                POSIX, universal (a) auto: automatically
                                detects the execution platform. (b) universal:
                                platform independent.  [default: universal]
  -v, --verbose                 Verbosity level  [default: 0]
  -h, --help                    Show this message and exit.

Commands:
  error     Print error reasons.
  sanitize  Sanitize file paths.
  validate  Validate file paths.DependenciesPython 3.8+
Package: pathway-assessor
PathwayAssessorAuthorsOverviewInstallationUsageReferencesContributionsAuthorsBoris Reva1, Anna Calinawan11Icahn School of Medicine at Mount Sinai (USA)OverviewComparison of tumors by activities of molecular pathways can help nominate disease driver pathways,
identify targets for therapeutic intervention, and determine clinically relevant subtypes and diagnostic biomarkers.
We introduce a new method for calculating overrepresentation and underrepresentation scores to assess a pathway’s
activation and suppression, respectively.
The novelty of this approach is in independent assessment of overrepresentation and underrepresentation of pathway’s
genes from both top and bottom of the ranked gene list of a given sample.InstallationRequires: Python >= 3.6To install the latest version of PathwayAssessor, run:pip install pathway-assessorUsageTo see more information about the main functions, visit theReadMe included with the package code.import pathway_assessor as pa

pa.all()
pa.harmonic()
pa.geometric()
pa.min_p_val()ReferencesBarbie, D.A. , et al. “Systematic RNA interference reveals…”,  Nature. 2009 Nov 5;462(7269):108-12.Abril-Rodrigues, G., Ribas A., “SnapShot: Immune Checkpoint Inhibitors”, Cancer Cell 31, June 12, 2017.Aran, D., Hu Z., Butte, A. “xCell: digitally portraying the tissue…”, Genome Biology. (2017) 18:220.ContributionsIf you find small bugs, larger issues, or have suggestions, please email the maintainer atanna.calinawan@mssm.edu.
Contributions (via pull requests or otherwise) are welcome.
Package: pathwayenrichment
Permutation-based pathway enrichment analysisPython tools to perform a permutation-based pathway enrichment analysis. Currently supporting KEGG pathways.Usagefrompathwayenrichment.representationimportClusterPermutatorfrompathwayenrichment.databaseparserimportKEGGPathwayParserfrompathwayenrichment.utilsimportrandomPartitionFirst, let's download the KEGG database for Dokdonia, a marine bacterium. To this end, we employ KEGG's entry code for Dokdonia (dok). We will then parse the database to obtain a list of genes and associated cellular pathways and systems.KEGGparser=KEGGPathwayParser.fromKEGGidentifier('dok',only_curated_pathways=True)gene_pathways,gene_systems=KEGGparser.getGenePathways()system_pathways=KEGGparser.getSystemPathways()gene_info=KEGGparser.getGeneInfoFromKEGGorthology()gene_list=list(gene_pathways.keys())print(f'There are a total of{len(gene_list)}genes')There are a total of 786 genesNow, we simulate a set of gene clusters to perform a pathway enrichment analysis on them. To this end, we will randomly partition the set of genes into clusters.genes_under_study=gene_list[:300]clusters=dict(zip(['A','B','C','D'],randomPartition(gene_list,bin_sizes=[75,25,150,50])))Now we are ready to instantiate a ClusterPermutator to run the enrichment analysis. We will permute the total set of genes to form new random clusters 10000 times, our sample size to compute the sample p-value.permutator=ClusterPermutator(clusters,gene_pathways,system_pathways)res=permutator.sampleClusterPermutationSpace(sample_size=10000,n_processes=4)Finished permutation sampling# Here are the first 10 pathways with lowest sample p-value{k:vfork,vinlist(res['pathway']['A'].items())[:10]}{'03018 RNA degradation [PATH:dok03018]': (0.2777777777777778, 0.0484),
 '00020 Citrate cycle (TCA cycle) [PATH:dok00020]': (0.18181818181818182,
  0.0691),
 '02020 Two-component system [PATH:dok02020]': (0.2, 0.1527),
 '00541 O-Antigen nucleotide sugar biosynthesis [PATH:dok00541]': (0.19047619047619047,
  0.1641),
 '03060 Protein export [PATH:dok03060]': (0.2, 0.1683),
 '02024 Quorum sensing [PATH:dok02024]': (0.14814814814814814, 0.218),
 '00520 Amino sugar and nucleotide sugar metabolism [PATH:dok00520]': (0.14285714285714285,
  0.2211),
 '02010 ABC transporters [PATH:dok02010]': (0.15, 0.2422),
 '00040 Pentose and glucuronate interconversions [PATH:dok00040]': (0.3333333333333333,
  0.25),
 '00053 Ascorbate and aldarate metabolism [PATH:dok00053]': (0.2, 0.25)}Here, we see the 10 pathways with lowest sample p-values within clusterA.
Package: pathway-forte
A Python package for benchmarking pathway databases with functional enrichment and prediction methods
tasks.Installationpathway_fortecan be installed fromPyPIwith the following command in your terminal:$python3-mpipinstallpathway_forteThe latest code can be installed fromGitHubwith:$python3-mpipinstallgit+https://github.com/pathwayforte/pathway-forte.gitFor developers, the code can be installed with:$gitclonehttps://github.com/pathwayforte/pathway-forte.git$cdpathway-forte$python3-mpipinstall-e.Main CommandsThe table below lists the main commands of PathwayForte.CommandActiondatasetsLists of Cancer DatasetsexportExport Gene Sets using ComPathoraList of ORA AnalysesfcsList of FCS AnalysespredictionList of Prediction MethodsFunctional Enrichment Methodsora. Lists Over-Representation Analyses (e.g., one-tailed hyper-geometric test).fcs. Lists Functional Class Score Analyses such as GSEA and ssGSEA usingGSEAPy.Prediction Methodspathway_forteenables three classification methods (i.e., binary classification, training SVMs for multi-classification tasks, or survival analysis) using individualized pathway activity scores. The scores can be calculated from any pathway with a variety of tools (see[1]) using any pathway database that enables to export its gene sets.binary. Trains an elastic net model for a binary classification task (e.g., tumor vs. normal patients). The training is conducted using a nested cross validation approach (the number of cross validation in both loops can be selected). The model used can be easily changed since most of the models inscikit-learn(the machine learning library used by this package) required the same input.subtype. Trains a SVM model for a multi-class classification task (e.g., predict tumor subtypes). The training is conducted using a nested cross validation approach (the number of cross validation in both loops can be selected). Similarly as the previous classification task, other models can quickly be implemented.survival. Trains a Cox’s proportional hazard’s model with elastic net penalty. The training is conducted using a nested cross validation approach with a grid search in the inner loop. This analysis requires pathway activity scores, patient classes and lifetime patient information.Otherexport. Export GMT files with current gene sets for the pathway databases included in ComPath[2].datasets. Lists the TCGA data sets[3]that are ready to run inpathway_forte.References[1]Lim, S.,et al.(2018).Comprehensive and critical evaluation of individualized pathway activity measurement tools on pan-cancer data.Briefings in bioinformatics, bby125.[2]Domingo-Fernández, D.,et al.(2018).ComPath: An ecosystem for exploring, analyzing, and curating mappings across pathway databases.npj Syst Biol Appl., 4(1):43.[3]Weinstein, J. N.,et al.(2013).The cancer genome atlas pan-cancer analysis project.Nature genetics, 45(10), 1113.
Package: pathwin
pathwinsetPath is a library for easy manipulation of the Windows environment variable Path.importpathwinexamplePath="C:\\example\\"# Manipulation of system environment variablespathwin=Path(True)# Manipulation of user environment variablespathwin=Path(False)# get PathexistPath=pathwin.getPath()# -> "C:\\example;C:\\example2"existPathList=pathwin.getPathList()# -> ["C:\\example", "C:\\example2"]# Path Overridepathwin.setPath(existPath+";"+examplePath)# Add to toppathwin.addPath(examplePath)# Fourth Add topathwin.addPath(examplePath,3)# delete pathpathwin.removePath(examplePath)Installing pathwin and Supported Versionspipinstallpathwin
Package: pathxf
pathxfPathxf is a minimally viable tool for renaming large numbers of files based on a flexible yaml schema. As of now, the schema is provisional and could be changed. In it's current state, the tool only makes symlinks from dest to source files, and takes only minimal precautions for failure modes (e.g. it doesn't expect the filesystem to change via outside sources while it's running, and it's probably not robust to interruptions and restarts). No checks are made for multiple files given the same name. Loops, swaps, and chains are not supported. In other words, all input and output files must have unique names.Those stumbling across this library will not find it in a ready-to-use state, but feel free to adapt the source to your own needs.
Package: patiencebar
Terminal progress bar compatible with multi-threadingBuilt byGuillaume Schworer. Licensed under
the GNU General Public License v3 or later (GPLv3+) license (seeLICENSE).InstallationJust runpip install patiencebarto get the most recent stable version.UsageThe main entry points are thepatiencebar.Patiencebarandpatiencebar.Patiencebarmulticlasses. You’ll just use it
like this:import patiencebar as PB

n_calc = 34
pb = PB.Patiencebar(valmax=n_calc, barsize=50, title="Test bar")
for i in range(n_calc):
    dostuff()
    pb.update()More usage details, seeexample.py)DocumentationAll the options are documented in the docstrings for thePatiencebarandPatiencebarmulticlasses. These can be viewed in a Python shell using:import patiencebar as PB
print(PB.Patiencebar.__doc__)
print(PB.Patiencebarmulti.__doc__)or, in IPython using:import patiencebar as PB
PB.Patiencebar?
PB.Patiencebarmulti?LicenseCopyright 2016 Guillaume Schworerpatiencebar is free software made available under the GNU General
Public License v3 or later (GPLv3+) license (seeLICENSE).Changelog1.0.0 (2016-05-03)Initial release.
Package: patiencediff
This package contains the implementation of thepatiencediffalgorithm, asfirst describedby Bram Cohen.Like Python’sdifflib, this module provides both a convenienceunified_difffunction for the generation of unified diffs of text files
as well as a SequenceMatcher that can be used on arbitrary lists.Patiencediff provides a good balance of performance, nice output for humans,
and implementation simplicity.The code in this package was extracted from theBazaarcode base.The package comes with two implementations:A Python implementation (_patiencediff_py.py); this implementation only
requires a Python interpreter and is the more readable version of the twoA C implementation implementation (_patiencediff_c.c); this implementation
is faster, but requires a C compiler and is less readableUsageTo invoke patiencediff from the command-line:python -m patiencediff file_a file_bOr from Python:>>> import patiencediff
>>> print ''.join(patiencediff.unified_diff(
...      ['a\n', 'b\n', 'b\n', 'c\n'],
...      ['a\n', 'c\n', 'b\n']))
---
+++
@@ -1,4 +1,3 @@
 a
+c
 b
-b
-c
Package: patient-aware-splitter
Covid_Patient_Aware_Image_SplitIt is important not to split images of the same patient between the test and train sets to avoid overfitting. This repository splits a sample Covid/Normal classification dataset into test and train sets in a patient aware and stratified manner. The meta-data file is used to group the images based on Patient-ID. For example, all the images colored green belong to the same patient and should be either in the test or the train split.While grouping should be done strictly to ensure there is no splitting images of a patient, stratification can be done approximately i.e. as well as possible.
This code also assumes that all images of one patient have the same stratification category (diagnosis), meaning that all the images coming from the same Patient ID are either Covid or NonCovid.To split images into 4 folders (train/Covid, train/NonCovid, test/Covid, test/NonCovid) inside splitted folder:split_to_folders.pyTo split images into a dictionary:split_into_dictionary.pyTo split images into a torch Dataloader:split_into_dataloader.py
Package: patientMatcher
patientMatcher - a Python and MongoDB - based MatchMaker Exchange serverPatientMatcher is aPython(Flask) andMongoDB- based implementation of aMatchMaker Exchange(MME) server, developed and actively maintained byClinical Genomics, Science For Life Laboratory in Stockholm. PatientMatcher is designed as a standalone application, but can easily communicate with external applications via REST API. The MME Stockholm node is being implemented in clinical production in collaboration with the Genomic Medicine Center Karolinska at the Karolinska University Hospital.Info on how to test PatientMatcher or to set up a server containing an app frontend and backend is available on thedocumentation pages.
Package: patina
patinaThis is an implementation of Rust's Result and Option types in Python. Most
methods have been implemented, and the (very good)original documentationhas
been adapted into docstrings.The documentation for this package can be readhere. All doctests are
run and type-checked as part of the CI pipeline as unit tests. The tests are
direct ports of those in the Rust documentation.Why?2 reasons:Python (in 3.10) now has pattern matching, wouldn't it be cool if we could
make the most of that?Sometimes it's nice to have types for your errors.Being able tomapover possible failure can be very powerful.Check this out:frompatinaimportSome,None_# This value is an Option[str]maybe_value=api_call_that_might_produce_a_value()matchmaybe_value.map(str.upper):# Make it uppercase if it existscaseSome(val):print("We got a val:",val)caseNone_():# Don't forget the parentheses (otherwise it's binding a name)print("There was no val :(")A similar thing can be done with theResulttype (matching onOkorErr).
This can be handy if you want to be more explicit about the fact that a function
might fail. If the function returns aResult, we can explicitly type the
possible error values.If this all sounds good, I recommend looking into functional programming,
particularly of the ML variety (e.g. Haskell, OCaml, SML) or Rust.