Saravanan666/pypi-org huggingface dataset:
Package: microcosm-sagemaker
microcosm-sagemakerOpinionated machine learning with SageMakerUsageFor best practices, seecookiecutter-microcosm-sagemaker.ProfilingMake surepyinstrumentis installed, either usingpip install pyinstrumentor by installingmicrocosm-sagemakerwithprofilingextra dependencies:pip install -e '.[profiling]'To enable profiling of the app, use the--profileflag withrunserver:runserver --profileThe service will log that it is in profiling mode and announce the directory to which it is exporting. Each call to the endpoint will be profiled and its results with be stored in a time-tagged html file in the profiling directory.Experiment TrackingTo useWeights and Biases, installmicrocosm-sagemakerwithwandbextra depdency:pip install -e '.[wandb]'To enable experiment tracking in an ML repository:Choose the experiment tracking stores for your ML model. Currently, we only supportwandb. To do so, addwandbtograph.use()inapp_hooks/train/app.pyandapp_hooks/evaluate/app.py.Add the API key forwandbto the environment variables injected by Circle CI into the docker instance, by visitinghttps://circleci.com/gh/globality-corp/<MODEL-NAME>/edit#env-varsand addingWANDB_API_KEYas an environment variable.Microcosm-sagemakerautomatically adds the config for the active bundle and its dependents to thewandb's run config.To report a static metric:class MyClassifier(Bundle):
    ...

    def fit(self, input_data):
        ...
        self.experiment_metrics.log_static(<metric_name>=<metric_value>)To report a time-series metric:class MyClassifier(Bundle):
    ...

    def fit(self, input_data):
        ...
        self.experiment_metrics.log_timeseries(
            <metric_name>=<metric_value>,
            step=<step_number>
        )Note that thestepkeyword argument must be provided for logging time-series.Artifact TestsIf you want to report your artifact tests to wandb, add the following line to the top of yourconftest.py.
For more information on using plugins in pytest, seehere.pytest_plugins = 'pytest_sagemaker'It should be generated byglobality-build, but in case it is not, also make sure to run artifact
tests with--capture=tee-sys. This will allow to both capture and show stdout.ReproducibilityAs recommendedhere, we seed Python,
Numpy and Pytorch random number generators and force Pytorch operations to be deterministic. Seemicrocosm-sagemaker/random.pyfor details.Distributed trainingTo support "distributed" trainin - with multiple processes (like pytorchDistributedDataParallel),
we detect if the current process is a "worker process" (non-master member of a process group).
Worker processes are prevented from communicating with the outside world - writing logs and
saving artifacts.
Package: microcosm-sqlite
microcosm-sqliteOpinionated data loading with SQLite.While most distributed application runtimes will use a networked data store for mutable state,
the usage patterns of data that is read-only at runtime are great fit for SQLite.In particular,microcosm-sqliteassumes that applications willBuild data sets in advance and ship them as static artifacts (e.g. in source control)Load data immutable sets at runtime without loading entire data sets into memoryWriting ModelsPersistent data is expected to use SQLAlchemy's declarative base classes. Because different data sets
may be shipped in different SQLite databases, each declarative base class needs to have auniquename and a separate engine configuration, which is achieved by addingDataSetas the base of the
declarative base class:Base = DataSet.create("some_name")


class SomeModel(Base):
    __tablename__ = "sometable"

    id = Column(Integer, primary_key=True)Using StoresBasic persistence operations are abstracted through a store:class SomeStore(Store):

    @property
    def model_class(self):
        return SomeModel


 store = SomeStore()
 results = store.search()Configuring SQLiteEachDataSetdefaults to using:memory:storage, but can be customized in two ways:TheSQLiteBindFactorycan be configured with custom paths:loader = load_from_dict(
    sqlite=dict(
        paths={
            "some_name": "/path/to/database",
        },
    ),
)
graph = create_object_graph("example", loader=loader)Themicrocosm.sqliteentrypoint can contain a mapping from a data set name to a
function that returns a path.
Package: microcsound
microcsoundTO INSTALL:Make sure you have Python and Csound installedChoose as install method,piporgit(pip is recommended if you have it)From pip:pip install microcsoundFrom git:Either download from the 'dist' directory here, or:git clone https://github.com/akjmicro/microcsoundOnce downloaded, in the 'microcsound' directory:python -m pip install .Files will be installed into a Python lib directory on your system. E.G.,
on a Linux system, something like/usr/local/lib/Python3.11Copy.microcsound.tomlto your home user directory, edit the values to your preferencesABOUT:Microcsound implements the following features:an intuitive, clean shorthand syntax that allows one to both easily write
CSound scoresa focus on flexible entry of microtonal music, the emphasis being on
enabling one to compose in various equal-temperaments and just
intonation.symbols for various microtonal commas, so that extended just
intonation harmony is easily accessible in a convenient intuitive way.implementation of chord notation using bracketsimplementation of a 'time pointer' notation which allows arbitrary
number of counterpoint layers in a single 'voice'See the example 'ciconia.mc' (a rendering of a medieval piece, given in the
repo pathmicrocsound/share/data/ciconia.mc) and the tutorials/docs for an
understanding of how to use the syntax for your own compositions.To use:It's best to start by seeing all the command-line options, so first, try:$ microcsound -hAfter writing a little example in a file you might name 'yourfile.mc', try
this:$ microcsound yourfile.mcThe script outputs a wave file to the current directory, by default the wave
is called 'microcsound_out.wav', but you can change this using the '-o'
command line switch. If you use the '-s', it will avoid the
final step of compiling the orc/score pair and just put a csound score to
standard out. To put this output into a file, use redirection like so:$ microcsound -s yourfile.mc > yourcsoundscore.scoYou could also use an editor like 'joe' or 'emacs' that allows the
capture of the text output of a process, and call the script from
within the editing session of a .csd (orc+sco) file; in this way one
can be between the  and  tags and fill the space
with the script output.For realtime experimentation, just call the script with the name of a
csound '.orc' file, you can edit the variables at the top of the script
so that it automatically looks for orchestra files in a default directory.For instance:$ microcsound -i --orc fat_moog.orcwill give you a prompt, and you can type in a microcsound 'score', and when
you want it rendered, hit return and type 'done' and then hit return again.
In this example above, it will search in the directory I provided in the
script for the 'fat_moog.orc' file.See the csound documentation for how to use all the options and
command line switches to get the final audio output from csound.
The csound command called by the script can be changed at the top
of the script in the "user variables" area.Enjoy!Aaron Krister JohnsonPlease report bugs and successes toaaron@untwelve.org
Package: microdaq
MicrodaqThis package allows users to use data acquisition under MicroDAQ hardware
with Python2.7 and Python 3. It provides an interface between the MLink driver
and Python application. The package works with Windows x86/x64, Linux x86/x64, MacOS x64
and EABI ARM machines.Installationpip install microdaqIf already installed, upgrading could be done bypip install microdaq --upgradeExamplesSample programs are located inexamplesdirectory. In order to run them,
connect MicroDAQ device to your computer and run chosen script without any
additional steps. For example:python exmaples/ai-demo.pyScripts from'examples/complex'require additional packages to work.They could be installed viapip install -r requirements/examples.txtcommand.LED control exampleTurn on and turn off LED 1.import time
import microdaq

mdaq = microdaq.Device(ip='10.10.1.1')
mdaq.led_write(led=1, state=True)
time.sleep(1.0)
mdaq.led_write(led=1, state=False)Analog inputRead analog input channels 1 and 2.import microdaq

mdaq = microdaq.Device(ip='10.10.1.1')
data = mdaq.ai_read(channels=[1, 2], ai_range=[-10, 10])

for i, volt in enumerate(data):
    print('Channel[%d]: %f V' % (i, volt))Continuous data acquisitionRead analog input from channel 1, 100 kHz sampling period for a 0.1 second.
Expected 10 000 samples.import microdaq

mdaq = microdaq.Device("10.10.1.1")
mdaq.ai_scan_init(
    channels=[1], 
    ai_range=[-10, 10], 
    is_differential=[False], 
    rate=100000, 
    duration=0.1)

data = mdaq.ai_scan(
    scan_count=10000, 
    timeout=True)

for sample in data:
    print('%f V' % sample)Analog outputSet 1.0V and 2.0V to analog output channels 1 and 2 respectively.
Used range 0-5 volts.import microdaq

mdaq = microdaq.Device(ip='10.10.1.1')
mdaq.ao_write(
    channels=[1, 2],
    ao_range=microdaq.AORange.AO_5V_UNI,
    data=[1.0, 2.0])PWMGenerate PWM signal on two channels A and B (PWM module 1).import microdaq

mdaq = microdaq.Device(ip='10.10.1.1')
mdaq.pwm_init(module=1, period=1000)
mdaq.pwm_write(module=1, duty_a=25, duty_b=50)EncoderRead encoder position.import time
import microdaq

mdaq = microdaq.Device(ip='10.10.1.1')
mdaq.enc_init(module=1, init_value=0)

for i in range(30):
    time.sleep(0.1)
    enc = mdaq.enc_read(module=1)
    print('position: %d\tdir: %d' % (enc[0], enc[1]))DSP with Scilab XCOS modelLoad and run application generated by MicroDAQ Toolbox for Scilab.Toolbox available is here:https://atoms.scilab.org/toolboxes/microdaq/1.2.2Application overview:import os
import microdaq

mdaq = microdaq.Device(ip='10.10.1.1')

model = os.path.join("resources", "signal-model.out")
mdaq.dsp_init(dsp_application=model, rate=100, duration=-1)
mdaq.dsp_start()

print("DSP is running: %s" % mdaq.dsp_is_done())
mdaq.dsp_stop()
print("DSP is running: %s" % mdaq.dsp_is_done())TestsThis sections is meant to be for package's developers/contributors. Tests for API
layer which does not required connected MicroDAQ device could be triggered bypytest tests/test_api.py.Additional requirements needed:pip install -r requirements/tests.txtLicenseThe BSD license. For more information readLICENSE.mdfile.
Package: microdata-validator
⚠️ Deprecation Notice ⚠️This package has been deprecated. Please use themicrodata-toolspackage.microdata-validatorPython package for validating datasets in the microdata platform.Dataset descriptionA dataset as defined in microdata consists of one data file, and one metadata file.The data file is a csv file seperated by semicolons. A valid example would be:000000000000001;123;2020-01-01;2020-12-31;
000000000000002;123;2020-01-01;2020-12-31;
000000000000003;123;2020-01-01;2020-12-31;
000000000000004;123;2020-01-01;2020-12-31;Read more about the data format and columns inthe documentation.The metadata files should be in json format. The requirements for the metadata is best described through thejson schema,the examples, andthe documentation.Basic usageOnce you have your metadata and data files ready to go, they should be named and stored like this:my-input-directory/
    MY_DATASET_NAME/
        MY_DATASET_NAME.csv
        MY_DATASET_NAME.jsonNote that the filename only allows upper case letters A-Z, number 0-9 and underscores.Then use pip to install microdata-validator:pip install microdata-validatorImport microdata-validator in your script and validate your files:frommicrodata_validatorimportvalidatevalidation_errors=validate("MY_DATASET_NAME",input_directory="path/to/my-input-directory")ifnotvalidation_errors:print("My dataset is valid")else:print("Dataset is invalid :(")# You can print your errors like this:forerrorinvalidation_errors:print(error)For a more in-depth explanation of usage visitthe usage documentation.
Package: microday
MicrodayMicroday is a command line todo-list that lays out a schedule for your day
based on how much time you expect to spend on each todo-item.Todo-lists are stored in (and loaded from) a human-readable markdown format:# Todos

- Task1
- Task2Start the script and it will ask you how much time you want to spend on each item.$ How many minutes do you need for Task1? (enter=later) 10This creates a second list called 'Tasks' in your markdown file, which lays out
how much time you need for all your todos and when you will be done with the last
one. Starting times are always ending in 0 or 5, so you may have some rest time
in between tasks, which is just fine.# Tasks

12:30 - 0:10h Task1
12:40 - 0:05h Task2
12:45 FeierabendFeierabend is German for the end of a work day.SetupRequires Python 3 and pip.$ pip install microdayUsageStart microday from a shell withpython -m microday. It will then create a
markdown file with your todos in the current working directory.usage: microday.py [-h] [filename]

Meticulously plan your day minute-by-minute

positional arguments:
filename    Filename of your todo doc, default is 'todo_<y-m-d>.md'

optional arguments:
-h, --help  show this help message and exit
Package: microdot
microdot“The impossibly small web framework for Python and MicroPython”Microdot is a minimalistic Python web framework inspired by Flask. Given its
small size, it can run on systems with limited resources such as
microcontrollers. Both standard Python (CPython) and MicroPython are supported.frommicrodotimportMicrodotapp=Microdot()@app.route('/')asyncdefindex(request):return'Hello, world!'app.run()Migrating to Microdot 2Version 2 of Microdot incorporates feedback received from users of earlier
releases, and attempts to improve and correct some design decisions that have
proven to be problematic.For this reason most applications built for earlier versions will need to be
updated to work correctly with Microdot 2. TheMigration Guidedescribes the backwards incompatible changes that were made.ResourcesDocumentationStableLatestStill using version 1?CodeDocumentationChange Log
Package: microdotphat
https://shop.pimoroni.com/products/microdot-phatMicro Dot pHAT is an unashamedly old school LED matrix display board,
with up to 30x7 pixels, using the Lite-On LTP-305 matrices. Perfect for
building a retro scrolling message display or a tiny 30 band spectrum
analyser.InstallingFull install (recommended):We’ve created an easy installation script that will install all
pre-requisites and get your Micro Dot pHAT up and running with minimal
efforts. To run it, fire up Terminal which you’ll find in Menu ->
Accessories -> Terminal on your Raspberry Pi desktop, as illustrated
below:In the new terminal window type the command exactly as it appears below
(check for typos) and follow the on-screen instructions:curlhttps://get.pimoroni.com/microdotphat|bashAlternatively, on Raspbian, you can download thepimoroni-dashboardand install your product by browsing to the relevant entry:sudoapt-getinstallpimoroni(you will find the Dashboard under ‘Accessories’ too, in the Pi menu -
or just runpimoroni-dashboardat the command line)If you choose to download examples you’ll find them in/home/pi/Pimoroni/microdotphat/.Manual install:Library install for Python 3:on Raspbian:sudoapt-getinstallpython3-microdotphatother environments:sudopip3installmicrodotphatLibrary install for Python 2:on Raspbian:sudoapt-getinstallpython-microdotphatother environments:sudopip2installmicrodotphatDevelopment:If you want to contribute, or like living on the edge of your seat by
having the latest code, you should clone this repository,cdto the
library directory, and run:sudopython3setup.pyinstall(orsudo python setup.py installwhichever your primary Python
environment may be)In all cases you will have to enable the i2c bus.Documentation & SupportGuides and tutorials -https://learn.pimoroni.com/microdot-phatFunction reference -http://docs.pimoroni.com/microdotphat/GPIO Pinout -https://pinout.xyz/pinout/micro_dot_phatGet help -http://forums.pimoroni.com/c/supportUnofficial / Third-party librariesJava library by Jim Darby -https://github.com/hackerjimbo/PiJava0.2.2BugFix: Reset scroll X and Y to zero when cleared - The SequelSwitch to smbus2 for i2c back-endFeature: addis_connectedto check for presence of HAT0.2.1BugFix: Call setup within set_brightness, fixes #200.2.0BugFix: Defer setup to avoid import side effectsBugFix: Reset scroll X and Y to zero when clearedFeature: Added Japanese text support0.1.3Added __version__ string to moduleAdded degrees symbolAdded mirroring: flip display left to rightAdded DocStrings0.1.2Added set_decimal for toggling decimal placesReplaced clear_on_exit with set_clear_on_exit methodAdded support for 180 degree rotation0.1.1Added set_brightness0.1.0Vertical scrollingTweaks to write_string0.0.1Initial Release
Package: microdrill
SimpleApache Drillalternative usingPySparkinspired byPyDALSetupRun terminal commandpip install microdrillDependenciesPySpark was tested withSpark 1.6UsageDefining Query Parquet TableParquetTable(table_name, schema_index_file=file_name)table_name: Table referenced name.file_name: File name to search for table schema.Using Parquet DALParquetDAL(file_uri, sc)file_uri: It can be the path to files orhdfs://or any other locationsc: Spark Context (https://spark.apache.org/docs/1.6.0/api/python/pyspark.html#pyspark.SparkContext)Connecting in tablesparquet_conn = ParquetDAL(file_uri, sc)parquet_table = ParquetTable(table_name, schema_index_file=file_name)parquet_conn.set_table(parquet_table)QueriesReturning Table Objectparquet_conn(table_name)Returning Field Objectparquet_conn(table_name)(field_name)Basic Queryparquet_conn.select(field_object, [field_object2,...]).where(field_object=value)parquet_conn.select(field_object1,field_object2).where(field_object1==value1&~field_object2==value2)parquet_conn.select(field_object1,field_object2).where(field_object1!=value1| field_object1.regexp(reg_exp))Grouping Byparquet_conn.groupby(field_object1, [field_object2,...])Ordering Byparquet_conn.orderby(field_object1, [field_object2,...])parquet_conn.orderby(~field_object)Limitingparquet_conn.limit(number)Executingdf = parquet_conn.execute()execute() returns aPySpark DataFrame.Returning Field Names From Schemaparquet_conn(table_name).schema()DevelopersInstall latest jdk and run in terminalmake setup
Package: micro-file-server
Table of ContentsDescriptionFeatures:DependenciesUsageScreenshotDescriptionThe micro autoindex and file hosting server with one Flask framework dependence.
HTTP server that allow to download and upload files.Features:Allow to transfer files between systems easily and safely.ftp-like designability to uplaod fileprotection from folder escaping and injectingsize calculationconfiguration with enironmental variablesoptional basic file type recognition: text, image, audio, videooptional ability to prevent downloading of small files to use browser as a text reader.DependenciesPython version >= 3.10Flask >= 2.3.2Lower version may work as well.Usageexport FLASK_RUN_HOST=0.0.0.0 FLASK_RUN_PORT=8080
export FLASK_BASE_DIR='/home/user'
python -m micro_file_server --host=0.0.0.0
# or
python micro_file_server/__main__.pyHere is defaults, that you can change:export FLASK_FILENAME_MAX_LENGTH=40
export FLASK_MIMETYPE_RECOGNITION=True
export FLASK_SMALL_TEXT_DO_NOT_DOWNLOAD=True
export FLASK_SMALL_TEXT_ENCODING="utf-8"
export FLASK_FLASK_UPLOADING_ENABLED=TrueBuilt-in web server is secure enough, but to execute withpip install gunicorngunicorn micro_file_server.__main__:appScreenshotKeywordsFilesharing, fileserver, httpserver, microhttp.
Package: microfilter
microfilterSome ad-hoc approaches to filtering noisy data that don't appear in textbooksUsage exampleTrain filter on simulated noisy datafrom microfilter.univariate.expnormdist import ExpNormDist
from microfilter.univariate.noisysim import sim_lagged_values_and_times

lagged_values, lagged_times = sim_lagged_values_and_times
dist = ExpNormDist()
dist.hyper_params['max_evals']=500
dist.fit(lagged_values=lagged_values, lagged_times=lagged_times)
pprint(dist.params) 
new_value = 17.0
dist.update(value=new_value, dt=1.0)
pprint(dist.state)Seehttps://github.com/microprediction/microfilter/blob/master/examples/plot_expnorm.py
Package: microformats
microformatsare the simplest way to openly publish contacts, events,
reviews, recipes, and other structured information on the web.>>> import mf
>>> url = "https://alice.example"
>>> doc = f'''
... <p class=h-card><a href={url}>Alice</a></p>
... <ul class=h-feed>
... <li class=h-entry>foo
... <li class=h-entry>bar
... </ul>
... '''
>>> page = mf.parse(doc=doc, url=url)

# TODO >>> dict(page)
# TODO >>> page.json

>>> card = page["items"][0]
>>> card["type"]
['h-card']
>>> card["properties"]
{'name': ['Alice'], 'url': ['https://alice.example']}
>>> feed = page["items"][1]
>>> feed["children"][0]["properties"]["name"]
['foo']

>>> mf.util.representative_card(page, url)
{'name': ['Alice'], 'url': ['https://alice.example']}
>>> mf.util.representative_feed(page, url)["items"][0]["name"]
['foo']

# TODO >>> page.representative_card
# TODO {'name': ['Alice'], 'url': ['https://alice.example']}
# TODO >>> page.representative_feed["items"][0]["name"]
# TODO ['foo']Based uponmf2util.
Package: microfpga
OverviewMicroFPGA is an FPGA-based platform for the electronic control of microscopes. It aims at using affordable FPGA to generate or read signals from a variety of devices, including cameras, lasers, servomotors, filter-wheels, etc. It can be controlled viaMicro-Manager, or itsJava,PythonandLabViewcommunication libraries, and comes with optional complementaryelectronics.Documentation and tutorials are available onhttps://mufpga.github.io/.ContentThis repository contains the Python package to control MicroFPGA. To usemicrofpgain you Python environment, you can install it directly withpip:pipinstallmicrofpgaAlternatively, you can install it from the source code:gitclonehttps://github.com/mufpga/MicroFPGA-pycdMicroFPGA-py
pipinstall-e.Finally, configure your Alchitry FPGA with the correctconfigurationand try some of theexample scripts.Cite usJoran Deschamps, Christian Kieser, Philipp Hoess, Takahiro Deguchi, Jonas Ries, "MicroFPGA: An affordable FPGA platform for microscope control",
HardwareX 2023 (13): e00407, doi:10.1016/j.ohx.2023.e00407.MicroFPGA-py was written by Joran Deschamps, EMBL (2020).PyPi page