Saravanan666/pypi-org huggingface dataset:
Package: mmpy-bot-mk2
Forked from [attzonko/mmpy_bot]Documentation available atRead the Docs.DescriptionA Python based chat bot framework forMattermost. The code for
this bot framework was heavily re-factored in v2.0.0 and will only work with Python 3.8 or higher.
For Python 2 and Python3 < 3.8 support, please use versions v1.3.9 or lower.FeaturesBased on MattermostWebSocket API(V4.0.0)Simple plugins mechanismConcurrent message handlingAttachment supportAuto-reconnect to Mattermost after connection lossAdditional features added in v2.x:Multi-threading and asyncio executionIntegrated webhook serverSupport for click functionsJob schedulingCompatibilityMattermostmmpy_bot_mk2>= 4.0> 1.2.0<  4.0unsupportedInstallation:warning: Warning: pip will grab v1.x if your Python version is less than 3.8!v2.x (latest)pip install mmpy-botv1.3.9 (force legacy)pip install mmpy-bot==1.3.9Usage (v2.x)RegistrationFirst you need to create a bot account on your Mattermost server.
Note:Enable Bot Account Creationmust be enabled under System ConsoleLogin to your Mattermost server as a user with Administrative privileges.Navigate to Integrations -> Bot Accounts -> Add Bot AccountFill in the configuration options and upon creation take note of theAccess TokenNote that some API functions, such as ephemeral message replies, will require the bot to be part of theSystem Admingroup,
however most API functions will work with a regularMemberaccount role. Just be aware that if some API functions are not working, it
may be due to a lack of appropriate permissions.Configure and run the botCreate an entrypoint file (or copy the one provided), that defines your Mattermost server and bot account settings and imports
the desired modules.Examplemy_bot.py:#!/usr/bin/env pythonfrommmpy_bot_mk2importBot,Settingsfrommy_pluginimportMyPluginbot=Bot(settings=Settings(MATTERMOST_URL="http://chat.example.com",MATTERMOST_PORT=443,BOT_TOKEN="a69155mvlsobcnqpfdceqihaa",BOT_TEAM="test",SSL_VERIFY=True,),# Either specify your settings here or as environment variables.plugins=[MyPlugin()],# Add your own plugins here.)bot.run()Set the executable bit on the entrypoint file (i.e.chmod +x my_bot.py) and start your bot from the command prompt. Now you can talk to your bot in your Mattermost client!In order to get the most out of your bot, you will need to write your own plugins. Refer to thePlugins Documentationto get started.Talk to usThe primary channel for communication isGitHubviaIssuesorPull requests
Package: mmq
MMQ (Least Squares method) PackageDescriptionThe function takes a set of 2-D points(np.array)and returns the coefficients of the function that best fits the points, using the Least Squares method.
User needs to provide the function degree (1 for linear, 2 for quadratic, etc.) and the points (x and y) as np.arrays.Maybe, for high degree functions, the function will face some problems. Be careful.InstallationpipinstallmmqRequirementsnumpyUsagefrommmqimportmetodo_minimos_quadradosmetodo_minimos_quadrados.mmq(x,y,degree)Examplefrommmqimportmetodo_minimos_quadradosimportnumpyasnpx=np.array([1,2,3,4,5])y=np.array([1,3,5,7,9])degree=1metodo_minimos_quadrados.mmq(x,y,degree)LicenseMITAuthor[Igor Matheus Jasenovski]Version0.0.1ReferencesLeast Squares Method
Package: mmrbipy
mmrbipy: A solver for the min-max regret binary integer programming problem (MMR-BIP)InstallationIn a virtual environment with Python 3.6+, mmrbipy can be installed viapipinstallmmrbipyUsing mmrbipyWith a compatible instance file, mmrbipy solves the MMR-BIP from a Python script:frommmrbipyimportModel# Generate a model from instance filemod=Model(problem='kp',filename='../instance/KP/1-70-01-45-20')# Solve by iDS algorithm with best-scenario constraintsmod.solve(algorithm='ids-b',timelimit=100)# Print resultsprint("objective value:{}".format(mod.objval))print("time to best:{:.2f}".format(mod.ttb))# Write the results to filemod.write("result.txt")ModelTo solve the MMR-BIP, mmrbipy provides five types of instance format:min-max binary integer programming problem (bip)min-max regret knapsack problem (kp)min-max regret multidimensional knapsack problem (mkp)min-max regret set covering problem (scp)min-max regret generalized assignment problem (gap)Seeinstance pagefor the details of each typeSet problem type in constructor ofModelclass# Generate a model from instance filemod=Model(problem='kp',filename='../instance/KP/1-70-01-45-20')Note: Benchmark instances formin-max regret knapsack problemmin-max regret multidimensional knapsack problemmin-max regret set covering problemmin-max regret generalized assignment problemare available in theinstancedirectory on theproject's homepage. For easy access to the example files, we recommend cloning the repository.AlgorithmTo solve the MMR-BIP, mmrbipy provides the following algorithms:fixed scenario algorithm (fix);Benders-like decomposition algorithm (bd);branch-and-cut algorithm with Benders cuts (bc);dual substitution algorithm (ds);iterated dual substitution algorithm with best-scenario constraints (ids-b);iterated dual substitution algorithm with Hamming-distance constraints (ids-h);branch-and-cut algorithm for dual substitution model with best-scenario constraints (bcds-b);branch-and-cut algorithm for dual substitution model with Hamming-distance constraints (bcds-h).Set algorithm type insolvefunction# Solve by iDS algorithm with best-scenario constraintsmod.solve(algorithm='ids-b',timelimit=100)Note: The implement are based ongurobypy.Additional informationFor more information about the algorithms used in the solver, seeWu et al. (2022).
Package: mmr.py
MMR.pyMerkle Mountain RangeInstallpip3 install -U git+https://github.com/jjyr/mmr.py.gitExamplefrommmrimportMMRdeftest_mmr():defserialize(i):returni.to_bytes(4,'little')mmr=MMR()# push 0..11 into MMR, and record MMR positionspositions=[mmr.add(serialize(i))foriinrange(0,11)]merkle_root=mmr.get_root()# proofelem=5pos=positions[elem]# generate proof for 5proof=mmr.gen_proof(pos)# verify proofresult=proof.verify(root=merkle_root,pos=pos,elem=serialize(elem))assert(result)print("Ok")test_mmr()Seeteststo learn more.LicenseMIT
Package: mmrwrapper
Simple-Async API Wrapper for WhatIsMyMMR Website (League of Legends)Creator-Attribution:Title: WhatIsMyMMRCreator: Josh Kross /josh@whatismymmr.comSource:https://euw.whatismymmr.com//https://dev.whatismymmr.com/License:https://creativecommons.org/licenses/by/4.0/Disclaimer:Use a unique and descriptive user agent string, which should include the target platform, a unique application identifier, and a version string.
The following format is recommended: <platform>:<app ID>:<version string>. For example, iOS:com.example.helloworld:v1.0.3.
Don’t lie about your user agent, such as spoofing popular browsers. This is a bannable offense.Limit the rate of requests to 60 per minute.
The database server is only so powerful. If you think you’ll need a higher request rate, contact Josh before hitting the servers.! All API Rights Reserved by the Owner ofhttps://euw.whatismymmr.com- Josh !
Package: mmsbm
Mixed Membership Stochastic Block ModelsThis repo followsthiswork on Mixed Membership Stochastic Block Models to build a recommender
system [1].Installationpip install mmsbmUsageInput dataYou'll need a pandas dataframe with exactly 3 columns: users, items and ratings, e.g.:importpandasaspdfromrandomimportchoicetrain=pd.DataFrame({"users":[f"user{choice(list(range(5)))}"for_inrange(100)],"items":[f"item{choice(list(range(10)))}"for_inrange(100)],"ratings":[choice(list(range(1,6)))for_inrange(100)]})test=pd.DataFrame({"users":[f"user{choice(list(range(5)))}"for_inrange(50)],"items":[f"item{choice(list(range(10)))}"for_inrange(50)],"ratings":[choice(list(range(1,6)))for_inrange(50)]})SetupfrommmsbmimportMMSBM# Initialize the MMSBM class:mmsbm=MMSBM(user_groups=2,item_groups=4,iterations=500,sampling=5,seed=1,)Fit modelsIn here you have two options, a simple fit where we run "sampling" times the fitting algorithm and return the results
for all runs, you are then in charge of choosing the best one.mmsbm.fit(train)The other option is the cv_fit, whereby we split the input data in "folds" number of folds
and run the fitting in each one and test on the excluded fold. We then return all the
samplings of the best performing model.mmsbm.cv_fit(train,folds=5)PredictionOnce the model is fitted, we can predict on test data. The function predict returns
the prediction matrix (the probability of each user to belong to each group) as a numpy array.pred_matrix=mmsbm.predict(test)ScoreFinally, you can get statistics about the goodness of fit and other parameters of the model,
as well as the computed objects: the theta matrix, the eta matrix and the probability distributions.The function score returns a dictionary with two sub-dictionaries, one for statistics about the model (called "stats") and
the other one with the computed objects (called "objects").results=mmsbm.score()PerformanceEach iteration takes a little about half a second in an Intel i7. This means that a
500 iteration runs takes around 4 minutes. The computation
is vectorized, so, as long as you don't go crazy with the number of observations,
the time should be approximately the same regardless of training set size.
It is also parallelized over sampling, so, as long as you choose less sampling
than number of cores, you should have approximately the same performance
regardless of training set size and sampling number.A complete study could be something like 100 hyperparameter optimization runs
of 6 samples of 400 iterations, which will take about 10 hours.TestsTo run tests do the usual:python -m pytest tests/*TODOProgress bars are not working for jupyter notebooks.Include user_groups and item_groups optimization procedure.ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Please make sure to update tests as appropriate.References[1]: Godoy-Lorite, Antonia, et al. "Accurate and scalable social recommendation
using mixed-membership stochastic block models." Proceedings of the National
Academy of Sciences 113.50 (2016): 14207-14212.
Package: mmseg
MMseg中文分词 Chinese Segment On MMSeg Algorithm-------------------------------original editionpymmseg-cppby pluskidhttp://code.google.com/p/pymmseg-cpp/This package is Chinese Segment , I think only chinese need it, so the description is chinese .If you have interesting , have a look a the original edition-------------------------------全文索引用，配合 xapian ( http://xapian.org/ ) 可以很方便的做全文索引~:python -m mmseg.search----------哈尔罗杰历险记(套)哈尔罗杰历险历险记----------卡拉马佐夫兄弟卡拉马佐夫兄弟----------银河英雄传说银河英雄传说银河英雄传说----------张无忌在光明顶无忌张无忌光明光明顶----------韦帅望的江湖(Ⅲ众望所归)韦帅帅望韦帅望江湖众望望所所归众望所归----------少年韦帅望之童年结束了少年韦帅帅望望之韦帅望之童年结束----------晋江文学网站驻站作家，已出版多部作品。晋江文学网站文学网站驻站作家出版多部作品-------------------------------分词用，适用于聚类等等from mmseg import seg_txtfor i in seg_txt("最主要的更动是：张无忌最后没有选定自己的配偶。"):print i-------------------------------配合xapian做索引#coding:utf-8#!/usr/bin/env pythonimport xapianimport sysimport stringfrom collections import defaultdictfrom mmseg.search import seg_txt_search,seg_txt_2_dictimport xapianSEARCH_DB = xapian.WritableDatabase(DBPATH, xapian.DB_CREATE_OR_OPEN)SEARCH_ENQUIRE = xapian.Enquire(SEARCH_DB)def index_txt(id, txt):doc = xapian.Document()for word, value in seg_txt_2_dict(txt).iteritems():doc.add_term(word, value)key = ":%s"%iddoc.add_term(key)SEARCH_DB.replace_document(key, doc)def flush_db():SEARCH_DB.flush()if __name__ == "__main__":txt = """治安署地最高长官站在街头，皱眉看着一队近卫军飞快地走过，他心中满是疑惑，立刻回到了治安署里地办公室，然后喊来了自己地一个部下，让他立刻去军方统帅部请示一下."""index_txt(1, txt)flush_db()-------------------------------配合xapian做搜索#coding:utf-8from mmseg.search import seg_txt_search,seg_txt_2_dictimport xapianSEARCH_DB = xapian.WritableDatabase(DBPATH, xapian.DB_CREATE_OR_OPEN)SEARCH_ENQUIRE = xapian.Enquire(SEARCH_DB)def search(keywords, offset=0, limit=35, enquire=SEARCH_ENQUIRE):query_list = []for word, value in seg_txt_2_dict(keywords).iteritems():query = xapian.Query(word, value)query_list.append(query)if len(query_list) != 1:query = xapian.Query(xapian.Query.OP_AND, query_list)else:query = query_list[0]enquire.set_query(query)matches = enquire.get_mset(offset, limit, None)return matchesif __name__ == "__main__":matches = search( "治安")# Display the results.print "%i results found." % matches.get_matches_estimated()print "Results 1-%i:" % matches.size()for m in matches:print "%i: %i%% docid=%i [%s]" % (m.rank + 1, m.percent, m.docid, m.document.get_data())-------------------------------张沈鹏(zsp007@gmail.com) 修改版 rmmseg-cpp
Package: mmseqs
MMseqs2 bindings for PythonThis project provides bidings for mmseqs. It's still work in progress.
This is the base usage scenario:importmmseqs## Demonstration of basic mmseqs2 operations## Create a clientclient=mmseqs.MMSeqs()# Create a database from fasta file# Here we specify name of the database, description and input file# (The input can also be a Seq/SeqRecord list/iterator/etc.)client.databases.create("test","Test database","example/a.fasta")# Get description of the databaseprint(client.databases[0].description)# Perform search on a database# Note that the search queries can be a string with a patch to the FASTA file with queriesresults=client.databases[0].search(["ACTAGCTCAGTCAACTAGCTCAGTCCTCAGTCAACTAGCTCAGTCTATATATATACAAC","ACTAGCTCAGTCAACTAGCTCAGTCCTCAGTCAACTAGCT","ACTAGCTCAGTCAACTAGCT","ACTAGCTCAGT",],search_type="nucleotides",)# Load queries from file:# results = client.databases[0].search_file("input.fasta", search_type="nucleotides")# You can pass list of headers to get:#   query_sequence_id#   target_sequence_id#   query_sequence_content#   target_sequence_content#   sequence_identity#   alignment_length#   number_of_mismatches#   number_of_gap_openings#   domain_start_index_query#   domain_end_index_query#   domain_start_index_target#   domain_end_index_target#   e_value#   bit_score# For example:# results2 = client.databases[0].search(#     [#         "ACTAGCTCAGTCAACTAGCTCAGTCCTCAGTCAACTAGCTCAGTCTATATATATACAAC",#         "ACTAGCTCAGTCAACTAGCTCAGTCCTCAGTCAACTAGCT",#         "ACTAGCTCAGTCAACTAGCT",#         "ACTAGCTCAGT",#     ],#     search_type="nucleotides",#     headers=["query_sequence_id", "target_sequence_id", "sequence_identity", "alignment_length", "number_of_mismatches"]# )# results.records is a list of lists. Each item contains alignments for each query.# Each list of alignments consists of single result# print(results.records)# You can also get a pandas dataframeprint(results.dataframe)
Package: mms-python-adapter
MMS-Python-AdapterThis is a collection of "quality of life" improvements for using the Python client for
the Model Management System (MMS).PurposeThe purpose of the MMS-Python adapter is to wrap the complex REST API functions into easy to use
Python functions allowing users to interact with a system model in a familiar tool. Access to model
elements can allow users to run analyses or even model in Python.ClassesMMSAdapter(server,project id,ref id)Initializing a project object allows the user to set the server, reference ID, and project ID
then run methods on that project.login()This method prompts for the users MMS credentials (username/password) then requests and stores a
ticket to allow the user to run operations without having to log in constantly. Note the username
and password are destryed once the ticket is retrived.logout()This function clears any stored tickets.check_login()This function returns True if the user is logged in and False otherwise.get_element(element id,depth=depth)Returns an Element() object (defined in the MMS client) with the given ID. This is a dictionary
of the attributes of the retrived element and can be used to get the elements name, ID,
documentation, etc. The depth parameter is an optional input and its default value is set to '0'.
Note:depth= -1is the same asrecurse=trueupdate_element_documentation(element id,content)Sets the given elements documentation tocontent.update_element_name(element id,name)Sets the given elements name toname.publish_table(element id,table)Posts a table to the given elements documentation. Here,tableshould be an HTML table.update_element_value(element id,content)Sets the given elements default value tocontent. Note,contentmust be JSON which contatins all appropriate fields for
default value (not just the one to be updated).Installation Instructionsfor pip:pip install mms-python-adapterUpdate Conda to Latest VersionEnsure Conda is updated to its latest version on the BASE environment in order to prevent dependency discrepancies. Enter via terminal:conda update conda -yPulling from conda-forge and InstallationThe mms-python-adapter conda package will be on conda-forge. In order to pull and install the package onto a desired platform, such as JupyterLabs, first add the channel via Terminal:conda config --add channels conda-forgeAfter the channel has been added, install the mms-python-adapter package with:conda install mms-python-adapter -yUsing MMS-Python-AdapterWithin your python script, import the adapter with:from mms_python_adapter import MMSAdapterNote: Although the package is named "mms-python-adapter", the base script is "adapter," and the actual functions are called through the "Adapter" class.Finally, the Adapter is initialized with:ServerProjectIDRefIDadap = MMSAdapter(server, projectID, refID)The functions are listed above under "Classes."
Package: mms-python-logger
mms-alice-python-loggerLog Module for MMS/Alice standarzised log purposesThis is a package for writing logs to GCP App Engine.How to use:1. Import module:frommms_alice_python_logger_pkg.alice_log_handlerimportLoggerPlease also add the following to the requirements.txt or install the pip packages on your VM:google-cloud-logging==1.8.0
mms-python-logger>=0.0.22. Initalize the logger:CloudFunctionLogging:logger=Logger(run_id,project_id,function_name,resource_type)logger=Logger(run_id='lksjdf2',project_id='my-project-id',function_name='ppx-price-updates-de-gcs-bq',resource_type='cloud_function')AppEngineLogging:logger=Logger(run_id,project_id,module_id,version_id,resource_type)logger=Logger(run_id='lksjdfl98',project_id='v135-5683-alice-ksk-explore',module_id='app-flex-sample-service',version_id='v0.0.1',resource_type='gae_app')ComputeEngine:logger=Logger(run_id,project_id,resource_type)logger=Logger(run_id='lksjdfl98',project_id='v135-5683-alice-ksk-explore',resource_type='gce_instance')The following resource_types are supported:Cloud Function: 'cloud_function'
App Engine: 'gae_app'
Compute Engine: 'gce_instance'When resource type is unrecoginzable logs will be processed to 'Global'3. Use the logger:logger.info('your message')logger.warning('your message')logger.error('your message')logger.critical('your message')logger.debug('your message')The logs are visible in Stackdriver Logging via GAE Application -> Module_id -> Version_id for App Engine.
Or under Cloudfunctions -> Function_id
Or under GCE VM Instance -> Instance_idImportantThis log tool only works in App Engine Standard/Flexible, Cloud Function and Compute Engine environment.For local testing do not initialize the logger as it would ran into errors because of the missing GCP context.How we logWe initialize the logger only in the "app.py" file. From there every log entry will be written - Modules used within app.py need to return the exceptions to the caller so
error etc. get logged at one central point within app.py.
Package: mms-stacky
stackyA service management tool for local development.Requirementspython 3pipenvInstallationDevelopmentgitclonegit@gitlab.com:mega-mac-slice/stacky.gitcdstacky
makeinstall

stacky--helpBrewbrewtapmega-mac-slice/tap&&brewinstallstackyConfigurationA "Stacky File" is a json file in a project directory typically named.stacky.jsonthat looks like:{"name":"dev-application","commands":{"start":"make start","status":"make status"},"stack":["git@gitlab.com:mega-mac-slice/dev-postgres.git","git@gitlab.com:mega-mac-slice/dev-redis.git","git@gitlab.com:mega-mac-slice/dev-elasticsearch.git"],"extra":{"kafka":["git@gitlab.com:mega-mac-slice/dev-fast-data-dev.git"]}}Where we defined some commands for the project itself and also the project's dependencies on postgres, redis and elasticsearch.UsageStartstackystartThis will do the following:Iterate through each dependency defined in stack and retrieve it if it doesn't already exist locally.For each dependency, check if it also has a .stacky.json and retrieve those dependencies defined in stack locally.For each dependency, check it's status and start it if needed.With our example .stacky.json we would begin with:dev-application \
    .stacky.json
    MakefileAnd after runningstacky startwould have the dependencies checked out locally adjacent to the project.dev-application \
    .stacky.json
    Makefile
dev-postgres \
    .stacky.json
dev-redis \
    .stacky.json
dev-elasticsearch \ 
    .stacky.jsonStatusstackystatusThis will iterate through the dependencies and check it's status. Letting you know if the stack for your application is running.>stackystatus[INFO]dev-application-ok[INFO]dev-postgres-ok[INFO]dev-redis-ok[INFO]dev-elasticsearch-okStopstacky stopThis will iterate through the dependencies and stop them.>stackystop[INFO]stopping|dev-elasticsearch[INFO]stopping|dev-redis[INFO]stopping|dev-postgresRunstackyruncommand-nameAdditional commands can be defined incommandsand invoked with run.>stackyrunreset[INFO]dev-postgres-ok[INFO]dev-redis-ok[INFO]dev-elasticsearch-okWith the following possible results:ok- command existed and ran successfully.fail- command existed and ran unsuccessfully.skip- command did not exist.Pathsstacky pathsProvides porcelain output of dependency paths intended for usage with external tools.>stackypaths
/dev/src/dev-elasticsearch
/dev/src/dev-redis
/dev/src/dev-postgres

>stackypaths|xargsrm-rfCommand Lifecycleinstall - TODOstartstatusstopSupported Dependenciesgit ssh/httpslocalhttp/https - TODO
Package: mmstat
monitorThe monitor support stat the data from github lark and webot and save data to mongodbinstallaiongitclonehttps://github.com/vansin/monitor.gitcdmonitor
pipinstall-v-e.configsetting your envexportMONGO_URL=mongodb://localhost:27017exportfeishu_webhook_url=https://open.feishu.cn/open-apis/bot/v2/hook/xxxxxx