Saravanan666/pypi-org huggingface dataset:
Package: once-py
OnceThis library provides functionality to ensure a function is called exactly
once in Python, heavily inspired bystd::call_once.During initialization, we often want to ensure code is runexactly once.
But thinking about all the different ways this constraint can be violated can
be time-consuming and complex. We don't want to have to reason about what other
callers are doing and from which thread.Introducing a simple solution - theonce.oncedecorator! Simply decorate a
function with this decorator, and this library will handle all the edge cases
to ensure it is called exactly once! The first call will invoke the function,
and all subsequent calls will return the same result. Enough talking, let's
cut to an example:importonce@once.oncedefmy_expensive_object():load_expensive_resource()load_more_expensive_resources()returnObjectSingletonUsingLotsOfMemory()defcaller_one():my_expensive_object().use_it()defcaller_two_from_a_separate_thread():my_expensive_object().use_it()defoptional_init_function_to_prewarm():my_expensive_object()This module is extremely simple, with no external dependencies, and heavily
tested for races.
Package: oncodriveclust
OncodriveCLUST is a method aimed to identify genes whose mutations are biased towards a large spatial clustering. This method is designed to exploit the feature that mutations in cancer genes, especially oncogenes, often cluster in particular positions of the protein. We consider this as a sign that mutations in these regions change the function of these proteins in a manner that provides an adaptive advantage to cancer cells and consequently are positively selected during clonal evolution of tumours, and this property can thus be used to nominate novel candidate driver genes.The method does not assume that the baseline mutation probability is homogeneous across all gene positions but it creates a background model using silent mutations. Coding silent mutations are supposed to be under no positive selection and may reflect the baseline clustering of somatic mutations. Given recent evidences of non-random mutation processes along the genome, the assumption of homogenous mutation probabilities is likely an oversimplication introducing bias in the detection of meaningful events.
Package: oncoplot-extractor
OncoPlot ExtractorAboutOncoPlot Extractor provides python3.x library to read standard oncoplots also known as mutation matrix. This library allows you to export the data extracted as pandas.DataFrame so the data can be forth modified with toolkit offered by pandas. Two main modules that this package contains are OncoPlotExtractor and OncoPlotCreator.InstallationPlease install this library with python pip as$pip3-Uinstalloncoplot-extractorDocumentationYou can find extensive documentationhereUsageOncoPlot Extractorfromoncoplot_extractorimportOncoPlotExtractoroce=OncoplotExtractor(path="path/to/oncoplot.png",# path to oncoplot imagecorners=(0,0,100,100),# corners are optionalbackground_color=["#ffffff"]# you can also use oce.get_background_from_pixel())oce.extract()oce.export_to_excel("path/to/oncoplot.xlsx")OncoPlot Creatorimportpandasaspdfromoncoplot_extractorimportOncoPlotCreatordf=pd.DataFrame(my_data)opc=OncoPlotCreator(df=my_df,cell_size=60,workbook=wb,offset=10)opc.gen_base_oncoplot()opc.save(filename="my_oncoplot.xlsx")ContributionThis project is very amateur and I hope to help someone who might have ran into problem of getting one image or pdf as oncoplot and needing the actual data. If it helped you or have suggestions, please let me know.I would really appreciate your contributions and I will get to the PRs as soon as possible.
Package: oncourse-api
OnCourse-APIOnCourse-API is a python library meant to make getting data fromOnCourse Connecta simple taskInstallationUse the package managerpipto install foobar.pipinstalloncourse-apiUsagefromoncourse_apiimportOnCourseaccount=OnCourse("Username","Password")student=account.active_profile.studentprint(student)# Prints Student Nameassignments=student.assignments# Returns list of assignments# I love typehinting so your IDE should display options for everythingContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Please make sure to update tests as appropriate.LicenseMIT
Package: oncvideo
ONCvideoA collection of commands to help get archived videos from Oceans 3.Avaiable commands include:list - List video files for a specific camera between two datesblist - List video files based on parameters stored in a csv filegetDives - Create a csv file listing dives from Oceans3.0info - Extract video information (duration, resolution, fps)didson - Extract information of DIDSON filesdownload - Download video filestomp4 - Convert video to mp4 formatextframe - Extract frames from video filesextfov - Extract FOVs (frames or videos) from video filesdownloadTS - Download time series datamergeTS - Merge time series data based on the closest timestampsdownloadST - Download video from Seatube linklinkST - Generate link video from SeatuberenameST - Rename framegrabs from Seatube to correct timestampInstallationpip install git+https://github.com/correapvf/oncvideoFFmpeg must be installed and accessible via the$PATHenvironment variable.DocsDocumentation for functions in the package is avaiable athttps://correapvf.github.io/oncvideo.
After installation, useoncvideo -hto get help and a list of available commands avaiable as well.See alsotestsfolder for exemples of.csvfiles that can be used with theblist/list_file_batchcommand/function.
Package: ondamonitor
OM (OnDA Monitor) is a software framework for the development of
programs that can monitor of x-ray imaging experiments in real-time.It is the spiritual successor of the OnDA project and it is mantained mostly
by the same team of developers.OM provides users with a set of stable and efficient real-time monitors for
the most common types of x-ray imaging experiments. These can be used
immediately without modifications or can be easily adapted to meet the users’
requirements. In addition, the project provides a set of modules that can be
used to easily develop other monitoring programs tailored to the
characteristics of specific experiments.OM can process imaging data in the broadest sense: multidimensional and
multiple-pixel data (for example, a diffraction pattern or a photoemission
spectrum, but also an image coming from a camera or a microscope), but also
any kind of digital output from an instrument or sensor (for example, a
temperature readout, beam and pulse energies, etc.).OM focuses on scalability and portability, in order to facilitate its
adoption for a wide array of current and future instruments. It also strives
for stability and performance. In order to achieve these goals, OM
uses free and open-source libraries and protocols.OM is written in Python. The use of the Python programming language, which
is particularly suited to prototyping and rapid development, makes OM easy
to modify and to adapt to the requirements of specific experiments.OM also aims to keep the code base simple and as small as possible. The
focus is on providing a core set of functions, while allowing the framework to
be expanded with external software when possible, avoiding the need to
reimplement already optimized algorithms.
Package: onde
# OndeOnde ('OWN-jee') is a simple Python tool for naming and referencing file and directory paths meaningfully.## UsageInstall Onde with pip:`pip install onde`To use Onde, create a YAML file named `paths.yml` in the root directory of your project that maps important files and directories to convenient aliases that you can use to refer to those files.**paths.yml**```yaml- some_alias:- "/some_absolute_path/some_file.txt"- another_alias:- "some_relative_path/another_file.txt"- A third alias:- "~/some_folder/a_file.txt"```You then use Onde by instantiating it and calling `paths`:```python>>> from onde import Onde>>> onde = Onde()>>> onde.path('some_alias')'/some_absolute_path/some_file.txt'>>> onde.path('another_alias')'some_relative_path/another_file.txt'>>> onde.path('A third alias')'/Users/myusername/some_folder/a_file.txt'```Paths can include variables, which are wrapped in curly braces. When calling `paths()` you can fill in the variables:**paths.yml**```yaml- my_alias:- path:- "/{my_directory}/{my_file}.txt"``````python>>> from onde import Onde>>> Onde().path('my_alias', 'hey_there', my_file='hows_it_going')'/hey_there/hows_it_going.txt'```Directories can be nested, to make it easy to refer to represent multiple significant locations within a file system:**paths.yml**```yaml- top_level:- "some/folder"- thing1:- "path/to/child_1"- thing2:- "path/to/child_2"- deeply_embedded_thing:- "deeply/embedded/thing.txt"``````python>>> from onde import Onde>>> onde = Onde()>>> onde.path('top_level')'some/folder'>>> onde.path('thing1')'some/folder/path/to/child1'>>> onde.path('thing2')'some/folder/path/to/child2'>>> onde.path('deeply_embedded_thing')'some/folder/path/to/child2/deeply/embedded/thing.txt'```Aliases must be unique within the paths YAML file. Attempting to import a YAML file with duplicate aliases will raise an exception.Path variables must also be unique for each path.A well-formed Onde paths file should be in the format:```yaml- alias:- 'path_segment'- child_alias:- 'path_segment'- child_alias:- 'path_segment'```Each mapping has a single alias as its key and a list as the value of that key. The first item in the list is a## ContributingPull requests are welcome!To install: `python setup.py install`To run tests: `python setup.py test`## LicenseOnde is written by Aaron Knight <iamaaronknight@gmail.com>.  It is releasedunder the MIT license. See the LICENSE.txt file for more details.
Package: ondelta
A django model mixin that makes it easy to react to field value
changes on models. Supports an API similar to the model clean method.Quick StartGiven that I have the modelclass MyModel(models.Model):mai_field = models.CharField()
other_field = models.BooleanField()And I want to be notified when mai_field’s value is changed and
persisted I would simply need to modify my model to include aondelta_mai_fieldmethod.from ondelta.models import OnDeltaMixinclass MyModel(OnDeltaMixin):mai_field = models.CharField()
other_field = models.BooleanField()def ondelta_mai_field(self, old_value, new_value):print(“mai field had the value of {}”.format(old_value))
print(“but after we called save it had the value of {}”.format(new_value))This is the easiest method to watch a single field for changes, but
what if we want to perform an action that has an aggregate view
of all of the fields that were changed?OnDeltaMixinprovides anondelta_allmethod for these cases; it is only called once for
each save.from ondelta.models import OnDeltaMixinclass MyModel(OnDeltaMixin):mai_field = models.CharField()
other_field = models.BooleanField()ondelta_all(self, fields_changed):if ‘mai_field’ in fields_changed and ‘other_field’ in fields_changed:print(“Both fields changed during this save!”)Unsupported Field TypesSome field types are not supported:ManyToManyField, reverseManyToManyField,
reverseForeignKey, and reverseOneToOneFieldrelations.  If you create anondelta_field_namemethod for one of these fields, it willnotbe called when
that field is changed.HelpI like to help people as much as possible who are using my libraries,
the easiest way to get my attention is to tweet @adamhaney or open an
issue. As long as I’m able I’ll help with any issues you have.
Package: ondemand
Python client for Barchart OnDemandGet access to market data and the OnDemand APIs in just a few lines of code.InstallationFrom pypipip install ondemandFrom Sourcepython setup.py installUsageimportondemandod=ondemand.OnDemandClient(api_key='CHANGE_ME')# or if you are using a free sandbox APIod=ondemand.OnDemandClient(api_key='CHANGE_ME',end_point='https://marketdata.websol.barchart.com/')# if you want data in a format other than json. xml also supportedod=ondemand.OnDemandClient(api_key='CHANGE_ME',format='csv')# get quote data for Apple and Microsoftquotes=od.quote('AAPL,MSFT')['results']forqinquotes:print('Symbol:%s, Last Price:%s'%(q['symbol'],q['lastPrice']))# get 1 minutes bars for Appleresp=od.history('AAPL','minutes',maxRecords=50,interval=1)# generic request by API nameresp=od.get('getQuote',symbols='AAPL,EXC',fields='bid,ask')# or, get the cryptoresp=od.crypto('^BTCUSD,^LTCUSD')Interactive Python Notebook Examplehttps://colab.research.google.com/drive/1D8389Q8qQzbppqFxwpUOobheZ2jb3Gp4Version1.0 - 7/27/2017 -- init
Package: ondevice
This is the official ondevice.io client.ondeviceallows you to connect to all your devices from pretty much anywhere.InstallationYou can install the client via python’spipcommand:sudo pip3 install ondeviceImportant:At the time of this writingondevice connectdoesn’t fully work in python2, so make sure you installondevicein python3 (e.g. using thepip3command (or similar).Also make sure to install it as root.After that you should be able to use it (note that you need an account onhttps://ondevice.io/though).$ ondevice help
USAGE: ondevice <command> [args]

- Device commands:
    daemon
        Run the ondevice daemon
    service [add/rm] [args...]
        Manages services

- Client commands:
    connect <module> <dev> [svcName]
        Connects to a service on the specified device (shorthand: `:<module>`)
    dev <devName> props/set/rm [args]
        Fetch/Manage a device's information
    list
        Displays detailed information on your devices

- Other commands:
    help [cmd]
        lists available commands or prints detailed help for one
    module
        Lists installed modules
    setup
        Set up the API keys for communicating with the ondevice.io serviceKey setupAfter you’ve set up your ondevice.io account, you have to set up your API keys:$ ondevice setup
User: ondevUser
API key: **********
INFO:root:Updated client key (user: 'ondevUser')After that you’re good to goRunning the device daemonsimply runondevice daemonList your devices (on the client)$ ondevice list|head
ID                   State      IP              Version    Name
ondevUser.abcdefg    offline    127.0.0.1       0.1dev11   Raspberry Pi
ondevUser.foobar123  online     10.0.0.2        0.1dev11   Home router
...Connect to a device$ ondevice ssh manuel@ondevUser.abcdefghi
manuel@ondevice:ondevUser.abcdefghi's password:
Linux raspberrypi 3.10.33+ #654 PREEMPT Fri Mar 7 16:32:08 GMT 2014 armv6l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Jul 25 17:08:43 2016 from localhost
manuel@raspberrypi ~ $Device propertiesFor automation purposes, you can set custom properties for your devices.$ ondevice device abcdefghi set foo=bar abc=123
abc=123
foo=bar

$ ondevice device abcdefghi rm abc
foo=bar

$ ondevice device abcdefghi props
foo=bar

$ ondevice device abcdefghi set hello=world
hello=world
foo=barEach invocation returns the resulting property list; You can query the list usingondevice device <devId> propsThere’s currently one special property::title: set the device’s description (will be shown online and inondevice list)Requirementspython (with pip; the full functionality is currently only available on Python 3,
but the device side should work on python2 as well)see requirements.txt for the actual list of python modules
Package: ondewo-bpi
Ondewo BpiIf you have a grpc config with at least the following:{
  "grpc_cert": "<GRPC-CERT-HERE>"
}locally with the name 'config.json', you should be able to run the docker-compose files after building the image. Look in the makefile.The BPI (Business Process Integration) ModuleThis module sits between the user and CAI:_______           _______
  ___          |       |         |       |
  NLU ==grpc==>|  BPI  |==grpc==>|  CAI  |
 |___|<==grpc==|       |<==grpc==|       |
               |_______|         |_______|and has full access to the outgoing requests and the returning response. It also knows the location of CAI and has authorization, meaning it can edit the state of CAI directly with additional information.A simple example of a server using the BPI looks like this:importloggingfromondewo.nluimportsession_pb2fromondewo_bpi.bpi_serverimportBpiServerimportondewo_bpi.helpersashelpersclassMyServer(BpiServer):def__init__(self)->None:super().__init__()# initialize the server (parent class)self.register_handlers()# add handlerss for intentsdefregister_handlers(self)->None:# the mapping from handled intents to functionsself.register_handler(intent_name='i.my_handled_intent',# a user-created intenthandler=self.reformat_text_in_intent,# the function to handle it)self.register_handler(intent_name='Default Fallback Intent',# a default (system created) intenthandler=self.handle_default_fallback,# the function to handle it)defreformat_text_in_intent(# the handler functions take responses in an out, and can process parts of the responseself,response:session_pb2.DetectIntentResponse)->session_pb2.DetectIntentResponse:returnhelpers.replace_text_in_response(search="<REPLACE:REPLACE_THIS_TEXT>",# this entire pseudo-command would go in a text response for examplereplace="new text",response=response)defhandle_default_fallback(# the handler functions can also just trigger events and leave the response unchangedself,response:session_pb2.DetectIntentResponse)->session_pb2.DetectIntentResponse:logging.warning("Default fallback was triggered!")returnresponseThere is a more complete example in ondewo_bpi/example/example.py which is hooked up to run via the Dockerfile (just dodocker-compose up -d && docker-compose logs -f).Have a look at the docker-compose file, and the sample.env. The port that the bpi listens on functionally replaces the cai port, so at the frontend you just have to point to a different port to use the bpi, there is no other difference. And the cai port will still be available as well, so switching between using CAI directly and using the BPI is just a matter of changing a single variable, the port.CAIBPIHOST=localhost:50055HOST=localhost:50051BPI QAThere is also an example server for integrating both CAI and the QA. It sends requests to both servers and returns the response that is most accurate.BPI SIPThere is an example for integration with ONDEWO-VTSI (Voice Telephone System Integration), however the sip client submodule is not publicly available. Please request access to it to build telephone-system compantible BPI servers.
Package: ondewo-client-utils
Ondewo Client Utils LibraryThis library contains base classes and utilities for higher-level interface clients interacting with gRPC servers.Python InstallationYou can install the library by installing it directly from the pypi:pipinstallondewo-client-utilsOr, you could clone it and install the requirements:gitclonegit@github.com:ondewo/ondewo-client-utils-python.gitcdondewo-client-utils-python
pipinstall-e.
Package: ondewo-survey-client
Ondewo Survey Client LibraryThis library facilitates the interaction between a user and his/her Survey server. It achieves this by providing a higher-level interface mediator.This higher-level interface mediator is structured around a series of python files genereted from protobuff files. These protobuf files specify the details of the interface, and can be used to generate code in 10+ high-level languages. They are found in theapis submodulealong with the older Google protobufs from Dialogueflow that were used at the start.Python InstallationYou can install the library by installing it directly from the pypi:pipinstallondewo-survey-clientOr, you could clone it and install the requirements:gitclonegit@github.com:ondewo/ondewo-survey-client-python.gitcdondewo-survey-client-python
pipinstall-e.Let's Get Started! (WIP)Import your programming interface:lsondewoGet a suitable example:lsexamplesAutomatic Release ProcessThe entire process is automated to make development easier. The actual steps are simple:TODOs in Pull Request before the release:Update the Version number inside the Makefile! : Major and Minor Version Number must be the same for Client and API at all timesexample: API 2.9.0 --> Client 2.9.XCheck if RELEASE.md is up-to-dateUpdate the Version number inside the setup.py by using:makeupdate_setupTODOs after Pull Request was merged in:Checkout master:gitcheckoutmasterPull the new stuff:gitpullRelease:makeondewo_releaseThemake ondewo_releasecommand can be divided into 5 steps:cloning the devops-accounts repository and extracting the credentialscreating and pushing the release branchcreating and pushing the release tagcreating the GitHub releasecreating and pushing the new PyPi releaseThe variables for the GitHub Access Token, PyPi Username and Password are all inside
of the Makefile, but the values are overwritten duringmake ondewo_release, because
they are passed from the devops-accounts repo as arguments to the actualreleasecommand.
Package: ondilo
Ondilo ICOA simple client used to access Ondilo ICO APIs.Implemented to be used in Home Assistant, but can be used anywhere else.InstallTo install ondilo, run:pip install ondiloExample usageOndilo is using the Authorization Code Grant flow, so each user must be individually authenticated.Theclient_idandclient_secretare always the same, there is no need to create a specific app on Ondilo side. So they are hard coded. However, if needed, they can also be passed during initialization.A very basic implementation could look like:from ondilo import Ondilo

client = Ondilo(redirect_uri="https://example.com/api")
print('Please go here and authorize,', client.get_authurl())

redirect_response = input('Paste the full redirect URL here:')
client.request_token(authorization_response=redirect_response)

print("Found all those pools: ", client.get_pools())If the Oauth2 flow is handled externally and a token is already available, one can also use the package this way:from ondilo import Ondilo

client = Ondilo(token)
print("Found all those pools: ", client.get_pools())Available APIsMore information about the returned objects can be found here:https://interop.ondilo.com/docs/api/customer/v1/get_pools: Get list of available pools / spaget_ICO_details: Get details of a pool/spaget_last_pool_measures: Get the last measures from an ICOget_pool_recommendations: Get the list of recommendations from an ICOvalidate_pool_recommendation: Acknowledge a recommendationget_user_units: Get user unitsget_user_info: Get user infosget_pool_config: Get pool/spa ranges for temperature, pH, ORP, salt and TDSget_pool_shares: Get list of users with whom the pool/spa is sharedget_pool_histo: Get measurements historical data
Package: on-done
An IPython/Jupyter cell magic to execute code after a cell succeeds or fails so you can receive an alert when your code terminates.Installation$pipinstallon-doneExampleStart by launching an IPython session:$ipythonThen, load the extension:In[1]:%load_exton_doneNext, define a function to alert you that your code has terminated.In[2]:defalert():...:fromdatetimeimportdatetime...:print(f"Cell terminated at{str(datetime.now())}\n")You can change this function to send yourself an email, Slack alert, etc.Putting%%on_done alert()at the top of a cell will cause it to alert:In[3]:%%on_donealert()...:importnumpyasnp...:x=np.random.randn(10**8)...:print(f"mean={x.mean()}")mean=0.00021783589122321365Cellterminatedat2022-11-2100:35:40.678180In particular, the alert will also occur if the cell failed:In[4]:%%on_donealert()...:importnumpyasnp...:x=np.random.randn(10**8)...:print(f"mean={x.mean(axis=1)}")Cellterminatedat2022-11-2100:35:50.654766---------------------------------------------------------------------------AxisErrorTraceback(mostrecentcalllast)...Crediton-done is inspired bythis Stack Overflow answerbyColin Carroll