Saravanan666/pypi-org huggingface dataset:
Package: pysolbase
pysolbaseWelcome to pysolCopyright (C) 2013/2017 Laurent Labatut / Laurent Champagnacpysolbase is a set of python helpers to ease development.It is gevent (co-routines) based.UsageEngage gevent monkey patching and setup default logger configuration:SolBase.voodoo_init()Initialize logging system (without engaging gevent) with default configuration (ie console logs - there is support for syslog and file logs).SolBase.logging_init("INFO")Re-initialize logging system (without engaging gevent):SolBase.logging_init("DEBUG", True)Millis helpers:ms = SolBase.mscurrent()
do_something()
ms_elapsed = SolBase.msdiff(ms)Date helpersdt = SolBase.datecurrent()
do_something()
ms_elapsed = SolBase.datediff(dt)Binary helpersbin_buf = SolBase.unicode_to_binary('This is my text buffer', encoding='utf-8')
unicode_string = SolBase.binary_to_unicode(bin_buf, encoding='utf-8')File helpersFileUtility.append_text_to_file('/tmp/test.txt', 'This is my text buffer', 'utf-8')
bin_buf = FileUtility.file_to_binary('/tmp/test.txt')
unicode_string = FileUtility.file_to_text('/tmp/test.txt', 'utf-8')Exception helpertry:
   a = None
   b = a + 1
except Exception as e:
   logger.warn("Ex=%s", SolBase.extostr(e))Source codeWe are pep8 compliant (as far as we can, with some exemptions)We use a right margin of 360 characters (please don't talk me about 80 chars)All unittest files must begin withtest_orTest, should implement setUp and tearDown methodsAll tests must adapt to any running directoryThe whole project is backed by gevent (http://www.gevent.org/)We use docstring (:return, :rtype, :param, :type etc), they are mandatoryWe use PyCharm "noinspection", feel free to use themRequirementsDebian 10 or greater, x64, Python 3.7UnittestsTo run unittests, you will need:nothing special except Python and dependencies requirements.LicenseThis program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
Package: pysolcache
pysolcacheWelcome to pysolCopyright (C) 2013/2017 Laurent Labatut / Laurent Champagnacpysolcache is a set of python caches : in-memory and/or redis.Usefull to handle L1 (memory) and L2 (redis) cache for python daemons.In all cases, serialization/deserialization of stored datas have to be done at client side (ie, serialize as u wish, ujson or equivalent)All caches are instrumented by Meters (pysolmeters).MemoryCache:A pure python memory cache storing string/binary keys to string/binary valuesMax bytes cappedMax items count cappedItems TTLsLRU evictionsWatchdog evictionsRedisCache:A redis backed cache, storing string/binary keys to string/binary valuesHighCache:A high level cache, coupling MemoryCache adn RedisCache, which handle respectively L1 cache (in memory) and L2 cache (inside redis)HighCacheEx:A high level cache, storing internal data as tuple (ms_added, ttl_ms, string/binary data)Provided same level of functionality as HighCache but is able to perform an automatic L1 put in case of L2 hit and L1 missIt is gevent (co-routines) based.UsageMemoryCachec = MemoryCache()

# Put, ttl 60000 ms
c.put("keyA", "valA", 60000)

# Get
v = c.get("keyA")

# Remove
v = c.remove("keyA")

# Stop
c.stop_cache()RedisCachec = RedisCache()

# Put, ttl 60000 ms
c.put("keyA", "valA", 60000)

# Get
v = c.get("keyA")

# Remove
v = c.remove("keyA")

# Stop
c.stop_cache()HighCache / HighCacheExmc = MemoryCache()
rc = RedisCache()
hc = HighCache(mc, rc)

# Put, ttl 60000 ms, in L1 and L2
hc.put("keyA", "valA", 60000, l1=True, l2=True)

# Get from L1 only
v = c.get("keyA", l1=True, l2=False)

# Get from L2 only
v = c.get("keyA", l1=False, l2=True)

# Try get from L1, if miss, try from L2
v = c.get("keyA", l1=True, l2=True)

# Remove from L1
v = c.remove("keyA", l1=True, l2=False)

# Stop
hc.stop_cache()Source codeWe are pep8 compliant (as far as we can, with some exemptions)We use a right margin of 360 characters (please don't talk me about 80 chars)All unittest files must begin withtest_orTest, should implement setUp and tearDown methodsAll tests must adapt to any running directoryThe whole project is backed by gevent (http://www.gevent.org/)We use docstring (:return, :rtype, :param, :type etc), they are mandatoryWe use PyCharm "noinspection", feel free to use themRequirementsDebian 10 or greater, x64, Python 3.7UnittestsTo run unittests, you will need:redis-server installed and serving 6379 without creds.LicenseThis program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
Package: pysol-cards
pysol_cards.  Deal PySol FC CardsInfo:This is the README file for pysol_cards.Author:Shlomi Fish <shlomif@cpan.org>Copyright:© 2020, Shlomi Fish.Date:2024-01-05Version:0.16.0pysol_cardsDeal PySol FC CardsThe pysol-cards python modules allow the python developer to generate the
initial deals of some PySol FC games. It also supports PySol legacy deals
and Microsoft FreeCell / Freecell Pro deals.Free software: Expat licenseDocumentation: pydocSource:https://github.com/shlomif/pysol_cardsBugs:https://github.com/shlomif/pysol_cards/issuesExample:from pysol_cards.cards import CardRenderer
from pysol_cards.deal_game import Game
from pysol_cards.random_base import RandomBase
ms24_str = Game(
    game_id="freecell",
    game_num=24,
    which_deals=RandomBase.DEALS_MS,
    max_rank=13
).calc_layout_string(
    CardRenderer(print_ts=True)
)
print(ms24_str, end='')COPYRIGHTCopyright © 2020, Shlomi Fish.
All rights reserved.Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:Redistributions of source code must retain the above copyright
notice, this list of conditions, and the following disclaimer.Redistributions in binary form must reproduce the above copyright
notice, this list of conditions, and the following disclaimer in the
documentation and/or other materials provided with the distribution.Neither the name of the author of this software nor the names of
contributors to this software may be used to endorse or promote
products derived from this software without specific prior written
consent.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
“AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Package: pysolcast
Solcast APIClient library for interacting with the Solcast APIBasic UsageGet Forecastsfrompysolcast.rooftopimportRooftopSitesite=RooftopSite(api_key,resource_id)forecasts=site.get_forecasts()Post Measurementsmeasurement={'measurement':{'period_end':'2021-01-25T17:45:00.0000000Z','period':'PT15M','total_power':0.388}}results=site.post_measurements(measurement)Full APIDocumentation.
Package: py-solc-x
py-solc-xPython wrapper and version management tool for thesolcSolidity compiler.Forked frompy-solc.FeaturesFull support for Solidity>=0.4.11Install Solidity on Linux, OSX and WindowsCompile Solidity from source on Linux and OSXDependenciesPy-solc-x allows the use of multiple versions of solc, and can install or compile them as needed. If you wish to compile from source you must first insall the requiredsolc dependencies.Installationviapippipinstallpy-solc-xviasetuptoolsgitclonehttps://github.com/iamdefinitelyahuman/py-solc-x.gitcdpy-solc-x
python3setup.pyinstallDocumentationDocumentation is hosted atRead the Docs.TestingPy-solc-x is tested on Linux, OSX and Windows with solc versions>=0.4.11.To run the test suite:pytesttests/By default, the test suite installs all availablesolcversions for your OS. If you only wish to test against already installed versions, include the--no-installflag.ContributingHelp is always appreciated! Feel free to open an issue if you find a problem, or a pull request if you've solved an issue.Please check out ourContribution Guideprior to opening a pull request, and join the BrownieGitter channelif you have any questions.LicenseThis project is licensed under theMIT license.
Package: py-solc-x-ir
Python wrapper and version management tool for thesolcSolidity
compiler.Forked from`py-solc<https://github.com/ethereum/py-solc>`__.FeaturesFull support for Solidity>=0.4.11Install Solidity on Linux, OSX and WindowsCompile Solidity from source on Linux and OSXDependenciesPy-solc-x allows the use of multiple versions of solc, and can install
or compile them as needed. If you wish to compile from source you must
first insall the requiredsolc
dependencies.Installationviapippipinstallpy-solc-xviasetuptoolsgitclonehttps://github.com/iamdefinitelyahuman/py-solc-x.gitcdpy-solc-xpython3setup.pyinstallDocumentationDocumentation is hosted atRead the
Docs.TestingPy-solc-x is tested on Linux, OSX and Windows with solc versions>=0.4.11.To run the test suite:pytesttests/By default, the test suite installs all availablesolcversions for
your OS. If you only wish to test against already installed versions,
include the--no-installflag.ContributingHelp is always appreciated! Feel free to open an issue if you find a
problem, or a pull request if you’ve solved an issue.Please check out ourContribution Guideprior to
opening a pull request, and join the BrownieGitter
channelif you have any
questions.LicenseThis project is licensed under theMIT license.
Package: pysoldaemon
pysoldaemonWelcome to pysolCopyright (C) 2013/2017 Laurent Labatut / Laurent Champagnacpysoldaemon is a generic linux daemon in Python.It supports :Double forkingstd redirect to fileslog to fileworking directory change after Fork 1start/stop/status/reload commandsIt is gevent (co-routines) based.UsageAn implementation is available in :pysoldaemon_test.Daemon.CustomDaemon.CustomDaemonSource codeWe are pep8 compliant (as far as we can, with some exemptions)We use a right margin of 360 characters (please don't talk me about 80 chars)All unittest files must begin withtest_orTest, should implement setUp and tearDown methodsAll tests must adapt to any running directoryThe whole project is backed by gevent (http://www.gevent.org/)We use docstring (:return, :rtype, :param, :type etc), they are mandatoryWe use PyCharm "noinspection", feel free to use themRequirementsDebian 10 or greater, x64, Python 3.7UnittestsTo run unittests, you will need:nothing special except Python and dependencies requirements.LicenseThis program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
Package: pysoleng
pysolengpysoleng is a package designed to study solar energy and its applications.What can it do now?Describe positions and surfaces on Earth (all continents);Identify the position of the sun over time;Calculate the direct radiation incidence angle on a flat surface;Estimate how much insolation reaches a given surface on Earth.MilestonesIt would be interesting to add the following features to the package:The ability to use other models for sloped surface radiation calculations, such as the anisotropic sky model;The ability to estimate the performance of key solar energy technologies, namely solar thermal (ST) and photovoltaics (PV), using different models;The ability to estimate parameters for solar thermal collector models.BibliographyThe following publications were relied upon:John A. Duffie, William A. Beckman, Solar Engineering of Thermal Processes, Fourth Edition, John Wiley & Sons, 2013. DOI: 10.1002/9781118671603Jean Meeus, Astronomical Algorithms, Second Edition, Willmann-Bell, 1998. ISBN: 978-0943396613Soteris Kalogirou, Solar Energy Engineering: Processes and Systems, First Edition, 2009. DOI: 10.1016/B978-0-12-374501-9.X0001-5Soteris Kalogirou, Solar Energy Engineering: Processes and Systems, Second Edition, 2013. DOI: 10.1016/C2011-0-07038-2
Package: pysolhttpclient
pysolhttpclientWelcome to pysolCopyright (C) 2013/2017 Laurent Labatut / Laurent Champagnacpysolhttpclient is a set an HTTP client ApisThey are gevent based
They support urllib3 and geventhttpclient implementations
They support http and https
They support http proxy (tested with squid)HttpResponse.headers is a dict, from string to string (direct header access) or from string to list (in case the same header is present several times in the http response)Source codeWe are pep8 compliant (as far as we can, with some exemptions)We use a right margin of 360 characters (please don't talk me about 80 chars)All unittest files must begin withtest_orTest, should implement setUp and tearDown methodsAll tests must adapt to any running directoryThe whole project is backed by gevent (http://www.gevent.org/)We use docstring (:return, :rtype, :param, :type etc..), they are mandatoryWe use PyCharm "noinspection", feel free to use themRequirementsDebian 10 or greater, x64, Python 3.7UnittestsTo run unittests, you will need:internet outbound accessan optional squid proxy installed7900 tcp listening available (for HttpMock)LicenseThis program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
Package: pysolmeters
pysolmetersWelcome to pysolCopyright (C) 2013/2017 Laurent Labatut / Laurent Champagnacpysolmeters is a set of python helpers to populate and get counters, anywhere in the code.It can be used to instrument low-level APIs and validate stuff with unit testing or push counters toward some monitoring softwares.Internally, it uses AtomicIntSafe, AtomicFloatSafe and DelayToCountSafe classes, wrapped by a static class Meters, which exposes helper methods.UsageTo increment integers and floats :Meters.aii("int_counter")
Meters.afi("float_counter")To get integers and floats :vi = Meters.aig("int_counter")
vf = Meters.afg("float_counter")To put millis toward DelayToCount :Meters.dtci("dtc1", 0.5)To get DelayToCount instancedtc1 = Meters.dtcg("dtc1")To write all counters to logger :Meters.write_to_logger()To reset all counters :Meters.reset()Source codeWe are pep8 compliant (as far as we can, with some exemptions)We use a right margin of 360 characters (please don't talk me about 80 chars)All unittest files must begin withtest_orTest, should implement setUp and tearDown methodsAll tests must adapt to any running directoryThe whole project is backed by gevent (http://www.gevent.org/)We use docstring (:return, :rtype, :param, :type etc), they are mandatoryWe use PyCharm "noinspection", feel free to use themRequirementsDebian 10 or greater, x64, Python 3.7UnittestsTo run unittests, you will need:nothing special except Python and dependencies requirements.LicenseThis program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
Package: pysolmysql
pysolmysqlWelcome to pysolCopyright (C) 2013/2017 Laurent Labatut / Laurent Champagnacpysolmysql is a set of simple MYSQL client ApisThey are gevent based.
They rely on pymysql.Usaged_conf = {
    "host": "localhost",
    "port": 3306,
    "database": None,
    "user": "root",
    "password": "root",
    "autocommit": True,
}
        
ar = MysqlApi.exec_n(d_conf, "select user, host from mysql.user;")

for d_record in ar:
    logger.info("user=%s, host=%s", d_record["user"], d_record["host"])PoolNow backed by a basic pool implementation, which support underlying backend clusters (mariadb galera for instance)This basic pool implementation is forked and adapted from :https://github.com/laurentL/django-mysql-geventpool-27https://github.com/shunsukeaihara/django-mysql-geventpoolPool max sizePool max size (default 10) can be specified usingd_conf = {
    "pool_max_size": 10,
    ...
}Possible backward compatibility issue:If the pool is maxed, an exception will be raisedMultiple hostsMultiple hosts can be addressed in an active/active manner.Several hosts can be specified using :"hosts" list (preferred)d_conf = {
    "hosts": ["localhost", "127.0.0.1"],
    ...
}"host" comma separated listd_conf = {
    "host": "localhost,127.0.0.1",
    ...
}"host" single entry (backward compatible mode)d_conf = {
    "host": "localhost",
    ...
}Source codeWe are pep8 compliant (as far as we can, with some exemptions)We use a right margin of 360 characters (please don't talk me about 80 chars)All unittest files must begin withtest_orTest, should implement setUp and tearDown methodsAll tests must adapt to any running directoryThe whole project is backed by gevent (http://www.gevent.org/)We use docstring (:return, :rtype, :param, :type etc), they are mandatoryWe use PyCharm "noinspection", feel free to use themRequirementsDebian 10 or greater, x64, Python 3.7UnittestsTo run unittests, you will need:mysql installed and running, with root/root credentialsLicenseThis program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
Package: pysolorie
pysoloriepysoloriestands forPythonSolarOrientation Analysis of Solar Panel. It is a Python library designed to help you analyze the orientation of solar panels.How can one maximize the solar irradiation energy received by a solar panel?Featurespysolorieis a library designed to help you find this optimal orientation. Its features include, but are not limited to:Finding the optimal tilt angle for a fixed solar panel, assuming a clear-sky condition.Plotting the optimal tilt angle over a range of days.Plotting the daily direct irradiation energy over a range of days.Generating a CSV, JSON, or XML report detailing the optimal tilt angle over a range of days.Calculating the sunrise and sunset hour angles for a specific day.Utilizing Hottel's model to quantify clear-sky conditions and estimate the atmospheric transmission of clear-sky beam radiation.Calculating the solar zenith angle.Calculating the solar time.Calculating solar declination and hour angle.How to Install pysoloriepysolorierequires Python 3.9 or higher.The easiest way to installpysolorieis from PyPI.python3-mpipinstallpysolorieExample UsageWith the pysolorie package, you can plot the optimal orientation of a solar panel given the climate type, altitude, and latitude of the location. For instance, the following code plots the optimal orientation for each day of the year for the city of Tehran. For more examples, please refer to theGetting startedsection of our documentation. The fullAPI Referenceis also available on our website.frompathlibimportPathfrompysolorieimportIrradiationCalculator,Plotter# Instantiate a Plotter object from the pysolorie libraryplotter=Plotter()# Instantiate an IrradiationCalculator object for the city of Tehranirradiation_calculator=IrradiationCalculator(climate_type="MIDLATITUDE SUMMER",observer_altitude=1200,observer_latitude=35.6892)# Use the plotter to plot the optimal orientation of a solar panel for each day of the yearplotter.plot_optimal_orientation(irradiation_calculator,from_day=1,to_day=365,path=Path("results.svg"),plot_kwargs={"xlabel":"Day","ylabel":"Beta (degrees)","title":"Optimal Solar Panel Orientation",},savefig_kwargs={"dpi":300},)This figure, generated by the example code, illustrates the optimal orientation of a solar panel for each day of the year in Tehran. The x-axis represents the day of the year, while the y-axis represents the optimal angle (Beta) in degrees. As can be seen, the optimal angle varies throughout the year, highlighting the importance of adjusting the orientation of the solar panel to maximize the energy received.DocumentationYou can find the complete documentation for pysolorie at ourRead the Docs page.ContributingWe welcome contributions to pysolorie! If you're interested in contributing, please take a look at ourcontribution guidelinesfor detailed information on how you can help.Thank you for considering contributing to pysolorie!