package
stringlengths
1
122
pacakge-description
stringlengths
0
1.3M
a
UNKNOWN
a00k5pgrtn
UNKNOWN
a0_baas_sdk
a0_baas_sdkurllib3 and requests are used in this project.
a10ctl
UNKNOWN
a10-horizon
# A10 Networks Openstack Horizon Dashboard===========================================A10 Networks Openstack Horizon Dashboard for Thunder, vThunder and AX Series AppliancesSupported releases:* OpenStack: Icehouse, Juno, Kilo, Liberty, Mitaka* LBaaS versions: v1, v2* ACOS versions: ACOS 2/AxAPI 2.1 (ACOS 2.7.2+), ACOS 4/AxAPI 3.0 (ACOS 4.0.1-GA +)Working but not available for support:* OpenStack: git/master## A10 github repos- [a10-horizon](https://github.com/a10networks/a10-horizon) - A10 Horizon Dashboard repo.- [a10-neutron-lbaas](https://github.com/a10networks/a10-neutron-lbaas) - Main A10 LBaaS driver repo. Middleware sitting between theopenstack driver and our API client, mapping openstack constructs to A10's AxAPI.- [acos-client](https://github.com/a10networks/acos-client) - AxAPI client used by A10's OpenStack driver- [a10-openstack-lbaas](https://github.com/a10networks/a10-openstack-lbaas) - OpenStack LBaaS driver,identical to the files that are currently merged into neutron-lbaas. Pypi package'a10-openstack-lbaas'.- [a10-openstack-lbaas, havana branch](https://github.com/a10networks/a10-openstack-lbaas/tree/havana) - OpenStackLBaaS driver, for the Havana release. Pypi package 'a10-openstack-lbaas-havana'.- [a10networks-ci/project-config](https://github.com/a10networks-ci/project-config) - A10 Networks OpenStack third-party CI setup scripts## Installation steps:### Step 1:Make sure you have horizon installed. This dashboard will need to be installed on all of your Horizon nodes if you are running Horizon in an HA environment.### Step 2:The latest supported version of a10-horizon is available via standard pypi repositories and the current development version is available on github.##### Installation from pypi```shsudo pip install a10-horizon```##### Installation from cloned git repository.Download the dashboard from: <https://github.com/a10networks/a10-horizon>```shsudo pip install git+https://github.com/a10networks/a10-horizon.git``````shgit clone https://github.com/a10networks/a10-horizon.gitcd a10-horizonsudo pip install -e .```## ConfigurationHorizon provides a plugin architecture for adding external panels. To enable the A10 Networks Horizon UI dashboard, simply copy the files from `a10_horizon/_enabled_hooks` to the `local/enabled` directory in your Horizon Openstack dashboard directory. These paths can be auto-discovered by typing the following commands:### a10-horizon path```shpython -c "import a10_horizon; print(a10_horizon.__path__[0])"```### Horizon dashboard path```shpython -c "import openstack_dashboard; print (openstack_dashboard.__path__[0])"```## Restart necessary servicesa10-horizon has static resources that must be "collected" by Horizon. Following the installation of a10-horizon, execute the following command in the directory where you have installed Horizon:```sh./manage.py collectstatic./manage.py compress```Restart horizon after configuration updates (exact command may vary dependingon OpenStack packaging.)```shservice apache2 restart```## Examples## A10 CommunityFeel free to fork, submit pull requests, or join us on freenode IRC, channel #a10-openstack. Serious support escalations and formal feature requests muststill go through standard A10 processes.## Contributing1. Fork it2. Create your feature branch (`git checkout -b my-new-feature`)3. Commit your changes (`git commit -am 'Add some feature'`)4. Push to the branch (`git push origin my-new-feature`)5. Create new Pull Request
a10-neutronclient
A10 neutron client extensions
a10-neutron-lbaas
A10 Networks Openstack LBaaS v1/v2 Driver===========================================A10 Networks LBaaS Driver for Thunder, vThunder and AX Series AppliancesSupported releases:OpenStack: Liberty through current release.LBaaS versions: v2ACOS versions: ACOS 2/AxAPI 2.1 (ACOS 2.7.2+), ACOS 4/AxAPI 3.0 (ACOS 4.0.1-GA +)Working but not available for support:OpenStack: git/masterUnsupported, but may work with minor tweaking:OpenStack: v1 on any release, v2 Havana through KiloA10 github reposa10-neutron-lbaas- Main A10 LBaaS driver repo. Middleware sitting between the openstack driver and our API client, mapping openstack constructs to A10's AxAPI.acos-client- AxAPI client used by A10's OpenStack drivera10-openstack-lbaas- OpenStack LBaaS driver, identical to the files that are currently merged into neutron-lbaas. Pypi package 'a10-openstack-lbaas'.a10-openstack-lbaas, havana branch- OpenStack LBaaS driver, for the Havana release. Pypi package 'a10-openstack-lbaas-havana'.a10networks-ci/project-config- A10 Networks OpenStack third-party CI setup scriptsImplementation:Installation steps:Step 1:Make sure you have neutron installed, and neutron-lbaas if applicable. This driver will need to be installed on all of your neutron controller nodes (anywhere that neutron-server is running.)Step 2:The latest supported version of a10-neutron-lbaas is available via standard pypi repositories and the current development version is available on github.Installation from pypisudopipinstalla10-neutron-lbaasInstallation from cloned git repository.Download the driver from:https://github.com/a10networks/a10-neutron-lbaassudopipinstallgit+https://github.com/a10networks/a10-neutron-lbaas.gitgitclonehttps://github.com/a10networks/a10-neutron-lbaas.gitcda10-neutron-lbaas sudopipinstall-e.ConfigurationPost-installation configuration requires modification of your neutron.conf or neutron_lbaas.conf (neutron_lbaas.conf is only present in LBaaSv2) typically located in/etc/neutron.LBaaS v1 configurationOpen/etc/neutron/neutron.confin your preferred text editor. Under theservice_pluginssetting, ensurelbaasorlbaasv2is listed depending on your configuration.In the list ofservice_providersettings, add a service provider for A10 Networks:service_provider = LOADBALANCER:A10Networks:neutron_lbaas.services.loadbalancer.drivers.a10networks.driver_v1.ThunderDriver:defaultSave and close neutron.confLBaaS v2 configurationOpen/etc/neutron/neutron.confin your preferred text editor. Under theservice_pluginssetting, ensurelbaasv2is listed. Save and close neutron.conf.Open/etc/neutron/neutron_lbaas.confin your preferred text editor.In the list ofservice_providersettings, add a service provider for A10 Networks:service_provider = LOADBALANCERV2:A10Networks:neutron_lbaas.drivers.a10networks.driver_v2.ThunderDriver:defaultExtension configurationOpen/etc/neutron/neutron.confin your preferred text editor. Under theservice_pluginssetting, ensurea10_neutron_lbaas.neutron_ext.services.a10_device_instance.plugin.A10DeviceInstancePluginis listed. Theservice_pluginsare separated by,s.Under theapi_extensions_pathsetting, ensure the path toa10_neutron_lbaas.neutron_ext.extensionsis listed. Theapi_extensions_paths are separated by:s. You can find the path of the installed extension by runningpython -c "import os; import a10_neutron_lbaas.neutron_ext.extensions as m; print(os.path.dirname(os.path.abspath(m.__file__)))".Device configurationAfter installation, you will need to provide configuration for the driver so the driver is aware of the appliances you have configured. The configuration is a python file stored in/etc/a10/config.py. Below is a sample to show options and formatting, though any legal python can be used to calculate values or define classes:devices={"ax1":{"name":"ax1","host":"10.10.100.20","port":443,"username":"admin","password":"a10","autosnat":True,"api_version":"3.0",}}vThunder Appliance ConfigurationA10's LBaaS driver supports a default scheduling strategy of "one appliance per tenant". Below is a sample configuration (stored in/etc/a10/config.py):vthunder={'username':'admin','password':'a10','api_version':'3.0','nova_flavor':'acos.min','glance_image':'c2722746-0c06-48b1-93c3-a9dbc2f6e628','vthunder_tenant_name':'admina','vthunder_tenant_username':'admina','vthunder_tenant_password':'password','vthunder_management_network':'private','vthunder_data_networks':['vipnet','membernet']}username(required)The administrator username on your vThunder appliance image.password(required)The administrator password on your vThunder appliance image.api_version(required)The AXAPI version utilized to access vThunder appliances. This is dependent on your vThunder appliance image version:2.7.x -"2.1"4.x.x -"3.0"nova_flavor(required)The name of the nova flavor used to construct vThunder device instances. The minimum requirements are dependent on your vThunder appliance image version:2.7.xCPU: 1 VCPURAM: 2GBStorage: 12GB4.x.xCPU: 1 VCPURAM: 4GBStorage: 12GBglance_image(required)The Glance or Nova image ID of your vThunder appliance image. This can be obtained through Horizon or the Openstack CLI.vthunder_tenant_name(required)The name of the service tenant where vThunder appliance instances will be created.vthunder_tenant_username(required)The Openstack user login name which has access to the above-named service tenant.vthunder_tenant_passsword(required)The Openstack password of the above-mentioned login.vthunder_management_networks(required)The Openstack network name or ID that the vThunder management interface will be connected to.vthunder_data_networks(required)A list of Openstack network names or IDs that the vThunder data interfaces will be connected to. A minimum of one is required.For complete documentation of the a10 config.py file, please refer to thesample config file.Essential device configurationhost(required)The ip address or host name of the A10 appliance. For a virtual chassis configuration, this should be the floating host or ip address of the master.port(default443)Port that the AXAPI is exposed onusernameandpassword(required)Authentication credentials to control the A10 appliance via the AXAPI.api_version(default"2.1")Version of the A10 appliance's AXAPI."2.1"for 2.X series ACOS versions,"3.0"for 4.X versions.vThunder License Manager ConfigurationThe A10 vThunder virtual load balancing appliance has a flexible system for licensing. Below is a sample configuration for license management (stored in/etc/a10/config.py):license_manager={"hosts":[{"ip":"pdx.a10cloud.com","port":443},{"ip":"sfo.a10cloud.com","port":443},{"ip":"iad.a10cloud.com","port":443}],"serial":"SN0123456789ABCDEF","instance-name":"SCALING_INSTANCE","bandwidth-base":100,"interval":3,"use-mgmt-port":True}hosts(required)A list of host entries specifying the IP address or hostname and TCP port of licensing servers.serial(required)The serial number used for your vThunder appliancesinstance-name(required)The instance name attached to the license.bandwidth-base(required for Pay-As-You-Go licensing)The feature's bandwidth base measured in megabytes.interval(required for Pay-As-You-Go licensing)The feature's bandwidth allowance interval.1 - Monthly2 - Daily3 - Hourlyuse-mgmt-portThe appliance will use the management port for communicating with the licensing server if set to True. By default, the appliance will use the use the first available interface for license server operations.More details about A10 Licensing can be found atTODO(Add licensing info url).Install database migrationsIf 'use_database' is enabled, after installing the package and after any upgrades, run:a10-manage upgradeRestart necessary servicesRestart neutron after configuration updates (exact command may vary depending on OpenStack packaging.)serviceneutron-serverrestartExample architecturesYou must configure the network elements of the Thunder appliance for OpenStack.SNAT:VLAN:Verifying installation (lbaas v1)Step 1:Login to the OpenStack dashboard.Step 2:Under the “Network” menu, go to the “Load Balancers” tab and select “Add Pool”:Once you have added a pool, a success message should appear.Step 3:Login to the GUI on your Thunder or AX device, and validate which configuration was applied if the ADPs are set. The ADP name is the first 13 characters of the tenant ID.Repeat this for all configuration steps, then delete all resources if ADPs are configured. They should be deleted when the tenant has no more resources configured.Default and Name-based configurationSeename-based config examplefor details.ChangesSeeCHANGELOGfor changes made. NOTE: We didn't have a changelog until 1.6.5A10 CommunityFeel free to fork, submit pull requests, or join us on freenode IRC, channel #a10-openstack. Serious support escalations and formal feature requests must still go through standard A10 processes.ContributingFork itCreate your feature branch (git checkout -b my-new-feature)Commit your changes (git commit -am 'Add some feature')Push to the branch (git push origin my-new-feature)Create new Pull Request
a10-nlbaas2oct
This tool has been designed to migration A10 devices and their associated neutron lbaas objects from the Neutron database to Octavia.InstallationInstall from PyPipip install a10-nlbaas2octInstall from Sourcegitclonegit@github.com:a10networks/a10-nlbaas2oct.gitcda10-nlbaas2octpipinstall-e.Note: This tool must be installed on the host running neutron-lbaasUsageStep 1: Copy the sample config file from the project to another directoryInstalled from PyPipip show a10-nlbaas2oct | grep "Location" | cp $(awk '{print $2}')/a10_nlbaas2oct/a10_nlbaas2oct.conf /path/to/another/directoryInstalled from sourcecp /path/to/a10-nlbaas2oct/a10_nlbaas2oct/a10_nlbaas2oct.conf /path/to/another/directorySample Config File Contents[DEFAULT] debug = True [migration] # Run without making changes # trial_run = False # Delete the load balancer records from neutron-lbaas after migration # delete_after_migration = False # Octavia service account ID or username (ex: admin) octavia_account_id = # Example db connection string: # connection = mysql+pymysql://root:password@127.0.0.1:3306/octavia # Replace 127.0.0.1 above with the IP address of the database used by the # main octavia server. (Leave it as is if the database runs on this host.) # Connection string for the keystone databas keystone_db_connection = # Connection string for the neutron database neutron_db_connection = # Connection string for the octavia database octavia_db_connection = # Connection string for the A10 database used in neutron lbaas env # a10_nlbaas_db_connection = # Connection string for the A10 database used in the octavia env # a10_oct_connection = # Path to config file. Default is /etc/a10/config.py a10_config_path = /etc/a10/config.pyStep 2: Modify the config fileDatabase connection string locationsThekeystone_db_connectioncan be found in the/etc/keystone/keystone.conffile under thedatabasegroup.[database] connection = mysql+pymysql://root:password@127.0.0.1/keystone?charset=utf8Theneutron_db_connectioncan be found in the/etc/neutron/neutron.conffile under thedatabasegroup.[database] connection = mysql+pymysql://user:password@127.0.0.1/neutron?charset=utf8Theoctavia_db_connectioncan be found be found in the/etc/octavia/octavia.conffile under thedatabasegroup.[database] connection = mysql+pymysql://root:password@127.0.0.1:3306/octaviaConfig for migrating from Neutron LBaaS to Octavia on the same host# Octavia service account ID or username (ex: admin) octavia_account_id = admin # Connection string for the keystone databas keystone_db_connection = mysql+pymysql://root:password@127.0.0.1/keystone?charset=utf8 # Connection string for the neutron database neutron_db_connection = mysql+pymysql://user:password@127.0.0.1/neutron?charset=utf8 # Connection string for the octavia database octavia_db_connection = mysql+pymysql://root:password@127.0.0.1:3306/octavia # Path to config file. Default is /etc/a10/config.py a10_config_path = /etc/a10/config.pyConfig for migrating from Neutron LBaaS to Octavia across hosts# Octavia service account ID or username (ex: admin) octavia_account_id = admin # Connection string for the keystone databas keystone_db_connection = mysql+pymysql://root:password@127.0.0.1/keystone?charset=utf8 # Connection string for the neutron database neutron_db_connection = mysql+pymysql://user:password@127.0.0.1/neutron?charset=utf8 # Connection string for the octavia database octavia_db_connection = mysql+pymysql://root:password@<b>ip_address_of_remote_host</b>:3306/octavia # Path to config file. Default is /etc/a10/config.py a10_config_path = /etc/a10/config.pyPerforming cross host migration when A10 database is seperate from Neutron DB and Octavia DB# Octavia service account ID or username (ex: admin) octavia_account_id = admin # Connection string for the keystone databas keystone_db_connection = mysql+pymysql://root:password@127.0.0.1/keystone?charset=utf8 # Connection string for the neutron database neutron_db_connection = mysql+pymysql://user:password@127.0.0.1/neutron?charset=utf8 # Connection string for the octavia database octavia_db_connection = mysql+pymysql://root:password@<b>ip_address_of_remote_host</b>:3306/octavia # Path to config file. Default is /etc/a10/config.py a10_config_path = /etc/a10/config.py # Connection string for the A10 database used in neutron lbaas env a10_nlbaas_db_connection = mysql+pymysql://user:password@127.0.0.1/a10_db # Connection string for the A10 database used in the octavia env a10_oct_connection = mysql+pymysql://user:password@<b>ip_address_of_remote_host</b>/a10_dbPerforming migration when using parent projects# Octavia service account ID or username (ex: admin) octavia_account_id = admin # Connection string for the keystone database <b>keystone_db_connection = mysql+pymysql://user:password@127.0.0.1/keystone?charset=utf8</b> # Connection string for the neutron database neutron_db_connection = mysql+pymysql://user:password@127.0.0.1/neutron?charset=utf8 # Connection string for the octavia database octavia_db_connection = mysql+pymysql://root:password@127.0.0.1:3306/octavia # Path to config file. Default is /etc/a10/config.py a10_config_path = /etc/a10/config.pyStep 3: Perform the migrationMigrate a single loadbalancer and its child objectsa10_nlbaas2oct --config-file /path/to/a10_nlbaas2oct.conf --lb-id <loadbalancer_id>Note: This takes in the UUID of the loadbalancer **not*the name*Migrate all lbaas objects in a projecta10_nlbaas2oct --config-file /path/to/a10_nlbaas2oct.conf --project-id <project_id>Note: This takes in the UUID of the project **not*the name*Migrate all lbaas objectsa10_nlbaas2oct --config-file /path/to/a10_nlbaas2oct.conf --allStep 4 (OPTIONAL): Cleanup post migrationThere is a foreign key association with the VIP Port in the Neutron port table and the VIP entries in the Neutron lbaas_loadbalancer table. When performing a migration from Neutron LBaaS to Octavia, the VIPs are migrated to their own table and VIP port ownership is transferred to Octavia.However, that foreign key relationship between VIP and VIP Port will still exist in the Neutron lbaas_loadbalancer table and the port table. Therefore, a delete action on either the load balancer in the Neutron LBaaS table or the Octavia will result in a failure due to the deadlocked foreign key state. As such, it is required that the Neutron LBaaS database entries are deleted or otherwise made inaccessible before performingdeletecommands via Octavia.a10_nlbaas2oct --config-file /path/to/a10_nlbaas2oct.conf [--lb-id <lb_id> | --all | --project-id <project_id>] --cleanupThis step is only necessary if the delete_after_migration was not set to True in the config.Note to ReaderThe vast majority of this tooling was copied and modified from openstack’s neutron-lbaas repo for ease of use purposes. The original can be found herehttps://github.com/openstack/neutron-lbaas/tree/stable/stein/tools/nlbaas2octavia
a10-octavia
A10 Networks OpenStack Octavia DriverTable of ContentsOverviewProject ResourcesIssues and InquiriesOverviewThis solution is currently in beta stage with limited supportThe A10 Networks Octavia Driver allows for configuration of Thunder, vThunder, and AX Series Appliances deployed in an Openstack enviroment. While the default Octavia provider leverages an "Amphora per VIP" architecture, this provider driver uses a "vThunder-Amphora per Tenant" architecture. Therefore, each tenant may only be serviced by a singleactivevThunder-Amphora device.No such limitation exists for hardware Thunder devices in versions >=1.3. Through the use of Octavia flavors, operators may now have any number of hadware Thunder devices servicing a singular project.Supported Versions| a10-octavia | acos-client | ACOS Version | | v1.1 | v2.6.1 | 5.2.1, 4.1.4-GR1-P5 | | v1.2 | v2.7.0 | 5.2.1-p1 | | v1.3, v1.3.1, v1.3.2 | v2.8.0 | 5.2.1-p1 | | v2.0 | v2.9.0 | 5.2.1-p2 | | v2.1 | v2.9.1 | 5.2.1-p2 | | v2.2 | v2.10.0 | 5.2.1-p2 and later |Project ResourcesInstallation and usage information is available athttps://documentation.a10networks.com/Install/Software/A10_ACOS_Install/pdf/A10_OCTAVIA_INSTALL.pdfRelease notes are available athttps://documentation.a10networks.com/Install/Software/A10_ACOS_Install/pdf/A10_OCTAVIA_RN.pdfIssues and InquiriesFor all issues, please send an email tosupport@a10networks.com
a10-openstack-lbaas
# A10 Networks LBaaS DriverA10 github repos:- [a10-openstack-lbaas](https://github.com/a10networks/a10-openstack-lbaas) - OpenStack LBaaS driver,identical to the files that are currently merged into Juno. Also supports Icehouse. Pypi package'a10-openstack-lbaas'.- [a10-openstack-lbaas, havana branch](https://github.com/a10networks/a10-openstack-lbaas/tree/havana) - OpenStackLBaaS driver, for the Havana release. Pypi package 'a10-openstack-lbaas-havana'.- [a10-neutron-lbaas](https://github.com/a10networks/a10-neutron-lbaas) - Middleware sitting between theopenstack driver and our API client, mapping openstack constructs to A10's AxAPI.- [acos-client](https://github.com/a10networks/acos-client) - AxAPI client used by A10's OpenStack driver.- [neutron-thirdparty-ci](https://github.com/a10networks/neutron-thirdparty-ci) - Scripts used byour Jenkins/Zuul/Devstack-Gate setup, used to test every openstack code review submission againstA10 appliances and our drivers.- [a10_lbaas_driver](https://github.com/a10networks/a10_lbaas_driver) - An older revision of A10'sLBaaS driver; no longer supported.## InstallationTo use this driver, you must:1. Install the [a10-neutron-lbaas](https://github.com/a10networks/a10-neutron-lbaas) module.(E.g.: 'pip install a10-neutron-lbaas')- Create a driver config file, a [sample](#example-config-file) of which is given below.- Enable it in `neutron.conf`- Restart neutron-server### Configuration file:Create a configuration file with a list of A10 appliances, similar to thefile below, located at: `/etc/neutron/services/loadbalancer/a10networks/config.py`.Or you can override that directory by setting the environmentvariable `A10_CONFIG_DIR`.#### Example config file:```pythondevices = {"ax1": {"name": "ax1","host": "10.10.100.20","port": 443,"protocol": "https","username": "admin","password": "a10","status": True,"autosnat": False,"api_version": "2.1","v_method": "LSI","max_instance": 5000,"use_float": False,"method": "hash"},"ax4": {"host": "10.10.100.23","username": "admin","password": "a10",},}```## Third-party CI InformationIf you encounter any problems, contact A10 at:* [a10-openstack-ci@a10networks.com](mailto: a10-openstack-ci@a10networks.com)* Doug Wiegley directly via IRC (dougwig)## Contributing1. Fork it ( http://github.com/a10networks/a10-openstack-lbaas/fork )2. Create your feature branch (`git checkout -b my-new-feature`)3. Commit your changes (`git commit -am 'Add some feature'`)4. Push to the branch (`git push origin my-new-feature`)5. Create new Pull Request
a10-openstack-lib
A10 common openstack library
a10sa-script
Library for manipulating Vorze A10 sex toy scripts.FeaturesRead/Write/Convert supported script formats.Export scripts asButtplug Protocolcommand sequences.Supported FormatsVorze CSVAfesta/LPEG VCSX (.bin)Funscript JSONRequirementsPython 3.8+InstallationYou can installA10SA ScriptviapipfromPyPI:$pipinstalla10sa-scriptUsageConvert VCSXVorze_CycloneSA.bintoscript_cyclone.csv:>>>froma10sa_script.scriptimportVCSXCycloneScript,VorzeRotateScript>>>withopen("Vorze_CycloneSA.bin","rb")asf:...vcsx=VCSXCycloneScript.load(f)>>>withopen("script_cyclone.csv","wb")asf:...VorzeRotateScript(vcsx.commands).dump(f)Convert CSVscript_piston.csvtoscript.funscript:>>>froma10sa_script.scriptimportVorzePistonScript,FunscriptScript>>>withopen("script_piston.csv","rb")asf:...csv=VorzePistonScript.load(f)>>>withopen("script.funscript","wb")asf:...FunscriptScript(csv.commands).dump(f)Please see theCommand-line Referencefor details.ContributingContributions are very welcome. To learn more, see theContributor Guide.LicenseDistributed under the terms of theMIT license,A10SA Scriptis free and open source software.IssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.CreditsThis project was generated from@cjolowicz’sHypermodern Python Cookiecuttertemplate.
a10sdk
# A10 Networks Python Client SDKA10 github repos:[a10sdk-python](https://github.com/a10networks/a10sdk-python) - Full featured AxAPI client.[acos-client](https://github.com/a10networks/acos-client) - Alternate AxAPI client.## UsageIn order to get a session ID for continued use we need to create aDeviceProxyobject. The DeviceProxy class requires the hostname/IP, port, username, and password.`python from a10sdk.common.device_proxy import DeviceProxy dp =DeviceProxy(host="10.48.5.181",port=443,username="admin",password="a10")`#### Example setting up an SLB:To utilize the sdk you must import the modules for the objects you would like to manage.`python from a10sdk.core.slb.slb_virtual_server import VirtualServer vs =VirtualServer(name='s1',ip_address="1.1.1.1",DeviceProxy=dp) vs.create() `## ContributingFork it (http://github.com/a10networks/a10sdk-python/fork)Create your feature branch (git checkout -b my-new-feature)Commit your changes (git commit -am ‘Add some feature’)Push to the branch (git push origin my-new-feature)Create new Pull Request
a123-1
Failed to fetch description. HTTP Status Code: 404
a123a
Failed to fetch description. HTTP Status Code: 404
a12rta
No description available on PyPI.
a13e
a13e一个简单且可扩展的听歌识曲包,目前仅支持网易云音乐chromium插件API快速使用pipinstalla13e a13e-h作为python模块使用frompathlibimportPathimporta13eaudio_fp=Path('aaa.mp3')a13e.recognize(audio_fp)#调用所有的识别器并返回结果result=a13e.random_recognize(audio_fp)# 调用所有的识别器并随机返回一个结果a13e.set_tag(audio_fp,result)# 将返回的结果设置为MP3标签编写识别器myproject │ main.py #程序入口 │ └─plugins __init__.py #必须 new_recognizer.py#myproject/main.pyfromimportlibimportimport_modulefroma13e.pluginimportPluginRegisterPluginRegister(import_module('plugins'))#myproject/plugins/new_recognizer.pyfroma13e.pluginimportPluginRegisterfroma13e.recognizerimportBaseRecognizer@PluginRegister.registerclassNewRecognizer(BaseRecognizer):...目前支持的平台平台识别器名称额外参数描述网易云音乐NeteaseCloudMusic没有本API来自网易云音乐听歌识曲插件参考https://github.com/akinazuki/NeteaseCloudMusic-Audio-Recognize
a155testPackage
No description available on PyPI.
a16z
No description available on PyPI.
a1-notation
A1 Notation lookups in various formats for pre-computed or generated-as-needed usageConvert between int <--> column letter
a1pamfax
a1pamfaxAirport1's PamFax - short namea1pamfax- is a Python (3.6+) package that implements thePamFaxAPI.This is an adaption ofDynaptico PamFax (Python2)- once written for Python 2 - now adapted to work for Python 3.6 or later. The old code (and style) has been kept whenever possible, on purpose. The behavior should be nearly the same.For more information about the PamFax API, visit:PamFax for Developers.As this package is still in development, please report any bugs or issues by raising an issue in thisGithubrepository.This module is written for Python 3.6+ and has only been tested against Python 3.9. There is a big chance it works for previous versions, however, too.InstallationYou can installa1pamfaxeither via the Python Package Index (PyPI) or from source.To install the latest version via pip:pip install a1pamfax --upgradeThis is my first public package following the instructions onPython-Packaging. So far I included the test, test data (the former pdf file by dynaptico), a config example and a sample.RequirementsIt is required to install at least (e.g. viapip install requests):requestsTestsIt is strongly recommended to use the sandbox environment ('sandbox-apifrontend') for testing. First copy the fileconfig.example.pyand rename it toconfig.pyand fill in your credentials. Then run either the sample by:python sample.pyor the test suite by:cd test python test.pyYou may adapt the main method oftest.pyto en-/disable the tests you (dis)like.Depending on the tests you run it might be required that you already received or sent something, e.g. in the sandbox environment. The online storage tests will partially be skipped if you did not authenticate for e.g. Dropbox before, this is intentionally.UsageThere is also asample.pyprovided, but in short: after logging in follow thePamFax Processors Documentation. E.g. Common::GetCurrentSettings is available as pamfax.get_current_settings() etc. Full example:from config import HOST, USERNAME, PASSWORD, APIKEY, APISECRET from pamfax import PamFax pamfax = PamFax(USERNAME, PASSWORD, host=HOST, apikey=APIKEY, apisecret=APISECRET) response = pamfax.get_current_settings() print(response)DocumentationThere is no documentation for this package in Python 3 yet. But: the documentation for the older Python 2 implementation by dynaptico might be still available here:Dynaptico PamFax documentation (Python2)and nearly all methods and signatures have been kept ON PURPOSE, just adapted for Python 3. Only few private methods were changed.See also section Particularities.IntegrityAll methods in the PamFax API should be implemented by this package, except the ones introduced after Dynaptico released his Python 2 version. Missing methods will be added, step by step.Since v0.0.6 Dropbox methods are re-enabled and tested, plus missing methods for Common have been added.ParticularitiesAs said, the code is heavily based on an old package for Python 2. It was just adapted to run "the same" on Python 3. Intentionally nearly all methods and signatures have been kept, except the implementation might be different sometimes. So the code has only been touched where it was required, e.g. it's using nowrequests's session with a timeout of 30 seconds. I tried to stick to the coding style of dynaptico. However, few private methods had to be changed in their signature:_get_and_check_response_get_postThanksTo Dynaptico, on which this rewrite for Python 3 is heavily based on, see:Dynaptico PamFax (Python2).Packaging for Python - a small tutorialFor developing ensure the package is uninstalled e.g. in the venv and in test.py setdevelop_mode = True:pip uninstall a1pamfaxPre-testing: in test.py setdevelop_mode = False, then for e.g. in the venv do this:python setup.py install python test.pyIn general check outPython-Packaging. After setting up the Test-PyPI and PyPI accounts continue here.cd \workspace\python\a1pamfax rd /s /q dist build a1pamfax.egg-info python -m pip install --user --upgrade setuptools wheel python setup.py sdist bdist_wheel python -m pip install --user --upgrade twineUploading to testpypi:python -m twine upload --repository testpypi dist/*And after testing, for production use (e.g. in the venv):python -m twine upload dist/* pip uninstall a1pamfax pip install a1pamfax --upgrade
a2
No description available on PyPI.
a20
No description available on PyPI.
a28
Development ToolkitThe A28 Developer Toolkit provides developers with the tools and documentation necessary to build packages for the Area28 Application and to manage configuration files.General informationPython versionArea28 follows theVFX Reference Platformwhich restricts Python to 3.7.x currently.InstallationThe A28 Development Kit is published on PyPI and can be installed from there:pipinstall-Ua28We also publish beta releases:pipinstall-U--prea28If you wish to install A28 for development purposes, refer to the contributors guide.DocumentationDocumentation is available onGitHub.Get in touchReport bugs, suggest features or view the source code on GitHub.Coding structureInterfacesIPluginIApiExtensionIApplicationExtensionIChatExtensionIEventExtensionIInteractionExtensionILoggerExtensionIMetadataExtensionIPreferencesExtensionIRealtimeExtensionIUiExtensionIUnitsExtensionPluginsPlugins are decorators that can be used to manipulate the payload before being processed or before getting returned.ExtensionsExtension are used to add additional functionality to the Area28 application. Extensions are broken up into multiple types, defined within the Interfaces list.PackagingEach package has a unique identifier associated with it and is compressed into a .a28 file. Please look at the a28 development kit for details.Package structure@{provider}|--{package}|--extensions||--{extensions[]}.py|--scripts||--install.py||--postinstall.py||--preinstall.py||--uninstall.py|--plugin||--{applicationspecificplugin}|--plugins||--{plugin[]}.py|--bin||--{executable[]}.py|--package.jsonPackage.json structure{"name":"@area28/unity-application","version":"0.0.4","description":"Detect is running within Unity3D.","homepage":"https://area28.io","keywords":["area28","chat","lowercase","transform"],"repository":{"type":"git","url":"git+https://github.com/area28/area28.git","directory":"packages/unity-application"},"author":"Area28 Technologies","license":"MIT","bugs":{"url":"https://github.com/area28/area28/issues"},"bin":{"myapp":"./bin/lowercase.py"},"os":["darwin","linux"],"cpu":["x64","ia32","!mips"],"scripts":{"preinstall":"scripts/preinstall.py","install":"scripts/install.py","postinstall":"scripts/postinstall.py","uninstall":"scripts/uninstall.py"}}Performing package actionsAuthenticate with A28a28 account authenticate -u my.email@example.comInitialize a new packagea28 package init --scope my-company --name powerful-plugin --type app my/folderThis will generate apackage.jsonand the folder structure in the given folder ('my/folder')Building a packagea28 package build --src @area28/chat-logger --dest distThis will generate the.a28package indist/Installing a package locallya28 package install --pkg dist/00000000-0000-0000-0000-00000000-0.0.1.a28Publish a packagea28 package publish --pkg dist/00000000-0000-0000-0000-00000000-0.0.1.a28
a2a
No description available on PyPI.
a2b
A2B (Arxiv to Bibliography)Replace arXiv links (or doi links) by their corresponding bibliography in markdowns / Notion databases. Inspired byMu Li.This repo provides a tool to replace arXiv/DOI links saved inMarkdown filesorNotion databasewith their corresponding bibliographic information, which intends to create a more convenient experience for users in needs of searching, collecting, and taking notes of literatures. The script uses the Semantic Scholar API to retrieve information such as authors, title, journal, year, and citation count for a given arXiv paper.MarkdownNotion DatabaseInstallationTo installa2b, make sure you havepip installedand run:>>pipinstalla2bUsageThe tool can be run from the command line, e.g. to check the installed version ofa2b,>>a2b--versionMarkdown1. Generate markdown from a single arXiv link or DOIFor example:>>a2b--arxivhttps://arXiv.org/abs/1912.08957## __Optimization for deep learning: theory and algorithms.__ *Ruoyu Sun.* __ArXiv, 2019__ [(Arxiv)](ht## tps://arXiv.org/abs/1912.08957) [(S2)](https://www.semanticscholar.org/paper/c23173e93f1db79a422e2af## 881a40afb96b8cb92) (Citations __114__)Here you can use the link of pdfhttps://arXiv.org/pdf/1912.08957.pdf, instead of the link of arXiv page.>>a2b--doihttps://doi.org/10.1007/BF00133570## __Snakes: Active contour models.__ *M. Kass et al.* __International Journal of Computer Vision, 2004__## [(Link)](https://doi.org/10.1007/BF00133570) [(S2)](https://www.semanticscholar.org/paper/9394a5d5adcb6## 26128b6a42c8810b9505a3c6487) (Citations __15860__)One can simply provide the DOI10.1007/BF00133570without adding the hyperlink prefix to generate bibilography from DOI.2. Replace arXiv links in a single markdown file>>a2bpath/to/markdown.md3. Replace arXiv links in all markdown files within a directoryRun the following command to replace all arXiv links found in the given directory and its subdirectories.>>a2bpath/to/directoryTo replace arXiv links in the markdown filesONLYwithin the directory (subdirectories excluded), use arguments--no-recursiveor-nr:>>a2b-nrpath/to/directoryNotion DatabaseTo generate bibliography from links saved in a Notion database, follow the instructions belowCreate a newNotion integrationand keep the Notion API key obtained from the integrationGo to the Notion database andConnect the Notion database to the integrationyou just createdCreate these columns (with data type matched) in the Notion databaseTitle (title)Author (rich_text)Year (number)Journal (rich_text)Arxiv (url)Link (url)S2 (url)Citations (number)Paste Arxiv links or doi links in the columnTitleand run the following command to activate the conversion>>a2b--notionnotion_database_id--keynotion_api_key# or>>a2b--notionnotion_database_url--keynotionapi_keyYou can choose to save your Notion API key as a environment variableNOTION_API_KEY, and then you can simply run without manually providing the key in command:>>a2b--notionnotion_database_id# or>>a2b--notionnotion_database_urlChangelogVersion 1.0.7Fix the problem of arxiv and doi format confliction in NotionVersion 1.0.6Fix version commandVersion 1.0.5Support Notion databaseVersion 1.0.4Support creating bibliography from DOI linksSupport querying a single arXiv link from terminal
a2conf
a2confa2conf is python3 module which provides easy way to configure apache2. a2conf used bya2utilspackage, so you may use a2utils as examples.For all examples we will use test config fileexamples/example.confin source code. Useexport PYTHONPATH=.to use module if it's not installed.Create simple apache configsee examples/ex5_create.py for full code:vhost=root.insert('<VirtualHost *:80>')vhost.insert(['# This VirtualHost is auto-generated','ServerName example.com','ServerAlias www.example.com','','DocumentRoot /var/www/example.com/'])Read apache configlist all SSL hosts (see examples/ex2_query.py for full code):root=a2conf.Node(config)forvhostinroot.children('<VirtualHost>'):servername=vhost.first('servername').args# First query method, via first(). Not much fail-safe but short.try:ssl_option=next(vhost.children('sslengine')).args# Second query method, via children()ifssl_option.lower()=='on':print("{}has SSL enabled".format(servername))exceptStopIteration:# No SSL Engine directive in this vhostpassGet VirtualHostroot=a2conf.Node(config)vh1=root.find_vhost('example.com','*:80')vh2=root.find_vhost('www.example.com','*:443')vh3=root.find_vhost('example.example.com')forvhostinroot.yield_vhost('example.com'):do_something(vhost)Save virtualHostIf you will callwrite_file()method of vhost, it will write only this vhost. To save file with all vhosts, use save_file().root=a2conf.Node(config)vh=root.find_vhost('example.com')vh.insert(['CustomLog /var/log/apache2/example.com-access.log'])vh.save_file()Node classPropertiesraw- text line as-is, with all spaces, tabs and with commentscmd- cmd ('ServerName') without args or None (if section)section- section (e.g. 'VirtualHost')args- one text line args to cmd or section. for vhost args could be '*:80', for ServerAlias: 'example.com example.org'name- name of node. cmd if node has cmd, or section name (in brackets) if this is section. e.g. 'ServerName' or ''content- list of child nodes (possible empty). For container sections (VirtualHost) attributecontentis list of children. For usual commands (e.g. ServerName) - empty list.Methods__init__(self, read=filename, raw=None, parent=None, name=None, path=None, line=None, includes=True)- In most cases you should not need to use any parameters here exceptincludesandread.readis apache config filename to read. Useincludes=Falseif you wantread_filemethod to ignoreInclude*directives.children(name=None, recursive=None)- Main query method, returns generator for all children nodes (e.g. for VirtualHost node). Generator is empty if no children. If name specified, generator will return only nodes with this name (e.g. 'servername' or ''). If recursive is On, generator will return nested nodes too (e.g. what is inside<IfModule>or<Directory>settings). To get just one first element usenext(node.children('ServerName')). It will raiseStopIterationif node has no such children elements.first(name, recursive=None)- wrapper forchildren(). Returns only first element orNone. Not raising exceptions.read_file(filename)- Reads apache config. Called automatically from__init__if you specifiedreadargument.dump(fh=sys.stdout, depth=0)- dump loaded config in unified format (indented). if fh not specified, just dumps to stdout()write_file(filename)- opens file for writing and dump() to this file.save_file()- saves whole file with this vhost (with changes and with other vhosts)add(child)- add new child node to content of Node after all other nodes (including possible closing Node</VirtualHost>). Child is Node type, useadd_raw(line)to add raw string.insert(child, after)- smarter thenadd(). Add new child node, place it after last node with nameafter. e.g.:doc_root = Node(raw='DocumentRoot /var/www/site1') vhost.insert([doc_root], after=['ServerName','ServerAlias'])childis list ofNodes to insert. But a2conf is friendly: if you pass single element, it will be converted to list with this element, and then if any element is string, it will be converted to node. So, this command woks well too:vhost.insert('DocumentRoot /var/www/site1', after=['ServerName','ServerAlias'])Ifafternot specified, or not found, child is appended to end. If specified, method tries to insert new node after last found node inafter.In this example, new node will be inserted afterServerAlias(if it exists). If not, it will be inserted afterServerName(if it exists). And if all commands listed inafteris not found, node will be inserted as last node, right before closing tag (e.g., right before</VirtualHost>).Returns first inserted child. So you may write code like this:# Create virtualhost for example.net vhost = root.insert("<VirtualHost *:80>") vhost.insert('ServerName example.net')delete()- removes this Node from parent (e.g. remove vhost from apache config or remove directive from vhost). You should not calldelete()while iterating overchildren()(unless you want to delete just one node). Proper usage:# Bad way, it will delete only one node:forninvhost.children('Redirect'):n.delete()# Proper waydeleted=list()forninvhost.children('Redirect'):deleted.append(n)fornindeleted:n.delete()ExamplesJust dump apache configexamples/ex1_dump.pyjust loads config and dumps its structure (without comments) as JSON:#!/usr/bin/env python3importsysimporta2confimportjsonroot=a2conf.Node(sys.argv[1])defsection_dump(node):data=dict()forchinnode.children():ifch.sectionandnotch.section.startswith('/'):ifch.args:key=ch.section+' '+ch.argselse:key=ch.sectiondata[key]=section_dump(ch)elifch.cmd:data[ch.cmd]=ch.argsreturndatadata=section_dump(root)print(json.dumps(data,indent=4))Output:$ examples/ex1_dump.py examples/example.conf { "VirtualHost *:80": { "DocumentRoot": "/var/www/example", "ServerName": "example.com", "ServerAlias": "www.example.com example.com 1.example.com 2.example.com", "DirectoryIndex": "index.html index.htm default.htm index.php", "Options": "-Indexes +FollowSymLinks" }, "VirtualHost *:443": { "DocumentRoot": "/var/www/example", "ServerName": "example.com", "ServerAlias": "www.example.com 1.example.com 2.example.com secure.example.com", "DirectoryIndex": "index.html index.htm default.htm index.php", "Options": "-Indexes +FollowSymLinks", "SSLEngine": "On", "SSLCertificateFile": "/etc/letsencrypt/live/example.com/fullchain.pem", "SSLCertificateKeyFile": "/etc/letsencrypt/live/example.com/privkey.pem", "SSLCertificateChainFile": "/etc/letsencrypt/live/example.com/chain.pem" } }Note - this is short example just for demo, it's not very good for production: if virtualhost has more then one directive (e.g.ServerAlias,RewriteRule,RewriteCond), only last one will be used.Queryexamples/ex2_query.pyprint all SSL sites from config:#!/usr/bin/env python3importsysimporta2confroot=a2conf.Node(sys.argv[1])forvhostinroot.children('<VirtualHost>'):servername=vhost.first('servername').args# One query method, via first(). Not much fail-safe but short.try:ssl_option=next(vhost.children('sslengine')).args# Other query method, via children()ifssl_option.lower()=='on':print("{}has SSL enabled".format(servername))exceptStopIteration:# No SSL Engine directive in this vhostcontinueOutput:$ examples/ex2_query.py examples/example.conf example.com has SSL enabledReplace and deleteexamples/ex3_replace_delete.pydisables SSLEngine directive:#!/usr/bin/env python3importsysimporta2confroot=a2conf.Node(sys.argv[1])forvhostinroot.children('<VirtualHost>'):ifvhost.first('sslengine'):vhost.delete()# Delete SSL vhostelse:# Modify DocumentRootvhost.first('DocumentRoot').args='/var/www/example2'vhost.first('DocumentRoot').suffix='# New DocumentRoot!'# Delete ServerAliasvhost.first('ServerAlias').delete()root.dump()Output:$examples/ex3_replace_delete.pyexamples/example.conf## Example config file for a2conf#<VirtualHost*:80># Non-ssl siteDocumentRoot/var/www/example2# New DocumentRoot!ServerNameexample.com# .... OUR TEST SITE ....DirectoryIndexindex.htmlindex.htmdefault.htmindex.phpOptions-Indexes+FollowSymLinks </VirtualHost>
a2conn
No description available on PyPI.
a2connect
No description available on PyPI.
a2d
Archive2DiscordArchive your favourite 4Chan thread 2 DiscordEver had that moment where you wanted to look up a specific thread that had been archived but couldn't find it? Or you wanted to view the attachments in an archived thread, but it got deleted? Well, say no more!Demoa2d_demo.mp4InstallInstall using pip:pip install -U a2dUsageThis guide assumes that you know what Discord is and how to use it.Required URLsFirst, you'll need the URL of the thread you want to archive (e.g:https://boards.4chan.org/wg/thread/7977599). After that,create a Discord webhookand copy the URL.CLI argumentsUsage: a2d [OPTIONS] THREAD WEBHOOKThe first agument should be the thread URL and the second argument should be the webhook URL.If you want to archive the entire thread:a2d https://boards.4chan.org/wg/thread/7977599 https://discord.com/api/webhooks/1093195001258836058/xxxxxCLI optionsThere's some options to customize on what you want to archive. Here are the ones that are implemented:--skip-commentsUsing this flag skips all comments and only archives attachments.NoteDoes not skip comments WITH attachments.a2d thread_url webhook_url --skip-commentsskip-filesUsing this flag skips all comments with attachment and only archives comments.a2d thread_url webhook_url --skip-files--delay INTEGERUse this to set a delay when archiving to Discorda2d thread_url webhook_url --delay 5ContributingI have only tested this script with a handful of threads. Feel free to open an issue or PR to report/fix any bugs.If you have any ideas or improvements, feel free to suggest it too by opening an issue.
a2d_diary
A2D-Diaryis a web app that helps you to create multiple-choice questionnaires/diaries that can be marked automatically and transcribed to a digital CSV file. This web app was developed as part of the SKIP project at the Interaction Analysis and Modelling (IAM) Lab of the University of Manchester, UK.For more information check the official docs at https://a2d-diary.netlify.com/Special mention to the authors of two projects that were adapted and used in this web app:Luke Plant:https://bitbucket.org/spookylukey/booklet-maker/srcRaphael Baron:https://github.com/rbaron/omr
a2dl
a2dl | (A)sciidoc(2D)rawio(L)ibraryThis script generates a draw.io library from AsciiDoc-based descriptions and updates diagrams that use icons from these libraries.It recursively searches for adoc files in a specified folder and scans for particular lines within these files.These lines are then integrated into HTML tooltips of draw.io icons.The icons are bundled into a draw.io / diagrams.net library.I needed to visualize the relationship within previously written content. I wrote this script to extract relevant information from these articles into tooltips for draw.io icons. This allows me to concentrate on connecting the information and provide contextual information during a presentation.Installpython3 -m pip install a2dlPrepare Asciidoc filesTo use this script, simply add the identifiers to any adoc file.Set these variables at the top of the file:icon_image_rel_path: images/generated/3.png -> Path to an Icon Image PNG:icon_name: Icon3 -> Name for the Icon:read_more: #sec-icon3 -> Link for more info, to be appended to the tooltips endThese two lines form the start of a Tooltips content, while the first line will also work as a stop sign for the content extraction:== or === up to =====:variable_name: short_description -> choose any name for your variable, but do not include whitespaceExample Adoc:toc: :icon_image_rel_path: images/generated/3.png :icon_name: Icon3 :read_more: #sec-icon3 [[sec-icon3]] == Icon 3 image::{icon_image_rel_path}[The Icon 3s Alternative Text,160,160,float="right"] === Short Description :variable_name: short_description This is short Text to Describe the icon A short abstract of the Topic WARNING: Not Safe For Work === XML Attribute 1 :variable_name: xml_attribute_1 Some part of the text to add to the icons dataUseUse in CLIpython3 -m a2dl --library path/to/folder-to-scan path/to/library-file-to-write.xml # OR python3 -m a2dl --diagram path/to/folder-to-scan path/to/file-to-update # OR python3 -m a2dl --example path/to/folder-to-writeora2dl --library path/to/folder-to-scan path/to/library-file-to-write.xml # OR a2dl --diagram path/to/folder-to-scan path/to/file-to-update # OR a2dl --example path/to/folder-to-writeUse in python scriptA basic example.import a2dl.a2dl # Overwrite some constants a2dl.a2dl.ICON_STYLE = "rounded=1;whiteSpace=wrap;html=1;" a2dl.a2dl.IMAGE_STYLE = 'fillColor=none;rounded=1;shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image=data:image/{},{};' a2dl.a2dl.logging.getLogger('a2dl').addHandler(a2dl.a2dl.logging.NullHandler()) # create icon DI = a2dl.a2dl.Diagicon() DI.from_adoc('./data/exampleDocument.adoc') # write the icon to a Diagram file DI.write_diagram('./data/test-generated-icon-from-exampleDocument.drawio') # create a library DL = a2dl.a2dl.Diaglibrary() DL.from_folder('./data') DL.write('./data/test-generated-library.xml') # update a diagram DG = a2dl.a2dl.Diagdiagram() DG.from_file('./data/exampleDiagramFromLibrary-old.drawio') DG.update(libraries=[DL])
a2dr
a2dra2dris a Python package for solving large-scale non-smooth convex optimization problems with general linear constraints, with separable objective functions accessible through their proximal operators. It exploits the separability of the objective functions and the sparsity in the linear constraints, and utilizes the power of Anderson acceleration to achieve fast and robust convergence and scalability to multiple processors. The current version is0.2.3.post2.It is an implementation of type-II Anderson accelerated Douglas-Rachford splitting, based on our paperA. Fu, J. Zhang, and S. Boyd (2019).InstallationTo install using pip (recommended), run:pip install a2drTo installa2drfrom source, first make sure that you havesetuptoolsinstalled. Then follow the steps below:Clone thea2drgit repository.Navigate to the top-level of the cloned directory and run:pythonsetup.pyinstallTo test the installation with nose, first make sure that you havenoseinstalled. Then run:nosetestsa2drThe requirements are:MatplotlibCVXPYNumPySciPyPython 3.xPlease file an issue on Github if you want Python 2 support.Problema2drsolves problems of the following form:minimize f_1(x_1) + ... + f_N(x_N) subject to A_1x_1 + ... + A_Nx_N = b.where f_i (i=1,...,N) are convex, closed and proper, and are only accessible through their proximal operators. Notice that f_i can take infinite values, and in particular constraints can be included in the objectives with the help of indicator functions.Prox-affine formsThe above formulation is also referred to asprox-affineforms in the literature (see e.g.,Epsilon). When it is seen as a standard form for generic convex optimization problems, the major advantage ofprox-affineforms compared to the more widely usedconicforms include:Privacy: suitable for peer-to-peer optimization with privacy requirements.In practice, the data and source code that define the proximal oracle can be securely encrypted (e.g., via compilation) so that privacy is preserved. For example, in Python, we can convert the.pyfile containing the proximal operator function into an encrypted.sofile via theCythonextension.Compactness: straightforward canonicalization/transformation and lower dimensional representations.In general, the prox-affine form often requires less variables than the conic form (see e.g., the portfolio optimization examplehere). The compactness advantage is also partly exemplified by the comparison betweena2drandSCSin the sparse covariance estimation example in ourpaper.For a bit more detailed introduction to prox-affine forms and the comparisons with conic forms, see ourcompanion slides.UsageAfter installinga2dr, you can importa2drusingimporta2drThis module exposes a functiona2dr(the solver), which can be used viaa2dr.a2dr, or directly imported usingfroma2drimporta2drThe functiona2dris called with the commanda2dr_result=a2dr(p_list,A_list=[],b=np.array([]),v_init=None,n_list=None,max_iter=1000,t_init=1/10,eps_abs=1e-6,eps_rel=1e-8,precond=True,ada_reg=True,anderson=True,m_accel=10,lam_accel=1e-8,aa_method='lstsq',D_safe=1e6,eps_safe=1e-6,M_safe=int(max_iter/100),verbose=True)Parameters:The argumentsp_list,A_listandbcorrespond to the problem data.p_listis the list of proximal operators of f_i. Each element ofp_listis a Python function, which takes as input a vector v and parameter t > 0 and outputs the proximal operator of f_i evaluated at (v,t).A_listis the list of A_i. The listsp_listandA_listmust be given in the same order i = 1,...,N.bis the vector b. Notice thatA_listandbare optional, and when omitted, the solver recognizes the problem as one without linear constraints. Also notice that in such cases,A_listandbhave to be omitted together, and eitherv_initorn_listhas to be provided to declare the dimension of each x_i.For information on the other optional hyper-parameters, please refer to ourcompanion paper(Algorithm 2) and thesource code comments of the functiona2drin solver.py.Returns:The returned objecta2dr_resultis a dictionary containing the keys'x_vals','primal','dual','num_iters'and'solve_time':The outputx_valsis a list of x_1,...,x_N from the iteration with the smallest residuals.primalanddualare arrays containing the primal and dual residual norms for the entire iteration process, respectively.The valuenum_itersis the total number of iterations, andsolve_timeis the algorithm runtime.When the linear equality constraint is infeasible, the solver will print the corresponding flag and returnNonefor all the outputs.Other toolsThe modulea2dralso comes with several additional tools that facilitates the transformation of the problems into the required input format described above as well as tests and visualization. In particular, it come with apackage for proximal operators, which can be imported viaimporta2dr.proximalIt also comes with sometests and visualization tools, which can be imported viaimporta2dr.testsExampleWe showcase the usage of the solver functiona2dras well as the the tool packagesa2dr.proximalanda2dr.testswith the following example. More examples can be found in theexamples/directory.# Non-negative least squares (see our companion paper for more details)importnumpyasnpimportnumpy.linalgfromscipyimportsparsefroma2drimporta2drfroma2dr.proximalimport*froma2dr.tests.base_testimportBaseTest# Problem data.np.random.seed(1)m,n=150,300density=0.001X=sparse.random(m,n,density=density,data_rvs=np.random.randn)y=np.random.randn(m)# Convert problem to standard form.prox_list=[lambdav,t:prox_sum_squares_affine(v,t,F=X,g=y),prox_nonneg_constr]A_list=[sparse.eye(n),-sparse.eye(n)]b=np.zeros(n)# Solve with DRS.drs_result=a2dr(prox_list,A_list,b,anderson=False)# Solve with A2DR.a2dr_result=a2dr(prox_list,A_list,b,anderson=True)bt=BaseTest()bt.compare_total(drs_result,a2dr_result)CitingIf you wish to citea2dr, please use the following:@article{a2dr, author = {Fu, A. and Zhang, J. and Boyd, S.}, title = {Anderson Accelerated {D}ouglas-{R}achford Splitting}, journal = {http://stanford.edu/~boyd/papers/a2dr.html}, year = {2019}, } @misc{a2dr_code, author = {Fu, A. and Zhang, J. and Boyd, S.}, title = {{a2dr}: Anderson Accelerated {D}ouglas-{R}achford Splitting, version 0.2.3.post2}, howpublished = {\url{https://github.com/cvxgrp/a2dr}}, year = {2020} }
a2grunnerp
Package that enables users to run user_fx on a local environment as it was run on A2G.IO
a2h
a2hRewrite of ansi2html from scratch with a less-restrictive MIT licensing
a2jpg
No description available on PyPI.
a2ln
Android 2 Linux Notifications ServerAndroid 2 Linux Notifications(A2LN) is a way to display your Android phone notifications on your Linux computer.It consists of an app on your phone and a server on your computer which communicate securely over LAN. More information can be found atpatri9ck.dev/a2ln.
a2m.itertools
A collection of utilities providing some convenient iteration recipes.
a2ml
a2ml - Automation of AutoMLThe A2ML ("Automate AutoML") project is a Python API and set of command line tools to automate Automated Machine Learning tools from multiple vendors. The intention is to provide a common API for all Cloud-oriented AutoML vendors. Data scientists can then train their datasets against multiple AutoML models to get the best possible predictive model. May the best "algorithm/hyperparameter search" win. Full documentation for A2ML is available ata2ml.orgThe PREDIT PipelineEvery AutoML vendor has their own API to manage the datasets and create and manage predictive models. They are similar but not identical APIs. But they share a common set of stages:Importing data for trainingTrain models with multiple algorithms and hyperparametersEvaluate model performance and choose one or more for deploymentDeploy selected modelsPredict results with new data against deployed modelsReview performance of deployed modelsSince ITEDPR is hard to remember we refer to this pipeline by its conveniently mnemonic anagram: "PREDIT" (French for "predict"). The A2ML project provides classes which implement this pipeline for various Cloud AutoML providers and a command line interface that invokes stages of the pipeline.SetupA2ML is distributed as a python package, so to install it:$pipinstall-Ua2mlIt will install Auger provider.To use Azure AutoML:Mac:$brewinstalllibompFor Mac OS High Sierra and below:$SKLEARN_NO_OPENMP=1pipinstall"scikit-learn==0.21.3"$pipinstall"a2ml[azure]"--ignore-installedonnxruntimeonnxnimbusmlLinux:$apt-getupdate&&apt-get-yinstallgccg++libgomp1$pipinstall"a2ml[azure]"To use Google Cloud:$pipinstall"a2ml[google]"To install everything including testing and server code:$pipinstall"a2ml[all]"DevelopmentTo release a new version the flow should be:Change the__version__variable ina2ml/__init__.pyto match what you want to release, minus the "v". By default it would be ".dev0", for example "0.3.0.dev0". This ensures we don’t accidentally release a dev version to pypi.org. So for when we’re ready to release 0.3.0, the__version__variable should simply be "0.3.0".Commit and push the changes above.gittagv<the-version>(forexample:gittagv0.3.0)gitpush--tagsverify circleci build passed and docker image tag exists:pipinstall-Ua2ml==0.3.0 dockerpullaugerai/a2ml:v0.3.0Increment the__version__variable ina2ml/__init__.pyto the next version in the current milestone. For example, "0.3.1.dev0"
a2od
Table of Contentsanki2orgdrillWhat are flashcards ?What is Anki ?What is org-drill ?FeaturesInstallationUsageExampleReferencesanki2orgdrillWhat are flashcards ?From Wikipedia:A flashcard or flash card is a card bearing information, as words or numbers, on either or both sides, used in classroom drills or in private study. One writes a question on a side and an answer overleaf. Flashcards can bear vocabulary, historical dates, formulae or any subject matter that can be learned via a question-and-answer format. Flashcards are widely used as a learning drill to aid memorization. They are often associated with spaced repetition, i.e. reviewed at expanding time intervals.What is Anki ?Anki is a spaced repetition flashcard program.What is org-drill ?Org-Drill is an extension for Org mode. Org-Drill uses a spaced repetition algorithm to conduct interactive "drill sessions", using org files as sources of facts to be memorised.FeaturesConvert a single export file in plain text from Anki to a single file in org-drill format.Currently, only two-sided cards are supported.Installationpip install a2odUsageUsage: a2od convert [OPTIONS] SRC DST Convert Anki style flashcards to Emacs org-drill format. params: src: Anki Cards in plain text export. dst: Destination org file. Options: --help Show this message and exit.Examplea2od convert ~/Downloads/AllDecks.txt decks.orgReferenceshttps://en.wikipedia.org/wiki/Flashcardhttps://en.wikipedia.org/wiki/Anki_(software)https://orgmode.org/worg/org-contrib/org-drill.htmlhttps://orgmode.org/
a2p2
DescriptionPrepare your observations withinAspro2( V0.9.9.3+ ) and runa2p2to submit your OB.Once setup ready, select your target and use Interop MenuCHARA OB are only displayed in the GUI for the first implementations.ESO OB are ready to be submitted throughP2. You can use the demo account for tests or have to provide your credential for real cases.Atutorialis provided for your first steps withAspro2.InstallationThe package is uploaded toPyPI, so you can install the package (and/or upgrade it) using pip:pip install--upgrade[--user]a2p2We advice to use python environment. Prefer to use the--useroption over running sudo that can break you system modules.You can also build and install from sources using git:git clonehttps://github.com/JMMC-OpenDev/a2p2.gitpip install[--user]./a2p2or pip :pip installgit+https://github.com/JMMC-OpenDev/a2p2PrerequisitesSome basic tests have been operated on windows, Linux and Mac OS. pytest-datafiles must be installed previously.a2p2 should launch the program.You may have to install some package to run tk GUI (python-tkon linux).Usagea2p2 [-h] [-c] [-v]optional arguments:-h,--helpshow this help message and exit-c,--createprefsCreate preferences file-v,--verboseVerboseA GUI is provided using tkinter.OnceAspro2is running anda2p2is connected to an OB submission service (usingP2API) :select your targetenter the Aspro2’s menuInterop/Send Obs. block(s) to A2p2After few seconds, you shoud get a report of your new submission.Each facilities get it’s own code directory to manage specific GUI and specific OB processing. You can get associated inline help in theHELPtab.Please fill anissuefor any question, remark or enhancement request.LicenseA2P2 is released under GPL license. Please have a look in the LICENSE file for any detail and feel free to fill issues.ScreenshotInteraction diagram
a2pcej
a2pcej, convert Alphabet to Phonetic Code in English and Japanease.This module convert each alphabet letters to phonetic code, and also convert each alphabet letterts to katakana.Functionsconv_al(letters, delimiter=’-’, upper_sign=’(CAPS)’, num=False)letters is string.defconv_al(letters,delimiter='-',sign='(CAPS)',num=False):return<unicode>conv_ak(letters, delimiter=’・’, upper_sign=’(大文字)’, num=False)letters is string.defconv_ak(letters,delimiter='・',sign='(大文字)',num=False):return<unicode>Simple example of usage as below… (on Python3.5)First of all, import module.Importmodule.>>>froma2pcejimport*Convert ‘examples’ to Ponetic code in English.>>>conv_al('examples')'Echo-Xray-Alfa-Mike-Papa-Lima-Echo-Sierra'Convert ‘examples’ to Ponetic code in Japanese Katakana.>>>conv_ak('examples')'イー・エクス・エイ・エム・ピー・エル・イー・エス'Non alphabet letters are not convert (default).Upper case lattters has (CAPS) or (大文字) sign (default).>>>conv_al('Examples002')'Echo(CAPS)-Xray-Alfa-Mike-Papa-Lima-Echo-Sierra-0-0-2'>>>conv_ak('Examples002')'イー(大文字)・エクス・エイ・エム・ピー・エル・イー・エス・0・0・2'You can change delimiter and Upper case letters sign.>>>conv_al('Examples003',delimiter=', ',sign='(CAPITAL)')'Echo(CAPITAL), Xray, Alfa, Mike, Papa, Lima, Echo, Sierra, 0, 0, 3'>>>conv_ak('Examples003',delimiter='/',sign='(大)')'イー(大)/エクス/エイ/エム/ピー/エル/イー/エス/0/0/3'If you would like to convert numbers to phonetic code, setnum=True.>>>conv_al('Examples004',num=True)'Echo(CAPS)-Xray-Alfa-Mike-Papa-Lima-Echo-Sierra-zero-zero-four'>>>conv_ak('Examples004',num=True)'イー(大文字)・エクス・エイ・エム・ピー・エル・イー・エス・ゼロ・ゼロ・ヨン'
a2pm
A2PM is a gray-box method for the generation of realistic adversarial examples. It benefits from a modular architecture to assign an independent sequence of adaptative perturbation patterns to each class, which analyze specific feature subsets to create valid and coherent data perturbations.This method was developed to address the diverse constraints of domains with tabular data, such as cybersecurity. It can be advantageous for adversarial attacks against machine learning classifiers, as well as for adversarial training strategies. This Python 3 implementation provides out-of-the-box compatibility with the Scikit-Learn library.If you use A2PM, please cite the primary research article:https://doi.org/10.3390/fi14040108Check out the official documentation:https://a2pm.readthedocs.io/en/latestExplore the public source code repository:https://github.com/vitorinojoao/a2pmHow To InstallThe package and its dependencies can be installed using the pip package manager:pip install a2pmAlternatively, the repository can be downloaded and the package installed from the local directory:pip install .How To SetupThe package can be accessed through the following imports:froma2pmimportA2PMethodfroma2pm.callbacksimportBaseCallback,MetricCallback,TimeCallbackfroma2pm.patternsimportBasePattern,CombinationPattern,IntervalPatternfroma2pm.wrappersimportBaseWrapper,KerasWrapper,SklearnWrapper,TorchWrapperA2PM can be created with a simple base configuration of Interval and/or Combination pattern sequences, which have several possible parameters:pattern=(# First pattern to be applied: Interval{"type":"interval","features":list(range(0,20)),"integer_features":list(range(10,20)),"ratio":0.1,"max_ratio":0.3,"missing_value":0.0,"probability":0.6,},# Second pattern to be applied: Combination{"type":"combination","features":list(range(20,40)),"locked_features":list(range(30,40)),"probability":0.4,},)method=A2PMethod(pattern)To support domains with complex constraints, the method is highly configurable:# General pattern sequence that will be applied to new data classespattern=(# An instantiated patternMyCustomPattern(1,2),# A pattern configuration{"type":MyCustomPattern,"param_name_1":3,"param_name_2":4,},)# Pre-assigned mapping of data classes to pattern sequencespreassigned_patterns={# None to disable the perturbation of this class"class_label_1":None,# Specific pattern sequence that will be applied to this class"class_label_2":(MyCustomPattern(5,6),{"type":MyCustomPattern,"param_name_1":7,"param_name_2":8,},),}method=A2PMethod(pattern,preassigned_patterns)How To UseA2PM can be utilized through the ‘fit’, ‘partial_fit’, ‘transform’ and ‘generate’ methods, as well as their respective shortcuts:# Adapts to new data, and then creates adversarial examplesX_adversarial=method.fit_transform(X,y)# Encapsulates a Tensorflow/Keras classification modelclassifier=KerasWrapper(my_model,my_custom_class_labels)# Adapts to new data, and then performs an untargeted attack against a classifierX_adversarial=method.fit_generate(classifier,X,y)# Adapts to new data, and then performs a targeted attack against a classifierX_adversarial=method.fit_generate(classifier,X,y,y_target)To analyze specific aspects of the method, callback functions can be called before the attack starts (iteration 0) and after each attack iteration (iteration 1, 2, …):X_adversarial=method.fit_generate(classifier,X,y,y_target,# Additional configurationiterations=10,patience=2,callback=[# Time consumptionTimeCallback(verbose=2),# Evaluation metricsMetricCallback(classifier,y,my_custom_scorers,verbose=2),# An instantiated callbackMyCustomCallback(),# A simple callback functionMyCustomFunction,],)
a2rl
Amazon Accessible RL SDK[Documentation|PyPI|Blog-01| Blog-02 (coming soon) ]Amazon Accessible RL (A2RL) is an open-source Python package forsequential decision making problemusing offline time-series data. It focuses on offline RL using state-of-the-art generative transformer technology – the same technology behindGATO,trajectory transformeranddecision transformer.A2RL guides you throughproblem formulationviadata frames API, conductinitial data analysisto see if a solution is possible, use the data to train asimulator(akadigital twin) based on the data, and providingrecommended actions.Installationpipinstalla2rlUsageYou should start by formulating your problem intostates,actions, andrewards(see theonline documentation). Then, prepare a dataset that reflects the formulation, using A2RL'sPandas-like API.A synthetic dataset is included to help you quickly jump into the end-to-end workflow:importa2rlaswifroma2rl.utilsimportplot_information# Load a sample dataset which contains historical states, actions, and rewards.wi_df=wi.read_csv_dataset(wi.sample_dataset_path("chiller")).trim().add_value()wi_df=wi_df.iloc[:1000]# Reduce data size for demo purpose# Checks and analysisplot_information(wi_df)# Train a simulatortokenizer=wi.AutoTokenizer(wi_df,block_size_row=2)builder=wi.GPTBuilder(tokenizer,model_dir="my-model",)model=builder.fit()simulator=wi.Simulator(tokenizer,model,max_steps=100,reset_coldstart=2)# Get recommended actions given an input context (s,a,r,v,...s).# Context must end with states, and its members must be tokenized.custom_context=simulator.tokenizer.df_tokenized.sequence[:7]recommendation_df=simulator.sample(custom_context,3)# Show recommendations (i.e., trajectory)recommendation_dfFor more examples, seenotebooks/(pre-rendered versionshere), and the A2RL blog series:part-1and part-2 (coming soon).Help and SupportContributingApache-2.0License
a2s
a2sPython async function to sync function, Convert python async function to a sync function for calling from a normal function in an existing event loopUsageimportasynciofroma2simportsync@syncasyncdefan_async_func():print("Hello World")defa_sync_func():an_async_func()passasyncdefmain():a_sync_func()passif__name__=='__main__':asyncio.run(main())
a2squery
A2SQueryA2SQuery is a python implementation ofValve's A2S protocol.DocsView the full A2SQuery documentation here.FeaturesA2SQuery can retrieve various information from any game server that implements the protocol. This includes all Source and GoldSource games. The library will handle connecting, parsing, and even automatically respond to challenge requests.A2SQuery does not support multi-packet responses as they are impossible parse without knowing information about the server beforehand.PrerequisitesPython >= 3.6InstallationInstall the library via pypi withpip install a2squeryGetting StartedTo start querying servers, we'll need an instance ofa2squery.A2SQuery. We can either create one manually, or use a context manager. For this example, we will be using a context manager.>>>froma2squeryimportA2SQuery>>>withA2SQuery("127.0.0.1",27015)asa2s:Now, with the A2SQuery instance, we can query the game server.When usinga2squery.A2SQuerywithout a context manager. Remember to calla2squery.A2SQuery.close()when finished.>>>froma2squeryimportA2SQuery>>>withA2SQuery("127.0.0.1",27015)asa2s:>>>print(a2s.info())SourceInfo(protocol=17,name="Awp Bhop",map="awp_iceworld",folder="csgo",game="Counter-Strike: Global Offensive",app_id=730,players=43,max_players=64,bots=0,server_type=ServerType.Dedicated,environment=Environment.Linux,password=False,vac=True,version="1.38.4.4",extra_data_flag=177,mode=None,witnesses=None,duration=None,port=27015,steam_id=85568392924437989,spectator_port=None,spectator_name=None,keywords="awp,bhop,a2squeryiscool",game_id=730)Supported GamesApp IDGameNotes...All Half-Life/Half-Life 2 mods and games10Counter-Strike 1.6440Team Fortress 2550Left For Dead 2730Counter-Strike: Global Offensive1002Rag Doll Kung Fu2400The Ship: Murder PartyThis game has various unique fields ona2squery.SourceInfoanda2squery.Player.4000Garry's Mod17710Nuclear Dawn70000Dino D-Day107410Arma 3The query port is the server port + 1.115300Call of Duty: Modern Warfare 3211820Starbound244850Space EngineersThe query port is the server port + 1.304930UnturnedThe query port is the server port + 1.2515707 Days To Die252490Rust282440Quake Live346110ARK: Survival Evolved108600Project: Zomboid
a2sv
Installation$ pip install a2sv && a2svFeaturesa2sv, ** Auto Scanning to SSL Vulnerability **How to install ?$ pkg install python -y $ pip install a2sv $ a2svRun ?$ a2svDisclaimerWe are not responsible for your loss by this tool. this tool is made for Education/Learning Purpose. Dont harm anyone using this tool.Usage$ a2sv -h Author : hahwul PIP module : Parixit Sutariya Github : github.com/Bhai4You Blogspot : https://bhai4you.blogspot.comGithub
a2svm
a2svmis a Simple CLI tool to create and delete easily virtualhosts in Apache.usage: a2svm [-h] [-v] {mk,ls,rm,en,ds} …a2svm commands are:mkCreate a virtualhostslsShow managed virtualhosts on Apache serverrmDelete a virtualhostsenEnable a virtualhostsdsDisable a virtualhostsSee ‘a2svm <command> -h’ for more information on a specific command.PyPI packagehttp://pypi.python.org/pypi/a2svmSourceshttps://github.com/cypx/a2svmRequirementsa2svm need apache mod_macro which could be installed on debian 6 by the following command$aptitudeinstalllibapache2-mod-macroOnce mod_macro is avalaible some template could be created for use by a2svm like this one<Macrovhost_standard$name$servername$directory><VirtualHost*:80>ServerName$servernameDocumentRoot/var/www/$directory/public<Directory/var/www/$directory>OptionsFollowSymLinksMultiViewsAllowOverrideAllOrderallow,denyallowfromall</Directory>ErrorLog${APACHE_LOG_DIR}/error-$name.log#Possiblevaluesinclude:debug,info,notice,warn,error,crit,#alert,emerg.LogLevelwarnCustomLog${APACHE_LOG_DIR}/access-$name.logcombined</VirtualHost></Macro>#Commentsbeginningby"a2svm_make_command"areusedtorunexternalcommands#whenvhostiscreated#a2svm_make_command:/bin/mkdir-p/var/www/$directory/public/var/www/$directory/log#a2svm_make_command:/bin/chown-Rcyp:www-data/var/www/$directory#Commentsbeginningby"a2svm_remove_command"areusedtorunexternalcommands#whenvhostisremoved#a2svm_remove_command:/bin/tarczf/var/www/archive/$servername.tgz/var/www/$directory#a2svm_remove_command:/bin/rm-rf/var/www/$directoryInstallationInstall it easily:Using pip$pipinstalla2svmWarning! On some old distribution using Python 2.x, you could require to upgrade pip to support install, run:$pipinstall--index-url=https://pypi.python.org/simple/--upgradepipsetuptoolsUsing easy_installOn most Linux distribution$easy_installa2svmBut on some, prerequisites are required, for example, on Debian 6$aptitudeinstallpython-pipUpgradeUsing pip$pip--upgradea2svmUsing easy_install$easy_install--upgradea2svmFrom sources$gitclonehttps://github.com/cypx/a2svm$cda2svm$pipinstall-rrequirements.txt$pythonsetup.pyinstallReminderTo publish package on pypi$pipinstalltwine$rm-rfdist$pythonsetup.pysdistbdist_wheel$twineuploaddist/*
a2t
Ask2TransformersA Framework for Textual Entailment based Zero Shot text classificationThis repository contains the code for out of the box ready to use zero-shot classifiers among different tasks, such as Topic Labelling or Relation Extraction. It is built on top of 🤗 HuggingFaceTransformerslibrary, so you are free to choose among hundreds of models. You can either, use a dataset specific classifier or define one yourself with just labels descriptions or templates! The repository contains the code for the following publications:📄Ask2Transformers - Zero Shot Domain Labelling with Pretrained Transformersaccepted inGWC2021.📄Label Verbalization and Entailment for Effective Zero- and Few-Shot Relation Extractionaccepted inEMNLP2021📄Textual Entailment for Event Argument Extraction: Zero- and Few-Shot with Multi-Source Learningaccepted as Findings inNAACL2022To get started with the repository consider reading thenewdocumentation!InstallationBy using Pip (check the last release)pipinstalla2tOr by clonning the repositorygitclonehttps://github.com/osainz59/Ask2Transformers.gitcdAsk2Transformers python-mpipinstall.Demo 🕹️We have realeased a demo on Zero-Shot Information Extraction using Textual Entailment (ZS4IE: A toolkit for Zero-Shot Information Extraction with simple Verbalizations) accepted in theDemo Track of NAACL 2022. The code is publicly availabe on its own GitHub repository:ZS4IE.ModelsAvailable modelsBy default,roberta-large-mnlicheckpoint is used to perform the inference. You can try different models to perform the zero-shot classification, but they need to be finetuned on a NLI task and be compatible with theAutoModelForSequenceClassificationclass from Transformers. For example:roberta-large-mnlijoeddav/xlm-roberta-large-xnlifacebook/bart-large-mnlimicrosoft/deberta-v2-xlarge-mnliComing soon:t5-largelike generative models support.Pre-trained models 🆕We now provide (task specific) pre-trained entailment models to: (1)reproducethe results of the papers and (2)reusethem for new schemas of the same tasks. The models are publicly available on the 🤗 HuggingFace Models Hub.The model name describes the configuration used for training as follows:HiTZ/A2T_[pretrained_model]_[NLI_datasets]_[finetune_datasets]pretrained_model: The checkpoint used for initialization. For example: RoBERTalarge.NLI_datasets: The NLI datasets used for pivot training.S: Standford Natural Language Inference (SNLI) dataset.M: Multi Natural Language Inference (MNLI) dataset.F: Fever-nli dataset.A: Adversarial Natural Language Inference (ANLI) dataset.finetune_datasets: The datasets used for fine tuning the entailment model. Note that for more than 1 dataset the training was performed sequentially. For example: ACE-arg.Some models likeHiTZ/A2T_RoBERTa_SMFA_ACE-arghave been trained marking some information between square brackets ('[['and']]') like the event trigger span. Make sure you follow the same preprocessing in order to obtain the best results.Training your own modelsThere is no special script for fine-tuning your own entailment based models. In our experiments, we have used the publicly availablerun_glue.pypython script (from HuggingFace Transformers). To train your own model, first, you will need to convert your actual dataset in some sort of NLI data, we recommend you to have a look totacred2mnli.pyscript that serves as an example.Tutorials (Notebooks)Coming soon!Results and evaluationTo obtain the results reported in the papers run theevaluation.pyscript with the corresponding configurationfiles. A configuration file containing the task and evaluation information should look like this:{"name":"BabelDomains","task_name":"topic-classification","features_class":"a2t.tasks.text_classification.TopicClassificationFeatures","hypothesis_template":"The domain of the sentence is about {label}.","nli_models":["roberta-large-mnli"],"labels":["Animals","Art, architecture, and archaeology","Biology","Business, economics, and finance","Chemistry and mineralogy","Computing","Culture and society",..."Royalty and nobility","Sport and recreation","Textile and clothing","Transport and travel","Warfare and defense"],"preprocess_labels":true,"dataset":"babeldomains","test_path":"data/babeldomains.domain.gloss.tsv","use_cuda":true,"half":true}Consider reading the papers to access the results.About legacy codeThe old code of this repository has been moved toa2t.legacymodule and is only intended to be use for experimental reproducibility. Please, consider moving to the new code. If you need help read the newdocumentationor post an Issue on GitHub.CitationCite this paper if you want to cite stuff related to Relation Extraction, etc.@inproceedings{sainz-etal-2021-label,title="Label Verbalization and Entailment for Effective Zero and Few-Shot Relation Extraction",author="Sainz, Oscar andLopez de Lacalle, Oier andLabaka, Gorka andBarrena, Ander andAgirre, Eneko",booktitle="Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing",month=nov,year="2021",address="Online and Punta Cana, Dominican Republic",publisher="Association for Computational Linguistics",url="https://aclanthology.org/2021.emnlp-main.92",pages="1199--1212",abstract="Relation extraction systems require large amounts of labeled examples which are costly to annotate. In this work we reformulate relation extraction as an entailment task, with simple, hand-made, verbalizations of relations produced in less than 15 min per relation. The system relies on a pretrained textual entailment engine which is run as-is (no training examples, zero-shot) or further fine-tuned on labeled examples (few-shot or fully trained). In our experiments on TACRED we attain 63{\%} F1 zero-shot, 69{\%} with 16 examples per relation (17{\%} points better than the best supervised system on the same conditions), and only 4 points short to the state-of-the-art (which uses 20 times more training data). We also show that the performance can be improved significantly with larger entailment models, up to 12 points in zero-shot, allowing to report the best results to date on TACRED when fully trained. The analysis shows that our few-shot systems are specially effective when discriminating between relations, and that the performance difference in low data regimes comes mainly from identifying no-relation cases.",}Cite this paper if you want to cite stuff related with topic labelling (A2TDomains or our paper results).@inproceedings{sainz-rigau-2021-ask2transformers,title="{A}sk2{T}ransformers: Zero-Shot Domain labelling with Pretrained Language Models",author="Sainz, Oscar andRigau, German",booktitle="Proceedings of the 11th Global Wordnet Conference",month=jan,year="2021",address="University of South Africa (UNISA)",publisher="Global Wordnet Association",url="https://www.aclweb.org/anthology/2021.gwc-1.6",pages="44--52",abstract="In this paper we present a system that exploits different pre-trained Language Models for assigning domain labels to WordNet synsets without any kind of supervision. Furthermore, the system is not restricted to use a particular set of domain labels. We exploit the knowledge encoded within different off-the-shelf pre-trained Language Models and task formulations to infer the domain label of a particular WordNet definition. The proposed zero-shot system achieves a new state-of-the-art on the English dataset used in the evaluation.",}
a2utils
Table of ContentsTable of Contentsa2utilsInstallationCLI utilitiesa2vhosta2confa2certbotRequesting new certificate and troubleshootingTroubleshooting renew certificatesa2certbot warnings (false positives)a2certbotssha2okerra2utilsPackage consist of few CLI utilities (based ona2conflibrary)a2conf- query apache2 config (e.g. get DocumentRoot or get all hostnames for specific VirtualHost)a2certbot- diagnose problems with Apache2 VirtualHost and LetsEncrypt certificates and make SSL sites easilya2vhost- manipulate apache2 VirtualHostsa2okerr- generate indicators for SSL VirtualHosts inokerrmonitoring system.Why a2utils is so great?You can create VirtualHost right from shell:a2vhost --basic -d example.com www.example.com --autoor even better (create pair of http and https hosts with default auto-guessed settings and LetsEncrypt certificate):a2vhost --both -d example.com www.example.com --autoSee all SSLCertificateFile directives for vhosts which has SSLEngine Ona2conf --cmd sslcertificatefile --filter sslengine onSee all sites and documentroot for them (better then apache2ctl -S)a2conf --vhfmt '{vhostargs} {servername} {documentroot}'If you created/deleted apache vhosts, but have orphaned LE certificates:a2conf --cmd sslcertificatefile| cut -f 2 -d" " | sort | uniq > /tmp/apache-certs.txt find /etc/letsencrypt/live/ -name fullchain.pem|sort > /tmp/le-certs.txt diff /tmp/apache-certs.txt /tmp/le-certs.txtWhich way is easier and error-prone to request certificate?a2certbot --create -d example.com --aliasesorcertbot certonly --webroot -w /var/www/website_1234 -d example.com -d www.example.com -d shop.example.com -d my.example.coma2certbot reads all needed data right from apache config.InstallationUsual simple way:pip3 install a2utilsor get sources from git repo:git clone https://github.com/yaroslaff/a2utilsIf using git sources (without installing), work from root dir of repo and doexport PYTONPATH=.CLI utilitiesa2vhosta2vhost is utility to create new http/https websites from CLI. Easy to use from your scripts.Example uses hosts echoN.sysattack.com, but you should test with your hostname(s).Mighty one-liner: create HTTP/HTTPS websites (http will redirect to https), obtain certificate for https. (as root)a2vhost--both-decho2.sysattack.comecho3.sysattack.comecho4.sysattack.comecho5.sysattack.com--auto--bothinstructs to make both https website (main) and small plain http website to handle letsencrypt verification and redirect to https.--autoauto-detects virtualhost config file name (you may override with-c) and guesses and creates webroot directory if it's missing (override with-w)Following commands will make similar job step-by-step and without--auto:Create basic HTTP website# Create files for new site$mkdir/var/www/virtual/echo2.sysattack.com $echohello>/var/www/virtual/echo2.sysattack.com/index.html# Create HTTP VirtualHost and test$a2vhost--basic-decho2.sysattack.comecho3.sysattack.comecho4.sysattack.com-w/var/www/virtual/echo2.sysattack.com-c/etc/apache2/sites-available/echo2.sysattack.com.conf $a2ensiteecho2.sysattack.com $systemctlreloadapache2 $curlhttp://echo2.sysattack.com/ helloNow, lets make this site HTTPS and make new plain HTTP site which will redirect to secure HTTPS# Generate LetsEncrypt certificate. Yes, thats very simple. We do not need --alises for this vhost, but we may need it if VirtualHost has ServerAlias'es and we want certificates for them.$a2certbot--create-decho2.sysattack.com--aliases# Convert to HTTPS$a2vhost--convert-decho2.sysattack.com# Make HTTP-to-HTTPS redirection$a2vhost--redirect-decho2.sysattack.com# Reload$systemctlreloadapache2# List all websites$a2vhost--listIn the end we got this config file/etc/apache2/sites-enabled/echo2.sysattack.com.conf<VirtualHost *:443> ServerName echo2.sysattack.com ServerAlias echo3.sysattack.com echo4.sysattack.com echo5.sysattack.com DocumentRoot /var/www/virtual/echo2.sysattack.com SSLEngine On SSLCertificateFile /etc/letsencrypt/live/echo2.sysattack.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/echo2.sysattack.com/privkey.pem Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains" </VirtualHost> # auto-generated plain HTTP site for redirect <VirtualHost *:80> ServerName echo2.sysattack.com ServerAlias echo3.sysattack.com echo4.sysattack.com echo5.sysattack.com DocumentRoot /var/www/virtual/echo2.sysattack.com RewriteEngine On RewriteCond %{HTTPS} !=on RewriteCond %{REQUEST_URI} !^/\.well\-known RewriteRule (.*) https://%{SERVER_NAME}$1 [R=301,L] </VirtualHost>Add any directive to any VirtualHost. We will add comment:# add directivesudobin/a2vhost--add'# This site is main https site'-decho2.sysattack.com--vhost'*:443'Delete vhost:a2vhost--delete--vhost'*:80'-dexample.com(you may add-a /etc/apache2/apache2.confand/or-c /etc/apache2/sites-available/example.com.confif your configuration is non-standard)a2confExamplesFor all examples we will use fileexamples/example.conf. You can omit this parameter to use default/etc/apache2/apache2.conf.Useexport PYTHONPATH=.to use module if it's not installed.Most useful examples:$bin/a2confexamples/example.conf--dump--vhostsecure.example.com# examples/example.conf:15<VirtualHost*:443># SSL siteDocumentRoot/var/www/exampleServerNameexample.com# .... OUR TEST SITE ....ServerAliaswww.example.com1.example.com2.example.comsecure.example.comDirectoryIndexindex.htmlindex.htmdefault.htmindex.phpOptions-Indexes+FollowSymLinksSSLEngineOn# SSL Enabled for this virtual hostSSLCertificateFile/etc/letsencrypt/live/example.com/fullchain.pemSSLCertificateKeyFile/etc/letsencrypt/live/example.com/privkey.pemSSLCertificateChainFile/etc/letsencrypt/live/example.com/chain.pem</VirtualHost># Only specific commands with --vhost filter$bin/a2confexamples/example.conf--vhostwww.example.com:443--cmddocumentrootsslcertificatefileDocumentRoot/var/www/example SSLCertificateFile/etc/letsencrypt/live/example.com/fullchain.pem# Same output achieved with other way of filtering (based on SSLEngine directive)$bin/a2confexamples/example.conf--filtersslengineon--cmddocumentrootsslcertificatefile DocumentRoot/var/www/example SSLCertificateFile/etc/letsencrypt/live/example.com/fullchain.pem# All hostnames configured in this config file$bin/a2confexamples/example.conf--cmdservernameserveralias--uargs secure.example.comexample.comwww.example.com2.example.com1.example.com# per-vhost summary with filtering$bin/a2confexamples/example.conf--cmdservernameserveralias--vhfmt'Host: {servername} Root: {documentroot} Cert: {sslcertificatefile}'--filtersslcertificatefile Host:example.comRoot:/var/www/exampleCert:/etc/letsencrypt/live/example.com/fullchain.pemYou can get list of all available tokens for--vhfmtoption in verbose mode (-voption).a2certbota2certbot utility used to quickly detect commonLetsEncryptconfiguration errors such as:DocumentRoot mismatch between VirtualHost and LetsEncrypt renew config file (e.g. if someone moved site content)RewriteRule or Redirect apache directives preventing verificationDNS record points to other host or not exists at allAndANY OTHERproblem (such as using wrong certificate path in apache or whatever).a2certbotsimulates HTTP verification (If LetsEncrypt verification fails,a2certbotwill fail too, and vice versa).a2certbot does not calls LetsEncrypt servers for verification, so if you will use a2certbot to verify your configuration, you will not hitfailed validation limit(5 failures per account, per hostname, per hourat moment) and will not be blacklisted on LetsEncrypt site.Requesting new certificate and troubleshootingBefore requesting new certificates:# Verify configuration for website for which you want to request certificate for first time.bin/a2certbot--prepare-w/var/www/virtual/static.okerr.com/-dstatic.okerr.com===manual===Info:(static.okerr.com)islocal37.59.102.26(static.okerr.com)Vhost:/etc/apache2/sites-enabled/static.okerr.com.conf:1(static.okerr.com)DocumentRoot:/var/www/virtual/static.okerr.com/(static.okerr.com)DocumentRoot/var/www/virtual/static.okerr.com/matchesLetsEncryptandApache(static.okerr.com)Simulatedcheckmatchroot:/var/www/virtual/static.okerr.com/ ---# You can verify all hostnames for sitebin/a2certbot--prepare-w/var/www/virtual/static.okerr.com/-dstatic.okerr.com-dstatic2.okerr.com# ... and finally simple main all-in-one command, it guesses aliases and root (command below does same as command above):bin/a2certbot--prepare-dstatic.okerr.com--aliasesa2certbot can generate letsencrypt certificates in simple way (automatically detecting all aliases and DocumentRoot, but you can use -d instead of --aliases):root@bravo:/home/xenon# a2certbot --create -d static.okerr.com --aliases Create cert for static.okerr.com RUNNING: certbot certonly --webroot -w /var/www/virtual/static.okerr.com/ -d static.okerr.com -d static2.okerr.com Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator webroot, Installer None Obtaining a new certificate Performing the following challenges: http-01 challenge for static2.okerr.com Using the webroot path /var/www/virtual/static.okerr.com for all unmatched domains. Waiting for verification... Cleaning up challenges IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at: ...Troubleshooting renew certificatesIfcertbot renewfails:# Check (verify) ALL existing LetsEncrypt certificates (to check why 'certbot renew' may fail ):root@bravo:/home/xenon#a2certbot===/etc/letsencrypt/renewal/bravo.okerr.com.confPROBLEM===Info:(bravo.okerr.com)Vhost:/etc/apache2/sites-enabled/okerr.conf:17LetsEncryptconffile:/etc/letsencrypt/renewal/bravo.okerr.com.confbravo.okerr.comislocal37.59.102.26 Problems:NoDocumentRootinvhostat/etc/apache2/sites-enabled/okerr.conf:17 ---# Verify only one certificateroot@bravo:/home/xenon#a2certbot--hostbravo.okerr.com===/etc/letsencrypt/renewal/bravo.okerr.com.confPROBLEM===Info:(bravo.okerr.com)Vhost:/etc/apache2/sites-enabled/okerr.conf:17LetsEncryptconffile:/etc/letsencrypt/renewal/bravo.okerr.com.confbravo.okerr.comislocal37.59.102.26 Problems:NoDocumentRootinvhostat/etc/apache2/sites-enabled/okerr.conf:17 ---a2certbot warnings (false positives)a2certbot expects that requests to .well-known directory of HTTP (port 80) virtualhost must not be redirected. If you have redirection like this:Redirect 301 / https://example.com/it will report problem:Problems: Requests will be redirected: Redirect 301 / https://www.example.com/Actually, this could be OK (false positive) and real verification fromcertbot renewmay pass (if https site has same DocumentRoot). To see if this is real problem or not see result for 'Simulated check'. If simulated check matches - website will pass certbot verification.To avoid such false positive, do not use such 'blind' redirection, better use this:RewriteCond %{REQUEST_URI} !^/\.well\-known RewriteRule (.*) https://%{SERVER_NAME}$1 [R=301,L]This code in<VirtuaHost *:80>context will redirect all requests to HTTPS site EXCEPT LetsEncrypt verification requests.a2certbotssha2certbotsshis wrapper to get certificates using remote machines for verification. Remote machine must have a2utils installed.Example:(any machine):bin/a2certbotssh --aliases --ssh root@example.com -d example.comWith this command it will runcertbot certonly --manual ...using itself as hooks, to place (and cleanup) validation hooks on remote machine. If--aliasesgiven, it will request all aliases for this virtualhost. For example, alsowww.example.comand new.example.com. If--test-certis given, staging server is used (staging server has much higher rate limits, useful for testing)a2okerra2okerr is useful only if you are usingokerr: free and open source hybrid (host/network) monitoring system.Okerris likenagiosorzabbix, but can perform network checks from remote locations, has tiny and optional local client which can run from cron, has powerful logical indicators (notify me only if more then 2 servers are dead, notify me if any problem is not fixed for more then 30 minutes, ...), public status pages (likehttps://status.io/but free), fault-tolerant sites (okerr will redirect dynamic DNS record to backup server if main server is dead, and point it back to main server when it's OK), supportsTelegramand has many other nice features.You can use it as free service (like wordpress or gmail) or you can install okerr server on your own linux machine fromokerr git repository.You will need to install smallokerrupdatepackage to use a2okerr:pip3 install okerrupdate.a2okerr discovers all https sites from apache config and creates SSL-indicator in your okerr project for each website. You will get alert message to email and/or telegram if any of your https sites has any problem (certificate is not updated in time for any reason and will expire soon or already expired. Website unavailable for any reason). If you have linux server or website - you need okerr.# Create indicator for all local https websites. If indicator already exists, HTTP error 400 will be received - this is OK.a2okerr# alter prefix, policy and descriptiona2okerr--prefixmy:prefix:--policyHourly--desc"I love okerr and a2okerr"# do not really create indicators, just dry runa2okerr--dry
a2w
ANSI-to-webTTool to convert ANSI output to HTML. Optionally it can also upload the result to a web server/service and return a sharable url.Free software: MIT licenseDocumentation:https://a2w.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2018-08-02)First release on PyPI.
a2woz
a2woz - minimally process a2r files into woz filesUsageOne-time installation:pipinstallhttps://github.com/adafruit/a2wozConvert a single file:a2wozinput.a2rConvert multiple files, with output directory:a2woz--output-dirout*.a2rFull usage:a2woz--helpTheory of a2r to woz raw conversion:The a2r file contains "1 and a fraction" revolutions, for each track. (It can actually contain multiple revolutions, but ignore that for now)a2woztakes a revolution, then finds all the "sync points". "sync points" are a sequence of 2 or more "FF36" or "FF40", which are used by the floppy interface controller to synchronize with data on the floppy.For each pair of sync points within some distance of the start of the capture, and some distance of the "estimated bit length" of the capture, find the similarity measure. A similarity of 1.0 indicates that the next few thousand bits (at least one full 256-byte sector) are an exact match; a similiary of 0.67 seems to happen for random/fake flux regions.The pair of sync points with the best similarity is used as the "exact bit length" of the track. Ties are broken by choosing the resulting track length that is closest to the estimated bit length. Chop the flux after exactly this many bits, and write it to the output woz file.That's about all there is to it.This has worked for a small set of a2r files:Amnesia - Disk 1, Side A.a2r (4am from archive.org)DOS 3.3 System Master [1983] - Disk 1, Side A.a2r (cowgod from archive.org)skyfox.a2r (jepler from fluxengine)TODOShare with the worldTry more a2rsGraft in the greaseweazle flux readers & use them as input formatsTry different revolutions, if available in the a2r file, hopefully finding a single best revolutionProperly handle "weak bits" by locating stretches that look like they are not valid flux (due to sequences of 3+ zeros), and setting all the bits in the region to 0. A proper emulator then generates fake flux for these sections of the track.Creditsa2woz is based on passport.py, a2rchery, and wozardry from@a2-4am.
a2wsgi
a2wsgiConvert WSGI app to ASGI app or ASGI app to WSGI app.Pure Python. Only depend on the standard library.Compared with other converters, the advantage is that a2wsgi will not accumulate the requested content or response content in the memory, so you don't have to worry about the memory limit caused by a2wsgi. This problem exists in converters implemented by uvicorn/startlette or hypercorn.Installpip install a2wsgiHow to useWSGIMiddlewareConvert WSGI app to ASGI app:froma2wsgiimportWSGIMiddlewareASGI_APP=WSGIMiddleware(WSGI_APP)WSGIMiddleware executes WSGI applications with a thread pool of up to 10 threads by default. If you want to increase or decrease this number, just likeWSGIMiddleware(..., workers=15).WSGIMiddleware utilizes a queue to direct traffic from the WSGI App to the client. To adjust the queue size, simply specify the send_queue_size parameter (default to10) during initialization, like so: WSGIMiddleware(..., send_queue_size=15). This enable developers to balance memory usage and application responsiveness.ASGIMiddlewareConvert ASGI app to WSGI app:froma2wsgiimportASGIMiddlewareWSGI_APP=ASGIMiddleware(ASGI_APP)ASGIMiddlewarewill wait for the ASGI application's Background Task to complete before returning the last null byte. But sometimes you may not want to wait indefinitely for the execution of the Background Task of the ASGI application, then you only need to give the parameterASGIMiddleware(..., wait_time=5.0), after the time exceeds, the ASGI task corresponding to the request will be tried to cancel, and the last null byte will be returned.You can also specify your own event loop through theloopparameter instead of the default event loop. LikeASGIMiddleware(..., loop=faster_loop)Access the originalScope/EnvironSometimes you may need to access the original WSGI Environ in the ASGI application, just usescope["wsgi_environ"]; it is also easy to access the ASGI Scope in the WSGI Application, useenviron["asgi.scope"].BenchmarkRunpytest ./benchmark.py -sto compare the performance ofa2wsgianduvicorn.middleware.wsgi.WSGIMiddleware/asgiref.wsgi.WsgiToAsgi.Why a2wsgiConvert WSGI app to ASGI appYou can convert an existing WSGI project to an ASGI project to make it easier to migrate from WSGI applications to ASGI applications.Convert ASGI app to WSGI appThere is a lot of support for WSGI. Converting ASGI to WSGI, you will be able to use many existing services to deploy ASGI applications.Compatibility listThis list quickly demonstrates the compatibility of some common frameworks for users who are unfamiliar with the WSGI and ASGI protocols.WSGI:Django(wsgi)/Kuí(wsgi)/Pyramid/Bottle/FlaskASGI:Django(asgi)/Kuí(asgi)/Starlette/FastAPI/Sanic/QuartUnsupport:aiohttp
a2x
No description available on PyPI.
a2y
Python Module: a2y这个模块的存在只是为了简化a2y系列模块的安装:只要安装a2y包,所有a2y系列的包都将一次性全部安装。 是的,a2y模块依赖了其他所有a2y包。但它本身没有提供任何实质性的功能。
a2y-ats
Python Module: a2y_atsa2y_ats模块提供一个自动化测试框架。
a2y-atsui
Python Module: a2y_atsuia2y_atsui模块实现了a2y_ats模块所需要的UI部分。本模块只是图形界面,没有提供实质功能,通常不会单独使用。用户应使用a2y_ats模块提供的自动化测试框架。
a2y-builda2y
Python Module: a2y_builda2y这个模块包含了一些用于构建 Python 模块的小工具。Build先用 pip 安装 wheel 模块。 然后运行命令: python setup.py bdist_wheel
a2y-cppyy
Python Module: a2y_cppyy这个模块是为了避免cppyy模块的“include”函数在使用Cython编译时造成编译出错的问题。 嗯,“include”是C语言的关键字。
a2y-cv
Python Module: a2y_cv此模块提供一些图像处理、计算机视觉工具,基于OpenCV和NumPy。
a2y-fa
Python Module: a2y_faa2y_fa模块为工厂自动化提供一些工具,方便控制各种自动化设备。
a2y-fef
Python Module: a2y_mewa2y_mew模块实现了扩展的Mewtocol通信协议。原始的Mewtocol来自Panasonic,用于其FP系列PLC与上位机、触摸屏等设备通信。 本模块在以下方面对Mewtocol进行了扩展:地址空间从8位整数扩展为不定长,最高可达32位。为了兼容性,最小为8位,在报文中至少占两个字节。通讯方式从半双工增强为全双工,即主从双方可以同时发送数据。当从设备发生了某个事件(例如,输入点发生了变化),可以主动给主机发送报文。
a2y-handy
Python Module: a2y_handy这个模块包含各种各样不好分类的工具函数、类。
a2y-hengchangsheng
Python Module: a2y_hengchangshenga2y_hengchangsheng 模块提供一些针对深圳恒昌盛的专用功能。
a2y-hidcom
Python Module: a2y_hidcoma2y_hidcom 实现内核科技 USB(HID)转多通道UART 的驱动程序。
a2y-huazhuang
Python Module: a2y_huazhuanga2y_huazhuang 模块提供一些针对东莞市华庄电子有限公司的专用功能。始于荣文部分产品由华庄代工,需要对接华庄的 MES 系统。
a2y-inst
Python Module: a2y_inst简述这个模块包含各种外设、仪器的驱动程序。Buildpython setup.py bdist_wheel
a2y-matplot
Python Module: a2y_matplota2y_matplot模块封装了一些来自matplotlib的实用工具,使用wxWidgets为后端。
a2y-mew
Python Module: a2y_mewa2y_mew模块实现了扩展的Mewtocol通信协议。原始的Mewtocol来自Panasonic,用于其FP系列PLC与上位机、触摸屏等设备通信。 本模块在以下方面对Mewtocol进行了扩展:地址空间从8位整数扩展为不定长,最高可达32位。为了兼容性,最小为8位,在报文中至少占两个字节。通讯方式从半双工增强为全双工,即主从双方可以同时发送数据。当从设备发生了某个事件(例如,输入点发生了变化),可以主动给主机发送报文。
a2y-modbus
Python Module: a2y_modbusa2y_modbus模块实现了基本的Modbus通信协议,包括以下功能码:0x01,读多个连续的线圈。0x03,读多个连续的寄存器。0x05,写单个线圈。0x06,写单个寄存器。0x10,写多个连续寄存器。目前只包含有做为主站的功能,从站未有实现。
a2y-paratree
Python Module: a2y_paratree此模块提供一个与保存、加载、修改配置参数相关的功能类库。是 testparameters 模块的增强版。
a2y-paratreeui
Python Module: a2y_paratreeuia2y_paratreeui 模块实现了 a2y_paratree 模块所需要的 UI 部分。本模块只是图形界面,没有提供实质功能,通常不会单独使用。用户应使用 a2y_paratree 模块提供的参数配置功能。
a2y-smartray
Python Module: a2y_smartraya2y_smartray模块通过动态库KSSmartray.dll封装了3D相机品牌SmartRay的SDK。
a2y-sql
Python Module: a2y_sqla2y_sql 模块从老旧的 sorobust.zip 大杂烩模块移植而来。 主要是为了完成天人轴承的轴承芯技术分解项目而创建。 这个模块具体实现的功能已经忘得差不多了。 因为现在又有了天人的项目,所以又要把这个模块重新熟悉使用起来。刚开始的项目使用的数据库是 MySQL 5.1.4,安装程序在百度网盘中,名字叫 mysql-essential-5.1.4.msi。 使用的数据库工具是 Navicat-MySql.rar。 由于当时的数据库还一直使用着,后面也只能继续使用这个老旧的版本。 为了稳定,避免不必要的麻烦,数据库连接模块也就只能继续使用已经 deprecated 的 mysql-connector-2.2.x。 只是,那时候使用的是 Python2.7,现在是 Python3.6,旧版的 connector 时候能跟 Python3.6 和平共处还是个问题哦……
a2y-testparameters
Python Module: a2y_testparameters此模块提供一个与保存、加载、修改配置参数相关的功能类库。
a2y-touch
Python Module: a2y_toucha2y_touch模块提供一些便于在触摸屏上显示、输入的工具类。
a2y-touchui
Python Module: a2y_touchuia2y_touchui模块实现了a2y_touch模块所需要的UI部分。本模块只是图形界面,没有提供实质功能,通常不会单独使用。用户应使用a2y_touch模块提供的触摸屏便捷功能。
a2y-ttdg
Python Module: a2y_ttdga2y_ttdg模块提供一些针对东莞澳利电器制品有限公司项目需要使用的功能。
a2y-wxtools
Python Module: a2y_wxtools此模块提供一些GUI部件、工具,它们基于wxWidgets。
a38
Python A38Library to generate Italian Fattura Elettronica from Python.This library implements a declarative data model similar to Django models, that is designed to describe, validate, serialize and parse Italian Fattura Elettronica data.Only part of the specification is implemented, with more added as needs will arise. You are welcome to implement the missing pieces you need and send a pull request: the idea is to have a good, free (as in freedom) library to make billing in Italy with Python easier for everyone.The library can generate various kinds of fatture that pass validation, and can parse all the example XML files distributed byfatturapa.gov.itDependenciesRequired: dateutil, pytz, asn1crypto, and the python3 standard library.Optional:yapf for formattinga38tool pythonoutputlxml for rendering to HTMLthe wkhtmltopdf command for rendering to PDFrequests for downloading CA certificates for signature verificationa38toolscriptA simple command line wrapper to the library functions is available asa38tool:$ a38tool --help usage: a38tool [-h] [--verbose] [--debug] {json,xml,python,diff,validate,html,pdf,update_capath} ... Handle fattura elettronica files positional arguments: {json,xml,python,diff,validate,html,pdf,update_capath} actions json output a fattura in JSON xml output a fattura in XML python output a fattura as Python code diff show the difference between two fatture validate validate the contents of a fattura html render a Fattura as HTML using a .xslt stylesheet pdf render a Fattura as PDF using a .xslt stylesheet update_capath create/update an openssl CApath with CA certificates that can be used to validate digital signatures optional arguments: -h, --help show this help message and exit --verbose, -v verbose output --debug debug outputSeea38tool.mdfor more details.Example codeimporta38froma38.validationimportValidationimportdatetimeimportsyscedente_prestatore=a38.CedentePrestatore(a38.DatiAnagraficiCedentePrestatore(a38.IdFiscaleIVA("IT","01234567890"),codice_fiscale="NTNBLN22C23A123U",anagrafica=a38.Anagrafica(denominazione="Test User"),regime_fiscale="RF01",),a38.Sede(indirizzo="via Monferrato",numero_civico="1",cap="50100",comune="Firenze",provincia="FI",nazione="IT"),iscrizione_rea=a38.IscrizioneREA(ufficio="FI",numero_rea="123456",stato_liquidazione="LN",),contatti=a38.Contatti(email="local_part@pec_domain.it"),)cessionario_committente=a38.CessionarioCommittente(a38.DatiAnagraficiCessionarioCommittente(a38.IdFiscaleIVA("IT","76543210987"),anagrafica=a38.Anagrafica(denominazione="A Company SRL"),),a38.Sede(indirizzo="via Langhe",numero_civico="1",cap="50142",comune="Firenze",provincia="FI",nazione="IT"),)bill_number=1f=a38.FatturaPrivati12()f.fattura_elettronica_header.dati_trasmissione.id_trasmittente=a38.IdTrasmittente("IT","10293847561")f.fattura_elettronica_header.dati_trasmissione.codice_destinatario="FUFUFUF"f.fattura_elettronica_header.cedente_prestatore=cedente_prestatoref.fattura_elettronica_header.cessionario_committente=cessionario_committentebody=f.fattura_elettronica_body[0]body.dati_generali.dati_generali_documento=a38.DatiGeneraliDocumento(tipo_documento="TD01",divisa="EUR",data=datetime.date.today(),numero=bill_number,causale=["Test billing"],)body.dati_beni_servizi.add_dettaglio_linee(descrizione="Test item",quantita=2,unita_misura="kg",prezzo_unitario="25.50",aliquota_iva="22.00")body.dati_beni_servizi.add_dettaglio_linee(descrizione="Other item",quantita=1,unita_misura="kg",prezzo_unitario="15.50",aliquota_iva="22.00")body.dati_beni_servizi.build_dati_riepilogo()body.build_importo_totale_documento()res=Validation()f.validate(res)ifres.warnings:forwinres.warnings:print(str(w),file=sys.stderr)ifres.errors:foreinres.errors:print(str(e),file=sys.stderr)filename="{}{}_{:05d}.xml".format(f.fattura_elettronica_header.cedente_prestatore.dati_anagrafici.id_fiscale_iva.id_paese,f.fattura_elettronica_header.cedente_prestatore.dati_anagrafici.id_fiscale_iva.id_codice,bill_number)tree=f.build_etree()withopen(filename,"wb")asout:tree.write(out,encoding="utf-8",xml_declaration=True)Digital signaturesDigital signatures on Firma Elettronica areCAdESsignatures.openssl cal verify the signatures, but not yet generate them. A patch to sign with CAdEShas been recently mergedbut not yet released as of 2019-02-26.Downloading CA certificatesCA certificates for validating digital certificates aredistributed by the EU in XML format. See alsothe AGID page about it.There is aTrusted List Browserbut apparently no way of getting a simple bundle of certificates useable by openssl.a38toolhas basic features to download and parse CA certificate information, and maintain a CA certificate directory:a38tool update_capath certdir/ --remove-oldNo particular effort is made to validate the downloaded certificates, besides the standard HTTPS checks performed by therequests library.Verifying signed.p7mfilesOnce you have a CA certificate directory, verifying signed p7m files is quite straightforward:openssl cms -verify -in tests/data/test.txt.p7m -inform der -CApath certs/Useful linksXSLT stylesheets for displaying fatture:Fromfatturapa.gov.it, among theFatturaPA resourcesFromAssoSoftwareCopyrightCopyright 2019-2024 Truelite S.r.l.This software is released under the Apache License 2.0
a38-decimal
Python A38Library to generate Italian Fattura Elettronica from Python.This library implements a declarative data model similar to Django models, that is designed to describe, validate, serialize and parse Italian Fattura Elettronica data.Only part of the specification is implemented, with more added as needs will arise. You are welcome to implement the missing pieces you need and send a pull request: the idea is to have a good, free (as in freedom) library to make billing in Italy with Python easier for everyone.The library can generate various kinds of fatture that pass validation, and can parse all the example XML files distributed byfatturapa.gov.itDependenciesRequired: dateutil, pytz, asn1crypto, and the python3 standard library.Optional:yapf for formattinga38tool pythonoutputlxml for rendering to HTMLthe wkhtmltopdf command for rendering to PDFrequests for downloading CA certificates for signature verificationa38toolscriptA simple command line wrapper to the library functions is available asa38tool:$ a38tool --help usage: a38tool [-h] [--verbose] [--debug] {json,xml,python,diff,validate,html,pdf,update_capath} ... Handle fattura elettronica files positional arguments: {json,xml,python,diff,validate,html,pdf,update_capath} actions json output a fattura in JSON xml output a fattura in XML python output a fattura as Python code diff show the difference between two fatture validate validate the contents of a fattura html render a Fattura as HTML using a .xslt stylesheet pdf render a Fattura as PDF using a .xslt stylesheet update_capath create/update an openssl CApath with CA certificates that can be used to validate digital signatures optional arguments: -h, --help show this help message and exit --verbose, -v verbose output --debug debug outputSeea38tool.mdfor more details.Example codeimporta38froma38.validationimportValidationimportdatetimeimportsyscedente_prestatore=a38.CedentePrestatore(a38.DatiAnagraficiCedentePrestatore(a38.IdFiscaleIVA("IT","01234567890"),codice_fiscale="NTNBLN22C23A123U",anagrafica=a38.Anagrafica(denominazione="Test User"),regime_fiscale="RF01",),a38.Sede(indirizzo="via Monferrato",numero_civico="1",cap="50100",comune="Firenze",provincia="FI",nazione="IT"),iscrizione_rea=a38.IscrizioneREA(ufficio="FI",numero_rea="123456",stato_liquidazione="LN",),contatti=a38.Contatti(email="local_part@pec_domain.it"),)cessionario_committente=a38.CessionarioCommittente(a38.DatiAnagraficiCessionarioCommittente(a38.IdFiscaleIVA("IT","76543210987"),anagrafica=a38.Anagrafica(denominazione="A Company SRL"),),a38.Sede(indirizzo="via Langhe",numero_civico="1",cap="50142",comune="Firenze",provincia="FI",nazione="IT"),)bill_number=1f=a38.FatturaPrivati12()f.fattura_elettronica_header.dati_trasmissione.id_trasmittente=a38.IdTrasmittente("IT","10293847561")f.fattura_elettronica_header.dati_trasmissione.codice_destinatario="FUFUFUF"f.fattura_elettronica_header.cedente_prestatore=cedente_prestatoref.fattura_elettronica_header.cessionario_committente=cessionario_committentebody=f.fattura_elettronica_body[0]body.dati_generali.dati_generali_documento=a38.DatiGeneraliDocumento(tipo_documento="TD01",divisa="EUR",data=datetime.date.today(),numero=bill_number,causale=["Test billing"],)body.dati_beni_servizi.add_dettaglio_linee(descrizione="Test item",quantita=2,unita_misura="kg",prezzo_unitario="25.50",aliquota_iva="22.00")body.dati_beni_servizi.add_dettaglio_linee(descrizione="Other item",quantita=1,unita_misura="kg",prezzo_unitario="15.50",aliquota_iva="22.00")body.dati_beni_servizi.build_dati_riepilogo()body.build_importo_totale_documento()res=Validation()f.validate(res)ifres.warnings:forwinres.warnings:print(str(w),file=sys.stderr)ifres.errors:foreinres.errors:print(str(e),file=sys.stderr)filename="{}{}_{:05d}.xml".format(f.fattura_elettronica_header.cedente_prestatore.dati_anagrafici.id_fiscale_iva.id_paese,f.fattura_elettronica_header.cedente_prestatore.dati_anagrafici.id_fiscale_iva.id_codice,bill_number)tree=f.build_etree()withopen(filename,"wb")asout:tree.write(out,encoding="utf-8",xml_declaration=True)Digital signaturesDigital signatures on Firma Elettronica areCAdESsignatures.openssl cal verify the signatures, but not yet generate them. A patch to sign with CAdEShas been recently mergedbut not yet released as of 2019-02-26.Downloading CA certificatesCA certificates for validating digital certificates aredistributed by the EU in XML format. See alsothe AGID page about it.There is aTrusted List Browserbut apparently no way of getting a simple bundle of certificates useable by openssl.a38toolhas basic features to download and parse CA certificate information, and maintain a CA certificate directory:a38tool update_capath certdir/ --remove-oldNo particular effort is made to validate the downloaded certificates, besides the standard HTTPS checks performed by therequests library.Verifying signed.p7mfilesOnce you have a CA certificate directory, verifying signed p7m files is quite straightforward:openssl cms -verify -in tests/data/test.txt.p7m -inform der -CApath certs/Useful linksXSLT stylesheets for displaying fatture:Fromfatturapa.gov.it, among theFatturaPA resourcesFromAssoSoftwareCopyrightCopyright 2019-2022 Truelite S.r.l.This software is released under the Apache License 2.0
a3a3-dictionary
No description available on PyPI.
a3b2bbc3ced97675ac3a71df45f55ba
a3cosmos
A simple introduction:This Python package contains some useful functions to query A3COSMOS catalog and make cutout images.It is currently under development.A simple usage:To query source by RA Dec coordinate::import a3cosmos as a3c a3cosmos.find_source(RA = 150.0, Dec = 2.0)To make a cutout image centered at a source RA Dec coordinate::import a3cosmos as a3c a3cosmos.make_cutout(RA = 150.0, Dec = 2.0, FoV = 10, Band=’Ks’) # Note that this is currently not working for ALMA images because our data are still waiting to be released on COSMOS IRSA website.More functions underway::TODO
a3cosmos-gas-evolution
A simple introduction:This Python package provides functions to calculate a galaxy’s cold molecular gas mass to stellar mass ratio (gas fraction), cold molecular gas depletion time and galaxy main-sequence star formation rate.The motivation is that the evolution of star-forming galaxies’ star formation rate (SFR) and cold molecular gas reservoir have now been reasonably well measured out to very high redshift (z~6), from present time up to as early as one giga-year after the Big Bang (Madau & Dickinson 2014; Genzel et al. 2015; Scoville et al. 2016, 2017; Tacconi et al. 2018; Liu et al. 2018, 2019). These studies have found that the majority of galaxies have a steady and parametrizable evolution in their stellar mass growth, SFR, and molecular gas mass (or molecular gas to total baryon fraction, i.e., gas fraction). These evolution functions have provided crucial constraints to cosmological simulations of dark matter halo evolution and the semi-analytic modeling of the simulated galaxy evolution in the dark matter halo (e.g., Popping et al. 2014ab, 2016, 2017, 2019ab). However, currently there are many parametrizations (or we say “equations”) in the literature and each has its own limitation which is not very well aware by the generic users. Therefore, we provide this Python package which contains as many galaxy gas, dust, star formation and stellar mass evolution equations as possible for easier comparison and study.A simple usage:To get cold molecular gas density evolution curve, e.g., Fig. 15 ofD. Liu et al. (2019b)importa3cosmos_gas_evolutiona3cosmos_gas_evolution.help()z,rho_mol_gas=a3cosmos_gas_evolution.get_cosmic_mol_gas_density_A3COSMOS()# return rho_mol_gas in solar mass per cubic mega parsec.z,rho_mol_gas=a3cosmos_gas_evolution.get_cosmic_mol_gas_density_Tacconi2018()# return rho_mol_gas in solar mass per cubic mega parsec.z,rho_mol_gas=a3cosmos_gas_evolution.get_cosmic_mol_gas_density_Scoville2017()# return rho_mol_gas in solar mass per cubic mega parsec.a3cosmos_gas_evolution.plot_cosmic_mol_gas_density()# or plot it with matplotlibTo compute gas fraction, i.e.,M_molgas / (M_molgas + M_star)importa3cosmos_gas_evolutiona3cosmos_gas_evolution.help()a3cosmos_gas_evolution.calc_gas_fraction_A3COSMOS(z=3.0,lgMstar=10.5,DeltaMS=0.5)# or we can input cosmic_age = 2.178 instead of z = 3.0a3cosmos_gas_evolution.calc_gas_fraction_Tacconi2018(z=3.0,lgMstar=10.5,DeltaMS=0.5)a3cosmos_gas_evolution.calc_gas_fraction_Scoville2017(z=3.0,lgMstar=10.5,DeltaMS=0.5)To compute gas depletion time, i.e.,M_molgas / SFRimporta3cosmos_gas_evolutiona3cosmos_gas_evolution.help()a3cosmos_gas_evolution.calc_gas_depletion_time_A3COSMOS(z=3.0,lgMstar=10.5,DeltaMS=0.0)a3cosmos_gas_evolution.calc_gas_depletion_time_Tacconi2018(z=3.0,lgMstar=10.5,DeltaMS=0.0)a3cosmos_gas_evolution.calc_gas_depletion_time_Scoville2017(z=3.0,lgMstar=10.5,DeltaMS=0.0)To compute galaxy main-sequence star formation rate, i.e.,SFR_MSimporta3cosmos_gas_evolutiona3cosmos_gas_evolution.help()a3cosmos_gas_evolution.calc_SFR_MS_Speagle2014(z=3.0,lgMstar=10.5)Acknowledgement:Please citeLiu et al. (2019b)and/orhttps://ascl.net/1910.003if you would like to use this package for your research. Thank you.
a3d-cli
A3D CLIAccessing the Axial3D apis from the command lineRequirementsPython 3.7, 3.8, 3.9Installpip install a3d-cliUsageCreate an order:a3dcli create --config_file config.json --dicom_location ./path_to_dicoms/ --order-type 3DPrint --notes notes --surgery 'Surgery' --patient-gender M --patient-birth-year 2001 --catalogue-item 101 --required-date '10-08-2021'Update an ordera3dcli upload --config_file config.json --dicom_location ./path_to_dicoms/ --order_id 1000View help:a3dcli --help usage: a3dcli [-h] --config_file CONFIG_FILE --order-type [ORDER_TYPES [ORDER_TYPES ...]] --catalogue-item-id [CATALOGUE_ITEM_ID] --surgery [SURGERY] --required-date [REQUIRED_DATE] --patient-gender [{M,F,U}] --patient-birth-year [BIRTH_YEAR] --notes [NOTES] [--base_url BASE_URL] [--verify] [--username USERNAME] [--password PASSWORD] [--order_id ORDER_ID] [--dicom_location DICOM_LOCATION] {create,upload} Axial3D CLI (0.2.0) positional arguments: {create,upload} Create Order, Upload by order id optional arguments: -h, --help show this help message and exit --config_file CONFIG_FILE a3dcli config file --order-type [ORDER_TYPES [ORDER_TYPES ...]] Order Types --catalogue-item-id [CATALOGUE_ITEM_ID] Catalogue Item --surgery [SURGERY] Surgery --required-date [REQUIRED_DATE] Required Date --patient-gender [{M,F,U}] Gender --patient-birth-year [BIRTH_YEAR] Gender --notes [NOTES] Notes --base_url BASE_URL Base url of axial3D API --verify --username USERNAME axial3D account username --password PASSWORD axial3D account password --order_id ORDER_ID ID of the order --dicom_location DICOM_LOCATION Path to DICOM filesDev requirementsPoetry -https://python-poetry.org/Tox -https://tox.readthedocs.io/Buildpoetry buildTestingUnit testspoetry run pytestIntegration testspoetry run pytest --integration --integration-user USERNAME --integration-password PASSWORD --integration-url https://example.comBuildpoetry build > Building a3d-cli (0.1.0) > - Building sdist > - Built a3d-cli-0.1.0.tar.gz > - Building wheel > - Built a3d_cli-0.1.0-py3-none-any.whl
a3dj
a3dj基于django做了一些规则设定,让开发过程更简单特点不用专门写注解或语法,就可以全量生成open api文档,包含各种异常返回非常方便写单元测试抛出一个异常就是一个异常响应;单元测试时甚至也可以在发出请求后去捕获这个异常请求时想用json用json、想用form-data用form-data自问自答1. 为什么用纯post的方式,不用restful?如果项目只是纯sql数据对象的增删改查,用restful、GraphQL更合适我经历的项目通常都比这个复杂一些,多种类型的数据库、不能简单抽象为资源的业务、需求还老变、对严谨性要求稍高等,让我使用restful时考虑怎样restful占用了很常时间总的来说,我很快放弃了restful;后来又经历了带新人,甚至想让其他人也能看得懂代码,我的需要就变成了:适应快速变化、简单易懂纯post的方式,也可以提供增删改查的基类便于快速实现增删改查;对于习惯了restful风格开发的前后端程序员来说,这个只会更简单2. 为什么不使用或基于django-rest-framework?它很复杂、上手需要花费较多时间进行系统的学习不直观、不易懂,反而容易混淆,比如serializer3. 为什么重新写form模块?django的form模块对于生成open api文档来说,太简陋了;对于平常使用(非admin)来说太重了
a3exception
a3exceptionFramework-agnostic exception component.History.Installpipinstalla3exception
a3faker
a3fakerIt's just a thin wrapper ofFaker, because PyCharm cannot autocomplete Faker related code.Installpipinstalla3fakerExamples1. AutocompletefromfakerimportFakerfroma3fakerimportTypePersonFaker,TypeAllFakers# But there is a warning here,the solution is below.f:TypePersonFaker=Faker()f.name()f:TypeAllFakers=Faker()f.past_date()2.FakerProxyget LOCALE from environment variableimportosfroma3fakerimportFakerProxy,TypePersonFakeros.environ['FAKER_LOCALE']='zh_CN'f:TypePersonFaker=FakerProxy.get_faker()f.name()
a3json-struct
a3json-structdescribe json struct with python classInstallpipinstalla3json-structExamplesfromdatetimeimportdatetimefroma3json_structimportstructclassComment(struct.JsonStruct):content=struct.CharField()post_time=struct.DateTimeField()classVideo(struct.JsonStruct):id=struct.IntegerField(verbose_name='video id')url=struct.CharField()title=struct.CharField(min_length=5,max_length=30)description=struct.CharField()score=struct.DecimalField()view_count=struct.IntegerField(default=0)tag_list=struct.ListField(element_field=struct.CharField(min_length=2,max_length=8),required=False)comment_list=struct.ListField(element_field=struct.ObjectField(obj_kls=Comment))if__name__=='__main__':comment=Comment()comment.content="content"comment.post_time="2023-09-10 20:32"video=Video()video.id=12345video.url="https://xxx.xxx/12345.mp4"video.title="video title"video.description="video description"video.score='2.3'video.comment_list=[comment,# instance{"content":"content","post_time":datetime.now()}# or dict]video.full_clean()# clean instance (the step can be omitted)video.to_json()# return json dict
a3m
What is a3m?a3mis a lightweight version of Archivematica focused on AIP creation. It has neither external dependencies, integration with access sytems, search capabilities nor a graphical interface.All functionality is made available as agRPCservice with a minimal set of methods and strongly typed messages. a3m can be executed as a standalone process or be embedded as part of your application.For more documentation, please seehttps://a3m.readthedocs.io.a3m is a proof of concept. Please send us your feedback!
a3py
a3pyPython utils.History.Installpipinstalla3pyExamples1. Simplified examplefromdatetimeimportdatefroma3py.simplified.datetimeimportdate2strassertdate2str(date(2019,10,3))=='2019-10-03'2. Improved examplefroma3py.improved.jsonimportfast_dumpsfast_dumps([1,2,3])3. Readable examplefroma3py.improved.readableimportget_readable_sizeassertget_readable_size(1024*1024)=="1.0MB"
a3redis
a3redisIt is just a thin wrapper of redis.History.Installpipinstalla3redisExamples1. conf{"standalone":{"mode":"standalone","init":{"host":"standalone-redis-master","port":6379,"db":0,"password":"standalone","decode_responses":true}},"sentinel":{"mode":"sentinel","init":{"sentinels":[["sentinel-redis-node-0.sentinel-redis-headless",26379],["sentinel-redis-node-1.sentinel-redis-headless",26379],["sentinel-redis-node-2.sentinel-redis-headless",26379]],"sentinel_kwargs":{"password":"sentinel"},"password":"sentinel","db":1,"decode_responses":true},"runtime":{"service_name":"my-master"}},"cluster":{"mode":"cluster","init":{"host":"cluster-redis-cluster","port":6379,"password":"cluster","decode_responses":true}}}2. Structures2.1 Hashfroma3redis.structuresimportHashclassUser(Hash):main_key='user:{id}'_hkey_username='username'defget_username(self)->str:returnself.get_member_by_key(self._hkey_username)defset_username(self,username:str):self.set_member(self._hkey_username,username)if__name__=='__main__':# If the redis service configuration is not specified, the `redis://localhost:6379/0` will be used.user=User(id='123')user.set_username('xxx')user=User(id='234')user.get_username()2.2 Listfroma3redis.structuresimportListfroma3redis.basesimportRedisClientFactoryclassMessageList(List):# Specified redis server by rdb_conf_namerdb_conf_name="cluster"main_key="message_list"if__name__=="__main__":RedisClientFactory.init_redis_clients(conf={"cluster":"Refer to the conf json above"})message_list=MessageList()message_list.right_push("......")2.3 Stringfroma3redis.structuresimportStringfroma3redis.basesimportRedisClientFactoryclassDataCache(String):rdb_conf_name="cache"main_key="data:{id}"if__name__=="__main__":RedisClientFactory.init_redis_clients(conf={"sentinel":"Refer to the conf json above"})readwrite_rdb=RedisClientFactory.get_rdb("sentinel")DataCache(id=123,rdb=readwrite_rdb).set(".....")readonly_rdb=RedisClientFactory.get_rdb("sentinel",readonly=True)data=DataCache(id=123,rdb=readonly_rdb).get()3. Different redis serve modefroma3redis.basesimportRedisClientFactory,RedisModefroma3redis.structuresimportHashclassUser(Hash):main_key='user:{id}'_hkey_username='username'defget_username(self)->str:returnself.get_member_by_key(self._hkey_username)defset_username(self,username:str):self.set_member(self._hkey_username,username)if__name__=='__main__':# load all redis serverRedisClientFactory.init_redis_clients(conf={"...":"Refer to the conf json above"})localhost_anonymous_rdb=Nonestandalone_rdb=RedisClientFactory.get_rdb(RedisMode.Standalone)sentinel_rdb=RedisClientFactory.get_rdb(RedisMode.Sentinel)cluster_rdb=RedisClientFactory.get_rdb(RedisMode.Cluster)forrdbin[localhost_anonymous_rdb,standalone_rdb,sentinel_rdb,cluster_rdb]:user=User(id="123",rdb=rdb)user.set_username("tom")user.get_username()user.delete()
a3rt-sdk-py
No description available on PyPI.
a3rt-talkpy
A3RT-TalkPyA3RT-TalkPyは、A3RT TalkAPIをPythonから利用するための、非公式ラッパーライブラリです。なぜ作ったのか?俺が使う理由もなく無駄なライブラリをわざわざ作るわけがないだろう...A3RT TalkAPIとは?株式会社リクルートが立ち上げた新規事業の1つであるA3RTという機械学習API群のAPIの1つで、TalkAPIでは会話を行うことができます。詳しくは、A3RT TalkAPIのページをご覧ください。A3RT-TalkPyとは?上記で述べた、A3RT TalkAPIをPythonから利用するための、非公式ラッパーライブラリです。非同期による処理が可能です。必要条件このライブラリを使用するには、以下の環境が必要です。Python 3.10 以上TalkAPIのAPIキー (こちらから発行できます。)インストールpipinstalla3rt-talkpy使い方同期処理froma3rt_talkpyimportTalkClientAPI_KEY="aaabbbcccddd"# APIキーを入力してください。client=TalkClient(API_KEY)defmain():query=input("> ")response=client.talk(query)print(response.reply)if__name__=="__main__":main()非同期処理importasynciofroma3rt_talkpyimportAsyncTalkClientAPI_KEY="aaabbbcccddd"# APIキーを入力してください。client=AsyncTalkClient(API_KEY)asyncdefmain():query=input("> ")response=awaitclient.talk(query)print(response.reply)if__name__=="__main__":asyncio.run(main())ライセンスLICENSEをご確認ください。
a3t
A3T is an adversarial training technique that combines the strengths of augmentation and abstraction techniques. The key idea underlying A3T is to decompose the perturbation space into two subsets, one that can be explored using augmentation and one that can be abstracted.
a_3y
# 3yzh Formerly known as: 3y Renamed name :a_3y A three-circle calculator, It contains Circle Circles and Cylinders. It is in Chinese.If you konw how to speak and write or mean these,you can useNow,you can Download and input python 3y and then it will runningPlease comply with local laws and regulations, User only has the right to use The final interpretation belongs to the author For mainland China only. You can see or read the log in log.py This means that you have read and agreed to all the above regulations.Welcome Download and use!
a4
A4 – Minimal library for command-line applications.The name comes from A4 paper. It provides absolutely minimal (but not lousy) support for command-line applications.A4islisted on PyPI.Simple logginga4.logimplements minimal logging with three major features which, in my highly opinionated opinion, should be included in all logging libraries:Levels.Colors.Timestamps.Yet another command-line application decoratora4.appprovides a decoratorRunnableto convert a class into a runnable command-line application. All class methodsNOTstarting with understore are recognized as sub-commands. This pattern offers more convenience over single-function decorators when multiple commands require shared resources.importa4froma4.appimportAppBase,Runnable@RunnableclassMyApp(AppBase):def__init__(self):AppBase.__init__(self)defgen_calendar(self,args):"""<yyyy> mmdd-mmdd [mmdd-mmdd ...]Generate trading calendar for one year.-c <cal_id> calendar ID, default 86"""opts,args=a4.get_opts('c:',args)iflen(args)<2:self._die_usage()cal_id=int(opts['c']or'86')self._log(f'calendar id ={cal_id}')if__name__=='__main__':MyApp().run()
a4be0643f1d98573b97cdca98a65347dd
Failed to fetch description. HTTP Status Code: 404
a4e-bmacer
This is a Hello World commit.
README.md exists but content is empty. Use the Edit dataset card button to edit it.
Downloads last month
147
Edit dataset card