Saravanan666/pypi-org huggingface dataset:
Package: resvg
resvg-pyResvg-py is a Python package that provides high-performance SVG rendering by wrapping theresvgRust library using PyO3. This package allows Python applications to easily render SVG files to various image formats with high fidelity and performance.Seehttps://github.com/RazrFalcon/resvgfor more info about resvg.This project is inspired byhttps://github.com/yisibl/resvg-js. The image displayed above has been modified from a test image(SVG) included in this project and was converted using this package.InstallationpipinstallresvgaffineUsageHere's a simple example of how to use resvg-py to convert an SVG file to a PNG image:fromresvgimportrender,usvgimportaffinewithopen("a.svg","r")asf:svg=f.read()db=usvg.FontDatabase.default()db.load_system_fonts()options=usvg.Options.default()options.font_family="Space Mono"tree=usvg.Tree.from_str(svg,options,db)tr=Affine.identity()data=render(tree,tr[0:6])withopen("a.png","wb")asout:out.write(bytes(data))File content ofa.svg<svgwidth="600"height="300"xmlns="http://www.w3.org/2000/svg"xmlns:xlink="http://www.w3.org/1999/xlink"><defs><linearGradientx1="0%"y1="45%"x2="100%"y2="55%"id="b"><stopstop-color="#FF8253"offset="0%"/><stopstop-color="#DA1BC6"offset="100%"/></linearGradient><pathid="a"d="M0 0h600v300H0z"/></defs><gfill="none"fill-rule="evenodd"><usefill="url(#b)"xlink:href="#a"/><textx="50%"y="20%"font-size="48"fill="#FFF"dominant-baseline="middle"text-anchor="middle">resvg-py</text><textx="50%"y="40%"font-size="24"fill="#FFF"dominant-baseline="middle"text-anchor="middle">aPythonbindingofresvg</text><textx="50%"y="60%"font-size="48"fill="#FFF"dominant-baseline="middle"text-anchor="middle">resvg</text><textx="50%"y="80%"font-size="24"fill="#FFF"dominant-baseline="middle"text-anchor="middle">anSVGrenderinglibraryinRust</text></g></svg>Affine TransformationThe resvg-py package utilizes theaffinelibrary for the convenient creation of affine transformation matrices, thereby eliminating the need to directly wrap theTransformationclass from tiny_skia.It's important to note that when providing a 6-element tuple as the second parameter to therender()function, this tuple should be in row-major format. This detail is crucial for those who might calculate the transformation matrix using other methods or libraries before passing it to resvg-py.
Package: reSW
reStructuredWeb (rSW, reSW or rstW) – is a highly customizable static site
generator for the reStructuredText markup language.Docs:https://nixhacks.net/resw/https://git.nxhs.cloud/ge/reSW/src/branch/master/docsInstallationVia pippip install reSWFrom tarballpip install ./reSW-0.1.2.tar.gzInstall shell completionpip install infi.docopt-completion
docopt-completion rswQuick startInitialise site with following commands:rsw init my_site
cd my_siteCreate first template and post.Template layouts/template.jinja2:<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>{{ page.title }}</title>
  </head>
<body>
   {{ html | safe }}
</body>
</html>Post content/index.rst::title: Hello, World!
:date: 1970-01-01

=============
Hello, World!
=============

Hello, there! This is my first site built with *re*\ **Structured**\ *Web*!Build your site:rsw buildCommand Line InterfaceUsage: rsw init [--no-makefile] [<name>]
       rsw build [-c <file>]
       rsw print [-c <file>] [--default] [--json]
       rsw (-h | --help | -v | --version)

Commands:
  init          initialise new site.
  build         build site.
  print         print configuration.

Options:
  -c <file>, --config <file>    configuaration file.
  -j, --json                    JSON output.
  -d, --default                 print default config.
  -M, --no-makefile             do not create Makefile.
  -h, --help                    print this help message and exit.
  -v, --version                 print version and exit.DevelopmentBuild Python packageVariant 1:pip install setuptools wheel twine
python setup.py sdist bdist_wheelVariant 2:pip install -U build
python -m buildVia Makefile (buildpackage needed):make build
Package: reswarm
reswarm-pyAboutMakes publishing data to a Record Evolution Datapod incredibly easy!UsageimportasynciofromreswarmimportReswarm# create a reswarm instance, which auto connects to the Record Evolution Platform# the reswarm instance handles authentication and reconnects when connection is lostrw=Reswarm()asyncdefmain():whileTrue:# publish an event (if connection is not established the publish is skipped)publication=awaitrw.publish("test.publish.com",{"temperature":20})print(publication)awaitasyncio.sleep(3)if__name__=="__main__":# run the main coroutineasyncio.get_event_loop().create_task(main())# run the reswarm componentrw.run()OptionsTheReswarm__init__function can be configured with the following options:{
    serial_number: string;
}serial_number: Used to set the serial_number of the device if theDEVICE_SERIAL_NUMBERenvironment variable does not exist. It can also be used if the user wishes to authenticate as another device.Advanced UsageIf you need more control, e.g. acting on lifecycle events (onJoin,onLeave) take a look at
theexamplesfolder.
Package: reswmsecanalyzer
RES Workspace Manager application security rule analyzerDescriptionA simple script to visualize and find bypasses in RES Workspace Manager application restrictionsFeaturesFinding possible paths to reach a targeted resource such as an executable programVisually displaying rules as an oriented graphOptions$ python reswmsecanalyzer.py -h
Usage: reswmsecanalyzer.py [options]
Version: 1.0

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

  Main parameters:
    -i INPUT_FILE, --input-file=INPUT_FILE
                        sec_globauth.xml file containing the security rules
    -t TARGET, --target=TARGET
                        Program or file name you want to reach, globbing
                        format accepted (Ex: cmd.exe, *cmd*)

  Optional parameters:
    -g, --graph         Draw and show the graph with matplot
    -o OUTPUT_GRAPH, --output-graph=OUTPUT_GRAPH
                        Filename to save the png graph (Ex. -o test.png)PrerequisitesOn a protected environment (physical/logical/virtualized workstation):Thewhole configurationis stored in this directoryC:\Program Files (x86)\RES Software\Workspace Manager\Data\DBCache\Objects\Theapplication security rulesare stored in this fileC:\Program Files (x86)\RES Software\Workspace Manager\Data\DBCache\Objects\sec_globauth.xmlWorkspace access control(if implemented) is defined in the following fileC:\Program Files (x86)\RES Software\Workspace Manager\Data\DBCache\Objects\workspaces.xmlExamplesSomeexample rules and their associated graphsare provided in thereswmsecanalyzer/examplesfolder. For each example, apretty-printversion_prettyprint.xmlis also includedFor thereswmsecanalyzer/examples/multiple-rules:The policy defined in the RES Console looks like:Searching a path tocmdgives that:$ python reswmsecanalyzer.py -i examples/multiple-rules/sec_globauth.xml -t cmd -g
[+] Number of enabled rules: 4
[+] Possible path to 'cmd.exe': ['.', 'calc.exe', 'cmd.exe']
[+] Possible path to 'cmd.exe': ['.', 'notepad.exe', 'cmd.exe']Dependencies and installationThe easiest way:pip install reswmsecanalyzerOrpip install -r requirements.txtOr installing manually each dependency:Python NetworkX:apt-get install python-networkxorpip install networkxPython Matplotlib:apt-get install python-matplotliborpip install matplotlibRoadmapImprove the possible path output descriptionAdd csv outputTake into account edge constraints such as workspace access controlUse some dynamic representation, like D3JS
Package: resync
resyncresyncis a ResourceSync library with supporting client scipts,
written in python.ResourceSyncis a synchronization
framework for the web consisting of various capabilities that allow
third party systems to remain synchronized with a server's evolving
resources. The capabilities can be combined in a modular manner to
meet local or community requirements.Client usageTypical client usage to synchronize from a source athttp://source.example.com/to a set of local files would beresync-sync http://source.example.com/which will create or update a local directory./source.example.com.
Alternatively, the destination directory may be specified explicitly::resync-sync http://source.example.com/ /tmp/my_copyOption details and a number of different modes are described with::resync-sync -hPython library usageTypical library use in a source (create and output a Resource List)::from resync import Resource, ResourceList

rl = ResourceList()
rl.add( Resource('http://example.com/res1', lastmod='2013-01-01') )
rl.add( Resource('http://example.com/res2', lastmod='2013-01-02') )
print rl.as_xml()Typical library use in a destination (get and examine a Capability List)::from resync import CapabilityList

# Read Capability List and show supported capabilities
cl = CapabilityList()
cl.read("https://raw.github.com/resync/resync/1.0/resync/test/testdata/examples_from_spec/resourcesync_ex_2_6.xml")
for resource in cl:
    print "supports %s (at %s)" % (resource.capability,resource.uri)InstallationThe client and library are designed to work with Python 3.5 and up. (The
last version supporting Python 2.7 was1.0.9, also on PyPI)Automatic installationpip install resyncrsync is listed inPyPIand can be
installed withpiporeasy_install.Manual installation from githubcd /tmp
git clone git://github.com/resync/resync.git
cd resync/
python setup.py build
python setup.py installThis will install the library code in the appropriate place within
a user-space python setup, including the clientsresync-sync,resync-buildandresync-explorer. Use ofsudoto install in
system spaces is generally discouraged.The source code is maintained onGithuband there may be branches/versions available there that are not
yet packaged for PyPI.See alsoResourceSync simulatorContributorsThanks to:Bernhard Haslhofer,
[Robert Sanderson](<https://github.com/azaroth42)
andother contributors.SeeCONTRIBUTING.mdfor guidelines for contributing.Copyright and LicenseCopyright 2012--2020 Simeon Warner and contributorsLicensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.SeeLICENSE.txt
Package: resync-orm
## IntroductionResync is a Django-ORM inspired wrapper around the official rethinkdb driver's (currently undocumented) asyncio connection class.### Usage Examples```pythonimport asyncioimport resyncfrom resync import fieldsfrom resync.models import Model, NestedDocumentfrom myapp.auth.models import Userclass Grommet(NestedDocument):"""Nested documents don't have a table associated, but allow you to define aschema for arbitrary json sub-documents in a model."""weight = fields.FloatField()enabled = fields.BooleanField(default=False)class Widget(Model):"""Model classes refer to a table in the database.  By default, the tablename is the lowercased name of the class."""id = fields.StrField()grommet = fields.NestedDocumentField(Grommet)foo = fields.StrField()owner = fields.ForeignKeyField(User)async def create_widget(user: User) -> None:"""Model objects can be created and manipulated like ordinary python objects,then saved to the database."""new_widget = Widget(owner=user, foo='bar')new_widget.grommet = Grommet(weight=15.0)await new_widget.save()print(new_widget.id)  # '45226082-976e-4226-b2c7-0d2c86c45b73': generated by rethinkdbasync def get_widget_by_id(id: str) -> Widget:"""Use the 'objects' class attribute to query the database to retrieve aninstance."""widget = await Widget.objects.get(id=id)return widgetasync def get_all_widgets() -> typings.List[Widget]:"""Querysets can be `await`ed to get all the results in a list ..."""widgets = await Widget.objects.all()return widgetsasync def send_all_widgets_to_socket(socket: aiohttp.web.WebSocketResponse) -> None:"""... or iterated over using `async for`"""async for widget in Widget.objects.all():serializer = MyWidgetSerializer(widget)socket.send(serializer.data)async def rename_all_widgets() -> None:"""Make simple changes to the database in a single query without extractingthe objects to python code."""await Widget.objects.all().update(foo='baz')async def get_enabled_widgets_for_user(user: User) -> typings.List[Widget]:"""Querying related fields works similarly to django, returning a querysetthat can be manipulated as normal"""ret = []async for widget in user.widget_set.filter(enabled=True):ret.append(widget)return retdef main():"""Resync deals transparently with connections, managing a connection pool toreuse open connections when available."""resync.setup({'host': 'my.rethinkdb.fqdn','db': 'my_database_name','user': 'test','password': '123456'})  # These arguments are passed to rethinkdb.connect# (docs: https://www.rethinkdb.com/api/python/connect/)loop = asyncio.get_event_loop()fut = asyncio.ensure_future(get_all_widgets())loop.run_until_complete(fut)print(fut.result())  # List of widgets...teardown = asyncio.ensure_future(resync.teardown())loop.run_until_complete(teardown)  # Closes all connections.loop.close()```### TODO- Tests- Docs### Contributors- James Keys (author) <@skolsuper>
Package: resync-simulator
ResourceSync SimulatorThe ResourceSync Simulator simulates aResourceSyncSource, which is a server that hosts resources subject to synchronization.Any ResourceSync-compliant client can be used to synchronize a Destination with the simulated Source. This version of the simulator is written against v1.0 of theResourceSync specificationand has been tested with v1.0.9 of our ownResourceSync client and library reference implementation.InstallationThis simulator is designed to run under Python 3. Check withpython --versionAutomatic installationpip install resync-simulatorrsync-simulatoris listed inPyPIand can be installed withpiporeasy_install. Either installation method should also dependencies if they are not already on your system.Manual installation from githubInstall theresynclibrary code and theTornadoweb server (you might need to usesudodepending on you local setup)pip install resync tornadoGet the ResourceSync Simulator fromGithubgit clone git://github.com/resync/resync-simulator.gitQuick StartRun the source simulator (with the default configuration in./config/default.yaml./resync-simulatorAccess from a web browser ashttp://localhost:8888/Terminate the source simulator withCTRL-CHow to define parameterized use casesParameterized Use Cases can be defined by creating aYAMLconfiguration file (e.g.,simulation1.yamland defining a set of parameterssource:
    name: ResourceSync Simulator with 1000 resources
    number_of_resources: 1000
    change_delay: 2
    event_types: [create, update, delete]
    average_payload: 1000
    max_events: -1
    stats_interval: 10Additionalresource_list_builderandchange memoryimplementations can be attached for simulation purposes. For instance, the following configuration attaches a change memory implemented by theDynamicChangeListclassresource_list_builder:
    class: DynamicResourceListBuilder
    uri_path: resourcelist.xml

changememory:
    class: DynamicChangeList
    uri_path: changelist.xml
    max_changes: 1000See the examples in the./configdirectory for further details.See alsoResourceSync libraryAuthor and ContributorsAuthor:Bernhard HaslhoferContributors:Simeon Warner
Package: resype
ReSyPE: Recommender System in Python EnvironmentIntroductionReSyPE (pronouncedrecipe) is a Python library built for both practitioners and researchers that wish to quickly develop and deploy ML-based recommender systems.The library provides an end-to-end pipeline that includes:Loading transaction, user feature, and item feature datasetsInterchangable methods for user and item clusteringModular framework for machine learning modelsIterative and decomposition-based techniquesInstallationpip install resypeSetupThe package uses Python 3 andvirtualenvto manage the environment.  Once you've cloned this repo run this from the root of the repo to create the environment:conda env create -f environment.yml
source activate resypeGetting Startedimportpandasaspdimportnumpyasnpfromresype.collab_filteringimportCollabFilteringModel# load transaction listtransaction_list=pd.read_csv("sample_data/ratings.csv")transaction_list=transaction_list[['userId','movieId','rating']]transaction_list=transaction_list.sample(20)transaction_list.columns=["user_id",'item_id','rating']re=CollabFilteringModel(transaction_list)# construct utlity matrixre.construct_utility_matrix()# import sklearn Modelfromsklearn.neural_networkimportMLPClassifier,MLPRegressormlp1=MLPRegressor(hidden_layer_sizes=(50,50))# fit and predictre.fit(mlp1,method='iterative')# recommenduser_list=[0,1,2]# indicestop_n=10re.get_rec(user_list,top_n)Comparison with SurpriseFeaturesSurpriseReSyPEHandles explicit rating data✔️✔️Cross validation✔️✔️Recommendation evaluation✔️✔️Collaborative filtering✔️✔️Content-based filtering✔️Customizable ML models✔️PerformancePrediction AlgorithmMSEMAENormalPredictor2.0510801.135742BaselineOnly0.8586670.735921KNNBasic1.3627820.906558KNNWithMeans1.1734800.850230KNNWithZScore1.1850110.842193KNNBaseline1.0579570.796983SVD0.8622250.730675NMF1.3609500.921752SlopeOne1.2220820.869121CoClustering1.2992100.900984ReSyPE (SVD-based Collaborative Filtering using Random Forest)1.3433270.907147ReSyPE (Content-based; Random Forest)0.9550750.757576
Package: ret
A pure-python command-line regular expression tool for stream filtering, and extracting, designed to be minimal with an intuitive command-line interface.InstallationYou can install this via$python3-mpipinstallret✨🍰✨or using pipx$pipxinstallret✨🍰✨Ret is pure python (tested on python 3.6+) with no dependencies.That way, you can get a clean uninstall.NoteIf you want to install the bleeding edge version of ret, right when it gets pushed to master, seeherefor instructions.UsageExampleYou can useretto extract text via regex capture groups:$gitbranch*master$gitbranch|ret"\* (\w+)"s--group1master…finding all occurrences of a pattern:$ls|ret".*\.py"findallfoo.pybar.pyand even all occurrences of a patternwith capture groups:$ls|ret"(.*)\.py"findall--group1foobarWhile those may seem untypical use cases, I have found myself usingRetcountless times.Here’s a one-liner for uninstalling unnecessary stuff forpip:$piplist--not-required|ret".+\n.+\n((?:\n|.)+)"f-g1|ret"([^\s]+)\s+.+\n"f-g1|xargspipuninstall--yesAnother caseImagine this: you have just downloaded a bunch of tarballs, and have ranforxin$(grep".+\.tar\.gz");dotar-xzf$x;doneNow you just want tocdinto all of the extracted files, run./configure && make && make install.You could useretto get the names of the extracted files, just from the tarballs’ names. Like this:$ls|grep".+\.tar\.gz"foo.tar.gzbar.tar.gzfoobar.tar.gzextractme.tar.gz$ls|ret"(.+)\.tar\.gz"f-g1foobarfoobarextractmeand with that combined, we can do$forxin(ls|ret"(.+)\.tar\.gz"f-g1);do{cd$x&&./configure&&make&&makeinstall&&cd-};done✨🍰✨A life saver.And remember, this is python regex: a very powerful regular expression engine.The possibilities of usage are endless.DemonstrationBackgroundI lovegrep. But grep isn’t really for text extraction.For example, you cannot extract regexes via capture groups.Since I wanted that functionality, I decided to build this,Ret.Why the name?Retis an acronym forregularexpressiontool.Why it can’t replace grepRetoriginally was designed to provide some featuresgreplacks.
It never intended to replace good ol’grep.Grep is great for searching directories whileret(currently) can only read from a file or stdin.Furthermore, you cannot guarantee thatretis installed on the machine.Also,Retrelies on the (slow) python regex engine.What about sed?Sed is for find-and-replacing streams. Ret’s different. But together, you can do some powerful thingsFeel free to contribute!
Package: retaggr
retaggrLibrary to reverse search various boorus.See the documentation for details.ExamplefromretaggrimportReverseSearch,ReverseSearchConfigconfig=ReverseSearchConfig(min_score=80.0)rsearch=ReverseSearch(config)result=asyncio.run(rsearch.reverse_search("https://danbooru.donmai.us/data/__tsukumo_benben_touhou_drawn_by_elise_piclic__6e6da59922b923391f02ba1ce78f9b42.jpg"))LicensingThis project is under the GNU LGPLv3 license.In addition, this project contains a local copy of the aiohttp_requests package (this is to resolve a minor dependency pinning problem aiohttp_requests on pip has). This library is under the MIT. Check the header of the init file for the license.
Package: retag-opus
Retag OpusSay you have a music file in opus format, with a tag calleddescriptionthat holds data about the music in the format used by
YouTube's ContentID. This script will help you parse that tag and put
the relevant data into the tags where it actually belongs, such astitle,artist, andalbum.DependenciesRetag requiressimple-term-menuto
be installed.UsageRun the script like so:$python3retag--directory/path/to/directory/with/your/opus/files.opusThere is also a help (-h) flag:$retag-husage: main.py [-h] [-d DIR] [-v] [-V]options:-h, --help            show this help message and exit-s {bash,zsh,tcsh}, --print-completion {bash,zsh,tcsh}print shell completion script-a, --all             Even if there is no YouTube description, suggest improving existing tags-d DIR, --directory DIRdirectory in which the files to be retagged are located-V, --version         show program's version number and exitRetag will go through the opus file in the root of the directory you
provided and try to parse tag information from the YouTube description
if it is in the tags and from the original tags (e.g. adding another
artist if the title indicates a featured artist). It might look like
this:Purple text indicates that the tag comes from the YouTube description.
Blue indicates that the tag existed in the metadata since before. Yellow
indicates that the tag comes from interpreting one of the original tags,
and green indicates that the tag has been interpreted from one of the
new tags taken from the YouTube description.As you go on adjusting tags, they turn green for indicating that you're
done adjusting them. In the end, some tags may stay blue, indicating
that you have selected the original tag or that no new data is
available. Here is an example of what it can look like:As you can see, you can remove tags, which will make them print
"[Removed]" in red text. In the actual song metadata, they will just be
removed.ConfigurationYou can configure tags that should be deleted. There are two ways you can
configure these. You can either say an exact tag name that should be deleted –
that is, the name of the tag itself, not its value. You can also specify a regex
that, if fully matching any value in a tag, will result in that tag being
deleted.You specify this information in the Retag-Opus configuration file which isretag.tomlin yourXDG_CONFIG_HOMEdirectory, so usually~/.config/retag.toml. Here is an example:tags_to_delete=["language",]strings_to_delete_tags_based_on=["delete_exactly_this",".*delete_any_partial_match.*",]This will delete thelanguagetag, any tag containing the exact valuedelete_exactly_thisbut notdelete_exactly_this_other_thing, and also any
tag that matches the last regex, such astest_delete_any_partial_match_test.Project statusThe project is still under development. The most common tags can be
parsed but there are many more which will just be ignored. Work needs to
be done in usability.Latest workflow status:Latest version:Acitivy since last release: