Saravanan666/pypi-org huggingface dataset:
Package: marquez-python
Marquez Python ClientPython client forMarquez.DocumentationSee theAPI docs.RequirementsPython 3.6+Installation$pip3installmarquez-pythonTo install from source run:$python3setup.pyinstallUsageReading Metadatafrommarquez_clientimportMarquezClientclient=MarquezClient(url='http://localhost:5000')# list namespacesclient.list_namespaces()To enable logging, set the environment variableMARQUEZ_LOG_LEVELtoDEBUG,INFO, orERROR:$ export MARQUEZ_LOG_LEVEL='INFO'Writing MetadataTo collect OpenLineage events using Marquez, please use theopenlineage-pythonlibrary. OpenLineage is an Open Standard for lineage metadata collection designed to collect metadata for a job in execution.DevelopmentTo install all dependencies forlocaldevelopment:$pip3install-e.[dev]To run the entire test suite:$pytestSPDX-License-Identifier: Apache-2.0
Copyright 2018-2023 contributors to the Marquez project.
Package: marrow.script
The marrow.script package is a small library for turning average every-day
callables (such as functions and class methods) into command-line scripts
while automatically determining argument naming, typecasting, and generating
things like help and version information.  All behavior can be overridden by
you, the developer, giving you a flexible and easy to develop with command
line parsing library to replaceoptparseandargparse.  This package
is not a wrapper around existing parsing libraries, and attempts to match the
syntax common to GNU software.In a larger scope marrow.script aims to replace other high-level command-line
scripting libraries such as Paste Script and commandline while also
implementing Python 3 compatibility.For full documentation, see the README.textile file present in the package,
or view it online on the GitHub project page:https://github.com/pulp/marrow.script
Package: marrydoc
#####################################[MarryDoc] Easy DocString Maintenance#####################################.. currentmodule:: marrydoc.. image:: https://readthedocs.org/projects/marrydoc/badge/?version=latest:target: https://marrydoc.readthedocs.io/en/latest/?badge=latest:alt: Documentation StatusThe :mod:`marrydoc` Python module makes maintaining consistency ofrelated Python docstrings easy. :mod:`marrydoc` provides decorators to"wed" a docstring to another and provides a command line tool toautomatically update a module's docstrings when their basis docstringshave changed.The decorators offered annotate class, function, and method docstrings toidentify if their docstring is to be inherited from, maintained as a copyof, or maintained as a modified copy of a docstring of another programconstruct.***********Quick Start***********@inherit========Use the :func:`inherit()` decorator to dynamically copy a docstring fromone program construct to another when a module is imported. For example:.. code-block:: pythonimport marrydocfrom foo import bar@marrydoc.inherit(bar)def my_bar():passassert bar.__doc__ == my_bar.__doc__@copied_from============Use the :func:`copied_from` decorator in combination with the command linetool to evaluate if one program construct docstring is up to date withanother and automatically update the script if they are unequal. Forexample:.. code-block:: pythonimport marrydocfrom foo import bar@marrydoc.copied_from(bar)def my_bar():"""Perform foo bar."""passThen use the command line tool to evaluate if the source docstring haschanged and automatically update if so:.. code-block:: shell$ python -m marrydoc --merge my_foo.pymy_foo.py ... OK@based_on=========Use the :func:`based_on` decorator instead of :func:`copied_from`when the docstring is a copy but has been modified. Pass an unmodifiedcopy of the source docstring as the second argument to :func:`based_on`(to facilitate source docstring change detection and provide a basis ofa three way merge). For example:.. code-block:: pythonimport marrydocfrom foo import bar@marrydoc.based_on(bar,"""Perform foo bar.""")def my_bar():"""Perform my special foo bar."""passThen use the command line tool to evaluate if the source docstring haschanged and automatically perform a three way merge if so:.. code-block:: shell$ python -m marrydoc --merge my_foo.pymy_foo.py ... UPDATED
Package: marsbots
Mars College Discord Bots FrameworkThis repository contains code for creating chatbots/utility bots for Mars College, or otherwise.There are several useful utilities for chat programs, including support for numerous language model API providers, as well as methods for completing text, searching topics, and getting message similarity.Setup (for development)python -m virtualenv venv
pip install flit
flit install --deps=all --pth-fileCreating a botAll bots must be placed in a directory equal to or higher in the file system than the run script (bot.py). It is recommended that you create a folder calledbotsin themarsbots-coredirectory, then create additional folders and files in there as needed.All bots expect three things:A JSON settings fileA Python script containing the bot's code as a Discord.py Cog classA .env file to load API keys/settings fromSettings FileThe bot's JSON settings file should contain the following:"name": The name of the bot"token_env": The name of the environment variable which contains the discord bot token used to run the bot
(Optional)"command_prefix": This will be the prefix used for the bot to respond to commands.
(Optional)"intents": A list of special intents needed. Takes a list, with accepted values "presence" and "members"Cog FileThe bot's main logic should be created as a Discord.py Cog class, and should have a setup function which adds the Cog to the bot.Env FileThis should contain any API keys or sensitive variables you need to use to run the bot. Expected default names for environment variables can be found in theconfig.pyfile of Marsbots core.Running Your BotLocallyBots can be run locally using a command such as the following:pythonbot.py./examples/examplebot/examplebot.json--cog-path=examples.examplebot.examplebot--dotenv-path=.envNote that the--cog-pathflag should be provided using python module syntax, using dots.Managing several bots with PM2Several bots can be managed at once usingPM2and a PM2 config file. An example config file is provided in theexamplesfolder for running the example bot using PM2.
Package: marsgpt
MarsGPTA ChatGPT API安装pip install MarsGPT使用import sys
import asyncio
from MarsGPT import Chatbot

async def main():
    """
    Chat AI Test
    """
    # params
    email = "xxx@xxx.com"
    password = "xxxxxx"

    # login
    chatbot = Chatbot(email=email, password=password)
    
    # ask
    try:
        while True:
            print("You:")
            prompt = ""
            while(len(prompt.strip()) == 0):
                prompt = input()

            # # clear
            # chatbot.conversations.remove("default")

            print("ChatGPT:")
            # ret, res = self.chatbot.ask_sync(prompt)
            # print(res)
            async for line in chatbot.ask(prompt):
                result = line["choices"][0]["text"].replace("
", "")
                print(result, end="")
                sys.stdout.flush()
            print()


    except KeyboardInterrupt:
        print("Exiting...")
        sys.exit(0)

if __name__ == "__main__":
    asyncio.run(main())
Package: mars-gym
MARS-Gym (MArketplace Recommender Systems Gym), a benchmark framework for modeling, training, and evaluating RL-based recommender systems for marketplaces.Three main components composes the framework:Data Engineering Module: A highly customizable module where the consumer can ingest and process a massive amount of data for learning using spark jobs.Simulation Module: Holds an extensible module built on top of PyTorch to design learning architectures. It also possesses an OpenAI’s Gym environment that ingests the processed dataset to run a multi-agent system that simulates the targeted marketplace.Evaluation Module: Provides a set of distinct perspectives on the agent’s performance. It presents traditional recommendation metrics, off-policy evaluation metrics, and fairness indicators. This component is powered by a user-friendly interface to facilitate the analysis and comparison betweenagentsFrameworkDependencies and Requirementspython=3.6.7pandas=0.25.1matplotlib=2.2.2scipy=1.3.1numpy=1.17.0seaborn=0.8.1scikit-learn=0.21.2pytorch=1.2.0tensorboardx=1.6luigi=2.7.5tqdm=4.33requests=2.18.4jupyterlab=1.0.2ipywidgets=7.5.1diskcache=3.0.6pyspark=2.4.3psutil=5.2.2category_encodersplotly=4.4.1imbalanced-learn==0.4.3torchbearer==0.5.1pytorch-nlp==0.4.1unidecode==1.1.1streamlit==0.52.2gym==0.15.4Free software: MIT licenseInstallationpip install mars-gymYou can also install the in-development version with:pip install https://github.com/deeplearningbrasil/mars-gym/archive/master.zipDocumentationhttps://mars-gym.readthedocs.io/DevelopmentTo run the all tests run:toxNote, to combine the coverage data from all the tox environments run:Windowsset PYTEST_ADDOPTS=--cov-append
toxOtherPYTEST_ADDOPTS=--cov-append toxUsageSimulate Examplemars-gymruninteraction--projectPROJECT\--n-factorsN_FACTORS--learning-rateLR--optimizerOPTIMIZER\--epochsEPOCHS--obs-batch-sizeOBS_BATCH\--batch-sizeBATCH_SIZE--num-episodesNUM_EP\--bandit-policyBANDIT--bandit-policy-paramsBANDIT_PARAMSEvaluate Examplemars-gymevaluateiteraction\--model-task-idMODEL_TASK_ID--fairness-columns"[]"\--direct-estimator-classDE_CLASSEvaluation Modulemars-gymvizCitePlease cite the associated paper for this work if you use this code:@misc{santana2020marsgym,
      title={MARS-Gym: A Gym framework to model, train, and evaluate Recommender Systems for Marketplaces},
      author={Marlesson R. O. Santana and Luckeciano C. Melo and Fernando H. F. Camargo and Bruno Brandão and Anderson Soares and Renan M. Oliveira and Sandor Caetano},
      year={2020},
      eprint={2010.07035},
      archivePrefix={arXiv},
      primaryClass={cs.IR}
}Changelog0.0.1 (2020-06-27)First release on PyPI.
Package: marsh
Marsh(Un)marshaling library for objects in Python 3.8+.Tested on Ubuntu, Windows and Mac OSX for Python 3.8, 3.9 and 3.10.Relies heavily on type-hint reflection. All (un)marshaling is performed recursively which allows for support of nested types.Influenced by the work ofOmry Yadanonhydra.Thedocumentationis hosted on ReadTheDocs.Getting StartedInstallmarsh is available through pippipinstallmarshEntry pointUsing the unmarshaling capabilities ofmarshwe can
create entry points for python code.These entry points allow for arguments to be given on the command
line and/or through config files which are then validated, converted to the correct types and passed to the entry point function.Most python types are supported (primitives, type aliases, dataclasses, namedtuple e.t.c.)CreateCreating an entry point is as simple as decorating a function
and calling it without arguments.# app.pyimportmarshfromtypingimportSequence,Union@marsh.maindefrun(a:int,b:Union[float,Sequence[int]],c:dict[str,bool],)->None:"""Example of an entry point.Arguments:a: An integer argument.b: A floating point value or a sequence of ints.c: A dictionary with string keys andbool values. If this was python 3.8we would instead use typing.Dict[str, bool] astype hint as the builtin dict did not supporttype annotations."""print(a,type(a))print(b,type(b))print(c,type(c))if__name__=='__main__':run()RunWhen running the application we can use the positional arguments
on the command line to pass values to our function.$pythonapp.pya=1b=5e-1c.key1=truec.key2=false1<class'int'>0.5<class'float'>{'key1':True,'key2':False}<class'dict'>Argument validationWhen giving invalid values or when required arguments are missing an error message is printed and the application exits.$pythonapp.pya=1.5b=0c.some_key=truefailedtounmarshalconfig:int:couldnotconvert:1.5path:a$pythonapp.pyb=0c.some_key=truefailedtounmarshalconfig:MissingValueErrorpath:aHelpUsing --help we can also get a help message for the arguments. Here the output was piped totailto truncate the output into displaying only the arguments of our entry point.$pythonapp.py--help|tail-n11fields:a:<int>Anintegerargument.b:<float>|[<int>,...]Afloatingpointvalueorasequenceofints.c:{<str>:<bool>,...}Adictionarywithstringkeysandboolvalues.Ifthiswaspython3.8wewouldinsteadusetyping.Dict[str,bool]astypehintasthebuiltindictdidnotsupporttypeannotations.MarshalMarshaling values simply means taking a python object and turning it into JSON-like data.# marshal.pyimportdataclassesimportmarsh@dataclasses.dataclassclassConfig:a:intb:floatconfig=Config(1,5e-1)print(marsh.marshal(config))$pythonmarshal.py{'a':1,'b':0.5}UnmarshalUnmarshaling is the opposite of marshaling. A type is instantiated using JSON-like data.# unmarshal.pyimportdataclassesimporttypingimportmarshclassRange(typing.NamedTuple):start:typing.Optional[int]stop:int@dataclasses.dataclassclassConfig:a:intb:floatc:Rangeconfig=marsh.unmarshal(Config,{'a':1,'b':1.5,'c':{'start':None,'stop':5,},})print(config)$pythonumarshal.py
Config(a=1,b=1.5,c=Range(start=None,stop=5))LicenseMIT License.
Package: marsha
MarshaA serialization and validation library for python 3 based on the typing module.Status🔬 ExperimentalDon't put this code on servers. You can, but you probably shouldn't.Documentation📖https://deckar01.gitlab.io/marshaFeatures💂 StrictnessWhen using python's builtin types for schema annotations, the datamustbe
instances of the specified types or the load operation will fail with an exception.
Unexpected and missing data will error by default.🕵 ClarityValidation errors mirror the structure of the data, provide insight into the values
that caused the error, and present meaningful information to help resolve the problem.🏃 SpeedThe default functionality is fast and lean. The performance degrades gracefully as
complex functionality is explicitly opted into by the developer.🤸 FlexibilityCustom data types are created by defining formatter classes, then transfored into
types compatible with the builtin typing module.💃 ExpressivenessPython's builtin typing generics can be leveraged to declare complex type unions that
know how to automatically handle multiple types using a syntax that is explicit and concise.InstallationpipinstallmarshaUsageNeed to create database model instances from user input and expose them in serialized form?Creating a schema that is separate from the model is a useful way to declare a "view" and
allows defining multiple schemas to control how data is exposed in different contexts.frommy_app.database_modelsimportArtist,AlbumimportmarshafromtypingimportList@marsha.schema(Artist)classArtistSchema:name:str@marsha.schema(Album)classAlbumSchema:title:strartists:List[Artist]# dict -> Albumalbum=marsha.load(album_data,Album)# Do stuffalbum.save()# Album -> dictresponse_data=marsha.dump(album)Just need to validate some data and convert it to the correct type?You can automatically register the type annotations of any model as a schema by
adding theschemadecorator.importmarshafromtypingimportList@marsha.schema()classArtist(dict):name:str@marsha.schema()classAlbum(dict):title:strartists:List[Artist]# dict -> dictalbum=marsha.load(album_data,Album)# Do stufffirst_artist=album['artists'][0]Development📚 Dependencies# python >= 3.6pipinstall-rdev-requirements.txt🏅 Testing# Quick testing.flake8
pytest# Ensure all statements and branches are covered with tests.pytest--cov=marsha--cov-branch--cov-reporthtml--cov-reportterm# Ensure documentations changes render correctly.makehtml
Package: marshmallow
marshmallowis an ORM/ODM/framework-agnostic library for converting complex datatypes, such as objects, to and from native Python datatypes.fromdatetimeimportdatefrompprintimportpprintfrommarshmallowimportSchema,fieldsclassArtistSchema(Schema):name=fields.Str()classAlbumSchema(Schema):title=fields.Str()release_date=fields.Date()artist=fields.Nested(ArtistSchema())bowie=dict(name="David Bowie")album=dict(artist=bowie,title="Hunky Dory",release_date=date(1971,12,17))schema=AlbumSchema()result=schema.dump(album)pprint(result,indent=2)# { 'artist': {'name': 'David Bowie'},#   'release_date': '1971-12-17',#   'title': 'Hunky Dory'}In short, marshmallow schemas can be used to:Validateinput data.Deserializeinput data to app-level objects.Serializeapp-level objects to primitive Python types. The serialized objects can then be rendered to standard formats such as JSON for use in an HTTP API.Get It Now$ pip install -U marshmallowDocumentationFull documentation is available athttps://marshmallow.readthedocs.io/.RequirementsPython >= 3.8EcosystemA list of marshmallow-related libraries can be found at the GitHub wiki here:https://github.com/marshmallow-code/marshmallow/wiki/EcosystemCreditsContributorsThis project exists thanks to all the people who contribute.You’re highly encouraged to participate in marshmallow’s development.Check out theContributing Guidelinesto see how you can help.Thank you to all who have already contributed to marshmallow!BackersIf you find marshmallow useful, please consider supporting the team with
a donation. Your donation helps move marshmallow forward.Thank you to all our backers! [Become a backer]SponsorsSupport this project by becoming a sponsor (or ask your company to support this project by becoming a sponsor).
Your logo will show up here with a link to your website. [Become a sponsor]Professional SupportProfessionally-supported marshmallow is now available through theTidelift Subscription.Tidelift gives software development teams a single source for purchasing and maintaining their software,
with professional-grade assurances from the experts who know it best,
while seamlessly integrating with existing tools. [Get professional support]Project LinksDocs:https://marshmallow.readthedocs.io/Changelog:https://marshmallow.readthedocs.io/en/latest/changelog.htmlContributing Guidelines:https://marshmallow.readthedocs.io/en/latest/contributing.htmlPyPI:https://pypi.org/project/marshmallow/Issues:https://github.com/marshmallow-code/marshmallow/issuesDonate:https://opencollective.com/marshmallowLicenseMIT licensed. See the bundledLICENSEfile for more details.
Package: marshmallow2
marshmallowis an ORM/ODM/framework-agnostic library for converting complex datatypes, such as objects, to and from native Python datatypes.fromdatetimeimportdatefrommarshmallowimportSchema,fields,pprintclassArtistSchema(Schema):name=fields.Str()classAlbumSchema(Schema):title=fields.Str()release_date=fields.Date()artist=fields.Nested(ArtistSchema())bowie=dict(name='David Bowie')album=dict(artist=bowie,title='Hunky Dory',release_date=date(1971,12,17))schema=AlbumSchema()result=schema.dump(album)pprint(result.data,indent=2)# { 'artist': {'name': 'David Bowie'},#   'release_date': '1971-12-17',#   'title': 'Hunky Dory'}In short, marshmallow schemas can be used to:Validateinput data.Deserializeinput data to app-level objects.Serializeapp-level objects to primitive Python types. The serialized objects can then be rendered to standard formats such as JSON for use in an HTTP API.Get It Now$ pip install -U marshmallowDocumentationFull documentation is available athttp://marshmallow.readthedocs.io/.RequirementsPython >= 2.7 or >= 3.4marshmallow has no external dependencies outside of the Python standard library, althoughpython-dateutilis recommended for robust datetime deserialization.EcosystemA list of marshmallow-related libraries can be found at the GitHub wiki here:https://github.com/marshmallow-code/marshmallow/wiki/EcosystemCreditsContributorsThis project exists thanks to all the people who contribute.You’re highly encouraged to participate in marshmallow’s development.
Check out theContributing Guidelinesto see
how you can help.Thank you to all who have already contributed to marshmallow!BackersIf you find marshmallow useful, please consider supporting the team with
a donation. Your donation helps move marshmallow forward.Thank you to all our backers! [Become a backer]SponsorsSupport this project by becoming a sponsor (or ask your company to support this project by becoming a sponsor).
Your logo will show up here with a link to your website. [Become a sponsor]Professional SupportProfessionally-supported marshmallow is now available through theTidelift Subscription.Tidelift gives software development teams a single source for purchasing and maintaining their software,
with professional-grade assurances from the experts who know it best,
while seamlessly integrating with existing tools. [Get professional support]Security Contact InformationTo report a security vulnerability, please use theTidelift security contact.
Tidelift will coordinate the fix and disclosure.Project LinksDocs:http://marshmallow.readthedocs.io/Changelog:http://marshmallow.readthedocs.io/en/latest/changelog.htmlPyPI:https://pypi.python.org/pypi/marshmallowIssues:https://github.com/marshmallow-code/marshmallow/issuesDonate:https://opencollective.com/marshmallowLicenseMIT licensed. See the bundledLICENSEfile for more details.
Package: marshmallow-advanced
Marshmallow advanced Python libraryExtra fieldsActive fieldConvertsactivefield tostateand back.>>>classSimpleSchema(Schema):active=Active()>>>SimpleSchema().dump({'state':'active'}){'active':True})>>>SimpleSchema().dump({'state':'inactive'}){'active':False}>>>SimpleSchema().load({'active':True}){'state':'active'}>>>SimpleSchema().load({'active':False}){'state':'inactive'}Filter by query parameter:>>>classSimpleFilterSchema(Schema):active=Active(as_filter=True)>>>SimpleFilterSchema().load({'active':'true'}){'state':'active'}>>>SimpleFilterSchema().load({'active':'false'}){'state':'inactive'}>>>SimpleFilterSchema().load({}){'state__ne':'deleted'}For experienced usage trypositives,negatives,positive_filter,negative_filter,missing_filterparameters. You can see behaviour for this parameters in tests.
Package: marshmallow-annotations
marshmallow-annotations allows you to create marshmallow schema from classes
with annotations on themfrommarshmallow_annotationsimportAnnotationSchemafrom.musicimportAlbum,ArtistclassAlbumScheme(AnnotationSchema):classMeta:target=Albumregister_as_scheme=TrueclassArtistScheme(AnnotationSchema):classMeta:target=Artistregister_as_scheme=Truescheme=ArtistScheme()scheme.dump(Artist(id=1,name="Abominable Putridity",albums=[Album(id=1,name="The Anomalies of Artificial Origin")]))# {#     "albums": [#         {#             "id": 1,#             "name": "The Anomalies of Artificial Origin"#         }#     ],#     "id": 1,#     "name": "Abominable Putridity"# }Installationmarshmallow-annotations is available onpypiand installable with:pip install marshmallow-annotationsmarshmallow-annotations supports Python 3.6+ and marshmallow 2.x.xNoteIf you are installmarshmallow-annotationsoutside of a virtual
environment, consider installing withpip install--usermarshmallow-annotationsrather than using sudo or
adminstrator privileges to avoid installing it into your system Python.Why?Keeping up with entity definitions, ORM mappings and schema shapes can be a huge
pain the butt. If you change one thing, you need to change three things.Instead, marshmallow-annotations wants to drive schema shapes from your
entity defintions (with a little help from you of course).More InformationFor more information,please visit the documentation.Found a bug, have a question, or want to request a feature? Here is ourissue tracker.Need the source code? Here is therepository