Saravanan666/pypi-org huggingface dataset:
Package: rdpower
rdpower: Power and Sample Size Calculations for RD DesignsThe regression discontinuity (RD) design is a popular quasi-experimental design for causal inference and policy evaluation. Therdpowerpackage provides tools to perform power, sample size and MDE calculations in RD designs:rdpowercalculates the power of an RD design,rdsampsicalculates the required sample size to achieve a desired power andrdmdecalculates minimum detectable effects. This package relies on therdrobustpackage. See Calonico, Cattaneo and Titiunik (2014, 2015) and Calonico, Cattaneo, Farrell and Titiunik (2017). For more details visithttps://rdpackages.github.io/rdpower/.ReferencesCalonico, S., M. D. Cattaneo, M. Farrell and R. Titiunik. (2017).rdrobust: Software for Regression Discontinuity Designs.Stata Journal17(2): 372-404.Calonico, S., M. D. Cattaneo, and R. Titiunik. (2014).Robust Data-Driven Inference in the Regression-Discontinuity Design.Stata Journal14(4): 909-946.Calonico, S., M. D. Cattaneo, and R. Titiunik. (2015).rdrobust: An R Package for Robust Nonparametric Inference in Regression-Discontinuity Designs.R Journal7(1): 38-51.Cattaneo, M. D., R. Titiunik and G. Vazquez-Bare. (2019).Power Calculations for Regression Discontinuity Designs.Stata Journal, 19(1): 210-245.AuthorsMatias Cattaneo, Princeton University. Email:cattaneo@princeton.eduRocio Titiunik, Princeton University. Email:titiunik@princeton.eduRicardo Masini, UC Davis. Email:rmasini@ucdavis.eduGonzalo Vazquez-Bare, UC Santa Barbara. Email:gvazquez@econ.ucsb.edu
Package: rdppy
RDPpyImplementation of the Ramer-Douglas-Peucker algorithm for polylines using a point-to-line-segment distance measure.UsageThe API consists of a single functionrdppy.filter(points, threshold)which returns a binary mask upon calling with a sequence of points and a threshold (aka theepsilonvalue):>>>importrdppy>>>points=[(0,0),...(4,0),...(0,1),...(1,1),...(1,2),...(2,2),...(2,3),...(3,3),...(3,4),...(5,4)]>>>mask=rdppy.filter(points,threshold=.9)>>>maskarray([True,True,True,False,False,False,False,False,True,True])This mask is anumpy arrayand can be used to filter a given sequence, e.g.,>>>importnumpyasnp>>>np.array(points)[mask]array([[0,0],[4,0],[0,1],[3,4],[5,4]])Note that this allows the filtering of more complex sequences which carry, for instance, meta information:>>>points=np.array([(0,0,'a'),...(4,0,'b'),...(0,1,'c'),...(1,1,'d'),...(1,2,'e'),...(2,2,'f'),...(2,3,'g'),...(3,3,'h'),...(3,4,'i'),...(5,4,'j')])>>>mask=rdppy.filter([(float(x),float(y))forx,y,_inpoints],.9)>>>points[mask,-1]array(['a','b','c','i','j'],dtype='<U21')The default metric only works for 2D pointsbut users may define custom metrics to measure the distance between a list of points,points, of any dimension and a segment parametrized via its start,seg_start, and endseg_end. For instancemy_dist2measures the distances of 2D points to the (infinite) line rather than the finite segment:>>>defmy_dist2(points,seg_start,seg_end):...d=np.divide(seg_end-seg_start,np.sqrt(np.sum((seg_end-seg_start)**2)))...returnnp.cross(points-np.expand_dims(seg_start,0),np.expand_dims(d,0))**2>>>rdppy.filter(points,threshold=.9,dist2_fun=my_dist2)The maximum of the returned values is compared with the squared threshold value. By default the functionrdp.dist2is used:rdppy.filter(points,threshold,dist2_fun=rdppy.rdp.dist2)
Package: rdp-rust
RDP RustBinary version of MIT licensed RDPimplementationbyfhirschmann.Binary wheels are built for Python >= 3.7Benchmarks show approximately 60x speed increase.Rust implementation of the Ramer-Douglas-Peucker algorithm (Ramer 1972; Douglas and Peucker 1973) for 2D data.Installationpipinstallrdp-rustUsageThe inputs must all be floating points values.>>>importnumpyasnp>>>fromrdp_rustimportreduce_points>>>arr=np.array([5.0,0,4,0,3,0,3,1,3,2]).reshape(5,2)>>>reduce_points(small_arr,0.2)array([[5.,0.],[3.,0.],[3.,2.]])>>>importnumpyasnp>>>fromrdp_rustimportmask_points>>>arr=np.array([5.0,0,4,0,3,0,3,1,3,2]).reshape(5,2)>>>mask_points(small_arr,0.2)array([True,False,True,False,True])Example
Package: rdpywheel
pywheelPython项目的公共代码。./scripts/publish.sh安装将发布到本地到包安装：# 本地安装此库，将包发布到本地/usr/local/bin/python3.10setup.pyinstall安装本地库：# 本地安装此库，将包发布到本地# 打包/usr/local/bin/python3.10setup.pysdistbdist_wheel# 上传twineuploaddist/*--skip-existing
Package: rdrand
A module to use Intel’s hardware RNG with python’s random classUSAGEfor full docs, seehttps://rdrand.rtfd.io# easy_install rdrand# python>>> from rdrand import RdRandom
>>> r = RdRandom()>>>from rdrand import RdSeedom
>>>s = RdSeedom()At this point,randswill behave just likerandomRdRandomis a subclass ofrandom.Random, and behaves likerandom.Random, but it uses inline assembly to access the hardware RNG using the RdRand instruction. This should be a cryptographically secure drop in replacement forrandomwith a prediction complexity bound of O(2^128), if the Intel random number generator is valid. No mitigation is done to modify the output of the hardware to prevent problems with Intel’s implementation. Caveat Emptor.RdSeedomis a subclass ofrandom.Random, and behaves likerandom.Random, but it uses inline assembly to access the hardware RNG using the RdSeed instruction. This should be a cryptographically secure drop in replacement forrandomreturning full entropy bits, if the Intel random number generator is valid. No mitigation is done to modify the output of the hardware to prevent problems with Intel’s implementation. Caveat Emptor.Also, both RdRandom and RdSeedom include the functionr.getrandombytes(i)whereiis a positive int. This returns a string of lengthifilled with random bytes, which is ideal for generating a key or using directly in a protocol.Please note, as with any security solution, it is possible to subvert this. Please understand the full context before deploying. I am not liable for misuse or clever hackers.Works with 32 and 64 bit builds of python.Works with python2 and python3.
Package: rds2py
rds2pyParse and construct Python representations for datasets stored in RDS files.rds2pysupports a few base classes from R and Bioconductor'sSummarizedExperimentandSingleCellExperimentS4 classes.This is possible because ofAaron's rds2cpp library.The package uses memory views (except for strings) to access the same memory from C++ in Python (through Cython of course). This is especially useful for large datasets so we don't make multiple copies of data.InstallPackage is published toPyPIpipinstallrds2pyUsageIf you do not have an RDS object handy, feel free to download one fromsingle-cell-test-files.fromrds2pyimportas_summarized_experiment,read_rdsr_obj=read_rds(<path_to_file>)Thisr_objholds a dictionary representation of the RDS file, we can now transform this object into Python representations.rObjalways contains two keysdata: If atomic entities, contains the NumPy view of the array.attributes: Additional properties available for the object.In addition, the package provides functions to convert parsed R objects into Python representations.fromrds2pyimportas_spase_matrix,as_summarized_experiment# to convert an robject to a sparse matrixsp_mat=as_sparse(rObj)# to convert an robject to SCEsce=as_summarized_experiment(rObj)For more examples convertingdata.frame,dgCMatrix,dgRMatrix,dgTMatrixto Python, checkout thedocumentation.Developer NotesThis project uses Cython to provide bindings from C++ to Python.Steps to setup dependencies -git submodules is initialized inextern/rds2cppcmake .inextern/rds2cppdirectory to download dependencies, especially thebytemelibraryFirst one needs to build the extern library, this would generate a shared object file tosrc/rds2py/core-[*].sopythonsetup.pybuild_ext--inplaceFor typical development workflows, runpythonsetup.pybuild_ext--inplace&&toxNoteThis project has been set up using PyScaffold 4.5. For details and usage
information on PyScaffold seehttps://pyscaffold.org/.
Package: rds-cep
É uma biblioteca pública em Python que condensa um conjunto de boas práticas para o desenvolvimento das aplicações que compõem a Rede da Dados em Saúde (RDS) RDS do Laboratório de Inovação Tecnológica em Saúde (LAIS) e dos parceiros que contam com o LAIS para fazer suas próprias RDS, a exemplo RDS-RN e RDS-ES.
Package: rds-cognito-attributes
RDS_Cognito_attribute_alignmentUse this script to evaluate data between Cognito and Aurora RDS.To use, first install the code. Then update the settings.py file to include the appropriate values for your specific project.settings.pyCOGNITO_ATTRIBUTE:This is the specific name of the cognito attribute you would like the script to pull down for you.RDS_TABLE_COLUMN:This is the specific RDS column(s) which you would like to have the script pull down for you. This variable is primarily used in the QUERY_STRING variable as well as to generate the necessary files.QUERY_STRING:Use this variable to define the query you would like to run. Include the RDS_COLUMN attribute if you want.REGION:Use this variable to define the AWS region where your resources are stored.FOLDER_NAME:Use this variable to define the specific folder name you would like to have any query results stored.
Package: rds-core
É uma biblioteca pública em Python que condensa um conjunto de boas práticas para o desenvolvimento das aplicações que compõem a Rede da Dados em Saúde (RDS) RDS do Laboratório de Inovação Tecnológica em Saúde (LAIS) e dos parceiros que contam com o LAIS para fazer suas próprias RDS, a exemplo RDS-RN e RDS-ES.
Package: rdsdataapi
DB-API 2.0 driver & SqlAlchemy dialect for the AWS RDS Data APINOTE: This is currently ALPHA quality software and has not been thoroughly tested yetThe RDS Data API allows use of MySQL and PostgreSQL RDS databases via an HTTP API, making it ideal
for use in AWS Lambda because it allow syou to use RDS without running your lambda in a VPC. This
library wraps that API in both aDB-API 2.0driver andSqlAlchemydialect allowing you to tap into the vast python
ecosystem for working with relational databases.Installationpip install rdsdataapiUsageTo use the DB-API 2.0 interface:fromrdsdataapiimportconnectcon=connect(resource_arn="arn:aws:rds:us-east-1:490103061721:cluster:database-2",secret_arn="arn:aws:secretsmanager:us-east-1:490103061721:secret:pgdb-gIucWr",database="postgres",)cur=con.cursor()cur.execute("select :foo as bar",{"foo":"foobar"})result=cur.fetchall()Or via SqlAlchemy:engine=create_engine('rdsdataapi://',connect_args=dict(resource_arn="arn:aws:rds:us-east-1:490103061721:cluster:database-2",secret_arn="arn:aws:secretsmanager:us-east-1:490103061721:secret:pgdb-gIucWr",database="postgres",))withengine.connect()ascon:result=con.execute("select :foo as bar",foo="foobar")
Package: rds-host
A simple command line utility, allowing you to find the hostname associated with
your Amazon RDS instance name.Also has a simple wrapper for PostgreSQL’s psql utility. If you want a similar
script for MySQL or Oracle, patches are welcome.A few examples:# w/o arg: prints all active instances
% rds-host
mydbinstance    mydbinstance.c6ulnjwxjm.us-west-2.rds.amazonaws.com:5432
myotherdbinstance  myotherdbinstance.d5ulnswdjyf.us-west-2.rds.amazonaws.com:5432

# w/ arg: prints host name of matching instance
% rds-host mydbinstance
mydbinstance.c6ulnjwxjm.us-west-2.rds.amazonaws.com:5432

# connect to the instance with psql
% rds-psql mydbinstance -U mydbuser mydbname
Connecting to mydbinstance.c6ulnjwxjm.us-west-2.rds.amazonaws.com...
Password for user mydbuser:
psql (9.0.5, server 9.3.1)
WARNING: psql version 9.0, server version 9.3.
Some psql features might not work.
SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)
Type "help" for help.

mydbname=>
Package: rds-log
A small utility to download/stream logs from Amazon AWS RDS to a local
directory. When started, all log files will be downloaded, and the latest file
will be watched for changes.InstallationMake sure you already have installedAmazon RDS Command Line ToolkitPython 3.4 (Python 2 is not supported)Install from PyPI:pip install rds-logUsagerds-log-stream will find AWS credentials in ~/.aws/credentials or environment
variables. rds-log-stream uses boto3 and finds credentials/config in the same
locations.Set up ~/.aws/credentials with AWS authentication details:[default]
aws_access_key_id = <your access key id>
aws_secret_access_key = <your secret key>Set up ~/.aws/config to point to your region:[default]
region = eu-central-1An alternative is to set up environment variables:export AWS_ACCESS_KEY_ID="<your access key id>"
export AWS_SECRET_ACCESS_KEY="<your secret key>"
export AWS_DEFAULT_REGION="<your aws region>"Run rds-log-stream with your database identifier and directory to store logs:rds-log-stream yourdbinstance /your/log/destination/your/log/destination will be populated with all current RDS logs and
continously updated with new messages as they arrive.DevelopmentCreating a new release:git tag x.x.x
python setup.py sdist bdist_wheel
twine upload dist/*x.x.x*
Package: rdsmon
rdsmoncommandline tool for monitoring aws RDS instancesQuick StartThe requirements for usingrdsmonare relatively straight forward, however you will need:InstallationInstall the tool -pip install rdsmon(to install the latest version)AuthenticationTypically you require an access token for a user that is configured for rds accessibility using
awsIAMroles.  Once your user has been created, you will require anaccess keyand this
should be either configured on disk, or exposed to the environment runningrdsmon.  It is
completely unadvised to user therootuser and the account running the tool should have as
minimal permissions as possible.  TheIAMcapabilities required by the tool are:TodoImportant: Properly configured IAM roles/users should be in place, tokens should be kept secure,
under no circumstances should you share them with anybody.rdsmonutilises the same mechanisms
by theboto3aws SDK for credential detection and usage.To better understand IAM user and policies, please refer to:AWS IAM user creationAWS Access TokensConfiguration on diskOnce you have appropriateIAMroles and have created anaccess_key, these should be stored in:~/.aws/credentials[default]aws_access_key_id = YOUR_ACCESS_KEYaws_secret_access_key = YOUR_SECRET_KEYYou may also want to add a default region to the aws configuration file, this should be set in:~/.aws/config[default]region=us-east-1Monitoring an RDS instanceTodoContributing to rdsmonEnsure you havepython3.11+installed andpoetry:git clone https://github.com/symonk/rdsmoncd rdsmonpoetry shellpoetry installThis will create aneditableinstall, you can point yourIDEto the virtualenv output bypoetry shelland begin contributing.Linting the code is done viatox -e linting, additionallypre-commit installwill run the linter before committing automatically.tox -e py311will run all tests againstpython3.11
Package: rdsmproj
RDSMprojRDSMproj (RareDiseasesSocialMediaProject) for theNational Center for Advancing Translational Sciencesat theNIH. This project looks at mining information from social media (Reddit) and finding subreddits that are related to different rare diseases found in theGARDdatabase. The project matches rare diseases to Reddit subreddits, downloads the post and comment data, and then analyzes the text data to find the different topics that people are talking about.OverviewThe project is split into four packages as part of rdsmproj:mapperis a python package that maps text to a rare disease(s) usingnltkandspaCy. An alternate name for this package isNormMap V2.sm_redditis a collection of scripts that utilizespmawto download Reddit post and comment text data for use in topic modeling or other text analyses.tm_t2vis a python package that creates topic models of text usingTop2Vec.tm_ldais a (legacy) python package that creates topic models of text primarily using LDA as implemented byGensim. This package was used in thispaper.InstallationEnsure that you have up to date copies ofpip,setuptools, andwheelprior to installation.pipinstall--upgradepipsetuptoolswheelFor now, each package above is installed separately.pipinstallrdsmproj[mapper]pipinstallrdsmproj[sm_reddit]pipinstallrdsmproj[tm_t2v]pipinstallrdsmproj[tm_tlda]Quick StartFor more information view the API guide.Examples using sm_redditsm_reddit.GetPostsfromrdsmprojimportsm_redditpmaw_args={'limit':1000}# Example subreddit 'MachineLearning'.# Passes pmaw arguments to search_submissions.sm_reddit.GetPosts(name='MachineLearning',silence=False,pmaw_args=pmaw_args)sm_reddit.GetRedditCommentsfromrdsmprojimportutilsfrompathlibimportPath# Default path to where the post data is located.path=utils.get_data_path('posts')data=utils.load_json(Path(path,'MachineLearning_posts.json'))# Example passes pmaw arguments to search_submission_comment_ids.sm_reddit.GetRedditComments(data=data,silence=False,pmaw_args=pmaw_args)Example using preprocess to process text data.preprocess.Preprocessfromrdsmprojimportpreprocessaspp# Example processes the comment data for use with tm_lda or tm_t2v.data=pp.PreProcess(name='MachineLearning')documents,tokenized_documents,id2word,corpus=data()Example using tm_t2v to create and analyze a top2vec model.tm_t2v.Top2VecModelfromrdsmprojimporttm_t2vembedding_model='doc2vec'name='MachineLearning'clustering_method='leaf'i=0# Creates and saves a model.model=tm_t2v.Top2VecModel(name,f'{name}_{embedding_model}_{clustering_method}_{i}',documents=documents,embedding_model=embedding_model,speed='fast-learn').fit()tm_t2v.AnalyzeTopics# Analyzes model and records the results.tm_t2v.AnalyzeTopics(model=model,model_name=f'{name}_{embedding_model}_{clustering_method}_{i}',subreddit_name=name,tokenized_docs=tokenized_documents,id2word=id2word,corpus=corpus,model_type='Top2Vec')To DoTest package install from TestPyPI.Update main README.md Quick Start with examples for most packages.Createsm_redditREADME.md.Createtm_t2vREADME.md.Createtm_ldaREADME.md.Create API guide and documentation pages.Add visualizations and flowcharts to the readme files.Upload to PyPI.
Package: rdspgbadger
RDS-pgBadgerFetches RDS log files and analyzes them withpgBadger.PrerequisitesMake sure your credentials are set in the~/.aws/credentialsfile.
Also, you can set a region in the~/.aws/configfile, so passing region option to the script is not needed.
Last but not least, make sure you havepgbadgerinstalled and reacheable from your$PATH.Parameter groupYou will have to configure your database parameter group.First of all, ensurelog_min_duration_statementis set to0or higher, else you won’t have anything to be parsed.Then you must enable some other parameters to get more information in the logs.ParameterValuelog_checkpoints1log_connections1log_disconnections1log_lock_waits1log_temp_files0log_autovacuum_min_duration0Also make surelc_messagesis either at engine default or set toC.For further details, please refer to Dalibo’spgBadgerdocumentation.InstallationYou can install it usingpip:$ pip install rdspgbadgerUsageTo build apgbadgerreport, just run the following (replacinginstanceidby your instance ID):$ rds-pgbadger instanceidOptionsOnly the Instance ID is mandatory, but there are also other options you can use:-d, –date : by default the script downloads all the available logs. By specifying a date in the formatYYYY-MM-DD, you can then download only that day’s logs.-r, –region : by default the script use the region specified in your AWS config file. If none, or if you wish to change it, you can use this option to do so.-o, –output : by default the script outputs log files and reports to theoutfolder. This option allows you to change it.-n, –no-process : download log file(s), but do not process them with pgBadger.-X, –pgbadger-args : command-line arguments to pass to pgBadger–assume-role : By specifying a role you can use STS to assume a role, which is useful for cross account access with out having to setup the.configfile. Formatarn:aws:iam::<account_id>:<role_name>Known issueIn spite of the great work ofaskainet, AWS API seems to be too instable, and sometimes download of big log files can
fail. In such case retrying a few minutes later seems to work.seepull request 10ContributeFor any request, feel free to make a pull request or fill an issue onGithub.
Package: rdsr-navigator
RDSR NavigatorA package for extracting data fromDICOMRDSR files. The focus of this project is to extract data. It is not possible to modify files. The project is currently in early development and things might not work exactly how you expect. The public API is not yet stable, please keep this in mind.The package is intended forRESEARCH USE ONLY, NOT FOR CLINICAL USE.Getting startedThese instructions will get you a copy of the project up and running on your local machine.PrerequisitesRDSR Navigator is written in Python 3.6 and usespydicom. Therefore make sure you are running Python 3.6 or later and make sure pydicom is installed. If pydicom is not installed, use the command below to install pydicom.$ pip install pydicomInstallationRDSR Navigator is available on pypi and can be installed using the following command.$ pip install rdsr_navigatorNow, you are ready to start using RDSR navigator.UsageRead fileTo open an RDSR file, type the following.>>>importrdsr_navigatorasnav>>>rdsr_obj=nav.read_file(r'C:\rdsr_file.dcm')The input argument toread_fileis astrcontaining the path to an RDSR file. Other supported data types arepathlibandpydicomobjects.Extract dataData is extracted by first navigating through the RDSR hierarchy using the concept names. All concept names are given in lower case, separated by underscores ("_"). In the example below we are extracting the value from "Procedure Reported".>>>rdsr_obj['procedure_reported'].value'Projection X-Ray'Data can also be extracted by using the code value and coding scheme designator separated by a colon (":"). This is shown in the example below.>>>rdsr_obj['121058:DCM'].value'Projection X-Ray'When the square brackets are used, the first matched concept name is returned. This is inappropriate if several entries with the same concept name exist on the same level.NOTE: Since version 0.4.0, a warning will be shown if more than one match is found. To disable warnings for a single call, userdsr_obj.get('procedure_reported', warnings=False).value.To disable all warnings, usenav.read_file(r'C:\rdsr_file.dcm', warnings=False)when loading the file.To iterate entries with the same concept name, use theget_allmethod.>>>forirr_eventinsr_obj.get_all('irradiation_event_x-ray_data')):print(irr_event['dose_area_product'].value)(1.9632189e-7,'Gy.m2')(1.1173212e-5,'Gy.m2')(8.566802e-7,'Gy.m2')Drill deeper into the hierarchy by adding more concept names in the square brackets.>>>rdsr_obj['procedure_reported','has_intent'].value'Combined Diagnostic and Therapeutic Procedure'Jupyter notebook integrationThe RDSR navigator classes are integrated withjupyter notebooks.Data is nicely displayed in tabular form.Tab completion is available when accessing data using square brackets.Supported value typesCurrently, only a few value types are supported. The supported value types are listed below.Code MeaningDate TimeMeasured ValuesText ValueUIDLicenseThis project is licensed under the MIT License - see the LICENSE file for details.
Package: rds-scheduler
CDK RDS Scheduler ConstructThis is a CDK construct for creating a schedule to periodically start and stop RDS (Aurora) clusters or instances.
It can be used to reduce billing outside of operational hours.UsageInstall it via npm:npminstallcdk-rds-schedulerThen use it in your CDK stack:import{RdsScheduler,Cron}from'cdk-rds-scheduler';import{TimeZone}from'aws-cdk-lib/core';//forDatabaseClusterdeclareconstdatabaseCluster:rds.DatabaseCluster;newRdsScheduler(this,'RdsClusterScheduler',{cluster:databaseCluster,schedule:[//Operateonlyduringdaytimeonweekdays{start:newCron({minute:'0',hour:'8',day:'?',weekDay:'MON-FRI'}),stop:newCron({minute:'0',hour:'18',day:'?',weekDay:'MON-FRI'}),timeZone:TimeZone.ASIA_TOKYO,},],});//forDatabaseInstancedeclareconstdatabaseInstance:rds.DatabaseInstance;newRdsScheduler(this,'RdsInstanceScheduler',{instance:databaseInstance,schedule:[//Puttheinstanceintoadormantstate.//AsameasureforautomaticstartofAurora,stopiteveryday.{stop:newCron({minute:'0',hour:'0',day:'?'}),//timeZoneisoptional,defaultisUTC},],});