Saravanan666/pypi-org huggingface dataset:
Package: aliyunstoreplugin
Aliyun OSS store plugin for MLflowThis repository provides a MLflow plugin that allows users to use a aliyun oss as the artifact store for MLflow.Implementation overviewaliyunstoreplugin: this package includes theAliyunOssArtifactRepositoryclass that is used to read and write artifacts from Aliyun OSS storage.setup.pyfile defines entrypoints that tell MLflow to automatically associate theossURIs with theAliyunOssArtifactRepositoryimplementation when thealiyunstorepluginlibrary is installed. The entrypoints are configured as follows:entry_points={
        "mlflow.artifact_repository": [
            "oss=aliyunstoreplugin.store.artifact.aliyun_oss_artifact_repo:AliyunOssArtifactRepository"
        ]
    },UsageTo store artifacts in Aliyun OSS Storage, specify a URI of the formoss://<bucket>/<path>.
This plugin expects Aliyun Storage access credentials in theMLFLOW_OSS_ENDPOINT_URL,MLFLOW_OSS_KEY_IDandMLFLOW_OSS_KEY_SECRETenvironment variables,
so you must set these variables on both your client
application and your MLflow tracking server. Finally, you must runpip install oss2separately (on both your client and the server) to access Aliyun OSS Storage
Package: aliyunswarm
集群接入点地址：参考：
https://help.aliyun.com/document_detail/26063.html?spm=a2c4g.11186623.6.768.81bb2d05Wmhak0Testfrom aliyunswarm import *

if __name__ == "__main__":
    swarm_api = SwarmApi("https://host:port/",
                        "/path/ca.pem",
                        "/path/cert.pem",
                        "/path/key.pem")

    ################################################
    # applications api
    ################################################
    # 查询全部应用
    swarm_api.query_applications()
    # 查询应用
    swarm_api.query_applications('swarmtest')
    # 创建应用
    template = open('./compose/compose_ngx.yaml', 'r').read()
    swarm_api.create_application(template, 'swarmtest', 'swarm test')
    # 停止应用
    swarm_api.stop_application('swarmtest')
    # 启动应用
    swarm_api.start_application('swarmtest')
    # 终止应用
    swarm_api.kill_application('swarmtest')
    # 删除应用
    swarm_api.delete_application('swarmtest')
    # 重新部署应用
    swarm_api.redeploy_application('swarmtest')
    # 更新应用
    template = open('./compose/compose_ngx.yaml', 'r').read()
    swarm_api.update_application(template, 'swarmtest', 'swarmtest 2', version='2.0')

    ################################################
    # services api
    ################################################
    # 查询服务
    swarm_api.query_services('api')
    # 查询指定应用的服务
    swarm_api.query_service('swarmtest', 'api')
    # 启动指定应用的服务
    swarm_api.start_service('swarmtest', 'api')
    # 停止指定应用的服务
    swarm_api.stop_service('swarmtest', 'api')
    # 中止指定应用的服务
    swarm_api.kill_service('swarmtest', 'api')
Package: aliyun-swarm-sdk
#create_application====================================================================="""data = {"name": "nginx","description": "This is a test application",'template': 'version: \'2\'\r\nservices: \r\n nginx4:\r\n    volumes:\r\n     - /data/servicesLog:/data/servicesLog\r\n    image: "xxxx"\r\n    restart: always\r\n    environment:\r\n      - msjvm="2048"\r\n      - mxjvm="2048"\r\n      - env_tag=prod\r\n    command: ["/bin/sh","/usr/local/run.sh"]\r\n    labels:\r\n        aliyun.routing.port_8080: nginx4;http://nginx4.xxxx.com\r\n        aliyun.routing.session_sticky: false\r\n        aliyun.global: true',"version": "1.0",}Swarm_Object.create_application('https://xxxxxxxxxxx:20180', 'ca.pem', 'cert.pem', 'key.pem', data)"""#update_application"""data = {"description": "This is a test application",'template': 'version: \'2\'\r\nservices: \r\n nginx4:\r\n    volumes:\r\n     - /data/servicesLog:/data/servicesLog\r\n    image: "docker.wanshifu.com:5000/worker"\r\n    restart: always\r\n    environment:\r\n      - msjvm="2048"\r\n      - mxjvm="2048"\r\n    command: ["/bin/sh","/usr/local/run.sh"]\r\n    labels:\r\n        aliyun.routing.port_8080: nginx4;http://nginx4.wanshifu.com\r\n        aliyun.routing.session_sticky: false\r\n        aliyun.global: true',"version": "4.0",}Swarm_Object.update_application('https://xxxxxxxxxxx:20180', 'ca.pem', 'cert.pem', 'key.pem', data, 'nginx' )"""#update_application"""data = {"update_method": "blue-green","description": "This is a test application",'template': 'version: \'2\'\r\nservices: \r\n nginx8:\r\n    volumes:\r\n     - /data/servicesLog:/data/servicesLog\r\n    image: "docker.wanshifu.com:5000/worker"\r\n    restart: always\r\n    environment:\r\n      - msjvm="2048"\r\n      - mxjvm="2048"\r\n    command: ["/bin/sh","/usr/local/run.sh"]\r\n    labels:\r\n        aliyun.routing.port_8080: nginx4;http://nginx4.wanshifu.com\r\n        aliyun.routing.session_sticky: false\r\n        aliyun.global: true',"version": "5.0",}Swarm_Object.update_application('https://xxxxxxxxxxx:20180', 'ca.pem', 'cert.pem', 'key.pem', data, 'nginx')"""#update_confirmation#Swarm_Object.update_confirmation('https://xxxxxxxxxxx:20180', 'ca.pem', 'cert.pem', 'key.pem','nginx')#redeploy_application"""redeploy_application"""#Swarm_Object.redeploy_application('https://xxxxxxxxxxx:20180', 'ca.pem', 'cert.pem', 'key.pem', 'nginx')#stop_application#Swarm_Object.stop_application('https://xxxxxxxxxxx:20180', 'ca.pem', 'cert.pem', 'key.pem', 'nginx')#start_application#Swarm_Object.start_application('https://xxxxxxxxxxx:20180', 'ca.pem', 'cert.pem', 'key.pem', 'nginx')#kill_application#Swarm_Object.kill_application('https://xxxxxxxxxxx:20180', 'ca.pem', 'cert.pem', 'key.pem', 'nginx')#delete_application#Swarm_Object.delete_application('https://xxxxxxxxxxx:201801', 'ca.pem', 'cert.pem', 'key.pem', 'nginx')
Package: aliyun-table
aliyun-table阿里云表格相关操作目前支持：[ ] 查询全部数据[x] 表格查询：短语查询，前缀匹配查询，精准查询，范围查询[x] 插入数据[x] 更新数据已知bug:[ ] 查询超过100条时，不加排序可能导致查询无法翻页.CHANGELOGv0.1.2 (2020-03-19)现在put_row和update_row会以字典形式返回主键信息.安装pipinstall--upgradealiyun-table安装完成后，在交互界面执行：>>>fromaliyun_tableimportTableClient>>>如果没有报错，说明安装成功初始化以下变量可以设置为环境变量OTS_END_POINTOTS_ACCESS_KEY_IDOTS_ACCESS_KEY_SECRETfromaliyun_tableimportTableClienttable_cli=TableClient()插入数据和更新数据table_cli=TableClient(instance_name='实例名',end_point='endpoint',access_key_id='access_key_secret',access_key_secret='access_key_secret'):data={'pk1':'123',# pk2为自增列，需要传None.'pk2':None,'col1':'test''article':'This is a test article.'}pk_dict=table_cli.put_row(table_name='table_name',pk_list=['primary_key1','primary_key2'],data=data)print(pk_dict)ReferenceclassTableClient(object):def__init__(self,table_name,instance_name,end_point=None,access_key_id=None,access_key_secret=None):...defshow_index(self,index_name='filter'):...defput_row(self,table_name,pk_list,data):"""写入数据,写入成功返回消耗cu.:param pk_list [list]: primary key name list. e.g. ['pk1', 'pk2']:param data [dict]: 包括主键在内的数据字典."""...defupdate_row(self,pk_list,data):"""Update row:param pk_list [list]: primary key name list. e.g. ['pk1', 'pk2']:param data [dict]: 包括主键在内的数据字典."""...defquery(self,table_name,must_query_list=[],must_not_query_list=[],should_query_list=[],get_total_count=False,sort_list=None,index_name='filter',column_to_get=None,limit=None):"""第一个版本的and查询.根据用户输入的查询条件构造阿里云查询.:param must_query_list [list]: 需要满足的查询条件列表, 不指定则默认为查询全部数据:param must_not_query_list [list]: 不查询的条件列表（满足这些条件的数据不查询）:param should_query_list [list]: 不查询的条件列表（满足这些条件的数据不查询）:param get_total_count [bool]: 是否需要获取查询到的总数量:param sort_list [list]: 列的排序列表，格式为list. 默认不排序:param limit [int]: 最多返回多少数量的数据:return: 查询到数据的迭代器，每个数据根据get_total_count的取值有所不同...
Package: aliyun-voice
Python 语言版本Go版本Installpip install aliyun_voiceTTS 【语音合成服务】Voice(ACCESS_ID, ACCESS_KEY)阿里云认证。from aliyun_voice.voice import Voice
auth = Voice(ALIYUNACCESSID, ALIYUNACCESSKEY)auth.get_voice(text, **tts_params)获取语音文件字节数组，或抛出错误。auth.save_voice(text, dist, **tts_params)存储语音文件到指定目录【dist】，或抛出错误。auth.tts_params设置语音文件属性,参考：https://help.aliyun.com/document_detail/52793.html?spm=5176.doc30422.6.587.Z6MuvvTestpython-munittestdiscover-v
Package: aljson
Convert a SqlAlchemy query object to a dict(json)Installpip install aljsonUsagefromaljsonimportBaseMixin# The Sqlalchemy modelclassParent(Base,BaseMixin):__tablename__='parent'id=sa.Column(sa.Integer,primary_key=True,unique=True)name=sa.Column(sa.String(64))# query Parent modelprint(result.to_json())Full examplefromsqlalchemy.ormimportsessionmaker,relationship,backreffromsqlalchemy.ext.declarativeimportdeclarative_basefromaljsonimportBaseMixinimportsqlalchemyassaBase=declarative_base()classParent(Base,BaseMixin):__tablename__='parent'id=sa.Column(sa.Integer,primary_key=True,unique=True)name=sa.Column(sa.String(64))classChild(Base,BaseMixin):__tablename__='child'id=sa.Column(sa.Integer,primary_key=True,unique=True)name=sa.Column(sa.String(64))parent_id=sa.Column(sa.Integer,sa.ForeignKey('parent.id'))parent=relationship("Parent")# Create an engine that stores data in the local directory's# sqlalchemy_example.db file.engine=sa.create_engine('sqlite:///my_database.sqlite')# Create all tables in the engine. This is equivalent to "Create Table"# statements in raw SQL.Base.metadata.create_all(engine)DBSession=sessionmaker(bind=engine)session=DBSession()# Create a new parent and a childnew_parent=Parent()new_parent.name="parent_1"new_child=Child()new_child.name="child_1"new_child.parent=new_parentsession.add(new_parent)session.add(new_child)session.commit()# Search for a rowquery_result=session.query(Child).first()# And you can call .to_jsonprint(query_result.to_json())# The result should be like this:# {'id': 1, 'name': 'child_1', 'parent_id': 1, 'parent': {'id': 1, 'name': 'parent_1'}}
Package: alkana
alkanaA tool to get the katakana reading of an alphabetical string.InstallingPython 3 or higher is required.From pippython3 -m pip install -U alkanaClone from GitHub$ git clone https://github.com/cod-sushi/alkana.py
$ cd alkana.py
$ python3 -m pip install -U .ExamplePython importimportalkanaprint(alkana.get_kana("Hello"))print(alkana.get_kana("World"))print(alkana.get_kana("abcdefg"))Output of above example is:ハロー
ワールド
NoneIf the reading is not exist, ReturnsNone.Command line$alkanahello
ハロー
$alkanaworld
ワールド
$alkanaabcdefgIf the reading is not exist, there is no output.External fileAlkana can extend the dictionary.sample.csvhogehoge,ホゲホゲ
piyopiyo,ピヨピヨ
...importalkanaalkana.add_external_data('./sample.csv')print(alkana.get_kana('hogehoge'))# ホゲホゲCopyrightsAlphabetical word - katakana dictionary's data is frombep-eng.dic.Bilingual Emacspeak Project(c) 1999-2002 Bilingual Emacspeak ProjectLisenceGPLv2
Package: alkana.py
alkana.pyA tool to get the katakana reading of an alphabetical string.InstallingPython 3 or higher is required.From pippython3 -m pip install -U alkana.pyClone from GitHub$ git clone https://github.com/cod-sushi/alkana.py
$ cd alkana.py
$ python3 -m pip install -U .ExamplePython importQuick example:importalkanaprint(alkana.get_kana("Hello"))print(alkana.get_kana("World"))print(alkana.get_kana("abcdefg"))Output of above example is:ハロー
ワールド
NoneIf the reading is not exist, ReturnsNone.Command line$alkanahello
ハロー
$alkanaworld
ワールド
$alkanaabcdefgIf the reading is not exist, there is no output.CopyrightsAlphabetical word - katakana dictionary's data is frombep-eng.dic.Bilingual Emacspeak Project(c) 1999-2002 Bilingual Emacspeak ProjectLisenceGPLv2
Package: alkh
alkh [al-khwarizmi]Algorithmic python debugging1.Convert your debugger stack to jupyter notebook2.Focus on code pathways using local web applicationInstallationpip install alkhConvert your debugger stack to jupyter notebookAPIfunction name: take_it_offlinedescription: create jupyter notebook based on the program stackparameters:notebook_dir_path: Optional[str] = None, directory path to save the notebook inlevels: Optional[int] = 1, number of program stack layers to put in notebookUsageimport alkhalkh.take_it_offline('path-of-notebooks-directory')oralkh.take_it_offline('path-of-notebooks-directory', levels=2)orbash:export ALKH_NOTEBOOKS_PATH='path-to-notebooks-directory'python:import alkhalkh.take_it_offline()oralkh.take_it_offline(levels=2)Usage flow exampleStop at breakpoint within PyCharmUse Console to run code within debuggerRun: import alkhRun: alkh.take_it_offline('path-of-notebooks-directory')Start JupyterRun the notebookFocus on code pathways using local web applicationAPIfunction name: analyzedescription: launches web application to analyze code pathwaysparameters:NoneUsageimport alkhalkh.analyze()Usage flow exampleAdd two line to top of fileRun the fileAnalyze your code
Package: alkivi-config-manager
Python config-manager used at AlkiviPackageExampleWrite a conf like[default]; general configuration: default endpointendpoint=dev[dev]; configuration specific to 'dev' endpointenv=dev[prod]; configuration specific to 'prod' endpointenv=prodfromalkivi.configimportConfigManagerconfig=ConfigManager('test')# This will look for several files, in order# 1. Current working directory: ``./test.conf``# 2. Current user's home directory ``~/.test.conf``# 3. System wide configuration ``/etc/test.conf``# Then find the endpointendpoint=config.get('default',endpoint)# Or use a specific oneendpoint='prod'# And thenenv=config.get(endpoint,'env')ParametersTestsTesting is set up usingpytestand coverage is
handled with the pytest-cov plugin.Run your tests withpy.testin the root directory.Coverage is ran by default and is set in thepytest.inifile. To see
an html output of coverage openhtmlcov/index.htmlafter running the
tests.TODOTravis CIThere is a.travis.ymlfile that is set up to run your tests for
python 2.7 and python 3.2, should you choose to use it.TODO
Package: alkivi-google-client
Google python client used at AlkiviPackageExamplefromalkivi.googleimportclientasgoogleimportloggingscope='https://www.googleapis.com/auth/admin.directory.user.readonly'# Using default configurationgoogle_client=google.Client(scopes=[scope])# Using specific endpointgoogle_client=google.Client(endpoint='account2')# Get directory client for Admin SDK apiimpersonate='toto@alkivi.fr'directory_client=google_client.get_directory_client(impersonate)# Get a gmail client for gmail APIgmail_client=google_client.get_gmail_client()CredentialsCredentials are fetched from, in priority order: - ./google.conf (script
directory) - $HOME/.google.conf - /etc/google.confExample[default]; general configuration: default endpointendpoint=account1[account1]; configuration specific to 'account1' endpoint; using can be; - service: for Service Account; - oauth: for OAuth authentificationusing=service; for Service Accountservice_account_key=/path/to_your_service_key.json[account2]; other account configurationusing=oauth; for OAuthclient_id=your_client_idclient_secret=your_client_secretrefresh_token=your_refresh_tokenTestsTesting is set up usingpytestand coverage is
handled with the pytest-cov plugin.Run your tests withpy.testin the root directory.Coverage is ran by default and is set in thepytest.inifile. To see
an html output of coverage openhtmlcov/index.htmlafter running the
tests.TODOTravis CIThere is a.travis.ymlfile that is set up to run your tests for
python 2.7 and python 3.2, should you choose to use it.TODO
Package: alkivi-logger
Python logger used at AlkiviPackageExampleimportloggingfromalkivi.loggerimportLogger## Define Logger#logger=Logger(min_log_level_to_mail=None,min_log_level_to_save=logging.DEBUG,min_log_level_to_print=logging.DEBUG,min_log_level_to_syslog=None,emails=['youremail@example.org'],use_root_logger=False)# If set to True will use root_logger## All log level, from bottom to top#logger.debug('This is a debug comment')logger.info('This is an info comment')logger.warning('This is a warning comment')logger.error('This is an error comment')logger.critical('This is a critical comment')try:1/0exceptExceptionase:logger.exception('This is an exception comment')pass## You can adjust log level on the fly#logger.set_min_level_to_mail(logging.WARNING)logger.set_min_level_to_save(logging.WARNING)## You can use loops#logger.new_loop_logger()foriinrange(0,11):logger.new_iteration(prefix='i=%i'%(i))logger.debug("We are now prefixing all logger")ifi==9:logger.debug("Lets do another loop")logger.new_loop_logger()forjinrange(0,5):logger.new_iteration(prefix='j=%i'%(j))logger.debug("Alkivi pow@")# Dont forget to close logger or shit will happenlogger.del_loop_logger()# Bonus point : if emailing is set, only send email for the loop we have# errorifi==10:logger.critical("We shall receive only mail for last loop")logger.del_loop_logger()logger.debug('We now remove an loop, thus a prefix')ParametersTestsTesting is set up usingpytestand coverage is
handled with the pytest-cov plugin.Run your tests withpy.testin the root directory.Coverage is ran by default and is set in thepytest.inifile. To see
an html output of coverage openhtmlcov/index.htmlafter running the
tests.TODOTravis CIThere is a.travis.ymlfile that is set up to run your tests for
python 2.7 and python 3.2, should you choose to use it.TODO
Package: alkivi-odoo-client
Odoo python client used at Alkivi. Based on odoorpc on which we add
additional fonction.PackageExamplefromalkivi.odooimportclientasodoo# Using default configurationclient=odoo.Client()# Using specific endpointclient=odoo.Client(endpoint='prod')# TODOCredentialsCredentials are fetched from, in priority order: - ./odoo.conf (script
directory) - $HOME/.odoo.conf - /etc/odoo.confExample[default]; general configuration: default endpointendpoint=dev[dev]; configuration specific to 'dev' endpointprotocol=jsonrpc+sslport=443url=odoo.domainversion=8.0db=odooDatabaseuser=pdooUserpassword=AweSomePasswOrd[prod]; other configurationTestsTesting is set up usingpytestand coverage is
handled with the pytest-cov plugin.Run your tests withpy.testin the root directory.Coverage is ran by default and is set in thepytest.inifile. To see
an html output of coverage openhtmlcov/index.htmlafter running the
tests.TODOTravis CIThere is a.travis.ymlfile that is set up to run your tests for
python 2.7 and python 3.2, should you choose to use it.TODO
Package: alkompy
Python bindings foralkomp, a GPGPU library written in Rust for performing compute operations.pip3 install alkompyAt this time, the Python interface is designed to specifically work withnumpy ndarrays. This means you can quickly send a numpy array to a GPU withdata_gpu = device.to_device(my_np_array)and run a computation usingdevice.call(...).to_devicereturns an object that records the memory location of a GPU buffer, as well shape and type. In order to retrieve the contents of the buffer:device.get(data_gpu).getfunction returns a numpy in the same shape asmy_np_array.Build from sourcegit clone https://github.com/RustyBamboo/alkomp && cd alkomppip3 install -r requirements-dev.txtpython3 setup.py develop --userpython3 test/test.py
Package: alkymi
alkymi ⚗️Alkymi is a pure Python (3.7+) library for describing and executing tasks and pipelines with built-in caching and
conditional evaluation based on checksums.Alkymi is easy to install, simple to use, and has very few dependencies outside of Python's standard library. The code
is cross-platform, and allows you to write your pipelines once and deploy to multiple operating systems (tested on
Linux, Windows and Mac).Documentation, including a quickstart guide, is providedhere.FeaturesEasily define complex data pipelines as decorated Python functionsThis allows you to run linting, type checking, etc. on your data pipelinesReturn values are automatically cached to disk, regardless of typeEfficiently checks if pipeline is up-to-dateChecks if external files have changed, bound functions have changed or if pipeline dependencies have changedNo domain specific language (DSL) or CLI tool, just regular PythonSupports caching and conditional evaluation in Jupyter NotebooksCross-platform - works on Linux, Windows and MacExpose recipes as a command-line interface (CLI) using alkymi'sLabtypeSample UsageFor examples of how to use alkymi, see thequickstart guide.Example code:importnumpyasnpimportalkymiasalk@alk.recipe()deflong_running_task()->np.ndarray:# Perform expensive computation here ...hard_to_compute_result=np.array([42])# Return value will be automatically cached to diskreturnhard_to_compute_resultresult=long_running_task.brew()# == np.ndarray([42])Or one of the examples, e.g.MNIST.InstallationInstall via pip:pipinstall--useralkymiOr see theInstallation page.TestingAfter installing, you can run the test suite (use thelint,coverageandtype_checkrecipes to perform those
actions):python3labfile.pybrewtestLicensealkymi is licensed under The MIT License as found in the LICENSE.md fileUpcoming FeaturesThe following features are being considered for future implementation:Type annotations propagated from bound functions to recipesSupport for call/type checking all recipes (e.g. by adding acheckcommand toLab)Cache maintenance functionalityKnown Issuesalkymi currently doesn't check custom objects for altered external files when computing cleanliness (e.g.MyClasshas aself._some_paththat points to a file somewhere outside alkymi's internal cache)alk.foreach()currently only supports enumerable inputs of typeListorDictRecipes markedtransientwill always be dirty, and thus always require reevaluation. This functionality should be
replaced by a proper means of creating recipes that don't cache outputs, but only run when needed to provide inputs for
downstream recipes
Package: allabaster
All these fancy sidebars and footers were stripped down, as well,
as html head and body tags. Now theme generates not complete html
pages, but html fragments. It’s intended usage – to insert these
fragments into other html pages.CSS code was modified to decrease chance of interference with
css rules of the main site.Breadcrumbs were added to simplify navigation.WarningThe rest of the page is not reworked yet, and copied from Alabaster.Alabaster is a visually (c)lean, responsive, configurable theme for theSphinxdocumentation system. It is Python 2+3 compatible.It began as a third-party theme, and is still maintained separately, but as of
Sphinx 1.3, Alabaster is an install-time dependency of Sphinx and is selected
as the default theme.Live examples of this theme can be seen onthis project’s own website,paramiko.org,fabfile.organdpyinvoke.org.For more documentation, please seehttp://alabaster.readthedocs.io.NoteYou can install thedevelopment versionviapip installalabaster==dev.
Package: allabolag
This is a scraper for collecting data from allabolag.se. It has no formal relationship with the site.It is written and maintained forNewsworthy, but could possibly come in handy for other people as well.InstallingpipinstallallabolagExample usagefromallabolagimportCompanycompany=Company("559071-2807")# show all available data about the company in a raw...print(company.raw_data)# ...or cleaned formatprint(company.data)And you can iterate the list of recent liquidations.fromallabolagimportiter_liquidated_companiesforcompanyiniter_liquidated_companies(until="2019-06-01"):print(company)DevelopingTo run tests:python3-mpytestDeploymentTo deploy a new version to PyPi:Update Changelog below.Update version insetup.pyBuild:python3 setup.py sdist bdist_wheelUpload:python3 -m twine upload dist/allabolag-X.Y.X*…assuming you have Twine installed (pip install twine) and configured.Changelog0.1.7Bug fix: Add encoding for Python 2.70.1.6Fixes bug when company has remark about Svensk Handels Varningslistan0.1.5Make Python 2.7 compatible.0.1.4Updating _iter_liquidate_companies to handle rebuilt site.0.1.3Bug fixes0.1.0First version
Package: all-against-all
Each item of a list against all others$pipinstallall-against-allfromall_against_allimportall_against_allimportoperatorlist_=[1,2,3,4]e=all_against_all(func=operator.add,iterable=list_,ignore_exceptions=True,skip_own=True)e=list(e)foreeine:print(ee)# [((1, 2), 3), ((1, 3), 4), ((1, 4), 5)]# [((2, 1), 3), ((2, 3), 5), ((2, 4), 6)]# [((3, 1), 4), ((3, 2), 5), ((3, 4), 7)]# [((4, 1), 5), ((4, 2), 6), ((4, 3), 7)]e=all_against_all(func=operator.add,iterable=list_,ignore_exceptions=True,skip_own=False)e=list(e)foreeine:print(ee)# [((1, 2), 3), ((1, 3), 4), ((1, 4), 5)]# [((2, 1), 3), ((2, 3), 5), ((2, 4), 6)]# [((3, 1), 4), ((3, 2), 5), ((3, 4), 7)]# [((4, 1), 5), ((4, 2), 6), ((4, 3), 7)]# [((1, 1), 2), ((1, 2), 3), ((1, 3), 4), ((1, 4), 5)]# [((2, 1), 3), ((2, 2), 4), ((2, 3), 5), ((2, 4), 6)]# [((3, 1), 4), ((3, 2), 5), ((3, 3), 6), ((3, 4), 7)]# [((4, 1), 5), ((4, 2), 6), ((4, 3), 7), ((4, 4), 8)]