Saravanan666/pypi-org huggingface dataset:
Package: smartalloc
SMarTallocA collection of utility functions for using Microsoft's Z3 theorem prover to
find the maximal allocation of limited resources given a prioritized list of
discrete tasks to be executed.Resources and Taskssmartallocis designed to be as thin of a wrapper around the Z3 library as
possible, so it does not define classes called "Resource" or "Task."Instead, Z3 primitives, such as Int or Real, are considered the resources, and
tasks that they are allocated for are represented by (collections of) Z3
constraints.AllocationThe main workhorse ofsmartallocis theallocate()function.  It takes
two arguments: the intrinsic constraints on the resources, and a list of the
constraints required for each task.Intrinsic resource constraints are applied immediately, and if the system
already has no solution then an exception will be raised.  After this, the
constraints for each task are added to the system.  If the system is still
satisfiable then the task is considered "worked" and the next task will be
added.  If the system is not satisfiable, that task will be removed from the
system before moving to the next.  All tasks provided will be attempted to be
added to the system; the ordering of the tasks determines which tasks get to
claim their necessary resources first.Theallocate()function returns a tuple of two items.  The first is the
allocation description object (in the form of a Z3 model).  The value of a
resource variable can be retrieved from it by using it like a dictionary with
the resource variable as the key.  The second is a list of the indices of the
tasks from the input are "worked" in the allocation result.
Package: smart-alpha-connect
Smart Alpha Connect APIInstallationRun the following command to install :pipinstallsmart-alpha-connectUsagefromSmartAlphaConnectimportcreate_session# Create a session using your clientID and smarttraderkeysession_data=create_session(clientID,smarttraderkey)ifsession_dataisnotNone:print(session_data)# Get the access token from the response received through create_session in session_dataaccess_token=session_data.get("accesstoken")# Import all the other functionalitiesfromSmartAlphaConnectimportget_funds,get_orderbook,place_order,get_tradebook# Get the funds datafunds_data=get_funds(clientID,access_token)iffunds_dataisnotNone:print(funds_data)# Get the orderbook dataorderbook_data=get_orderbook(clientID,access_token)iforderbook_dataisnotNone:print(orderbook_data)# Place an orderplaceorder_data=place_order(access_token,exchange,token,action,producttype,quantity,price,clientID,orderidentifier)ifplaceorder_dataisnotNone:print(placeorder_data)# Get the tradebook datatradebook_data=get_tradebook(clientID,access_token)iftradebook_dataisnotNone:print(tradebook_data)
Package: smartanthill
SmartAnthillis an open IoT system which allows easy control over multiple
microcontroller-powered devices, creating a home- or office-wide heterogeneous
network out of these devices.SmartAnthill system can be pretty much anything: from a system to control
railway network model to an office-wide heating control and security system.
As an open system, SmartAnthill can integrate together a wide range of devices
beginning from embedded development boards and ending with off-the-shelf
sensors and actuators. They can be connected via very different communication
means - from wired (currently Serial, with CAN bus and Ethernet planned soon)
to wireless (currently IEEE 802.15.4, with low-cost RF, Bluetooth Smart,
ZigBee and WiFi planned soon).All SmartAnthill devices within a system are controlled from the one place
(such as PC or credit-card sized computer Raspberry Pi, BeagleBoard or
CubieBoard), with an optional access via Internet.DocumentationSpecificationOverall ArchitectureCore ArchitectureProtocolsYocto VMReference ImplementationMCU Software Architecture
Package: smartanthill-zc
Zepto VM is a minimalistic virtual machine used by SmartAnthill Devices. It implements SACCP (SmartAnthill Command&Control Protocol) on the side of the SmartAnthill Device (and SACCP corresponds to Layer 7 of OSI/ISO network model). By design, Zepto VM is intended to run on devices with extremely limited resources (as little as 512 bytes of RAM).Zepto VMZepto Programming Patterns
Package: smartapp-sdk
SmartApp SDKsmartapp-sdk is a Python library to build awebhook-based SmartAppfor theSmartThings platform.The SDK is intended to be easy to use no matter how you choose to structure your code, whether that's a traditional Python webapp (such as FastAPI on Uvicorn) or a serverless application (such as AWS Lambda).The SDK handles all the mechanics of thewebhook lifecycle interfaceon your behalf.  You just implement a single endpoint to accept the SmartApp webhook requests, and a single callback class where you define specialized behavior for the webhook events.  A cleanattrsobject interface is exposed for use by your callback.SDK documentation is found atsmartapp-sdk.readthedocs.io.  Look there for installation instructions, the class model documentation, and example code. Thesmartapp-sensortrackrepo on GitHub is also a good example of how to use this SDK to build a traditional Python webapp.
Package: smart-arabidopsis-traits
Speedy Measurement of Arabidopsis Rosette Traits (SMART)Author: Suxing LiuRobust and parameter-free plant image segmentation and trait extraction.Process with plant image top view, including whole tray plant image, this tool will segment it into individual images.Robust segmentation based on parameter-free color clustering method.Extract individual plant gemetrical traits, and write output into excel file.RequirementsEitherDockerorSingularityis required to run this project in a Unix environment.UsageDockerdockerpullcomputationalplantscience/smart
dockerrun-v"$(pwd)":/opt/arabidopsis-rosette-analysis-w/opt/arabidopsis-rosette-analysiscomputationalplantscience/arabidopsis-rosette-analysispython3/opt/arabidopsis-rosette-analysis/trait_extract_parallel.py-iinput-ooutput-ft"jpg,png"Singularitysingularityexecdocker://computationalplantscience/arabidopsis-rosette-analysispython3trait_extract_parallel.py-iinput-ooutput-ft"jpg,png"ContentsRequirementsUsageRequirementsThe easiest way to run this project is withDockerorSingularity.To pull thecomputationalplantscience/smartimage, the current working directory, and open a shell with Docker:docker run -it -v $(pwd):/opt/dev -w /opt/dev computationalplantscience/smart bashSingularity users:singularity shell docker://computationalplantscience/smartUsageSegmentationTo perform color segmentation:python3 /opt/smart/core/color_seg.py -p /path/to/input/file -r /path/to/output/folderYou can also pass a folder path (-p /path/to/dir). By default anyJPGandPNGare included. You can choose filetype explicitly with e.g.-ft jpg.To extract traits:python3 /opt/smart/core/trait_extract_parallel_ori.py -p /path/to/input/file -r /path/to/output/folderYou can also use a folder path as above, likewise for filetype specification.By default this script will not perform leaf segmentation and analysis. To enable leaf analysis, use the-lflag.To indicate that your input is a multiple-tray or -individual photo, add the-mflag.
Package: smart-assertions
smart-assertionsSoft assertions for PythonInstallationpipinstallsmart-assertionsUsageAssertion is performed immediately after the callsoft_assert(),
but the expected result is obtained only after the callverify_expectations()Quick example:fromsmart_assertionsimportsoft_assert,verify_expectationsdeftest_something():soft_assert(1==1)soft_assert(2>1,'Message if test failed')soft_assert('one'!='two','Some message')verify_expectations()You can use asserts in loop:fromsmart_assertionsimportsoft_assert,verify_expectationsdeftest_asserts_in_loop():fornumberinrange(1,10):soft_assert(number%2==0,'{}is not a multiple of 2'.format(number))verify_expectations()Also you can use it with pytest parametrized tests:importpytestfromsmart_assertionsimportsoft_assert,verify_expectations@pytest.mark.parametrize("number",list(range(1,10)))deftest_pytest_example(number):soft_assert(number%2==0)verify_expectations()Example of output:AssertionError:Failedconditionscount:[4]1.Exception:CustommessageiftestfailedFailin"/Users/nromanov/Documents/smart-assertions/unittest_example.py:28"test_mixed()2.Exception:ListsnotequalsFailin"/Users/nromanov/Documents/smart-assertions/unittest_example.py:30"test_mixed()3.Exception:Yourcustommessage;4<5!Failin"/Users/nromanov/Documents/smart-assertions/unittest_example.py:32"test_mixed()4.Exception:one!=twoFailin"/Users/nromanov/Documents/smart-assertions/unittest_example.py:34"test_mixed()More examples you can find inunittest_example.py
Package: smartbear-tunnel-python
Smartbear SecureTunnel PythonA Python package for automating the Smartbear SecureTunnelInstallationpip install smartbear-tunnel-pythonAPISmartbearTunnel constructor:SmartbearTunnel()(type: SmartbearTunnel): returns an instance of the SmartbearTunnel class
Arguments:username (type: str) (optional): the email address/username you use to authenticate with Smartbear products, see authentication for detailsauthkey (type: str) (optional): the authkey/api key you use to authenticate with Smartbear products, see authentication for detailsoptions (optional): dictionary of options to use when running the tunnel, supported options:name(type: str): for naming your tunnel, this enables you to run multiple tunnels in paralleldirectory(type: str): path to files that should be statically hosted by the tunnelproxyIp(type: str): the ip/host of a proxy server to use with the tunnelproxyPort(type: int): the port of a proxy server to use with the tunnelbypass(type: bool): whether to bypass the tunnel for public traffic - defaults to True, may speed up traffic when usedverbose(type: bool): for debugging the tunnel client, enables verbose logging to stdoutSmartbearTunnel Attributes:SmartbearTunnel.tunnel_id(type: str): the tunnel ID corresponding with your active tunnelSmartbearTunnel.tunnel_type(type: str): the type of tunnel generated by the clientSmartbearTunnel methods:SmartbearTunnel.run(): starts an active tunnel, must be called to startSmartbearTunnel.is_active()(type: bool): queries whether the current tunnel is still activeSmartbearTunnel.stop(): stops the active tunnelAuthorizationYou can authenticate by passing your username and authorization key when creating the SmartbearTunnel:tunnel = SmartbearTunnel(username='myusername', authkey='myauthkey')You can also use the environment variables:from bash...
export SMARTBEAR_USERNAME=myusername
export SMARTBEAR_AUTHKEY=myauthkey
python test.py

from test.py...
tunnel = SmartbearTunnel()This package currently only works for CrossBrowserTesting but will work for Bitbar in the future.TestingSMARTBEAR_USERNAME=<TESTING_USERNAME> SMARTBEAR_AUTHKEY=<TESTING_AUTHKEY> python -m unittest tests/test_smartbear_tunnel.py
Package: smartblinds-client
Python MySmartBlinds Smart Bridge ClientThis is an unofficial client for theMySmartBlinds Smart Bridge. You
must have configured your blinds and bridge with the official iOS or Android app first in order to use this.USE AT YOUR OWN RISK.Usagefromsmartblinds_clientimportSmartBlindsClientclient=SmartBlindsClient("email","password")client.login()blinds,rooms=client.get_blinds_and_rooms()print(blinds)print(rooms)print(blinds[0].name)states=client.get_blinds_state(blinds)print(states[blinds[0].encoded_mac].position)client.set_blinds_position(blinds,100)
Package: smartboiler
SMART BOILERFrom dumb boiler smart with help of smart plug.Recursive link to the github repository:https://github.com/grinwi/smart_boiler.What's it all about?This project is my bachelor's thesis with one simple goal: make from dumb boiler a smart one with help of a smart plug and few sensors.
The smart part is, that the heating of the boiler is based on historic data of consumption from the boiler.
That provides, that boiler doesn't have to be heated up at max temperature all the time, so the heat losses will be smaller.
There is also the possibility to link the solution with a Google Calendar.
In a calendar can be set events for holidays, when the boiler won't heat, or events describing an unordinary consumption following with temperature, on which should be the boiler heated on.How does it work?The solution is made with SHELLY 1PM plug and an additional temperature module with two connected DS18B20's. One is inside of a boiler and the second one on an output pipe of a boiler.
Testing and appliance are managed by docker containers. One for collecting data from a plug, the second for controlling the plug. There is also one more for an InfluxDB where are data collected from plug stored.
Review is managed by Graphana container connected to InfluxDB.Problems in solutionThe hardest part was finding out, how much water was consumed based on a temperature of an output pipe.
This is managed by averaging a temperature during days, searching for peaks in consumption, and selecting possible consumptions.
The peak's top temperature is multiplied by a coefficient, which is edited concerning maximal reducing of an average temperature in the boiler but also due to heat comfort of water.The second hardest thing was to guess or estimate the real temperature of water in the boiler because this thermometer couldn't be placed right into a water tank but only in an isolation,
so the temperature on a sensor is lower than it actually is and there is also an extrapolation in time when the water is heated on.
Package: smartbonuspy
Smartbonus package for Python languageThis package provides Python implementation of Smartbonus api. Supported all public api of smartbonus.With 100% test coverage.InstallationUse thepipcommand:$ pip install smartbonuspyRequirementsSmartbonus package tested against Python 3.8.1ExamplefromsmartbonusimportSmartBonus,set_root_path# Creating sb# Ask about params smartbonus teamset_root_path("https://your.smartbonus.com/api/v2/")sb=SmartBonus("your store id")# Get smartbonus info about client: catch error by selfclient=sb.get_client('0555555555')print(client)# Get erorrdata,ok=sb.get_client('0555555555',raise_error=False)ifok:print('your client',data)else:print('error',data)# see tests for more
Package: smartbot
# SmartbotThe smartest bot for telegram/slack#### DescriptionSmartbot is a python library that helps to write enhanced bots to [Telegram](https://telegram.org/) / [Slack](https://slack.com/).The concept of **behaviours** makes easier to add costumizable features to your bot. Some features are already built-in in this package like:- **Wolfram**: Use wolfram knowledge system to query sentences;- **Evi**: Use evi knowledge system query sentences;- **Google Image**: Use google image to search images;- **Bing Image**: Use bing image to search images;- **Translate**: Use bing translator to translate sentences;- **Talk**: Use bing text-to-speech to convert text in spoken sentences;- **Joke**: Use [PiadasNet](http://piadasnet.com) to search jokes;- **Nasa**: Retrieve [Nasa Image Of The Day](http://apod.nasa.gov/apod/astropix.html);- **Friendly**: Redirect metioned interaction to behaviours;- **Loader**: Enable/Disable behaviours on the fly.#### InstalationYou can install the through [pip](https://github.com/pypa/pip):```pip install smartbot```or inside directory (in case you downloaded the code):```python setup.py install```#### Usage```usage: smartbot_full.py [-h] [--telegram-bot-token TELEGRAM_BOT_TOKEN][--slack-bot-token SLACK_BOT_TOKEN][--wolfram-app-id WOLFRAM_APP_ID][--admin-id ADMIN_ID] [--config CONFIG]Run smartbotoptional arguments:-h, --help            show this help message and exit--telegram-bot-token TELEGRAM_BOT_TOKENThe telegram bot token (orenv[SMARTBOT_TELEGRAM_TOKEN])--slack-bot-token SLACK_BOT_TOKENThe slack bot token (or env[SMARTBOT_SLACK_TOKEN])--wolfram-app-id WOLFRAM_APP_IDThe wolfram app id (or env[SMARTBOT_WOLFRAM_APPID])--admin-id ADMIN_ID   The user id to admin (or env[SMARTBOT_ADMIN_ID])--config CONFIG       The configuration file (or env[SMARTBOT_CONFIG])```#### DevelopmentYou are free to contribute with this project and even fork it. Of cource, following the license instructions. We will be available as much as possible to solve any doubts or issues about this project.#### Documentation and TestsThe code and wiki documentation are in development.The test suite is not that perfect, but we are in a pursuit to improve it. Manual tests confirm the project is stable enough to be in a public repository. Enjoy
Package: smartbotsol
pythonSmartBotssmart conversation bots packageFree software: MIT licenseDocumentation:https://smartbotsol.readthedocs.io.Getting startedDescribe yor statesCreateserver.py:fromtelegram.extimportUpdaterfromsmartbotsolimportStateMachinefromsmartbotsol.telegramimportFsmTelegramHandlerimportlogginglogging.basicConfig(format='%(asctime)s-%(name)s-%(levelname)s-%(message)s',level=logging.DEBUG)log=logging.getLogger(__name__)fromstatesimportBootStrapStatehandler=FsmTelegramHandler(StateMachine(BootStrapState(),filters=[]))defcreate_bot():token=os.environ.get('TELEGRAM_TOKEN')port=int(os.environ.get('PORT','5000'))updater=Updater(token)updater.dispatcher.add_handler(handler)returnupdaterdefstart_polling_bot():bot=create_bot()bot.start_polling(read_latency=50.0)returnbotif__name__=='__main__':start_polling_bot()For async runs passasync=True:handler=FsmTelegramHandler(StateMachine(BootStrapState(),filters=[]),async=True)CreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History1.0.0 (2017-11-02)First release on PyPI.1.0.1 (2017-11-05)Bugfix with reply_markup
Package: smartbox
smartboxPython API to control heating 'smart boxes'InstallationInstall using pip fromPyPI:pip install smartboxsmartboxCommand Line ToolYou can use thesmartboxtool to get status information from your heaters
(nodes) and change settings.A few common options are required for all commands:-a/--api-name: The API name for your heater vendor. This is visible in
the 'API Host' entry in the 'Version' menu item in the mobile app/web app. If
the host name is of the formapi-foo.xxxxorapi.xxxxuse the valuesapi-fooorapirespectively.-u/--username: Your username as used for the mobile app/web app.-p/--password: Your password as used for the mobile app/web app.-b/--base-auth-creds: An HTTP Basic Auth credential used to do initial
authentication with the server. Use the base64 encoded string directly. See
'Basic Auth Credential' section below for more details.Verbose logging can be enabled with the-v/--verboseflag.Listing smartbox devicessmartbox <auth options...> devicesListing smartbox nodesThenodescommand lists nodes across all devices.smartbox <auth options...> nodesGetting node statusThestatuscommand lists status across all nodes and devices.smartbox <auth options...> statusSetting node statusTheset-statuscommand can be used to change a status item on a particular
node.smartbox <auth options...> set-status <-d/--device-id> <device id> <-n/--node-addr> <node> <name>=<value> [<name>=<value> ...]Getting node setupThesetupcommand lists setup across all nodes and devices.smartbox <auth options...> setupSetting node setupTheset-setupcommand can be used to change a setup item on a particular
node.smartbox <auth options...> set-setup <-d/--device-id> <device id> <-n/--node-addr> <node> <name>=<value> [<name>=<value> ...]Getting device away statusThedevice-away-statuscommand lists the away status across all devices.smartbox <auth options...> device-away-statusSetting device away statusTheset-device-away-statuscommand can be used to change the away status on a
particular device.smartbox <auth options...> set-device-away-status <-d/--device-id> <device id> <name>=<value> [<name>=<value> ...]Getting device power limitThedevice-power-limitcommand lists the power limit (in watts) across all
devices.smartbox <auth options...> device-power-limitSetting device power limitTheset-device-power-limitcommand can be used to change the power limit (in
watts) on a particular device.smartbox <auth options...> set-device-power-limit <-d/--device-id> <device id> <limit>Basic Auth CredentialInitial authentication to the smartbox REST API is protected by HTTP Basic Auth,
in addition to the user's username and password which are then used to obtain an
access token. In order not to undermine the security layer it provides, and also
because it might change over time or vary between implementations,the token
is not provided here and system owners need to find it themselves.Seeapi-notes.mdfor notes on REST and socket.io endpoints.
Package: smartbytes-monitor
Python package to monitor your Airtel broadband network stats like remaining data, days
left, etc.Installationpip install smartbytes-monitoror if you like to live on the bleeding edge:python setup.py installUsageJust launch the commandsmartbytesand it will tell you about your
broadband plan information.$ smartbytes
=============================
Total data : 30.0 GB
Data left  : 2.6 GB
Days left  : 1 day(s)
DSL number : 0172xxxxxxx:_dsl
=============================This tool can also used as a library:>>> import smartbytes
>>> airtel = smartbytes.smartbytes()
>>> airtel.data_total
u'30.0 GB'
>>> airtel.data_left
u'2.6 GB'
>>> airtel.days_left
u'1 day(s)'
>>> airtel.dsl_number
u'0172xxxxxxx:_dsl'LicenseThe MIT License
Package: smart-cache
Smart CacheThis is not production ready! There are still likely many bugs and there are several performance improvements which can be madeThere are several Python caching alternatives, but there is only one to rule them all 💍.Introducing smart cache—apply the@smart_cachedecorator and all inputs
with the same hash will be cached cross-run. Furthermore,the cache will be invalidated if the method bytecode OR the bytecode of method dependencies changes. This allows for fast rapid prototyping. You do not have to focus on which
functions have been changed,Smart Cachedoes the work for you.The only thing to pay attention to is that your functions arepure! Thisbasicallymeans that the same input arguments will always yield the same result.  If this isn't the case, then don't include the@smart_cachedecorator on that function—it can't be cached!Installationpip3installsmart-cacheBenchmarksLet's benchmark the times between cached and non-cached versions of recursive fibonacci.@smart_cachedeffib(n):ifn==0:return0ifn==1:return1returnfib(n-1)+fib(n-2)defbad_fib(n):ifn==0:return0ifn==1:return1returnbad_fib(n-1)+bad_fib(n-2)if__name__=="__main__":start=time.time()cached_result=fib(40)end=time.time()print("total time cached:{:.2f}ms".format((end-start)*1000))start=time.time()actual_result=bad_fib(40)end=time.time()print("total time uncached:{:.2f}ms".format((end-start)*1000))difference=actual_result-cached_resultprint("difference: ",difference)The first run (without any previous caching) we get times oftotal time cached: 0.58ms
total time uncached: 31840.58ms
difference:  0The second time will be even faster—we only need one lookup sincefib(40)is cached. We gettotal time cached: 0.48ms
total time uncached: 31723.69ms
difference:  0Simple ExampleSuppose we rundefabc():x=2+2returnx@smart_cachedeftester():return1+abc()if__name__=="__main__":print(tester())Only the first time we run this will
results not be cached.Suppose we make a modification toabcdefabc():x=2+3returnxAll caches will be invalidated. However, ifabcwere
changed todefabc():# this is a commentx=2+2returnxThe cache will not be invalidated because even though the
code changes—none of the byte code changes.Similary if we add another functionxyz(),defxyz(a_param):returna_param*2The cache willalsoNOT be invalidated because although
the bytecode of the file changes, the bytecode of neither the functiontesternor its dependencies change.Recursive FunctionsRecursive functions also work as expected!@smart_cachedeffib(n):ifn==0:return0ifn==1:return1returnfib(n-1)+fib(n-2)if__name__=="__main__":print(fib(6))will run inO(n)time when it is first run
andO(1)the time after that.