Saravanan666/pypi-org huggingface dataset:
Package: simple-dl-toolkit
English|简体中文介绍simpledl是Simple Deep Learning Toolkit的缩写，基于PyTorch，旨在用极简的接口构建神经网络和训练，能方便地复用模型，以及修改训练流程的各个环节，主要用于复现经典模型和进行一些实验。关键接口Data不同任务的数据格式和处理方法都不相同，如果对数据进行抽象处理的话，会使整个代码变得极其复杂，simpledl没有针对数据抽象单独的类，而是复用PyTorch的Dataset，只要求返回的batch数据是dict格式，例如batch={'src':src_seq,'src_size':src_size,'tgt':tgt_seq}在simpledl/data中提供了一些常用的数据处理类，可以方便地复用，比如TranslationDataset，根据两种语言的文本文件，构建一个Dataset。ModelModel的接口是forward函数，表示模型的前向计算，函数的参数可以是batch的key，或者是batch，输出也要求是一个dict，比如defforward(self,src,src_size,tgt):# do somethingoutput_logits=calc_output_logits()return{'logits':output_logits,}LossLoss的接口是数据的一个batch和模型的前向计算的输出，输出是dict，要求有key为loss，便于后面进行梯度更新 比如defforward(self,batch,out):return{'loss':loss_calc(batch,out),}Optimizer使用PyTorch的Optimizer，进行简单的包装，可以根据参数str构建需要的optimizerTrainerTrainer是主要的类，包括构建数据集、Model、Loss、Optimizer、callbacks。callbacks是训练过程中使用的，用于统计每一步训练的结果、保存断点、模型评估、earlystopping等操作。训练的流程如下:deftrain(...):prepare_callbacks()restore_training_if_necessary()foreintraining_epochs:call_callbacks_epoch_begin()forbatchindataset:call_callbacks_batch_begin()model_out=forward_model(batch)# 根据batch，调用Model的forward函数loss=calc_loss(model_out,batch)gradient_update_step()# 进行优化call_callbacks_batch_end()# 统计结果、保存断点、调整学习率等call_callbacks_epoch_end()evaluate_if_necessary()通过修改trainer，可以方便地修改数据、模型、以及训练的每个环节示例Machine Translation: Transformer, IWSLT2014BLEU结果:Modelde -> enen -> deTransformer33.2727.72Tied Transformers35.1029.07fairseq34.5428.61Ours34.3628.33ReferencefairseqAllenNLPRead TFRecord
Package: simple-dmarc-parser
simple-dmarc-parsersimple-dmarc-parser is a basic Python script that reads the contents of an IMAP mailbox, seeks out DMARC RUA reports, downloads and parses them in aggregate to provide a basic summary of passes and failures.FunctionThe script will print any DMARC reports which had a failed result, so that you can review them. A summary will also be printed at the end by default, which shows how many reports had a pass/fail result from each provider, how many pass/fail results were found for each IP address, and how many pass/fail results were found for each domain.The summary can be disabled if you only want to see failures. See the usage section for appropriate options.InstallationIt's recommended that you install simple-dmarc-parser via pip so that it is available on the system:pip install simple-dmarc-parserUsageThe script reads all unread messages in the mailbox provided, so you should only use this with a dedicated DMARC RUA address. simple-dmarc-parser does not process RUF reports.simple-dmarc-parser accepts command line arguments, a config file, or it can prompt you for the IMAP server information.Runsimple-dmarc-parser -hfor command line argument options. Or, just runsimple-dmarc-parserand you will be prompted for the appropriate information. Your password will not be shown as you enter it.A config file option is recommended for any sort of automation so that your credentials aren't potentially exposed in process lists. See theexample config file, place it in an appropriate location with sensible permissions, and run usingsimple-dmarc-parser --config /path/to/configUse the delete messages option with caution.Messages deleted with this optionare notput in a deleted folder. They are immediately removed from the IMAP server with no option for recovery.Automatic ReportsYou can use cron to run simple-dmarc-parser regularly and send you its output via email, or whatever source you can send to via the command line.For example, the following cron entry running on your mail server will result in nightly DMARC summaries being sent by cron to the user running the job:0 0 * * * simple-dmarc-parser --config /path/to/configIf you prefer a version that only notifies you on errors, you can usethis example script. Make sure you havemailutilsinstalled, put the script in root's home directory, and install the following cronjob as root:0 0 * * * /root/dmarc_report.shThe script assumes your configuration is in /etc/simple-dmarc-parser.conf (make sure silent is true), and it will send its report to the root user on the local system. If you wish to send to send the reports off-system, change "root" to a full email address.
Package: simple-dmessage
Simple Message BotThis bot is designed to send a custom direct message to a user on discord.Exampleimportasynciofrommessageimportsend_direct_messageasyncdefmy_script():# Your script code goes hereawaitsend_direct_message(TOKEN,USER_ID,"Hello, World!")asyncdefmain():awaitmy_script()asyncio.run(main())WhyI wanted an easy way to get remote notfications from scripts
Package: simpledns
A lightweight yet useful proxy DNS server designed to cope withcomplicated Internet environmentin China, inspired byChinaDNS,dnsmasq-chinadnsandfqdns, powered by PythonTwisted.RequirementPython 2.7TwistedTornado for using Tornado IOLoop(optional)InstallLinux/Mac OS X:$ pip install simplednsWindowsDownloadUsageRunsudo simplednson your local machine. Then set your DNS server to 127.0.0.1.$ dig www.twitter.com +short
twitter.com.
199.59.149.230
199.59.148.10
199.59.150.7
199.59.150.39Note that the default cache lifetime depends on the ttl of DNS answer. You may want to set a larger ttl using –min-ttl to extend the cache lifetime.Advanced$ simpledns -h
usage: simpledns [-h] [-b BIND_ADDR] [-p BIND_PORT]
                 [--upstream-ip UPSTREAM_IP] [--upstream-port UPSTREAM_PORT]
                 [--query-timeout QUERY_TIMEOUT] [--min-ttl MIN_TTL]
                 [--max-ttl MAX_TTL] [--cache-size CACHE_SIZE] [-t]
                 [--hosts-file HOSTS_FILE] [--dispatch-conf DISPATCH_CONF]
                 [-v {0,1,2}] [-q] [-V]

A lightweight yet useful proxy DNS server

optional arguments:
  -h, --help            show this help message and exit
  -b BIND_ADDR, --bind-addr BIND_ADDR
                        local address to listen
  -p BIND_PORT, --bind-port BIND_PORT
                        local port to listen
  --upstream-ip UPSTREAM_IP
                        upstream DNS server ip address
  --upstream-port UPSTREAM_PORT
                        upstream DNS server port
  --query-timeout QUERY_TIMEOUT
                        time before close port used for querying
  --min-ttl MIN_TTL     the minimum time a record is held in cache
  --max-ttl MAX_TTL     the maximum time a record is held in cache
  --cache-size CACHE_SIZE
                        record cache size
  -t, --tcp-server      enables TCP serving
  --hosts-file HOSTS_FILE
                        hosts file
  --dispatch-conf DISPATCH_CONF
                        URL dispatch conf file
  -v {0,1,2}, --verbosity {0,1,2}
                        output verbosity
  -q, --quiet           disable output
  -V, --version         print version number and exitConfigurationConfiguration file is at /usr/local/etc/simpledns/dispatch.conf.Dispatch conf file uses the same rule as inDnsmasq. ‘Address’ and ‘Server’ rules are supported.address=/example1.com/1.1.1.1
server=/example2.com/1.1.1.2Default dispatch conf file is fromdnsmasq-china-list.Fake ip list file is at /usr/local/ect/simpledns/iplist/txt. The source isChinaDNS.TODOConfig file supportEDNS supportNegative cachingLicenseThe MIT License
Package: simpledorff
SimpleDorff - Calculate Krippendorff's Alpha on a DataFrameKrippendorff's Alpha is a commonly used inter-annotator reliability metric, but it's hard to calculate on a Dataframe. This package makes it easy.Made with ❤️ byLightTag - The Text Annotation Tool For Teams. We use this in production to give our customers a single number to understand the quality of their labeled data. Read theblog post hereProblem It SolvesCalculating Krippendorff's Alpha assumes data is formatted in a way that just doesn't appear in the wild. We wanted a package that could read a Dataframe in the formats we see in real life and give us the Alpha in one line.InstallingpipinstallsimpledorffUsageimportsimpledorffimportpandasaspdData=pd.read_csv('./examples/from_paper.csv')#Load Your DataframeData.head()Unnamed: 0document_idannotator_idannotation001A1.0111B1.0221D1.0331CNaN442A2.0simpledorff.calculate_krippendorffs_alpha_for_df(Data,experiment_col='document_id',annotator_col='annotator_id',class_col='annotation')0.743421052631579
Package: simple-dotdict
Simple DotdictThedotdictclass is a dictionary that allows access to its elements using dot notation. It inherits from the built-indictclass in Python.InstallationTo installsimple-dotdict, you can use pip:pipinstallsimple-dotdictUsageHere is an example of how to use thedotdictclass:fromsimple_dotdictimportdotdictd=dotdict({'key':'value'})print(d.key)# Outputs: valueYou can also set and delete keys using dot notation:d.new_key='new_value'# Sets a new key-value pairprint(d.new_key)# Outputs: new_valuedeld.new_key# Deletes the key-value pairLicenseThis project is licensed under the MIT License - see theLICENSEfile for details.# simple-dotdict
Package: simple-draw
# simple_drawPygame-based package for drawing graphical primitives for tutorial purpose.![screenshot one](screenshots/fractal_tree.png “Fractal tree”)​#### Changelog#### 2.9.0
* ADD py311 support
* ADD pygame 2.5 support
* ADD annotations
* FIX function docs#### 2.8.0
* ADD py310 support
* ADD pygame 2.1 support#### 2.7.0
* ADD py39 support
* ADD pygame 2.0 support#### 2.6.8
* ADD py38 support
* DROP py27 support#### 2.6.7
* small fix: duplicate assert#### 2.6.6
* more calls _init() in low level functions
* add take_background and draw_background#### 2.6.5
* added take_snapshot#### 2.6.4
* budfix pygame init in start_drawing
* move vector width to .draw()#### 2.6.3
* added width for lines#### 2.6.2
* added quit()#### 2.6.0
* added support for line/vector width
* set up resolution
Package: simple-drone-control
Simple Drone Control (SDC)Simple drone control simulation that serves as API for more complex programs.[!IMPORTANT]
This package has been developed with the sole purpose ofserving as educational tool. It does not provide with real dynamic simulation models for drones nor tracks. However, it can be used to develop some initial ideas for autonomous drone flight algorithms, without having to deal with heavy constraints such as air drag, gravity, etc. Furthermore, since it has not been developed for external usage, multiple errors or inconsistencies might ariseInstallationThis packagehas been released through PyPI, so it can be installed using Python'spipmodule:python-mpipinstall--upgradesimple-drone-control[!NOTE]
The command above asumes that your Python interpreter is aliased topythonand references a version equal to or greater than 3.10Alternatively, it is also possible to clone this repository and use the package usingpipand/orbuild.UsageThe code snippet below shows all imports required to start developing a simulation. Take a look at thiscode skeleton examplefor a more detailed example.importsdc# Imports the whole package.fromsdc.core.vectorimportVector3D,Rotator3D,distance3D# Imports core functionality classes and functions.fromsdc.api.simulationimportSimulationAPI# Imports API simulation class.fromsdc.environment.readerimportTrackSequenceReader# Imports a reader class for track databases.[!WARNING]
The package is installed assimple-drone-control, but imported assdc. Attempting to import it using the installation name will result in an errorContributionsThis package has not been developed with expansion expectations, yet external feedback is always welcome, so feel free to drop your suggestions or error reports on theissues section.
Package: simpledsapp
Table of ContentsAbstractSynopsisRunUsing PyPIUsingdocker runExamplesCopy from input to output with a prefixSimply write a timestamp to the output directory, ignoring the input completelyAbstractsimpledsappis a simple DS plugin that copies directories file from aninputtooutput. If called with an optional--ignoreInputDirthe plugin will simply write a JSON formatted timestamp to the output directory.Synopsispython simpledsapp.py                                           \
    [-v <level>] [--verbosity <level>]                          \
    [--prefix <filePrefixString>]                               \
    [--sleepLength <sleepLength>]                               \
    [--ignoreInputDir]                                          \
    [--version]                                                 \
    [--man]                                                     \
    [--meta]                                                    \
    <inputDir>
    <outputDir>RunThisplugincan be run in two modes: natively as a python package or as a containerized docker image.Using PyPITo run from PyPI, simply do apipinstallsimpledsappand run withsimpledsapp.py--man/tmp/tmpto get inline help. To copy from one directory to another, simply dosimpledsapp.py/some/input/directory/destination/directoryUsingdocker runTo run usingdocker, be sure to assign an “input” directory to/incomingand an output directory to/outgoing.Make sure that the$(pwd)/outdirectory is world writable!Now, prefix all calls withdockerrun--rm-v$(pwd)/out:/outgoing\fnndsc/pl-simpledsappsimpledsapp.py\Thus, getting inline help is:mkdirinout&&chmod777outdockerrun--rm-v$(pwd)/in:/incoming-v$(pwd)/out:/outgoing\fnndsc/pl-simpledsappsimpledsapp.py\--man\/incoming/outgoingExamplesCopy from input to output with a prefixAssign an “input” directory to/incomingand an output directory to/outgoingmkdirinout&&chmod777outdockerrun-v$(pwd)/in:/incoming-v$(pwd)/out:/outgoing\fnndsc/pl-simpledsappsimpledsapp.py\--prefixtest-\--sleepLength0\/incoming/outgoingThe above will create a copy of each file in the container’s/incomingand prefix the file copied with theprefixtext (in this case “test-“). The copies will be stored in the container’s/outgoingdirectory.Simply write a timestamp to the output directory, ignoring the input completelyAssign an “input” directory to/incomingand an output directory to/outgoingmkdirinout&&chmod777outdockerrun-v$(pwd)/in:/incoming-v$(pwd)/out:/outgoing\fnndsc/pl-simpledsappsimpledsapp.py\--ignoreInputDir\/incoming/outgoingThis will simply create a file calledtimestamp.jsonin the output directory. This mode is useful to just create mock nodes in a Feed tree.
Package: simpledsapp-moc
Table of ContentsAbstractSynopsisDescriptionAgrumentsRunUsing PyPIUsingdocker runExamplesAbstractA simple DS type ChRIS application specifically created for the Massachusetts Open Cloud remote computing environment.Synopsispython simpledsapp_moc.py                                       \
    [--prefix <filePrefixString>]                               \
    [--sleepLength <sleepLength>]                               \
    [--ignoreInputDir]                                          \
    [-v <level>] [--verbosity <level>]                          \
    [--version]                                                 \
    [--man]                                                     \
    [--meta]                                                    \
    <inputDir>
    <outputDir>Descriptionsimpledsapp_moc.pyis a ChRIS-based application that basically does an explicit copy of each file in  an input directory to the output directory, prefixing an optional string to each filename.Agruments[--prefix <prefixString>]
If specified, a prefix string to append to each file copied.

[--sleepLength <sleepLength>]
If specified, sleep for <sleepLength> seconds before starting script processing. This is to simulate a possibly long running  process.

[--ignoreInputDir]
If specified, ignore the input directory. Simply write a single json  file to the output dir that is a timestamp. Useful if the input  directory contains large nested file trees.

[-v <level>] [--verbosity <level>]
Verbosity level for app. Not used currently.

[--version]
If specified, print version number.

[--man]
If specified, print (this) man page.

[--meta]
If specified, print plugin meta data.RunThisplugincan be run in two modes: natively as a python package or as a containerized docker image.Using PyPITo run from PyPI, simply do apipinstallsimpledsapp_mocand run withsimpledsapp_moc.py--man/tmp/tmpto get inline help. The app should also understand being called with only two positional argumentssimpledsapp_moc.py/some/input/directory/destination/directoryUsingdocker runTo run usingdocker, be sure to assign an “input” directory to/incomingand an output directory to/outgoing.Make sure that the$(pwd)/outdirectory is world writable!Now, prefix all calls withdockerrun--rm-v$(pwd)/out:/outgoing\fnndsc/pl-simpledsapp_mocsimpledsapp_moc.py\Thus, getting inline help is:mkdirinout&&chmod777outdockerrun--rm-v$(pwd)/in:/incoming-v$(pwd)/out:/outgoing\fnndsc/pl-simpledsapp_mocsimpledsapp_moc.py\--man\/incoming/outgoingExamples
Package: simple-dvc
Read the Docshttp://simple-dvc.readthedocs.io/en/latest/Gitlab (main)https://gitlab.kitware.com/computer-vision/simple_dvcPypihttps://pypi.org/project/simple_dvcThis repo aims to simplify DVC tojusta data versioning tool (ignoring all
of the experiment management stuff), as well as provide other simple tools for
easier local cache management.This installs the CLI programsdvcwhich currently has the following help page:usage: sdvc [-h] {add,pull,request,cache_dir,sidecars,validate_sidecar,registery} ...

A DVC CLI That uses our simplified (and more permissive) interface.

The main advantage is that you can run these commands outside a DVC repo as
long as you point to a valid in-repo path.

options:
  -h, --help            show this help message and exit

commands:
  {add,pull,request,cache_dir,sidecars,validate_sidecar,registery}
                        specify a command to run
    add                 Add data to the DVC repo.
    pull                Pull data from a DVC remote.
    request             Like pull, but only tries to pull if the requested file doesn't exist.
    cache_dir           Print the cache directory
    sidecars            List all sidecars associated with a path.
    validate_sidecar    Validate that everything marked in a sidecar file looks ok.
    registery           A DVC CLI That uses our simplified (and more permissive) interface.
Package: simple-dyn365
Simple DYN365 is a simple Microsoft Dynamics365 Web API client, it provides full CRUD functionality and eases use of Micorost Dynamics Web API, responses are returned in form of dictionary JSON.More about Web API can be found at:https://docs.microsoft.com/en-us/powerapps/developer/data-platform/webapi/overviewExamplesThere are two ways to gain access to DynamicsThe first is using client credentials which is to simply pass the CRM Org link, client ID, client Secret, TenantIDFor example:fromsimple_dyn365importDynamicsdyn=Dynamics(client_id='47xxxx37-xxxx-4837-bxx6-5fxxxx2a07e',client_secret='nb4gh5jtbKG.MWASDTU-bLqP~9YCFt-n',tenant_id='cxxxx58c-xxxx-4d8a-ac2e-1a8dxxxxfbb4',crm_org='https://myenvname.crm.dynamics.com')For more information about this method and configuration of API user please refer to:Simple-dyn365 API ConfigurationThe second way is using password, as this feature is still to be implemented.Record ManagementTo create a new ‘Contact’ in Dynamics:dyn.contacts.create({'firstname':'Adam','email':'adam@adam-ma.dev'})This will return a string of response such as'https://myenvname.crm.dynamics.com/api/data/v9.2.21051.00140/contacts(96c5a6d3-28d3-eb11-bacc-000d3a57991e)'To get a dictionary with all the information regarding that record, use:contact=dyn.contacts.get('96c5a6d3-28d3-eb11-bacc-000d3a57991e')To change that contact’s first name from ‘Adam’ to ‘John’ and add a last name of ‘Mahameed’ use:dyn.contacts.update('96c5a6d3-28d3-eb11-bacc-000d3a57991e',{'firstname':'John','lastname':'Mahameed'})To delete the contact:dyn.contacts.delete('96c5a6d3-28d3-eb11-bacc-000d3a57991e')Note that Update, Delete and Upsert actions return the associatedHTTP status codesUse the same format to create any record, including ‘accounts’, ‘contacts’, and ‘annotations’.
Make sure to have all the required fields for any entry. TheWeb APIhas all entities and their fields.QueriesIt’s also possible to write select queries in DynamicsQueries are done via:dyn.query("contacts?$select=fullname,contactid")It can also be done in the following way:dyn.contacts.query("select=fullname,contactid")Other OptionsTo retrieve basic metadata use:dyn.contacts.metadata()To upload Base64 object, use:dyn.annotations.upload_base64(file_path='myimage.png',base64_field='documentbody'data={'subject':'Some subject','notetext':'Some text for the sweet note','objectid_contact@odata.bind':'contacts(02125b8c-9ed2-eb11-bacc-000d3a57991e)','filename':'myimage.png'})To update Base64 object, use:dyn.annotations.update_base64(entity_id='65bb00b9-99d2-eb11-bacc-000d3a57991e',base64_field='documentbody',file_path='newimg.png'))To retrieve a Base64 object:base64_data=dyn.annotations.get_base64('65bb00b9-99d2-eb11-bacc-000d3a57991e',base64_field='documentbody')withopen('img.png','wb')asf:f.write(base64_data)Author & LicenseThis package is released under MIT license. Simple-DYN365 was written byAdam Mahameed, its idea was taken from implementation of simple-salesforce REST API package.GitHub
Package: simple-eartquake-info
Simple Eartquake InformationThis package will get the simple info of eartquake from BMKGHOW TO USEimport gempaterkini

if __name__ == "__main__":
    result = gempaterkini.ekstraksi_data()
    gempaterkini.tampilkan_data(result)HOW IT WORK?This package will scrape fromBMKGThis package will use BeautifulSoap4 and Request to produce output in the form of JSON that is ready to be used in web or mobile application
Package: simple-eff
Simple EffA Simple Tiny (only <100 lines) Algebraic Effects Library for Python.fromsimple_effimportEffect,effnot_integer=Effect()defparse_int(str):try:returnint(str)except:returnNone@effdefsum_lines(s:str)->int:lines=s.split()sum=0forlineinlines:matchparse_int(line):caseNone:sum+=yieldnot_integer.perform(line)casenum:sum+=numreturnsumdefhandle_notinteger(k,v):print(f"Parse Error:{v}is not an integer.")returnk(0)if__name__=='__main__':twelve=sum_lines("1\n2\nthree\n4\n5")twelve.on(not_integer,handle_notinteger)ret=twelve.run()print(f"Sum:{ret}")AcknowledgementThis library is ...inspired byeffective-rustfor the API design.heavily based onrufffor the implementation.
Package: simpleelasticlogging
Simple python pip package to log to elasticsearch.
The main focus of this package is simplicity, such that errorlogging becomes super easy and needs only to be set up once.InstallHosted on PyPi now:https://pypi.org/project/simpleelasticlogging/So just simply run `pip install simpleelasticlogging´Bleeding Edge version:`pip install git+https://github.com/JustinGuese/pip-simple-elasticsearch-logging´Usagefrom simpleelasticlogging import ElasticLogger
el = Elasticlogger()

def boundToFail():
    array = [2, 6, "tendies"]
    for elem in array:
        try:
            elem = elem / 2
        except Exception as e:
            msg = {
                "error" : repr(e),
                "elementWhereItHappened": elem,
                "otherNotes": "boundToFail Function"
            }
            el.log(msg)
            # raise

boundToFail()Elasticsearch connectionThe connection supports host, port, user and password for elastic.The default values are - which can be changed:host="localhost"port=9200es_user = Nonees_pass = Noneappname = "app"errorindexname = "errors"es_user and es_pass only need to be passed if xpack security in Elasticsearch is enabled, together with the Elasticsearch user.DescriptionThe good thing with a NoSql database is, that you can basically submit anything you want to thelog()function as it takes everything.I created this even though other packages exist to make it even simpler to log to elastic, and to support username and password with Elasticsearch.