Saravanan666/pypi-org huggingface dataset:
Package: retention
RetentionRetention is a simple tool to calculate and plot app retention related dataInstallationPlease make sure your Python is v3.7 or above, as it's required by Matplotlib 3.4 for plottting.python3--version
python3-mpipinstallretentionOr, clone from GitHub:gitclonehttps://github.com/floatinghotpot/retention.gitcdretention
python3-mpipinstall-e.How to Useretentionsample1.csv
Package: retention-model
鎻愪緵涓嶅悓cohort鐣欏瓨鐜囩殑棰勬祴銆佸彂鏂囬娴嬨90澶┿180澶╂祦閲忋佹敹鍏ラ娴嬬瓑浣跨敤鏂瑰紡濡備笅锛#鍙戞枃棰勬祴
df = pd.read_csv('D:/椤圭洰/X椤圭洰/X鍙戞枃棰勪及妯″瀷/鐣欏瓨妯″瀷/X寮曞叆鐣欏瓨(鏈).csv', encoding='utf-8')
df['cp'] = df['cp_num'] / df['pr']
total_cp = df.groupby('start_month')['cp'].max()
df = df[(df.start_month <= 202209) & (df.lag_month <= 202209)]
df['lag'] = df['lag_month'].apply(lambda x: int(str(x)[0:4]) * 12 + int(str(x)[4:])) - \
            df['start_month'].apply(lambda x: int(str(x)[0:4]) * 12 + int(str(x)[4:]))
df1 = pd.pivot(df, index='lag', columns='start_month', values='pr')
df2 = pd.pivot(df, index='lag', columns='start_month', values='cp_num')
ra = MonthRetention(df)
print(ra.retention_predict_per_month(202210))
la = Pubnum(df)
print(la.avgpub_predict(202210))
total_cp_add = pd.Series(index=[202212,202301,202302,202303,202304,202305,202306,202307,202308,202309,202310,202311,202312])
total_cp = pd.concat([total_cp, total_cp_add], axis=0)
total_cp = total_cp.fillna(method='ffill')
# print(total_cp)
p = MonthPubCalc(df, total_cp)
print('鍙戞枃鏁帮細', p.calc_monthlist_pubnum(202301,202312))

#娴侀噺棰勬祴
data = pd.read_csv('鍙戞枃90澶╁唴娴侀噺.csv', encoding='utf-8')
his = data[data.month1 != 202207]
pre = data[data.month1 == 202207]
cl = IncomePredict(his, pre, month='month1', delta_days='delta_days', vv_income='vv', n=15, m=90)
result = cl.calc_income_vv(method='frdist')
print(result)
print(pre.sum())
Package: retentive-network
RetentiveNetworkUnofficial codebase for the "Retentive Network: A Successor to Transformer for Large Language Models" paper [https://arxiv.org/pdf/2307.08621.pdf]The official codebase for RetNet should be made available roughly August 1st, 2023 according to Microsoft here:https://github.com/microsoft/unilm/tree/master/retnethttps://github.com/microsoft/torchscaleGetting StartedThis library can be installed using pip.pip install retentive-networkExample TrainingThe paper provides three forward passes which can all be used to train this model. However,
theforward()andforward_chunkwise()are recommended for sample data and sample data
with long sequences respectively. Theforward_recurrent()method, while it can be used for
training, the authors suggest using it for faster inference instead.example-training-scriptimporttorchfromretentive_network.models.clmimportRetentiveNetworkCLMbatch_size=8sequence_length=5hidden_size=32number_of_heads=4number_of_layers=4feed_forward_size=20chunk_size=2samples=100vocab_size=100sample_data=torch.randint(0,vocab_size,(samples,batch_size,sequence_length))labels=torch.randint(0,sequence_length,(samples,batch_size))model=RetentiveNetworkCLM(number_of_layers=number_of_layers,hidden_size=hidden_size,number_of_heads=number_of_heads,feed_forward_size=feed_forward_size,vocab_size=vocab_size,chunk_size=chunk_size,softmax=True)optimizer=torch.optim.AdamW(model.parameters(),lr=1e-3)criterion=torch.nn.CrossEntropyLoss()initial_out=model(sample_data[0])initial_loss=criterion(initial_out,labels[0])forsample,labelinzip(sample_data,labels):optimizer.zero_grad()out=model(sample)loss=criterion(out,label)loss.backward()optimizer.step()
Package: reter
Retry TerminalReteralternativelyTerminal Retryis a pure-python, terminal manipulation library inspired bycrossterma terminal manipulation library for Rust.Retermakes it possible to write text-based interfaces. It supports all UNIX terminalshopefully windows at some point.InstallLinux/Macpip install reterFeaturesFew dependenciesFull control over writing and flushing output bufferIs ttyCursorMove the cursor N times (up, down, left, right)Move to previous / next lineMove to columnSet/get the cursor positionStore the cursor position and restore to it laterHide/show the cursorEnable/disable cursor blinking (not all terminals support this feature)Styled outputForeground color (16 base colors)Background color (16 base colors)256 (ANSI) color supportRGB/True color supportText attributes like bold, italic, underscore, crossed, etcTerminalClear (all lines, current line, from cursor down and up)Set/get the terminal sizeExit current bufferAlternate screenSet terminal titleEnable/disable line wrappingEventInput EventsTerminal Resize EventsAdvanced key eventsDocumentationSadly there is no documentation as far as the eye can see : (
As of nowreter is in a beta state, when the full version releases so will documentation!
Package: retexto
Fast text processing for pythonRuncd /[project_path]
docker build -t retexto .
docker run -v $(pwd):/retexto:rw -it retexto bashBasic Useif __name__ == '__main__':
s = '@Edux87, i need this www.google.com | https://github.com <br> \
<strong>UserName: çarlos </strong> \
i\'m from Perú 😛 \
#Friends #Text jajajajaja so fffunny  \
loooveee thiiis 😌😎 \
@florenciaflor19 Si!!! sé vo… 🐷JUANA🐷 \
smile! haha jejeje jojojo jujuju jijijijajaja 😂'
text = ReTexto(s)

s = text.remove_html() \
    .remove_mentions() \
    .remove_tags() \
    .remove_smiles(by='SMILING') \
    .convert_specials() \
    .convert_emoji() \
    .remove_nochars(preserve_tilde=True) \
    .remove_url() \
    .remove_duplicate(r='a-jp-z') \
    .remove_duplicate_vowels() \
    .remove_duplicate_consonants() \
    .remove_punctuation() \
    .remove_multispaces() \
    .lower() \
    .remove_stopwords() \
    .split_words(uniques=True)
print(s)
['username', 'from', 'love', 'i', 'ned', 'funy', 'juana', 'vo', 'this', 'si', 'im', 'se', 'peru', 'smile', 'so', 'smiling', 'carlos']
Package: retexture
retextureReTexture dataset toolkit for generation and analysisInstallationclone the repogit clone "https://github.com/mhyatt000/retexture"pip install -e .Installing blenderMacOS:brew install blenderUnix:apt-get install blenderInstall Blender via scriptseeretexture/scripts/setup/install_blender.shDataset Setupplace all models indatasets/modelsand place textures indatasets/textureslike so:datasets
├── models
│   ├── bird1.dae
│   ├── butterfly1.dae
│   ...
├── datasets/textures
│   ├── bird1.jpg
│   ├── butterfly1.png
│   ...Config Setupseeconfigs/base.yamlRunpython -m retexture runNOTES and Design ChoicesBlender is incompatible with external python librariesBlender uses its own distribution of Pythondoes not allow changes to site packages (without weird hacks)ie: usingsys.path.appendas a workaroundArgparse conflicts with blender commandline argumentsSolution:blender -b -P <script.py> -- <args>GPU rendering seems to cause problemsYields a black imagecould be due to external servers having limited GUIcould be due to problems with the GPU and CUDA compatible librariesBlender provides lower level gpu support... seeBlender Official DocsMemory required increases with job runtimeBlender keeps a history of all operationsSolution:Render jobs are split into batchesMaster script spins off Blender processes with the child scriptKnown ProblemsBounding box centering fails occasionally
Package: retfidf
Document retrieval for social sciencesThis package provides a simple method to retrieve documents from large text corpora. For use in social sciences.It accompanies the paper [Finding democracy in big data: document retrieval using word-embedding] and is animplementation of the algorithm described in the paper.ManualTo create tfidf metrics, first pass the documents in list form to the class DocumentRetrieval at initialization.You can either pass a created word2vec model to the class, or let the algorithm train word embeddings for you.Then use the function calculate_similarity() with a keyword fo your choice to calculate the similarity betweenthe documents and the query. This function will return a list of scores for each of the documents passed to theclass at initialization.You can use a multiple words query by simply passing it in a string format to the calculate_similarity() function.Proposed usage:fromretfidfimportdoc_retrievaldf=pd.read_csv('corpus.csv')emb_sim=doc_retrieval(df['text'])query='democracy'df['democracy_metrics']=emb_sim.calculate_similarity(query)GITHUBhttps://github.com/hplisiecki/document-retrieval-for-social-sciences
Package: rethge-torch
rethge_torchthis repo contains help functions to convenient pytorch using. including plot, model train & evaluate, results analysis and more...
those functions were wrote during my learning of pytorch, it can be directly use during to DeepLearning project development, and also using for learning purposesome of funcs were adapted from this awesome tutorial:https://www.learnpytorch.io/by Daniel Bourke, which is high recommend to check out
Package: rethinkdbcm
RethinkDB контекстный менеджерКонтекстный менеджер реклизует некоторые основные методы API RethinkDBRethinkDB-context-managerPython ReQL command referenceИспользованиеpipinstallrethinkdbcmfromrethinkdbcmimportWorkRethinkDBdb=WorkRethinkDB()db.db_list()pythonPython3.8.5(default,Jan272021,15:41:15)[GCC9.3.0]onlinuxType"help","copyright","credits"or"license"formoreinformation.>>>fromrethinkdbcmimportWorkRethinkDB>>>db=WorkRethinkDB()>>>db.db_list()['geo-temp','rethinkdb','test']>>>
Package: rethinkengine
RethinkDB Object-Document Mapper written in PythonRethinkengine is currently in development and not ready for production use.Running unit tests[![Build Status](https://travis-ci.org/bwind/rethinkengine.png?branch=master)](https://travis-ci.org/bwind/rethinkengine) [![Coverage Status](https://coveralls.io/repos/bwind/rethinkengine/badge.png)](https://coveralls.io/r/bwind/rethinkengine)In the root of the repository you’ll findruntests.sh, which will run all the tests and show coverage stats. Requires packagesnoseandcoverageto be installed. Rethinkengine aims to be compatible with Python versions 2.6 and 2.7. Python 3 support will be added later.Connecting to RethinkDBfrom rethinkengine import connect
connect(‘dbname’)Ifdbnamedoesn’t exist, it will be created for you.Defining Documentsfrom rethinkengine import *class User(Document):name = StringField()
colors = ListField()# Create the table
User.table_create()Storing datau = User(name=’John’, colors=[‘red’, ‘blue’])
u.save()u.colors = []
u.save()Retrieving datafor u in User.objects.all():print u.name, u.colorsfor u in User.objects.filter(name=’John’):print u.name, u.colorsfor u in User.objects.all().order_by(‘name’):print u.name, u.colors
Package: rethinkmodel
Rethink:ModelSimple and easy to use ORM forRethinkDB.
Use Pythontypingpackage and annotations to describe data
representation.RethinkModel aims to help you to describe your data as classes to be
easilly created, updated and get fromRethinkDB.Rethink:Model make uses oftyping
supportannotations -
Python annotations describe the model fields. That’s easy, you only have
to import the standardtypingmodule, and use any ofOptionnal,Type,List,Union… types.It’s simple as a piefromtypingimportOptional,Listfromrethinkdb.modelimportModelclassPost(Model):author:User# One to One relation to Usercontent:strtags:Optional[List[str]]# use typing, tags can be NoneclassUser(Model):login:stremail:str# saveuser=User(login="John",email="me@foo.com").save()post=Post(author=user,content="This is the post").save()# get useruser=User.get(user.id)# get Postpost=Post.get(post.id)# post.author is an User, but in DB it's the ID# get post from User ?user=User.get(user.id).join(Project)# user.projects is now filledThere areother methodslikejoin(),get_all()and so on. Please
check documentation.The goalsDescribe the models in the simplest possible way, but also in the
most meaningful wayMake use of powerful typing package from Python > 3.7Avoid type checking at runtime (What ?) but let your IDE punish youPython is not a staticly typed langage. But Python developers want it
(or not 😜) - So there are many Python tools that are designed to use
typing package which is integrated with Python SDK: Pyright (use by
PyLance), MyPy, PyType…Your IDE can make type checking.Vim can usecoc-pyrightVsCode can usePyLancePyCharm knows how to manage typingetc…So, let’s use typing ! Rethink:Model is designed to use the typing
package.
Package: rethink-note
RethinkEnglish|简体中文A note-taking app dependent on python.
The official web version can be found athttps://rethink.run.Why RethinkRethink was born out of my inability to find a note-taking app that truly catered to my needs. My vision for a
note-taking app includes:Effortless Recording: When capturing ideas, rethink provides with a swift and seamless recording process.Easy Application: To facilitate easy application, merely jotting down notes is insufficient.
The recorded information should be able to form a knowledge network,
enabling your accumulated knowledge to compound over time.
This foundation allows for effective application and each new idea recorded serves to reinforce
and strengthen the existing knowledge network.FeaturesBi-directional links: A knowledge network is important.
Rethink allows you to @ link to other notes in the note with one click;Markdown syntax: Seamless support for Markdown syntax, the format of notes is more controllable;Automatic association: Too many notes? Don't remember what you wrote before?
Unable to effectively form a note network?
Rethink automatically recommend related notes while writing,
actively assist you in forming a knowledge network.Local storage: Rethink attaches great importance to data security.
You can store data in a local storage.
Or you can also use the online versionhttps://rethink.run,
which makes it easy to synchronize across multiple platforms.Multi-language: Support multiple languages, including Chinese and English.InstallFirst install:pipinstallrethink-noteTo update:pipinstall-Urethink-noteUsageQuickly start the note web service withrethink.run(), and save your note data locally,
The default save path is the.datafolder under the path of this script:importrethinkrethink.run()If you need to customize settings, you can set the parameters inrethink.run():importrethinkrethink.run(path='.',# path to store notes, default is current directoryhost="127.0.0.1",# host ip, default is localhostport=8080,# port number, default is 8080language="zh"# language, default is English, optional: zh, en)All notes will be stored in the path specified bypath,
and the.datafolder will be created in yourpathdirectory.English and Chinese languages are supported, and the default is Englishen.
If you want to use Chinesezh, you can uselanguage="zh"parameter.Open your browser and visithttp://127.0.0.1:8080to start recording your ideas.
Package: rethinkstuff
rethinkstuffRudimentary rethinkdb python library with some smarts (and maybe some
dumbs)What? Why?As of now there is a very small amount of code here. I had three
projects using the Rethinker class, and had enough code churn inside the
class that it became too painful to keep the three copies in sync. Thus,
a library shared among them.Three main purposes:round-robin connections among database serversmake sure connections close at proper timeretry retry-able queries on failureNot really a connection pool, because it doesn’t keep any connections
open, but it does take care of connection management.Service RegistryNow also has a ServiceRegistry class, a lightweight solution for service
discovery for distributed services. Maintains service info and status in
a rethinkdb table called “services”.Usageimport rethinkstuff
r = rethinkstuff.Rethinker(['db0.foo.com', 'db0.foo.com:38015', 'db1.foo.com'], 'my_db')
r.table('my_table').insert({'foo':'bar','baz':2}).run()
for result in r.table('my_table'):
    print("result={}".format(result))
Package: rethon
RE Model Python ImplementationPython implementation of a model developed in our SNF-DFG project"Formal Models of Reflective Equilibrium - How Far Does Reflective Equilibrium Take Us?".Further information (including installation instructions) can be found underhttps://debatelab.github.io/re-docs/.Claus Beisbart, Gregor Betz, Georg Brun, Sebastian Cacean, Andreas Freivogel, Richard Lohse
Package: rethread
ReThreadMinimalistic Python Library for Easy MultithreadingInstallationLinux/Macpython3 -m pip install -U rethreadWindowspy -3 -m pip install -U rethreadExampleimportrethreadimporttime@rethread.autodefmy_long_function():time.sleep(10)return'a'defsome_other_function():foriinrange(3):time.sleep(1)print(i)defanother_function(t:rethread.RunningThread):time.sleep(10)ift.done:print('thread is finished!')withmy_long_function()ast:some_other_function()another_function(t)print(thread.value)UsageTo create a thread, you can use therethread.threadfunction, like so:importrethreaddeflong_function():...thread:rethread.RunningThread=rethread.thread(long_function)If you would like to pass in parameters, simply pass them in to the*argsand**kwargsof therethread.threadcall. For example:importrethreaddeflong_function(a:str,b:str,some_kwarg:str='c'):...thread:rethread.RunningThread=rethread.thread(long_function,'a','b',some_kwarg='c')If you plan on always running a function in a thread, you can userethread.autoto automatically thread a function:@rethread.autodeflong_function():...thread:rethread.RunningThread=long_function()# no need for a call to rethread.threadTo get the return value of the threaded function, access theRunningThread.valueattribute.An error will be raised if the thread is still running, so make sure to callwait()on the thread.@rethread.autodeflong_function()->str:...return'hi't=long_function()t.wait()# wait for the thread to finishprint(t.value)# hiAlternatively, you can use the context manager syntax to automatically wait for the thread to finish:@rethread.autodeflong_function()->str:...return'hi't=long_function()witht:do_something()# once everything in this context is finished, rethread automatically waits for the thread to finishprint(t.value)# hi
Package: retic
ReticRetic is a framework for Python.Designed to attack the following points in software development:Learning curve: Python has a short learning curve.Hosting: Quick and easy configuration on the servers.Artificial intelligence: The most important libraries are written in Python.Install a Python rest api frameworkInstall and update usingPip:# Get the latest stable release of Reticpipinstall-UreticSimple rest api example in Python# app.py"""Main app"""# ReticfromreticimportRouter,Appasapp"""Define Router instance"""router=Router()"""Define paths"""router\.get("/",lambdareq,res,next:res.ok({"msg":"Hello world! - HTTP GET"}))\.post("/",lambdareq,res,next:res.ok({"msg":"Hello world! - HTTP POST"}))\.put("/",lambdareq,res,next:res.send({"msg":"Hello world! - HTTP PUT"}))\.delete("/",lambdareq,res:res.send({"msg":"Hello world! - HTTP DELETE"}))"""Import router to App"""app.use(router)"""Create web server"""app.listen(hostname="localhost",port=1801)Want to help?Do you want to send an error, contribute some code or improve the documentation? Great, you can do it! Read our guidelines to contribute and then review one of our issues in thehotlist: community-help.LicenseMIT
Package: reticker
retickerretickeris a Python 3.8 package to extract what look like stock tickers from the given text.
It uses a configurably created regular expression. It does not however validate or use a whitelist of tickers.Examples>>>importreticker>>>reticker.TickerExtractor().extract("Comparing FNGU vs $WEBL vs SOXL- who wins? And what about $cldl vs $Skyu? BTW, will the $w+Z pair still grow? IMHO, SOXL is king! [V]isa is A-okay!")["FNGU","WEBL","SOXL","CLDL","SKYU","W","Z","V","A"]>>>reticker.TickerExtractor().extract("Which of BTC-USD, $ETH-USD and $ada-usd is best?\nWhat about $Brk.a and $Brk.B? Compare futures MGC=F and SIL=F.")['BTC-USD','ETH-USD','ADA-USD','BRK.A','BRK.B','MGC=F','SIL=F']FeaturesOptional matching of prefixed uppercase (e.g.$SPY), unprefixed uppercase (e.g.SPY), prefixed lowercase (e.g.$spy), and prefixed titlecase tickers (e.g.$Spy) is enabled by default, but can individually be disabled.
At least one of the four must be enabled.Two-part tickers are also matched using a customizable set of separator characters.The results are in the order they are first found.By default, the results are deduplicated, although this can be disabled.A configurable blacklist of common false-positives is used.A configurable remapping of tickers is supported.For lower level use, a configurably created compiled regular expression can be accessed.LinksCaptionLinkRepohttps://github.com/impredicative/reticker/Changeloghttps://github.com/impredicative/reticker/releasesPackagehttps://pypi.org/project/reticker/InstallationPython ≥3.8 is required. To install, run:pip install retickerNo additional third-party packages are required or installed.UsageDefault usage>>>importreticker>>>extractor=reticker.TickerExtractor()>>>type(extractor.pattern)<class're.Pattern'>>>>extractor.extract("Has $GLD/IAU bottomed yet? What's the prospect for gold miners like $nugt? Maybe check gold futures MGC=F!")['GLD','IAU','NUGT','MGC=F']Customized usage>>>importreticker# Custom config:>>>ticker_match_config=reticker.TickerMatchConfig(prefixed_uppercase=True,unprefixed_uppercase=False,prefixed_lowercase=False,prefixed_titlecase=False)>>>extractor=reticker.TickerExtractor(deduplicate=False,match_config=ticker_match_config)>>>extractor.extract("Which is better - $LTC or $ADA? $doge and ETH are already so high.")['LTC','ADA']# Separators:>>>reticker.TickerExtractor(match_config=reticker.TickerMatchConfig(separators="-=")).extract("BTC-USD")['BTC-USD']>>>reticker.TickerExtractor(match_config=reticker.TickerMatchConfig(separators="")).extract("BTC-USD")['BTC','USD']# Blacklist:>>>reticker.config.BLACKLIST.add("EUR")>>>reticker.config.BLACKLIST.remove("I")>>>reticker.TickerExtractor().extract("I see that EUR isn't a ticker, but URE is one.")['I','URE']# Mapping:>>>reticker.config.MAPPING["BTC"]="BTC-USD">>>reticker.TickerExtractor().extract("What is the Yahoo Finance symbol for BTC?")['BTC-USD']>>>reticker.config.MAPPING["COMP"]=["COMP","COMP-USD"]>>>reticker.TickerExtractor().extract('Is COMP for the equity named "Compass" or for the crypto named "Compound"? I want both!')['COMP','COMP-USD']
Package: reticle
reticlePython 3.6+ library for submitting to AWS Batch interactively.❯pipinstallreticleFeatures:Submit Batch jobsRead the documentation at:reticle.readthedocs.ioEnd-to-end ExampleThe principle object for deploying jobs to AWS Batch is the Batch job definition.
Every Batch job definition has a name, parameters, and some form of optional parameter validation.fromreticle.aws.batchimportJobDefinitionfromreticle.aws.s3importS3UriclassDemoJobDefinition(JobDefinition):"""A Batch job definition for demonstrating our API.Args:input_object: The S3 URI to the input object."""def__init__(self,input_object:S3Uri):self.input_object=input_object@propertydefname(self)->str:"""Return the job definition name."""return'demo-job'defvalidate(self)->None:"""Validate this parameterized job definition."""ifnotself.input_object.object_exists():raisef'S3 object does not exist:{self.input_object}'We can now wrap the parameterized job definition in a Batch job and set a specific revision.fromreticle.aws.batchimportBatchJobdefinition=DemoJobDefinition(input_object='s3://bucket/object')definition.at_revision('6')job=BatchJob(definition)Submitting this Batch job is easy, and introspection can be performed immediately:response=job.submit(queue='prod')When the job is in aRUNNINGstate we can access the job's Cloudwatch logs:forlog_eventinjob.log_stream_events():print(log_event)"""LogEvent(timestamp="1543809952329", message="You have started up this demo job", ingestion_time="1543809957080")LogEvent(timestamp="1543809955437", message="Configuration, we are loading from...", ingestion_time="1543809957080")LogEvent(timestamp="1543809955437", message="Defaulting to approximate values", ingestion_time="1543809957080")LogEvent(timestamp="1543809955437", message="Setting up logger, nothing to see here", ingestion_time="1543809957080")"""And if we must, we can cancel the job as long as we provide a reason:job.terminate(reason='I was just testing!')