Saravanan666/pypi-org huggingface dataset:
Package: nrkdl
nrkdlDownload content from nrk.noDisclaimer:This is for educational purposesONLY.Table of contentsnrkdlTable of contentsInstallationUpdatingSystem requirementsUsageExample usageDownload an entire tv-show with subtitlesDownload a single tv-show episodeDownload a movieSearch for a series and download all seasonsSearch for a specific episodeSupported sitesInstallationpipinstallnrkdlUpdatingpipinstallnrkdl--upgradeSystem requirementspython3ffmpegUsageusage: nrkdl.py [-h] (--search SEARCH | --url URL) [--season SEASON] [--episode EPISODE] [--write-subs] [--keep-subs] [--audio-only] [--write-metadata]

options:
  -h, --help         show this help message and exit
  --search SEARCH    Search for Movie/TV-show, and then download (e.g: Exit)
  --url URL          URL for the Movie/TV-show (e.g: https://tv.nrk.no/program/KOID75006720)
  --season SEASON    Season number (e.g: 1) (Only works if --search is used) (0 for all)
  --episode EPISODE  Episode number (e.g: 1) (Only works if --search is used) (0 for all)
  --write-subs       Download and embed subtitles to file
  --keep-subs        Prevent the subtitle files from being deleted after being embeded
  --audio-only       Only extract audio files
  --write-metadata   Write metadata to fileExample usageDownload an entire tv-show with subtitlesnrkdl--urlhttps://tv.nrk.no/serie/exit--write-subsDownload a single tv-show episodenrkdl--urlhttps://tv.nrk.no/serie/exit/sesong/2/episode/6/Download a movienrkdl--urlhttps://tv.nrk.no/program/MSUI31006017Search for a series and download all seasonsnrkdl--searchrådebank--season0Search for a specific episodenrkdl --search exit --season 2 --episode 6Supported sitesNRK
NRKPlaylist
NRKRadioPodkast
NRKSkole: NRK Skole
NRKTV: NRK TV and NRK Radio
NRKTVDirekte: NRK TV Direkte and NRK Radio Direkte
NRKTVEpisode
NRKTVEpisodes
NRKTVSeason
NRKTVSeries
Package: nrkdownload
nrkdownloadThis is a commandline tool to download programs and series from NRK (Norwegian public
broadcaster). It supports both TV, Radio and Podcast content. The tool is written in
Python, and is compatible with Python 3.8 or newer. It has been tested under Linux, Mac
OS X and Windows.DocumentationThe documentation for nrkdownload is availabe here:https://nrkdownload.readthedocs.orgSetting up a development environmentInstallpoetry, and a recent Python version (>=3.7). If
you want to run tests with multiple Python versions, installpyenv. Set up the development environment:poetryinstallMaking a new releaseMake sure all tests are ok by runningtoxMake a pull requst on GitHubUse the "new release" functionallity of GitHub. Make a new tag.Updatepyproject.tomlto match the new version number.poetry buildpoetry publish
Package: nrksub
Download, translate subtitles for NRK TV programs.DependenciesPython 3.4+Beautiful Soup 4RequestsUsageTo download subtitles for a programs, provide it’s URL as the first argument:$ url='https://tv.nrk.no/serie/side-om-side/MUHH48000415/sesong-3/episode-4'
$ ./nrksub.py $urlHelpAll command line options and arguments, and their purposes can be queried using
the help switch:$ ./nrksub.py --helpFileBy default, nrksub will print the subtitles out to STDOUT. To write to a file,
provide a file name as the second argument:$ ./nrksub.py $url nytt-paa-nytt-26-12-2014.srtTranslatenrksub can translate the Norwegian subtitles provided by NRK automatically using
Google Translate. The translations are by no means perfect, but they are better
than nothing. By default, the subtitles are translated to English, but you can
use any language supported by Google Translate:$ ./nrksub.py --lang es $url
Spanish output
$ ./nrksub.py --lang de $url
German outputIf you want the original Norwegian subtitles, set the language tono(for Norwegian). This will skip the translation process:$ ./nrksub.py --lang no $urlFormatBy default, nrksub will output SRT format subtitles. nrksub can also output
TTML format subtitles, but this is mostly for debugging purposes and of little
use, as rarely any video player supports them:$ ./nrksub.py --format ttml $urlMore formats maybe added in the future, if I have the time.
Package: nr.markdown
nr.markdownExtends themisakaMarkdown library for a couple of extensions.inside-html: Support Markdown inside HTML tags. Requires thebs4packagesmartypants: Automatically applymisaka.smartypants()on the input
Markdown. Enabled by defaultpygments: Highlight code blocks with Pygments. Requires thepygmentspackageurl-transform: Transform links and image URLs with a callback function.
Enabled by default, but only actually does something if theurl_transform_callbackoption is settoc: Generates a table of contents while rendering, but does not actually
render a TOC into the output. The generated TOC data structure can be
accessed via theMarkdown.tocattribute. Enabled by defaultCopyright © 2020 Niklas Rosenstein
Package: nr-merkletree
# nr-merkletreePython-3 compatible Merkle tree implementation.#### Current Stable Version```0.1.3```# Install### Pip```pip install nr-merkletree```### Development Installation* Clone the project.* Install in Anaconda3 environment```$ conda env create --force -f dev_environment.yml$ source activate nr-merkletree$ pip install -e .```# TestTo run the tests:```make test```# Usage```pythonfrom nr_merkletree import MerkleTreefrom pprint import pprint# A list of bytes datadata_chunks = [b'0', b'1', b'2', b'3', b'4']# Create merkle_treemerkle_tree = MerkleTree(data_chunks)# Print out Merkle Treepprint(merkle_tree.tree.to_dict())```# Examples```$ python examples/simple_merkle_tree.py```# LicenseMIT
Package: nr.metaclass
Note: This package is in the dangerous land of0.x.yversions and may be subject to breaking
changes with minor version increments.nr.metaclassThis module provides utilities for Python classes and metaclasses.nr.metaclass.copy– Copy a class, while optionally updating some properties
(for example the base classes).nr.metaclass.deconflict– Functions to determine conflicting metaclasses and
deconflicting them.nr.metaclass.inline– Provides theInlineMetaclassBase, allowing you to implement__new__()and__init__()of a metaclass in a class through__metanew__()and__metainit__().Copyright © 2020 Niklas Rosenstein
Package: nr-metadata
NR modelThis github project generates:nr-metadata- runtime support containing marshmallow, serializers, ... for NR metadata (documents and data)oarepo-model-builder-nr- a plugin for oarepo-model-builder to generateIncompatible changesNone yet. If you introduce any incompatible changes (vs previous major version),
enumerate them here and link the readme file from the previous major version
for reference.UsageSee theexamples/model.yamlfile for a skeleton of a repository
which uses nr metadata document model. An even easier way is to use thenrpcommand to generate a documents- or data- compatible repository.
See the same pages to get help about the model contents.BranchesBranches are always named "aa.bb" and denote the version of the contained metadata schema.Updating packagePackage needs to be updated whenever the version of oarepo-model-builder and
other builder plugins changes and influences the generated files.The package version is always in the form ofaa.bb.ccc, whereaa.bbis the version
of the metadata schema andcccis the version of the python package.To rebuild python packages:Create a development branch (named after the issue inside linear or github issue)Implement your changesIncrease the version number inversionfileRunbuild.sh(note - this has to be run after modification to theversionfile)Create a merge request to theaa.bbbranchCreate a new github release.Updating modelTo update the model version,start by creating a new branch with the nameaa.bb, whereaa.bbrepresents the new model version.For example, if the current version is2.0and your changes are minor,
the new version should be2.1, while major changes warrant
a version bump to3.0.Set this branch as the default branch on GitHub.Rename files inside themodeldirectory to include the correct versionChange the model version inside thebuild.shscriptMake your modifications to the files within the model directoryUpdate the content of theversionfile to reflect the new version asaa.bb.0Execute thebuild.shscript to ensure that everything builds correctlyPush your changes to GitHubMark the branch as the default branchCreate a new GitHub release.
Package: nrmk-clients
ecat_grpc_clientecat_grpc_clientis a Python package that provides a gRPC client for EtherCAT communication tasks. This package simplifies the interaction with EtherCAT devices by providing an easy-to-use API for various EtherCAT-related operations.InstallationTo installecat_grpc_client, simply run:pipinstallecat_grpc_clientDependenciesTheecat_grpc_clientpackage depends on the following libraries:grpcioMake sure you have them installed in your Python environment.UsageHere's a quick example to get you started:importsysfromecat_grpc_clientimportGRPCECatTaskasecat_clientimportsys,json,grpc,timefrommotordriver_utilsimport*ecat=ecat_client('192.168.214.20')# ecatFor more detailed usage instructions, refer to theAPI documentation.API OverviewTheecat_grpc_clientpackage provides aGRPCECatTaskclass with the following methods:get_master_status()get_slave_status()get_rxdomain_status()get_txdomain_status()is_system_ready()set_servo(slave_idx, state)set_md_rx_pdo(slave_idx, controlWord, modeOp, targetPos, targetVel, targetTor)get_md_rx_pdo(slave_idx)get_md_tx_pdo(slave_idx)get_md_di(slave_idx)get_error_code(slave_idx)get_max_torque(slave_idx)get_max_motor_speed(slave_idx)set_max_torque(slave_idx, value)set_max_motor_speed(slave_idx, value)get_ioboard_do()get_ioboard_di()set_ioboard_do(do_idx, do_val)set_ioboard_dos(do_vals)reset_welcon(slave_idx)get_error_code(slave_idx)get_core_temp1(slave_idx)get_core_temp2(slave_idx)get_core_temp3(slave_idx)get_maxTorque(slave_idx)get_profileVel(slave_idx)get_profileAcc(slave_idx)get_profileDec(slave_idx)set_maxTorque(slave_idx, value)set_profileVel(slave_idx, value)set_profileAcc(slave_idx, value)set_profileDec(slave_idx, value)LicenseThis project is licensed under the MIT License. See theLICENSEfile for details.ContributingWe welcome contributions! If you would like to improve this package or report any issues, please open a pull request or create an issue on the GitHub repository.ContactFor questions or suggestions, please contact the package author atyoungjin.heo@neuromeka.com.
Package: nrn-diff
nrn-diffUsage>>>fromnrndiffimportnrn_diff>>>fromneuronimporth>>>s1=h.Section()>>>s2=h.Section()>>>nrn_diff(s1,s2)[]>>>s2.L=s1.L*2>>>nrn_diff(s1,s2)[<nrndiff._differences.SectionLengthDifference object at 0x7f52eb4d3310>,<nrndiff._differences.SegmentAreaDifference object at 0x7f52eb47de80>,<nrndiff._differences.SegmentVolumeDifference object at 0x7f52eb47d7c0>,<nrndiff._differences.SegmentInputResistanceDifference object at 0x7f52eb47df40>]
Package: nrn-subprocess
NEURON subprocessingRun multiple NEURON setups isolated from each other from a single Python script.
This package uses Python'ssubprocessto run multiple NEURON instances that
are completely seperated from eachother, making it easier to executed repeated
and parametrized simulations without having to worry about cleaning up the state
of the previous run.Installationpip install nrn-subprocessUsageWrite your entire NEURON setup that you'd like to isolate inside of a function,
then use thesubprocessorisolateapproach to execute it in isolation:subprocessimport nrnsub

def my_sim(param1, opt1=None):
  from neuron import h
  s = h.Section(name="main")
  # ...
  return s.v

for i in range(10):
  nrnsub.subprocess(my_sim, 15, opt1=i)This will run the subprocesses in series, parallel coming Soon (tm).isolateThere's also theisolatedecorator that will make sure every call to that function is
ran as an isolated subprocess:import nrnsub

@nrnsub.isolate
def my_sim(param1, opt1=None):
  from neuron import h
  s = h.Section(name="main")
  # ...
  return s.v

for i in range(10):
  my_sim(15, opt1=i)WorkerPATHThe worker might have trouble unpacking the serialized objects because it can't
find the module they came from on the main process. This might result indillraising "module not found" errors. To fix them you can pass the_worker_pathtosubprocessorworker_pathto theisolatedecorator:import nrnsub

sys.path.insert(0, "/home/me/my_modules_folder")

@nrnsub.isolate(worker_path=["/home/me/my_modules_folder"])
def f():
  import something_in_my_modules_folder
Package: nr-oaipmh-harvesters
NR OAI-PMH harvestersThis package provides oai-pmh transformers for harvesting external repositories.
The following repositories are currently supported (other might work with the same transformers):NUSL - national repository of grey literatureinveniooarepooaiharvesteraddnusl\--name"NUSL harvester"\--urlhttp://invenio.nusl.cz/oai2d/\--setglobal\--prefixmarcxml\--loadersickle\--transformermarcxml\--transformernusl\--writer'service{service=nr_documents}'
Package: nr-objstore-util
Object Storage / S3 Utility MethodsGlueing together some object storage functionality into a
easy to use python library.Intent is to bundle up commonly used functions into a single
library that can be imported into other projects.Installingpip install nr_objstore_utilCreating an NRObjStoreUtil Object by passing credentialsimportNRUtil.NRObjStoreUtilasNRObjStoreUtilobjstor=NRObjStoreUtil.ObjectStoreUtil("name of object store host","object store user / access","object store secret","object store bucket")Creating an NRObjStoreUtil Object using env varsFirst populate the following environment variables:OBJ_STORE_BUCKETOBJ_STORE_SECRETOBJ_STORE_USEROBJ_STORE_HOSTexportOBJ_STORE_BUCKET=bucket_nameexportOBJ_STORE_SECRET=sdf3jkllvjiojl;a4sf892ikfjovjexportOBJ_STORE_USER=ostoreuserexportOBJ_STORE_HOST=nrs.objectstore.gov.bc.caThen create the NRObjStoreUtil object without args:importNRUtil.NRObjStoreUtilasNRObjStoreUtilobjstor=NRObjStoreUtil.ObjectStoreUtil()Examples... see the examples folder for examples
Package: nrp
nrpThis is a small package for computing roots of a given function using newton-raphson method.The user needs to supply an initial root guess, the function as well as the first derivative of the function as callbacks.Usage(We are actively adding support for passing functions as callback.)Example:fromnrpimportnewton_raphsonfromlpythonimportf64,i32defcheck():x0:f64=20.0c:f64=3.0maxiter:i32=20x:f64x=newton_raphson(x0,c,maxiter)assertabs(x-3.0)<1e-5check()
Package: nr.parsing.core
nr.parsing.coreThenr.parsing.corepackage provides a simple API to scan and tokenize text for the purpose of
structured langauge processing.Examplefromnr.parsing.coreimportRuleSet,Tokenizer,rulesruleset=RuleSet()ruleset.rule('number',rules.regex_extract(r'\-?(0|[1-9]\d*)',0))ruleset.rule('operator',rules.regex_extract(r'[\-\+]',0))ruleset.rule('whitespace',rules.regex(r'\s+'),skip=True)defcalculate(expr:str)->int:tokenizer=Tokenizer(ruleset,expr)result=0sign:t.Optional[int]=1whiletokenizer:iftokenizer.current.type!='number':raiseValueError(f'unexpected token{tokenizer.current}')assertsignisnotNoneresult+=sign*int(tokenizer.current.value)tokenizer.next()iftokenizer.current.type=='operator':sign=-1iftokenizer.current.value=='-'else1tokenizer.next()else:sign=NoneifsignisnotNone:raiseValueError(f'unexpected trailing operator')returnresultassertcalculate('3 + 5 - 1')==7Copyright © 2020 Niklas Rosenstein
Package: nr.parsing.date
nr.parsing.dateA fast, regular-expression based library for parsing dates, plus support for ISO 8601 durations.RequirementsPython 3.6+Supported Date & Time Formats%Y– 4 digit year%m– 2 digit month%d– 2 digit day%H– 2 digit hour%M– 2 digit minute%S– 2 digit second%f– arbitrary precision milliseconds%z– timezone offset ([+-]\d\d:?\d\doffset orZfor UTC)Built-in format collectionsISO_8601(seeISO 8601on Wikipedia)JAVA_OFFSET_DATETIME(seeOffsetDateTimeclass on the Java 8 API documentation)FeaturesEasily extensible to support more date/time format optionsDate/time formats can use an extended regex-style mode to mark format options as optional (e.g.
the two formats%Yand%Y-%mcan be expressed in a single regex-style format string as%Y(-%m)?)Quickstartfromnr.parsing.dateimportduration,ISO_8601ISO_8601.parse('2021-04-21T10:13:00.124+0000')duration.parse('P3Y6M4DT12H30M5S')BenchmarkThe below benchmark compares the performance of testing various format-strings for ISO-8601
dates using the standard library,dateutil.parser.parse(),dateutil.parser.isoparse()and
thenr.parsing.date.ISO_8601.parse_datetime()function.Conclusion: Faster than the standard library but with the same flexibility (except for the
missing support for most uncommon format options).asv run
· Creating environments
· Discovering benchmarks
· Running 5 total benchmarks (1 commits * 1 environments * 5 benchmarks)
[  0.00%] · For nr.parsing.date commit dd35e795 <develop>:
[  0.00%] ·· Benchmarking virtualenv-py3.8-pandas-python-dateutil
[ 10.00%] ··· Running (benchmarks.DatetimeParsingSuite.time_datetime_datetime_strptime--).....
[ 60.00%] ··· benchmarks.DatetimeParsingSuite.time_datetime_datetime_strptime                                     2.22±0.3ms
[ 70.00%] ··· benchmarks.DatetimeParsingSuite.time_datetime_datetime_strptime_reversed                           2.12±0.08ms
[ 80.00%] ··· benchmarks.DatetimeParsingSuite.time_dateutil_parser_isoparse                                      1.46±0.02ms
[ 90.00%] ··· benchmarks.DatetimeParsingSuite.time_dateutil_parser_parse                                          2.77±0.1ms
[100.00%] ··· benchmarks.DatetimeParsingSuite.time_nr_parsing_date_ISO_8601_parse_datetime                       1.62±0.03msCopyright © 2020 Niklas Rosenstein
Package: nrp-devtools
NRP repository development toolsThis tool is used to setup and run an Invenio based NRP instance.PrerequisitesPython 3.10node version 16 or greater, npm version 7, 8 or 10imagemagick and development packages for imagemagickstandard build tools (gcc, make, ...), on ubuntu build-essentialDocker 20.10.10+ and docker-compose 1.17.0+ (or OrbStack on Mac)Creating a new repositoryDownload the installercurl-sSLhttps://raw.githubusercontent.com/oarepo/nrp-devtools/main/nrp-installer.shRun the installer with a directory where the repository will be createdbashnrp-installer.shmy-repoAfter asking a couple of questions, the installer will create the
repository in themy-repodirectory.It will also initialize git version control system and commit the initial
sources.Go to the my-repo directory and see the README.md file there for further instructions
(or have a peek atREADME.md)
Package: nr.poetry-release
nr.poetry-releaseA Poetry plugin to automate releasing new versions of Python packages.FeaturesUpdate the version number in all relevant placesBuilt-in support forpyproject.toml(like thepoetry versioncommand) & in your package source codeConfiguration option to match and bump version numbers in other filesPlugin infrastructure to dispatch additional logic on version bump (used by e.g.poetry-changelog)Automatically commit, tag and push version bumpsEasily release from CIInstallationPlugins work with Poetry version1.2.0a2or above.$ poetry plugin add nr.poetry-releaseUsage$ poetry release patch --tag --pushThis willIncrement the patch version number inpyproject.tomland synchronize all other built-in and configured places
where the version number is referencedCommit the changes and create a Git tag with the new version number, then push the branch to the remote repositoryIn addition to the version rules already supported bypoetry version, thepoetry releaseplugin supports agitrule which will construct a version number based on the last Git tag and the commit distance. Note that this version
number is not PyPI compatible, but can be used to publish for example to Artifactory.Using the--verifyoption will instead check if the specified version number is used consistently across all version
references and is useful in CI.ConfigurationRelease branchIf in a Git project, unless--no-branch-checkis passed,poetry releasewill prevent you from creating the
release unless the worktree is currently on the configured release branch (developby default). The release
branch can be changed by setting thetool.nr.poetry-release.branchoption inpyproject.toml.[tool.nr.poetry-release]branch="main"Tag formatWhen using the--tagoption, a Git tag will be created with the target version as its name. The name assigned to the
new tag can be changed by setting thetool.nr.poetry-release.tag-formatoption inpyproject.toml. For example, if the
target version is1.0.0but the tag name should bev1.0.0, the configuration to use is:[tool.nr.poetry-release]tag-format="v{version}"Additional version referencesYou can configure additional references to the version number in your project using thetool.nr.poetry-release.referencesoption. It must be a list of tables that define the files and a regular expression to find the version number.[tool.nr.poetry-release]references=[{file="../frontend/package.json",pattern="  \"version\": \"{version}\","}]In addition to this configuration option, plugins of typepeotry_release.plugin_api.PoetryReleasePluginregistered
under thepoetry_release.pluginsentrypoint will be used to detect additional version number references, or register
a callback to modify file(s) with respect to the target version number.
Package: nr.powerline
nr.powerlineSimple powerline implementation, only tested in Bash. It is recommended that
you use a font fromNerdFontsin order to
have proper support for special characters (like the right triangle).RequirementsBashPipxPython 3.5+Linux/macOSjq (If not available, the environment variables cannot be sent from Bash to the powerline server)Installation$ pipx install nr.powerline
$ source <(nr-powerline --src bash)On OSX, sourcing a Bash script from/dev/<fd>seems to have some issues, so you
may need to write it to a temporary file instead.ifwhichnr-powerline>/dev/null;thenfunction_activate_powerline(){localTMP=`mktemp`;trap"rm -f$TMP"RETURNnr-powerline--srcbash>$TMPsource$TMP}_activate_powerlinefiCopyright © 2020 Niklas Rosenstein
Package: nr.proxy
nr.proxyThenr.proxymodule provides utilities for creating Python object proxies which will forward
almost any interaction with the object to another object. This allows for the creation of very
convenient APIs in Python applications (e.g. à la Flaskrequestobject).This package requires Python 3.5 or higher.Example:proxyCommand-line interfaces built withClickcan use theContext.ensure_object()method to
attach information to a context. Retrieving that information from the context include a couple
of lines which over all reduce the readability of the code. Using aproxyallows you to access
that information once it is initialized in the context as if the data was available globally.importclickimportnr.proxyfrompathlibimportPathfrom.configimportConfigurationconfig=nr.proxy.proxy[Configuration](lambda:click.get_current_context().obj['config'])@click.group()@click.option('-c','--config','config_file',type=Path,default='config.toml',default='Path to the configuration file.')@click.pass_contextdefcli(ctx:click.Context,config:Path)->None:ctx.ensure_object(dict)['config']=Configuration.load(config)@cli.command()defvalidate():# No need to use @click.pass_context or access ctx.obj['config'].config.validate()Example:threadlocalThe below is an example for creating a globally accessibleSqlAlchemysession. Inside a
with-context usingmake_session(), the globalsessionobject can be accesses like a normal
instance of theSessionclass. Outside of the context, accessing thesessionobject results
in aRuntimeErrorwith the specified error message.The advantage of this method is that theSessionobject does not need to be passed around,
but can instead just be accessed globally.importcontextlibimportnr.proxyfromsqlalchemy.ormimportsessionmakerfromtypingimportGeneratorSession=sessionmaker()session=nr.proxy.threadlocal[Session](name=__name__+'.session',error_message='({name}) No SqlAlchemy session is available. Ensure that you are using the ''make_session() context manager before accessing the global session proxy.',)@contextlib.contextmanagerdefmake_session()->Generator[None,None,None]:"""A context manager that creates a new #Session object and makes it available in the global#session proxy object."""nr.proxy.push(session,Session())try:yieldexcept:session.rollback()raiseelse:session.commit()finally:nr.proxy.pop(session)Copyright © 2020 Niklas Rosenstein