Saravanan666/pypi-org huggingface dataset:
Package: deferred2
Successor of the so useful deferred library on Google AppEngine (GAE).It should fix some issues.
It should work async.UsageBy example:from google.appengine.ext import ndb
import deferred2 as deferred


def work(message):
    pass


@ndb.tasklet
def defer_one_task():
    yield deferred.defer_async(work, 'to be done')


@ndb.tasklet
def defer_multiple_tasks():
    yield deferred.defer_multi_async(
        deferred.task(work, 'Hello'),
        deferred.task(work, 'world!'))


@ndb.tasklet
def defer_deferring():
    # this one enqueues one task right now, which will then add all the
    # other tasks
    yield deferred.one_shot_async(
        deferred.task(work, 'Hello'),
        deferred.task(work, 'world!'))You see, it pretty much looks and works as before.Changestransactional’s new default isauto(instead ofFalse), t.i. if your inside a transaction it will be set to True, otherwise it will be FalseYou can set_urlsuffixwhich can be a str or a sequence of strs; which will get appended to the url. Pure cosmetics.In case you set anamethat is too long or contains invalid characters, a hash of the name will be used instead.
Package: deferred-import
deferred-importLazy import and install on demand Python packages.Package will be loaded only when you use it in the first time. Deferring it makes module loading much faster.If module is missed, the package will be automatically installed. It allows to make some project dependencies optional and install them on demand.Installationpython3-mpipinstall--userdeferred-importUsagefromdeferred_importimportdeferred_importrequests=deferred_import('requests')attr=deferred_import('attr',package='attrs')requests.get('http://httpbin.org/status/200')# <Response [200]>
Package: deferred-result
DeferredResultThis library provides simple deferred result.UsageCreate deferred result:def_result=DeferredResult[str]()Then you can wait for the result using optional timeout:result=def_result.wait(timeout=1)While waiting for result other thread can set result:def_result.resolve('Hello World')After resolving result all threads waiting for result will be resumed.It is also possible to reject deferred result:def_result.reject(RuntimeError('Well....'))In that case all threads waiting for result will be resumed and exception passed torejectwill be thrown.
Package: defiance
<pre><h1>defiance</h1><h2>description</h2>This is a module that can reliablyascertain the health status of software.(It's like a testing kit)<h2>install</h2>[SH] pip install defiance<h2>documentation</h2>[SH] defiance shares<h2>defiance of defiance (the internal defiance of the defiance module)</h2><p>These checks are run with pypi "body_scan"</p><p>"defiance" is a fork of "body_scan"</p><p>("body_scan" checks are written with "unittest")</p>[SH] defiance defiance<h2>health checks</h2><p>Checks are started simultaneously, unless "--simultaneous no"</p><h3>create a status file</h3># status_1.pydef check_1 ():print ("check 1")def check_2 ():print ("check 2")def check_3 ():raise Exception ("not 110%")checks = {"check 1": check_1,"check 2": check_2,"check 3": check_3}<h3>start from a directory deeper than the status file "status_1.py"</h3>[SH] defiance status<h3>The report then should appear like this:</h3><code>paths: [{"path": "../status_1.py","empty": false,"parsed": true,"stats": {"passes": 2,"alarms": 1},"checks": [{"check": "check 1","passed": true,"elapsed": [4.054199962411076e-05,"seconds"]},{"check": "check 2","passed": true,"elapsed": [1.72930003827787e-05,"seconds"]},{"check": "check 3","passed": false,"exception": "Exception('not 110%')","exception trace": ["Traceback (most recent call last):","  File \"/home/veganecology/.local/lib/python3.11/site-packages/defiance/processes/scan/process/keg/check.py\", line 68, in start","    checks [ check ] ()","  File \"<string>\", line 13, in check_3","Exception: not 110%"]}]}]alarms: [{"path": "../status_1.py","checks": [{"check": "check 3","passed": false,"exception": "Exception('not 110%')","exception trace": ["Traceback (most recent call last):","  File \"/home/veganecology/.local/lib/python3.11/site-packages/defiance/processes/scan/process/keg/check.py\", line 68, in start","    checks [ check ] ()","  File \"<string>\", line 13, in check_3","Exception: not 110%"]}]}]stats: {"alarms": 0,"empty": 0,"checks": {"passes": 2,"alarms": 1}}</code><h2>advanced configurations</h2><p>It's recommended to run defiance programmatilly.An example of this can be found in the "advanced configurations"section of the documentation.</p><h2>Contacts</h2><p>status600@proton.me</p></pre>
Package: defichain-exporter
DefiChain ExporterPrometheus exporter for DefiChain Masternodesdefichain.ioInstallationpip3 install defichain-exporterUsageBy default defichain-exporter will run on port 8000 and run in foreground. Ideally this is installed into a daemon service such as systemd.usage: defichain-exporter [-h] [--username USERNAME] [--password PASSWORD]
                          [--port PORT] [--masternode MASTERNODE]

DefiChain Exporter

optional arguments:
  -h, --help            show this help message and exit
  --username USERNAME   rpc username
  --password PASSWORD   rpc password
  --port PORT           exporter port (default 8000)
  --masternode MASTERNODE
                        masternode host (default http://localhost:8554)LicenseMIT
Package: defillamaAPI
defillamaAPIAPI Collection of DefiLlama (https://defillama.com/docs/api)Splitted the endpoints categories on defillama's 'docs as a seperate class, so that user can import only required category endpoints.Installation:use pip to install:pip install defillamaAPIExample usage:from defillamaAPI import TVL, Stablecoins

# initialize TVL api client
defillama_tvl = TVL()

# initialize Stablecoins api client
defillama_stablecoins = Stablecoins()

# Get all protocols data
protocols = defillama_tvl.get_protocols()

# Get all stablecoins along with their circulating amounts
stablecoins = defillama_stablecoins.get_all_stablecoins()Task ToDoAdd Doc string details for all endpointsUser can select if he wants pandas dataframe or just response jsonTest with other versions of python ( Although used only requests and time module with no fancy methods)This is open-source project, I am extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.
Package: define
#DefineDefine is a terminal dictionary script that uses wordnik for
definitions. Supports audio pronunciationExample:>$define love>LOVE:>A deep, tender, ineffable feeling of affection and solicitude toward
>a person, such as that arising from kinship, recognition of
>attractive qualities, or a sense of underlying oneness.#INSTALLATIONInstalling define is easy:Using pip:>$ sudo pip install defineOn Arch:>$ yaourt -S defineManual Installation:>$ sudo python setup.py install
~~You will need an api key from wordnik, get one from
developer.wordnik.com and edit the “key” variable inside the script~~API key is now included in the scriptNotes for Ubuntu 15.04 (may apply to other versions):To enable pip you’ll need to add universe to your sources.$ echo “debhttp://archive.ubuntu.com/ubuntu/vivid universe” | sudo tee -a “/etc/apt/sources.list”$ sudo apt-get update$ sudo apt-get install python-pipTo make use of audio feature if you install with pip. You’ll need to install the gstreamer pacakge.$ sudo apt-get install gstreamer1.0-toolsUsing AudioAudio can be used in define with the -a or –audio flag.$ define –audio loveLOVE:A deep, tender, ineffable feeling of affection and solicitude toward
a person, such as that arising from kinship, recognition of
attractive qualities, or a sense of underlying oneness.Would you like to hear audio pronunciation? [Y/N] nFLAGSDefine has the following flags:-h/–help- Display help and exit.-a/–audio- Audio pronunciation of keyword.-t/–thesaurus- Thesaurus results for keyword.-u/–urban- Search Urban Dictionary for results instead of Wordnik.-l/–local- Search keywords using local dict and dictd dictionary (NOTE: This currently only works with the gcide dictionary, no other dictionary will work at the moment)
Package: defineif
Define IfIf the condition is true, define the method.For more information see:https://defineif.hakancelik.dev/How to install ?pip install defineifHow to use it ?importosfromdefineifimportDefineIfclassKlass(DefineIf):@staticmethod@DefineIf(os.name=='nt')defget_platform():return'Windows'@staticmethod@DefineIf(os.name=='posix')defget_platform():return'Linux'platform=Klass.get_platform()print(platform)
Package: definite
definiteSimple finite state machines.Perfect for representing workflows.QuickstartfromdefiniteimportFSM# You define all the valid states, as well as what their allowed# transitions are.classWorkflow(FSM):allowed_transitions={"draft":["awaiting_review","rejected"],"awaiting_review":["draft","reviewed","rejected"],"reviewed":["published","rejected"],"published":None,"rejected":["draft"],}default_state="draft"# Right away, you can use the states/transitions as-is to enforce changes.workflow=Workflow()workflow.current_state()# "draft"workflow.transition_to("awaiting_review")workflow.transition_to("reviewed")workflow.is_allowed("published")# True# Invalid/disallowed transitions will throw an exception.workflow.current_state()# "reviewed"# ...which can only go to "published" or "rejected", but...workflow.transition_to("awaiting_review")# Traceback (most recent call last):# ...# workflow.TransitionNotAllowed: "reviewed" cannot transition to "awaiting_review"# Additionally, you can set up extra code to fire on given state changes.classWorkflow(FSM):# Same transitions & default state.allowed_transitions={"draft":["awaiting_review","rejected"],"awaiting_review":["draft","reviewed","rejected"],"reviewed":["published","rejected"],"published":None,"rejected":["draft"],}default_state="draft"# Define a `handle_<state_name>` method on the class.defhandle_awaiting_review(self,new_state):spell_check_results=check_spelling(self.obj.content)msg=(f"{self.obj.title}ready for review. "f"{len(spell_check_results)}spelling errors.")send_email(to=editor_email,message=msg)defhandle_published(self,new_state):self.obj.pub_date=datetime.datetime.utcnow()self.obj.save()# You can also setup code that fires on **ANY** valid transition with the# special `handle_any` method.defhandle_any(self,new_state):self.obj.state=new_stateself.obj.save()# We can pull in any Python object, like a database-backed model, that we# want to associate with our FSM.fromnews.modelsimportNewsPostnews_post=NewsPost.objects.create(title="Hello world!",content="This iz our frist post!",state="draft",)# We start mostly the same, but this time pass an `obj` kwarg!workflow=Workflow(obj=news_post)# If you wanted to be explicit, you could also pass along the `initial_state`:workflow=Workflow(obj=news_post,initial_state=news_post.state)workflow.current_state()# "draft"# But when we trigger this change...workflow.transition_to("awaiting_review")# ...it triggers the spell check & the email we defined above, as well as# hitting the `handle_any` method & updating the `state` field in the DB.news_post.refresh_from_db()news_post.state# "awaiting_review" !Installationpip install definiteRequirementsPython 3.6+Testing$ pytest .LicenseNew BSD
Package: definitely-not-requests
RequestsRequestsis a simple, yet elegant, HTTP library.>>>importrequests>>>r=requests.get('https://httpbin.org/basic-auth/user/pass',auth=('user','pass'))>>>r.status_code200>>>r.headers['content-type']'application/json; charset=utf8'>>>r.encoding'utf-8'>>>r.text'{"authenticated": true, ...'>>>r.json(){'authenticated':True,...}Requests allows you to send HTTP/1.1 requests extremely easily. There’s no need to manually add query strings to your URLs, or to form-encode yourPUT&POSTdata — but nowadays, just use thejsonmethod!Requests is one of the most downloaded Python packages today, pulling in around30M downloads / week— according to GitHub, Requests is currentlydepended uponby1,000,000+repositories. You may certainly put your trust in this code.Installing Requests and Supported VersionsRequests is available on PyPI:$python-mpipinstallrequestsRequests officially supports Python 3.7+.Supported Features & Best–PracticesRequests is ready for the demands of building robust and reliable HTTP–speaking applications, for the needs of today.Keep-Alive & Connection PoolingInternational Domains and URLsSessions with Cookie PersistenceBrowser-style TLS/SSL VerificationBasic & Digest AuthenticationFamiliardict–like CookiesAutomatic Content Decompression and DecodingMulti-part File UploadsSOCKS Proxy SupportConnection TimeoutsStreaming DownloadsAutomatic honoring of.netrcChunked HTTP RequestsAPI Reference and User Guide available onRead the DocsCloning the repositoryWhen cloning the Requests repository, you may need to add the-c fetch.fsck.badTimezone=ignoreflag to avoid an error about a bad commit (seethis issuefor more background):gitclone-cfetch.fsck.badTimezone=ignorehttps://github.com/psf/requests.gitYou can also apply this setting to your global Git config:gitconfig--globalfetch.fsck.badTimezoneignore
Package: definition
VersionDownloadsFetch definition from 5 or more online dictionaries Available easily
from PyPiInstallationpipinstalldefinitionUsageTo fetch definition ofdefinition<query>$definition-hUsage:def[-p][-r[INT]][-e[INT]]queryOptions:--versionshowprogram's version number and exit
  -h, --help            show this help message and exit
  -w, --word            Show the word of the day
  -x, --xamples         Show 30 examples
  -e EXAMPLE, --example=EXAMPLE
                        Show specified number of examples
  -r, --random          Show random words
  -q, --quiet           don'tprintstatusmessagestostdout-p,--pronunciationShowdetailedpronunciation
Package: definitive-screening-design
Definitive Screening Design (DSD)Main ReferencesBradley Jones and Christopher J. Nachtsheim. "A Class of Three-Level Designs for Definitive Screening in the Presence of Second-Order Effects" Journal of Quality Technology 43, no. 1 (January 2011): 1–15.https://doi.org/10.1080/00224065.2011.11917841.Bradley Jones and Christopher J. Nachtsheim. "Definitive screening designs with added two-level categorical factors" Journal of Quality Technology 45.2 (2013): 121-129.https://doi.org/10.1080/00224065.2013.11917921Further References about the practical use of this designBradley Jones."Proper and Improper use of Definitive Screening Designs"Douglas Motngomery.Coursera lesson on "General Structure of a DSD with m Factors"Paul Nelson."The Evolution of Definitive Screening Designs from Optimal (Custom) DoE"Installationpip install definitive_screening_designExampleGenerate a Definitive Design screening with three numerical and two 2-levels categoricals factors,
using the protocol presented in the 2013 paper.
The result is a Pandas DataFrame.import definitive_screening_design as dsd
dsd.generate(n_num=3, n_cat=2)X01X02X03C01C021011222-0-1-111310-1224-1-011151-10126-11-021711-1218-1-111291111210-1-1-121111-112112-11-11213000111400022Check thenotebooksfolder for further examples and explainations.
Package: defipulsedata
OverviewAn unofficial Python SDK for theDeFi Pulse Dataproject and
each of its partner service providers. This project provides a lightweight Python
client for each service provider.Currently, the DeFi Pulse Data service providers include:DeFi PulseETH Gas StationDEX.AGRek.toPools.fyiThe goals of this package are to empower Python programmers to make use of DeFi Pulse Data services,
to enrich the broader DeFi developer ecosystem, and to reduce overall developer effort by providing
a packaged developer SDK so that developers do not need to reinvent the wheel for each project they make.This project bears no official relationship to the DeFi Pulse Data project, or theConcourse Open Communityproject.SetupRequirementsPython 3.7+InstallationInstall it directly into an activated virtual environment:$ pip install defipulsedataor add it to yourPoetryproject:$ poetry add defipulsedataUsageAfter installation, the package can imported.Each module below corresponds to a single, logical data provider service defined in
theDeFi Pulse Data documentation.fromdefipulsedataimportRekTo,EthGasStation,DefiPulse,DexAg,PoolsFyikey='REPLACE-WITH-YOUR-KEY'# Example requests for each client.# Rek.torekto=RekTo(api_key=key)rekto.get_events()# DeFi Pulsedp=DefiPulse(api_key=key)dp.get_projects()# ETH Gas Stationegs=EthGasStation(api_key=key)egs.get_gas_price()# DEX.AGdexag=DexAg(api_key=key)dexag.get_markets()# Pools.Fyipools=PoolsFyi(api_key=key)pools.get_exchanges()Contributing and Filing IssuesDetails for local development dependencies and useful Make targets can be found incontributing.mdContributions, suggestions, bug reports, are welcome and encouraged.If you have a bug or issue, please file a GitHub issue on the project describing the expected behavior and the actual behavior, with steps to reproduce the issue.If you have a feature request, please file a GitHub issue on the project describing the feature you want, and why you want it.LicenseThe MIT License (MIT)Copyright © 2021, James BoylePermission 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: defi-state-querier
defi-state-querierDescriptionReturn the asset list of an address in a blockchain. These assets are native token, tokens, nft, and the assets locked in protocols.RequirementAccuracyFastest speedPost all requests in a call with maximum batch size and workersInputaddress: str (lower case or upper case)block_number: intchain_id: string. Eg:0x1,0x38query: arrayquery_id: id of queryentity_id: token address, nft or id of protocols likeaave-v2,compound, andpancakeswap-ammquery_type: one of keywords -token_balance,ntf_balance,deposit_borrow,protocol_reward, andprotocol_apy.Output[
  {
    "query_id": "<query_id>",
    "entity_id": "<token_address>",
    "query_type": "token_balance",
    "token_balance": 173.84
  },
  {
    "query_id": "<query_id>",
    "entity_id": "<nft_address>",
    "query_type": "nft_balance",
    "nft_balance": 11
  },
  {
    "query_id": "<query_id>",
    "entity_id": "<protocol_id>",
    "query_type": "deposit_borrow",
    "deposit_borrow": {
      "<protocol_address>": {
        "<asset_address_1>": {
          "borrow_amount": 184.4,
          "deposit_amount": 331.5
        },
        "<asset_address_2>": {
          "borrow_amount": 184.4,
          "deposit_amount": 331.5
        }
      }
    }
  },
  {
    "query_id": "<query_id>",
    "entity_id": "<protocol_id>",
    "query_type": "protocol_reward",
    "protocol_reward": {
      "<reward_address>": {
        "amount": 1.4
      }
    }
  },
  {
    "query_id": "<query_id>",
    "entity_id": "<protocol_id>",
    "query_type": "protocol_apy",
    "protocol_apy": {
      "<protocol_address>": {
        "<asset_address_1>": {
          "total_deposit": 331.5,
          "total_borrow": 184.4,
          "deposit_apy": 0.051,
          "borrow_apy": 0.067,
        }
      }
    }
  }
]Query state dataPreparationGet some information of protocols in their github or documents.[1] Create abi files having format likeerc20 token abioraave v3 lending abi.[2] Get basic information of protocols and save in a python file likeaave_v2_eth.py.InfrastructureImportant files[1]state_querier.py- create function information, encode function calls, push function calls, and decode response data.[2]state_processor.py- receiveinput, combine all encoded function calls in a batch, execute function call batch, process response data, and returnoutput.[3]protocol_services.py- protocol service pattern file, all protocols should follow this file likeaave_v2_services.py. There are 4 main functions of a service: get service info, get token list related to protocol, get asset information supported by protocol (dapp), get all information of function calls, and process response data.[4]token_services.py- get information of erc 20 function calls and process response data.Examples[1]token_information.py- example of using state querier.[2]wallet_information.py- example of using state processor.
Package: deFit
Welcome to deFitFitting Differential Equations to Time Series Data (deFit).OverviewWhat is deFit?Use numerical optimization to fit ordinary differential equations (ODEs) to time series data to examine the dynamic relationships between variables or the characteristics of a dynamical system. It can now be used to estimate the parameters of ODEs up to second order.FeaturesFit ordinary differential equation models to time series dataReport model parameter estimations, standard errors, R-squared, and root mean standard errorPlot raw data points and fitted linesSupport ordinary differential equation models up to second orderdeFit can run in Python and R environmentsFirst impression in PythonTo get a first impression of how deFit works in simulation, consider the following example of a differential equational model. The figure below contains a graphical representation of the model that we want to fit.importdefitimportpandasaspddf1=pd.read_csv('defit/data/example1.csv')model1='''x =~ myXtime =~ myTimex(2) ~ x + x(1)'''result1=defit.defit(data=df1,model=model1)NavigationHomeUser guide in RUser guide in PythonIssues