Saravanan666/pypi-org huggingface dataset:
Package: print-wcolor
print_wcolor使用print_wcolor可以打印出彩色字体和彩色背景Use Print WColor to print out colored fonts and colored backgrounds
使用示例for examplefrom print_wcolor import print_wcolor

a=[1,2,3,4]
c={}
c["r"]=255
c["g"]=255
print("*"*20)
print_wcolor("i think","therefor i am",a,c,fg="red",bg="green")
print("*"*20)
print_wcolor("i think","therefor i am",a,c,fg="red")
print("*"*20)
print_wcolor("i think","therefor i am",a,c,bg="green")
print("*"*20)
print_wcolor("i think","therefor i am",a,c)其中"i think,therefor i am"是要打印的信息，fg是字体颜色，bg是背景颜色。Where "I think,therefor I am" is the information to be printed, fg is the font color, bg is the background color.关键词fg选项如下Keyword FG options are as follows{"black","red","green","yellow","blue","purple","cyan","white"}关键词bg选项如下Keyword BG options are as follows{"black","red","green","yellow","blue","purple","cyan","white"}
Package: printWithStyle
printWithStyleStyle your print.ModuleprintWithStyle(text, bold=False, italic=False, underline=False, foreground=None, background=None)text:text to printHas to be str or list[str] (if list[str] is used every element of the list in a line).bold:style the text boldHas to be bool.italic:style the text italicHas to be bool.underline:style the text underlineHas to be bool.foreground:foreground colorHas to be str. (possible values: "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white")background:background colorHas to be str. (possible values: "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white")UsagefromprintWithStyleimport*printWithStyle(["Hello","World"],bold=True)Output:HelloWorld
Package: print-yaml
print-yamlprint-yaml is a CLI tool that prints yaml files according to the desired depth.Installation# using pip
$ pip install print_yaml

# using poetry
$ poetry add print_yamlUsageLet's say you have the following yaml file.# data.yamla:b:1c:-one-two-three:A:6B:7-four:-8-9d:e:3f:4g:5BasicThe following values can be obtained usingprint_yaml$print_yamltests/data.yaml-d1a:g:$print_yamltests/data.yaml-d2a:b:c:d:g:5$print_yamltests/data.yaml-d3a:b:1c:-one-two-three:-four:d:e:f:g:5With valueBy default, only the "key" in the yaml file is output.If you add the '--value' or '-v' option, it also outputs a single value.$print_yamltests/data.yaml-d1-v

a:g:5$print_yamltests/data.yaml-d2-v
a:b:1c:d:g:5$print_yamltests/data.yaml-d3-v
a:b:1c:-one-two-three:-four:d:e:3f:4g:5All Commands$print_yaml--helpUsage:print_yaml[OPTIONS]FILE_PATH╭─Arguments───────────────────────────────────────────────────────────────────────────────────────────────╮
│*file_pathTEXT[default:None][required]│
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─Options─────────────────────────────────────────────────────────────────────────────────────────────────╮
│-dINTEGERRANGE[x>=0][default:0]│
│--value-v│
│--install-completionInstallcompletionforthecurrentshell.│
│--show-completionShowcompletionforthecurrentshell,tocopyitor│
│customizetheinstallation.│
│--helpShowthismessageandexit.│
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Package: prioheap
PrioHeapA priority queue from the textbooks. Python implementation is surprinsigly not modern.Installationpip3installprioheapUsageThe API is dead simple:importprioheapprio=prioheap.PrioHeap()prio.add(0)# add elementprio.add(3)prio.peak()# return highest element, e.g. 3prio.add(1)prio.pop()# remove and return highest element, 3.len(prio),bool(prio)# those are supportediter(prio),list(prio)# iterate elements in decreasing orderTestTo run the unit tests from the root of this repository:python3-mtestsLicenseLicense is Unlincense, so public domain.
Package: prio-merge
Prio mergeMerge two dictionaries on a deep level with one taking precedent over another,
and by using a few rules:If keys exist in just one of the dictionaries, it will be merged in the final dictionaryIf two keys exist in the same nested depth, one of these things will happenif the values have different types, prioritized dict value will take remainif both values are lists, they will be combined according by appending the non-prioritized list to the other and then removing duplicates by casting to a list.This means that list order can not be guaranteedIt also means that any list will end the recursive nature of the mergeif both values are dicts, the keys will be combined recursively using these rulesotherwise take the value from the prioritized dictionaryUsagefromprio_mergeimportprio_mergeprio_dict={}
Package: prioq
prioqIn what followspythonis an alias forpython3.7orpypy3.7or any later version (python3.8,pypy3.8and so on).InstallationInstall the latestpip&setuptoolspackages versionspython-mpipinstall--upgradepipsetuptoolsUserDownload and install the latest stable version fromPyPIrepositorypython-mpipinstall--upgradeprioqDeveloperDownload the latest version fromGitHubrepositorygitclonehttps://github.com/lycantropos/prioq.gitcdprioqInstall dependenciespython-mpipinstall-rrequirements.txtInstallpythonsetup.pyinstallUsage>>>fromprioq.baseimportPriorityQueue>>>queue=PriorityQueue(*range(10))>>>len(queue)10>>>queue.peek()0>>>queue.pop()0>>>len(queue)9>>>queue.peek()1>>>queue.push(0)>>>len(queue)10>>>queue.peek()0DevelopmentBumping versionPreparationInstallbump2version.Pre-releaseChoose which version number category to bump followingsemver
specification.Test bumping versionbump2version--dry-run--verbose$CATEGORYwhere$CATEGORYis the target version number category name, possible
values arepatch/minor/major.Bump versionbump2version--verbose$CATEGORYThis will set version tomajor.minor.patch-alpha.ReleaseTest bumping versionbump2version--dry-run--verbosereleaseBump versionbump2version--verbosereleaseThis will set version tomajor.minor.patch.Running testsInstall dependenciespython-mpipinstall-rrequirements-tests.txtPlainpytestInsideDockercontainer:withCPythondocker-compose--filedocker-compose.cpython.ymlupwithPyPydocker-compose--filedocker-compose.pypy.ymlupBashscript:withCPython./run-tests.shor./run-tests.shcpythonwithPyPy./run-tests.shpypyPowerShellscript:withCPython.\run-tests.ps1or.\run-tests.ps1cpythonwithPyPy.\run-tests.ps1pypy
Package: prioQbyrobi
Priority Queue For A* SearchAnyone of you can use this package to handle the priority Queue part of your A* Search code.Github Open Sourceusing processFirst need to add the librarypipinstallprioQbyrobiThen you need to import the A* Search specific queue from the libraryimportprioQbyrobiasQminQ=Q.PriorityQueue()#Creating an object of PriorityQueue class of the libraryminQ.insert(yournodeObj)#inserting your node object into the QueueminQ.delete()# popping your node object from the priority queue##Existing methodsinsert() - insert node object.delete() - pop min element and return it.isEmpty() - return true if queue is empty.size() - it returns length of the queue.N.B: You must need to declare a variable name "total_cost" the priority is prioritized based on this
Package: prior
PRIOR🐍 A Python package for distributing resources from AI2's PRIOR teamInstallationInstall thepriorpackage with pip:pipinstallpriorDatasetsProcTHOR-10k[GitHub]importpriorprior.load_dataset("procthor-10k")Object Nav Evaluation[GitHub]importpriorprior.load_dataset("object-nav-eval")ModelsProcTHOR Models[GitHub]importpriorprior.load_model(project="procthor-models",model="object-nav-pretraining")Example UsageTo use a public Python dataset, simply run:importpriordataset=prior.load_dataset("test-dataset",entity="mattdeitke",revision="main")Here,revisioncan be either a tag, branch, or commit hash.Private DatasetsIf you want to use a private dataset, make sure you're either:Already logged into GitHub from the command line, and able to pull a private repo.Set the GITHUB_TOKEN environment variable to a GitHub authentication token with read access to private repositories (e.g.,export GITHUB_TOKEN=<token>). You can generate a GitHub authentication tokenhere.Set thegh_auth_tokenglobal variable in thepriorpackage with:importpriorprior.gh_auth_token="<token>"
Package: prioritization-discovery
Prioritization DiscoveryPython algorithm to discover, from an event log, the case priority levels and the rules that classify a process case in its corresponding
level. For example, the cases of a process can belong to three priority levels (low, medium, high), where the activity instances of cases
with high priority are executed before than activity instances of cases with low priority (when both of them are enabled at the same time).Example of useimportpandasaspdfromprioritization_discovery.configimportDEFAULT_CSV_IDSfromprioritization_discovery.discoveryimportdiscover_priority_rules# Read event logevent_log=pd.read_csv("path_to_event_log.csv")event_log[DEFAULT_CSV_IDS.enabled_time]=pd.to_datetime(event_log[DEFAULT_CSV_IDS.enabled_time],utc=True)event_log[DEFAULT_CSV_IDS.start_time]=pd.to_datetime(event_log[DEFAULT_CSV_IDS.start_time],utc=True)event_log[DEFAULT_CSV_IDS.end_time]=pd.to_datetime(event_log[DEFAULT_CSV_IDS.end_time],utc=True)# Get priority levels and their rulescase_attributes=discover_priority_rules(event_log=event_log,attributes=['loan_amount','client_type']# Case attributes to consider in the rule discovery)To see a more detailed example of use, and the format of the output, you can check thistest file.No enabled time availableTo identify which activity instances have been prioritized over others, the information of the enabled time has to be available in the event
log. In case it is not available, consider usingthis Python libraryto estimate them.
Package: prioritymap
Python Priority MapA asymptotically-efficient combination between a heap and a map that stores key:priority mappings. Licensed under theApache License Version 2.0.OperationsOperationDescriptionRuntime Complexity__getitem__(key)Get priority of keyO(1)__setitem__(key, priority)Set priority of keyO(log n)__delitem__(key)Remove a keyO(log n)__contains__(key)Check whether a key is containedO(1)__len__()Return the number of keys containedO(1)peek()Get lowest-priority key and its priorityO(1)pop()Get and remove lowest-priority key and its priorityO(log n)Example Console Output>>>fromprioritymapimportPriorityMap>>>pm=PriorityMap()>>>pm["first"]=1>>>pm["second"]=2>>>pm["underdog"]=5>>>pm.peek()('first',1)>>>pm["underdog"]=0>>>len(pm)3>>>pm.pop()('underdog',0)>>>pm.pop()('first',1)>>>pm.pop()('second',2)>>>len(pm)0
Package: priority-memory
# Priority MemoryA prioritized sampling tool for priority memory replay.The implementation is based on sum tree, or segmentation tree.- Set the priority of each sample at anytime.- When you do not know the priority of the sample, you can appendthem to the buffer, and they will show up in the next sampling batch.- When the buffer is full, drop the samples with lowest priority.The time complexity for sampling a batch with batch size mfrom a dataset with n samples is O(mlogn), for setting priorityfor the batch is O(mlogn).# Usage> pip install priority_memory```pythonfrom priority_memory import FastPriorReplayBufferbuffer = FastPriorReplayBuffer(8000)buffer.append(features=[0.1, 0.1, 0.1], prior=1)buffer.append(features=[0.2, 0.2, 0.2], prior=2)buffer.append(features=[0.3, 0.3, 0.3], prior=3)buffer.append(features=[0.4, 0.4, 0.4], prior=4)indexes, data, weights = buffer.sample_with_weights(batch_size=2)mae = [10, 20]buffer.set_weights(indexes, mae)```
Package: priorityq
PriorityQ is a library for managing a priority queue (PQ) with a cleaner API to enable custom comparators,
finding references to values efficiently (in constant time) and deleting values from the PQ.   This was
developed because the current heapq module (in python’s standard library) does not provide an efficient
find operation (it is O(n)) and has no easy way to deleting an element and ensuring the heap invariant
afterwards.FeaturesO(1) finding of elementsDeletion of elements possible (in O(log n)).Adjusting of the priority of an element without requiring a deletion followed by an insertion.Opaque handles to elements that can be used to reference to the same item again.Duplicate elements allowed.Custom comparator function can be passed to the PQ itself instead of needing to implement __cmp__.It is simple to useTo create a PQ simply do:# A simple object with a comparatorclassItem(object):def__init__(self,value):self.value=valuedef__cmp__(self,another):returncmp(self.value,another.value)frompriorityqimportPQpq=PQ()pq.heapify([Item(r)forrin[1,10,2,20,4,7,9,3,5,6]])printlist(pq)# Should print:# 1 2 3 4 5 6 7 9 10 20handle_10=pq.find(10)#   Happens in O(1)handle_10.value=25#   Modify its value - O(log n)pq.adjust(handle_10)#   Indicate to the heap to reprioritise/adjust itprintlist(pq)# Should print:# 1 2 3 4 5 6 7 9 20 25handle_10.value=10#   Modify its value using the same opaque handle as beforepq.adjust(handle_10)#   Indicate to the heap to reprioritise/adjust itprintlist(pq)# Should print:# 1 2 3 4 5 6 7 9 10 20LinksDocumentationWebsite
Package: priorityY
Priority Based Connected ComponentsIn many scenarios we see there is a need to run connected components but first connect entities with higher priority edges and then move to lower priority ones. Also apart from it, every group has a size-limit.
To tackle such analytical challenges we have come up with an algorithm to adjust the priority of edges and limit the size of the components.Installationpip install priorityYHow to use it?from priorityY import *
G = [(1,4,1),(1,5,3),(2,3,2),(2,6,2),(6,7,3),(4,8,2),(5,9,1)]
threshold = 3
components = priority_based_linkage(G,threshold)
print(components)Output[[1, 4, 8], [2, 3, 6], [5, 9], [7]]Let us visualise the above example for better understanding how the library works.
The threshold is set to 3, limiting the size of components. Dotted edges denote the link and priority associated.At the first iteration, all nodes having edges with Priority-1 get connected.1–4 and 5–9 gets connected.In the next iteration, the algorithm connects nodes with edges between them of Priority-2.1–4–8 gets connected, 2–3–6 gets connected and both reach the thresholdThe algorithm stops as the threshold is reached for components and no more edges left. Above are the final connected components with the set threshold and provided edges priority.License© 2021 Abhishek Mungoli, Pravesh Garg, Somedip KarmakarThis repository is licensed under the MIT license. See LICENSE for details.Change Log0.0.1 (23/08/2021)First Release0.0.2 (27/01/2022)Second Release
Package: pripy
pripypripy is a python package aimed at providing phase retrieval algorithms, primarily for use in adaptive optics systems and simulators. These algorithms must have a common and minimal API, in order to accelerate the testing of various algorithms on a given optical system.PrerequisitesA recent version of Python 3 installed on any Windows/Linux/MacOS machine,Installing pripyTo install the most recent stable version of pripy, simply:pipinstallpripyTo install the latest development version from this git repo, instead do:gitclonehttps://github.com/jcranney/pripycdpripy
pipinstall-e.Using pripyTo use pripy, follow the provided examples, e.g., using Gerchberg-Saxton in the sandbox AO environment (no external simulator required):cdexamples
ipython-isandbox_gs.py# run the sandbox Gerchberg-Saxton exampleContributing to pripypripy is in its infancy and welcomes collaborative input. To contribute to pripy, follow these steps:Fork this repository.Create a branch:git checkout -b <branch_name>.Make your changes and commit them:git commit -m '<commit_message>'Push to the branch:git pushCreate the pull request.Alternatively see the GitHub documentation oncreating a pull request.Contributors@jcranney@mvandam@ndoucetContactIf you want to contact me you can reach me atjesse.cranney@anu.edu.au.LicenseThis project uses the following license:MIT License.
Package: prisma2markdown
Prisma2MarkdownPrisma2Markdown or more is a pure python package that aim to facilitate
prisma database visualization using mermaid.Unfortunately, mermaid still have an issue that prevent perfect visualization since mermaid cannot yet create attribute relations.Installationpip install py-prisma2markdownorpip install git+https://github.com/HOZHENWAI/py-prisma2markdown.gitUsageThis package make a command line available:prisma2markdownTo use theprisma2markdown updatecommand, you have to setup your markdown
with the following script:\n[comment]: # (prisma2markdown)\n\n[comment]: # ({TARGET_PRISMA_SCRIPT})replacing {TARGET_PRISMA_SCRIPT} with a path to the prisma script then calling
the cli command:prisma update --markdown-target PATH_TO_MARKDOWN
Package: prismacloud-api
Python SDK for the Prisma Cloud APIsThis project includes a Python SDK for the Prisma Cloud APIs (CSPM, CWPP, and CCS) in the form of a Python package.
It also includes reference scripts that utilize this SDK.Major changes with Version 5.0:Command-line argument and configuration file changes.Table of ContentsSetupSupportSetupInstall the SDK viapip3:pip3 install prismacloud-apiPlease refer toPyPIfor details.Example ScriptsPlease refer to thisscriptsdirectory for configuration, documentation, and usage.If you prefer to use this SDK without using command-line options, consider these minimal examples:Prisma Cloud Enterprise Editionimport os
from prismacloud.api import pc_api

# Settings for Prisma Cloud Enterprise Edition

settings = {
    "url":      "https://api.prismacloud.io/",
    "identity": "access_key",
    "secret":   "secret_key"
}

pc_api.configure(settings)

print('Prisma Cloud API Current User:')
print()
print(pc_api.current_user())
print()
print('Prisma Cloud Compute API Intelligence:')
print()
print(pc_api.statuses_intelligence())
print()

print('Prisma Cloud API Object:')
print()
print(pc_api)
print()Prisma Cloud Compute Editionimport os
from prismacloud.api import pc_api

# Settings for Prisma Cloud Compute Edition

settings = {
    "url":      "https://console.example.com/",
    "identity": "username",
    "secret":   "password"
}

pc_api.configure(settings)

print('Prisma Cloud Compute API Intelligence:')
print()
print(pc_api.statuses_intelligence())
print()

print('Prisma Cloud API Object:')
print()
print(pc_api)
print()Settings can also be defined as environment variables:Environment Variablessettings = {
    "url":      os.environ.get('PC_URL'),
    "identity": os.environ.get('PC_IDENTITY'),
    "secret":   os.environ.get('PC_SECRET')
}SupportThis project has been developed by members of the Prisma Cloud CS and SE teams, it is not Supported by Palo Alto Networks.
Nevertheless, the maintainers will make a best-effort to address issues, and (of course) contributors are encouraged to submit issues and pull requests.
Package: prisma-get-info
Prisma Get InfoRequirementsPanorama withcloud_servicesplugin v1.8 or higher (Prisma Access)Python >=3.7 (may work on lower)Python modules:pan-python >= 0.16.0 -tabulate >= 0.8.7 -https://github.com/astanin/python-tabulatexmltodictLicenseMITInstallation:Via PIP:pip install --upgrade prisma_get_infoVia download: Clone/Download, and from the directory run./get_prisma_spn.pyUsage:Runprisma_get_spnorprisma_get.spn.pydepending on how downloaded/installed.edwards-mbp-pro:prisma_get_infoaaron$prisma_get_spn
PanoramaHostname:panorama-test.mydomain.org
PanoramaUsername:aaron
PanoramaPassword:us-eastus-southwest
----------------------------------------
us-east-clementineus-southwest-kumarahouus-southwest-poplar
edwards-mbp-pro:prisma_get_infoaaron$Can also use--output-json-filecommand line switch to save output as JSON file:{"us-east":["us-east-clementine"],"us-southwest":["us-southwest-kumarahou","us-southwest-poplar"]}Full options available when run with--help.VersionVersionChanges1.0.1Initial Release.Argumentsedwards-mbp-pro:prisma_get_info aaron$ prisma_get_spn --help
usage: prisma_get_spn [-h] [--host HOST] [--user USER] [--pass PASS] [--panorama-api-key PANORAMA_API_KEY]
                      [--tenant TENANT] [--output-json-file OUTPUT_JSON_FILE]

Prisma get Info (managed by Panorama).

optional arguments:
  -h, --help            show this help message and exit

API:
  These options change how this program connects to the API.

  --host HOST           Panorama hostname or IP (or ENV var PANORAMA_HOST). If not entered, will prompt.
  --user USER           Panorama username (or ENV var PANORAMA_USERNAME). If not entered, will prompt.
  --pass PASS           Panorama password (or ENV var PANORAMA_PASSWORD). If not entered, will prompt.
  --panorama-api-key PANORAMA_API_KEY
                        Authenticate with Panorama API KEY instead of username/password.
  --tenant TENANT       Tenant name (if multi-tenancy is enabled.)

Output:
  These options change how the output is generated.

  --output-json-file OUTPUT_JSON_FILE
                        Output as JSON to this specified file name
edwards-mbp-pro:prisma_get_info aaron$
Package: prisma-sase
Palo Alto Networks Prisma SASE Python SDK v6.3.2b1Python3 SDK for the Prisma SASE AppFabricSynopsisIntended to be a small, lightweight SDK wrapper around the Prisma SASE API for easy use.
Initial version requires knowledge of JSON/Dict objects for POST/PUT/PATCH operations.RequirementsActive Prisma SASE AccountPython >= 3.7Python modules:Requests -http://docs.python-requests.org/en/master/Websockets >= 8.1 -https://websockets.readthedocs.io/en/stable/index.htmlurllib3 >= 2.0.0 -https://urllib3.readthedocs.io/en/stable/Code ExampleComes withexample.pythat shows usage to get a JSON list of sites.Super-simplified example code (rewrite of example.py in ~4 lines of code):# Import the Prisma SASE SDK API constructor and JSON response pretty printerfromprisma_saseimportAPI,jd# Instantiate the Prisma SASEx API constructorsdk=API()# Call Prisma SASE API login using the Interactive helpers (Handle SAML2.0 login and MSP functions too!).sdk.interactive.login_secret(client_id='api_user1@1111111111.iam.panserviceaccount.com',client_secret='xxxxxx',tsg_id=1111111111)# Print a dump of the list of sites for your selected accountjd(sdk.get.sites())LicenseMITVersionVersionBuildChanges6.3.2b1Support for February 2023 Controller release.6.3.1b1Support for November 2023 Controller release.6.2.3b1Support for August 2023 Controller release.6.2.2b1Support for June 2023 Controller release.6.2.1b1Support for April 2023 Controller release.6.1.2b1Support for January 2023 Controller release.6.1.1b1Support for November 2022 Controller release.6.0.1b1Support for May 2022 Controller release.For more infoGet help and additional Prisma SASE Documentation athttps://pan.dev/sase/docsView the autogenerated documentation in thedocs/directory, or athttps://github.com/PaloAltoNetworks/prisma-sase-sdk-python/.View in-python help usinghelp()functions. (example:help(sdk.get.login))