code
stringlengths
501
5.19M
package
stringlengths
2
81
path
stringlengths
9
304
filename
stringlengths
4
145
import redis import uuid import json import textwrap import shlex import base64 import signal import socket import logging import time from . import typchk DefaultTimeout = 10 # seconds logger = logging.getLogger('g8core') class Timeout(Exception): pass class JobNotFound(Exception): pass class Return:...
0-core-client
/0-core-client-1.1.0a4.tar.gz/0-core-client-1.1.0a4/zeroos/core0/client/client.py
client.py
missing = object() def primitive(typ): return typ in [str, int, float, bool] class CheckerException(BaseException): pass class Tracker(BaseException): def __init__(self, base): self._base = base self._reason = None self._branches = [] @property def branches(self): ...
0-core-client
/0-core-client-1.1.0a4.tar.gz/0-core-client-1.1.0a4/zeroos/core0/client/typchk.py
typchk.py
import json import collections from datetime import datetime from uuid import UUID from enum import Enum from dateutil import parser # python2/3 compatible basestring, for use in to_dict try: basestring except NameError: basestring = str def timestamp_from_datetime(datetime): """ Convert from da...
0-orchestrator
/0-orchestrator-1.1.0a7.tar.gz/0-orchestrator-1.1.0a7/zeroos/orchestrator/client/client_support.py
client_support.py
import requests from .graphs_service import GraphsService from .health_service import HealthService from .nodes_service import NodesService from .storageclusters_service import StorageclustersService from .vdisks_service import VdisksService class Client: def __init__(self, base_uri=""): self.base_u...
0-orchestrator
/0-orchestrator-1.1.0a7.tar.gz/0-orchestrator-1.1.0a7/zeroos/orchestrator/client/client.py
client.py
class NodesService: def __init__(self, client): self.client = client def DeleteBridge(self, bridgeid, nodeid, headers=None, query_params=None, content_type="application/json"): """ Remove bridge It is method for DELETE /nodes/{nodeid}/bridges/{bridgeid} """ uri...
0-orchestrator
/0-orchestrator-1.1.0a7.tar.gz/0-orchestrator-1.1.0a7/zeroos/orchestrator/client/nodes_service.py
nodes_service.py
class GraphsService: def __init__(self, client): self.client = client def DeleteDashboard(self, dashboardname, graphid, headers=None, query_params=None, content_type="application/json"): """ Delete a dashboard It is method for DELETE /graphs/{graphid}/dashboards/{dashboardname...
0-orchestrator
/0-orchestrator-1.1.0a7.tar.gz/0-orchestrator-1.1.0a7/zeroos/orchestrator/client/graphs_service.py
graphs_service.py
class VdisksService: def __init__(self, client): self.client = client def ResizeVdisk(self, data, vdiskid, headers=None, query_params=None, content_type="application/json"): """ Resize vdisk It is method for POST /vdisks/{vdiskid}/resize """ uri = self.client.b...
0-orchestrator
/0-orchestrator-1.1.0a7.tar.gz/0-orchestrator-1.1.0a7/zeroos/orchestrator/client/vdisks_service.py
vdisks_service.py
import datetime import time def generate_rfc3339(d, local_tz=True): """ generate rfc3339 time format input : d = date type local_tz = use local time zone if true, otherwise mark as utc output : rfc3339 string date format. ex : `2008-04-02T20:00:00+07:00` """ try: if lo...
0-orchestrator
/0-orchestrator-1.1.0a7.tar.gz/0-orchestrator-1.1.0a7/zeroos/orchestrator/client/client_utils.py
client_utils.py
import requests from .Bridge import Bridge from .BridgeCreate import BridgeCreate from .BridgeCreateSetting import BridgeCreateSetting from .CPUInfo import CPUInfo from .CPUStats import CPUStats from .CloudInit import CloudInit from .Cluster import Cluster from .ClusterCreate import ClusterCreate from .Container impo...
0-orchestrator
/0-orchestrator-1.1.0a7.tar.gz/0-orchestrator-1.1.0a7/zeroos/orchestrator/client/__init__.py
__init__.py
from enum import Enum from .Partition import Partition from .abstracts import Mountable class DiskType(Enum): ssd = "ssd" hdd = "hdd" nvme = "nvme" archive = "archive" cdrom = 'cdrom' class Disks: """Subobject to list disks""" def __init__(self, node): self.node = node s...
0-orchestrator
/0-orchestrator-1.1.0a7.tar.gz/0-orchestrator-1.1.0a7/zeroos/orchestrator/sal/Disk.py
Disk.py
from .abstracts import Mountable import os import time import logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) def _prepare_device(node, devicename): logger.debug("prepare device %s", devicename) ss = devicename.split('/') if len(ss) < 3: raise RuntimeError("ba...
0-orchestrator
/0-orchestrator-1.1.0a7.tar.gz/0-orchestrator-1.1.0a7/zeroos/orchestrator/sal/StoragePool.py
StoragePool.py
from zerotier.client import Client import netaddr class ZTBootstrap: def __init__(self, token, bootstap_id, grid_id, cidr): self.bootstap_nwid = bootstap_id self.grid_nwid = grid_id self._cidr = cidr # TODO validate format # create client and set the authentication header ...
0-orchestrator
/0-orchestrator-1.1.0a7.tar.gz/0-orchestrator-1.1.0a7/zeroos/orchestrator/sal/ZerotierBootstrap.py
ZerotierBootstrap.py
import json from io import BytesIO import logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) class Containers: def __init__(self, node): self.node = node def list(self): containers = [] for container in self.node.client.container.list().values(): ...
0-orchestrator
/0-orchestrator-1.1.0a7.tar.gz/0-orchestrator-1.1.0a7/zeroos/orchestrator/sal/Container.py
Container.py
from js9 import j import os from zeroos.core0.client.client import Timeout import json import hashlib class HealthCheckObject: def __init__(self, id, name, category, resource): self.id = id self.name = name self.category = category self._messages = [] self.resource = resour...
0-orchestrator
/0-orchestrator-1.1.0a7.tar.gz/0-orchestrator-1.1.0a7/zeroos/orchestrator/sal/healthcheck.py
healthcheck.py
from zeroos.core0.client import Client from .Disk import Disks, DiskType from .Container import Containers from .StoragePool import StoragePools from .Network import Network from .healthcheck import HealthCheck from collections import namedtuple from datetime import datetime from io import BytesIO import netaddr Mount...
0-orchestrator
/0-orchestrator-1.1.0a7.tar.gz/0-orchestrator-1.1.0a7/zeroos/orchestrator/sal/Node.py
Node.py
import ssl import json import aioredis import sys import uuid import time import logging import asyncio logger = logging.getLogger('g8core') class Response: def __init__(self, client, id): self._client = client self._id = id self._queue = 'result:{}'.format(id) async def exists(self...
0-orchestrator
/0-orchestrator-1.1.0a7.tar.gz/0-orchestrator-1.1.0a7/zeroos/orchestrator/sal/Pubsub.py
Pubsub.py
import io import time import logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) class StorageEngine: """storageEngine server""" def __init__(self, name, container, bind='0.0.0.0:16379', data_dir='/mnt/data', master=None): """ TODO: write doc string "...
0-orchestrator
/0-orchestrator-1.1.0a7.tar.gz/0-orchestrator-1.1.0a7/zeroos/orchestrator/sal/StorageEngine.py
StorageEngine.py
from io import BytesIO import logging import yaml logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) class EtcdCluster: """etced server""" def __init__(self, name, dialstrings): self.name = name self.dialstrings = dialstrings self._ays = None @classmeth...
0-orchestrator
/0-orchestrator-1.1.0a7.tar.gz/0-orchestrator-1.1.0a7/zeroos/orchestrator/sal/ETCD.py
ETCD.py
import json from js9 import j from .StorageEngine import StorageEngine import logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) class StorageCluster: """StorageCluster is a cluster of StorageEngine servers""" def __init__(self, label, nodes=None, disk_type=None): ...
0-orchestrator
/0-orchestrator-1.1.0a7.tar.gz/0-orchestrator-1.1.0a7/zeroos/orchestrator/sal/StorageCluster.py
StorageCluster.py
from ..abstracts import AYSable from js9 import j class StoragePoolAys(AYSable): def __init__(self, storagepool): self._obj = storagepool self.actor = 'storagepool' def create(self, aysrepo): try: service = aysrepo.serviceGet(role='storagepool', instance=self._obj.name) ...
0-orchestrator
/0-orchestrator-1.1.0a7.tar.gz/0-orchestrator-1.1.0a7/zeroos/orchestrator/sal/atyourservice/StoragePool.py
StoragePool.py
import re import os import datetime from ..healthcheck import HealthCheckRun descr = """ Rotate know log files if their size hit 10G or more """ class RotateLogs(HealthCheckRun): def __init__(self, node): resource = '/nodes/{}'.format(node.name) super().__init__('log-rotator', 'Log Rotator', 'Sys...
0-orchestrator
/0-orchestrator-1.1.0a7.tar.gz/0-orchestrator-1.1.0a7/zeroos/orchestrator/sal/healthchecks/log_rotator.py
log_rotator.py
import re from ..healthcheck import HealthCheckRun descr = """ Monitors if a network bond (if there is one) has both (or more) interfaces properly active. """ class NetworkStability(HealthCheckRun): def __init__(self, node): resource = '/nodes/{}'.format(node.name) super().__init__('networkstabil...
0-orchestrator
/0-orchestrator-1.1.0a7.tar.gz/0-orchestrator-1.1.0a7/zeroos/orchestrator/sal/healthchecks/networkstability.py
networkstability.py
from ..healthcheck import IPMIHealthCheck descr = """ Checks temperature of the system. Result will be shown in the "Temperature" section of the Grid Portal / Status Overview / Node Status page. """ class Temperature(IPMIHealthCheck): WARNING_TRIPPOINT = 70 ERROR_TRIPPOINT = 90 def __init__(self, node):...
0-orchestrator
/0-orchestrator-1.1.0a7.tar.gz/0-orchestrator-1.1.0a7/zeroos/orchestrator/sal/healthchecks/temperature.py
temperature.py
from ..healthcheck import HealthCheckRun from js9 import j descr = """ Clean up ssh deamons and tcp services from migration """ class SSHCleanup(HealthCheckRun): def __init__(self, node, job): resource = '/nodes/{}'.format(node.name) super().__init__('ssh-cleanup', 'SSH Cleanup', 'System Load', ...
0-orchestrator
/0-orchestrator-1.1.0a7.tar.gz/0-orchestrator-1.1.0a7/zeroos/orchestrator/sal/healthchecks/ssh_cleanup.py
ssh_cleanup.py
from ..healthcheck import IPMIHealthCheck descr = """ Checks the power redundancy of a node using IPMItool. Result will be shown in the "Hardware" section of the Grid Portal / Status Overview / Node Status page. """ class PowerSupply(IPMIHealthCheck): def __init__(self, node): resource = '/nodes/{}'.form...
0-orchestrator
/0-orchestrator-1.1.0a7.tar.gz/0-orchestrator-1.1.0a7/zeroos/orchestrator/sal/healthchecks/powersupply.py
powersupply.py
from js9 import j from ..healthcheck import HealthCheckRun descr = """ Checks average memory and CPU usage/load. If average per hour is higher than expected an error condition is thrown. For both memory and CPU usage throws WARNING if more than 80% used and throws ERROR if more than 95% used. Result will be shown in...
0-orchestrator
/0-orchestrator-1.1.0a7.tar.gz/0-orchestrator-1.1.0a7/zeroos/orchestrator/sal/healthchecks/cpu_mem_core.py
cpu_mem_core.py
import signal import time import requests from js9 import j class Grafana: def __init__(self, container, ip, port, url): self.container = container self.ip = ip self.port = port self.url = url self.client = j.clients.grafana.get(url='http://%s:%d' % ( ip, port),...
0-orchestrator
/0-orchestrator-1.1.0a7.tar.gz/0-orchestrator-1.1.0a7/zeroos/orchestrator/sal/grafana/grafana.py
grafana.py
import signal import time from zeroos.orchestrator.sal import templates from js9 import j class InfluxDB: def __init__(self, container, ip, port): self.container = container self.ip = ip self.port = port def apply_config(self): influx_conf = templates.render('influxdb.conf', ...
0-orchestrator
/0-orchestrator-1.1.0a7.tar.gz/0-orchestrator-1.1.0a7/zeroos/orchestrator/sal/influxdb/influxdb.py
influxdb.py
import os import sys import math import json import pandas as pd import tensorflow as tf from .settings import VALID_SPLIT_NAME, DEFAUT_SAVE_FILE_PATTERN from .settings import LABELS_FILENAME, SUMMARY_FILE_PATTERN class ImageReader(object): """Helper class that provides TensorFlow image coding utilities.""" # ...
0.0.1
/0.0.1-0.0.1.tar.gz/0.0.1-0.0.1/image2tfrecords/image2tfrecords.py
image2tfrecords.py
import json import os import pandas as pd import tensorflow as tf from tensorflow.contrib import slim # TODO: try tf.data API. because slim is not an official API. from .settings import (DEFAULT_READ_FILE_PATTERN, LABELS_FILENAME, SUMMARY_FILE_PATTERN, VALID_SPLIT_NAME) _ITEMS_TO_DESCRIPTIONS ...
0.0.1
/0.0.1-0.0.1.tar.gz/0.0.1-0.0.1/image2tfrecords/imagedataset.py
imagedataset.py
📦 setup.py (for humans) ======================= This repo exists to provide [an example setup.py] file, that can be used to bootstrap your next Python project. It includes some advanced patterns and best practices for `setup.py`, as well as some commented–out nice–to–haves. For example, this `setup.py` provides a `$...
0.618
/0.618-0.1.0.tar.gz/0.618-0.1.0/README.md
README.md
import math import matplotlib.pyplot as plt from .Generaldistribution import Distribution class Gaussian(Distribution): """ Gaussian distribution class for calculating and visualizing a Gaussian distribution. Attributes: mean (float) representing the mean value of the distribution stdev (float) representing ...
01-distributions
/01_distributions-0.1.tar.gz/01_distributions-0.1/01_distributions/Gaussiandistribution.py
Gaussiandistribution.py
import math import matplotlib.pyplot as plt from .Generaldistribution import Distribution class Binomial(Distribution): """ Binomial distribution class for calculating and visualizing a Binomial distribution. Attributes: mean (float) representing the mean value of the distribution std...
01-distributions
/01_distributions-0.1.tar.gz/01_distributions-0.1/01_distributions/Binomialdistribution.py
Binomialdistribution.py
======== Overview ======== .. start-badges .. list-table:: :stub-columns: 1 * - docs - |docs| * - tests - | |travis| |appveyor| | * - package - | |version| |wheel| |supported-versions| |supported-implementations| | |commits-since| .. |docs| image:: https://readthedo...
01d61084-d29e-11e9-96d1-7c5cf84ffe8e
/01d61084-d29e-11e9-96d1-7c5cf84ffe8e-0.1.0.tar.gz/01d61084-d29e-11e9-96d1-7c5cf84ffe8e-0.1.0/README.rst
README.rst
import sys import pexpect import signal import yaml import os import shutil import time import termios import struct import fcntl password_yaml = """ssh: - id: 1 name: demo1 user: fqiyou password: xxx host: 1.1.1.1 port: 20755 - id: 2 name: demo2 user: fqiyou password: xxx host...
0lever-so
/0lever_so-1.1.2-py3-none-any.whl/so/so.py
so.py
====== so ====== This is a SSH login tool Installation ============ :: pip install --upgrade 0lever-so or pip install --upgrade 0lever-so -i https://pypi.org/simple/ Usage ===== :: # 初始化配置文件,升级无需初始化,chmod 400 ~/.so/keys/* ➜ ~ so_install ➜ ~ cd .so ➜ .so tree . ├── keys ...
0lever-so
/0lever_so-1.1.2-py3-none-any.whl/0lever_so-1.1.2.dist-info/DESCRIPTION.rst
DESCRIPTION.rst
import requests import json class DingDing(object): def __init__(self, access_token): self._url = "https://oapi.dingtalk.com/robot/send" self._access_token = access_token def _do(self, payload): querystring = {"access_token": self._access_token} headers = {'Content-Type': "app...
0lever-utils
/0lever_utils-0.1.6-py3-none-any.whl/_lever_utils/foo/helpers/alarm/dingding.py
dingding.py
import sqlalchemy import pandas as pd import sqlalchemy.orm as sqlalchemy_orm from impala.dbapi import connect class Db(object): _engine = None _session = None _configuration = None def __init__(self, *args, **kwargs): self._host = kwargs["host"] self._port = kwargs["port"] se...
0lever-utils
/0lever_utils-0.1.6-py3-none-any.whl/_lever_utils/foo/helpers/db/impala_helper.py
impala_helper.py
from functools import wraps import hashlib import logging import json import redis class MyRedis(object): def __init__(self, host, port, password,db=0): self.pool = redis.ConnectionPool(host=host, password=password, port=port, db=db) self.rs = redis.Redis(connection_pool=self.pool, db=db) def...
0lever-utils
/0lever_utils-0.1.6-py3-none-any.whl/_lever_utils/foo/helpers/db/redis_helper.py
redis_helper.py
from redis_helper import redising import elasticsearch class MyElasticsearch(elasticsearch.Elasticsearch): redis_db = None def __init__(self, *args, **kwargs): self.redis_db = kwargs.pop("redis_db") elasticsearch.Elasticsearch.__init__(self, *args, **kwargs) @elasticsearch.client.utils....
0lever-utils
/0lever_utils-0.1.6-py3-none-any.whl/_lever_utils/foo/helpers/db/es_helper.py
es_helper.py
import sqlalchemy import sqlalchemy.orm as sqlalchemy_orm import pandas as pd from sshtunnel import SSHTunnelForwarder class Mysql(object): _engine = None _session = None _ssh_server = None def __init__(self, *args, **kwargs): user = kwargs["user"] password = kwargs["password"] ...
0lever-utils
/0lever_utils-0.1.6-py3-none-any.whl/_lever_utils/foo/helpers/db/mysql_helper.py
mysql_helper.py
from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import smtplib import os import poplib from email.parser import Parser from email.header import decode_header from email.utils import parseaddr from datetime import datetime class Mail(object): def __init__(self, server, port, u...
0lever-utils
/0lever_utils-0.1.6-py3-none-any.whl/_lever_utils/foo/helpers/mail/mail_helper.py
mail_helper.py
Hello, ZERO =========== Usage ----- `pip install 0proto` Then, simply use the command periodically: `0proto https://example.com/something/etc` This will save data to: `settings.BASE_DIR/data/0proto-DOMAIN:default/Item` N-Spacing --------- If you want to seprate different sessions and sources, just use name para...
0proto
/0proto-0.0.2.tar.gz/0proto-0.0.2/README.md
README.md
ハロー・ゼロ ============ 使い方 ------ `pip install 0rss` Then, simply use the command periodically: `0rss https://0oo.li/feed/en` This will save data periodically, to: `~/.metadrive/data/0rss-0oo.li:default/Post` 多源用法 -------- If you want to seprate different sessions and sources, just use name param: `0rss https://0...
0rss
/0rss-1.0.2.tar.gz/0rss-1.0.2/README.md
README.md
# 0wned [![Build Status](https://travis-ci.org/mschwager/0wned.svg?branch=master)](https://travis-ci.org/mschwager/0wned) [![Build Status](https://ci.appveyor.com/api/projects/status/github/mschwager/0wned?branch=master&svg=true)](https://ci.appveyor.com/project/mschwager/0wned/branch/master) Python packages allow fo...
0wneg
/0wneg-0.9.0.tar.gz/0wneg-0.9.0/README.md
README.md
from enum import Enum import json from typing import Dict, NamedTuple from pkg_resources import resource_string class ContractAddresses(NamedTuple): """An abstract record listing all the contracts that have addresses.""" erc20_proxy: str """Address of the ERC20Proxy contract.""" erc721_proxy: str ...
0x-contract-addresses
/0x_contract_addresses-3.0.0-py3-none-any.whl/zero_ex/contract_addresses/__init__.py
__init__.py
import json from typing import Dict from pkg_resources import resource_string class _ArtifactCache: """A cache to facilitate lazy & singular loading of contract artifacts.""" _contract_name_to_abi: Dict[str, Dict] = {} # class data, not instance @classmethod def contract_name_to_abi(cls, contract_n...
0x-contract-artifacts
/0x_contract_artifacts-3.0.0-py3-none-any.whl/zero_ex/contract_artifacts/__init__.py
__init__.py
from typing import Any, Union from eth_utils import is_address, to_checksum_address from web3 import Web3 from web3.providers.base import BaseProvider from .tx_params import TxParams class Validator: """Base class for validating inputs to methods.""" def __init__( self, web3_or_provider: U...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/bases.py
bases.py
from copy import copy from typing import cast, Dict, Union from eth_utils import remove_0x_prefix from zero_ex.json_schemas import assert_valid from zero_ex.contract_wrappers.exchange.types import Order def order_to_jsdict( order: Order, chain_id: int, exchange_address="0x0000000000000000000000000000000...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/order_conversions.py
order_conversions.py
from inspect import isclass from typing import List from eth_abi import decode_abi class RichRevert(Exception): """Raised when a contract method returns a rich revert error.""" def __init__( self, abi_signature: str, param_names: List[str], return_data: str ): """Populate instance varia...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/exceptions.py
exceptions.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/dev_utils/__init__.py
__init__.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/dummy_erc721_token/__init__.py
__init__.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/asset_proxy_owner/__init__.py
__init__.py
from typing import Any, Union from web3 import Web3 from web3.providers.base import BaseProvider from zero_ex import json_schemas from zero_ex.contract_wrappers.order_conversions import order_to_jsdict from ..bases import Validator class ExchangeValidator(Validator): """Validate inputs to Exchange methods."""...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/exchange/validator.py
validator.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/exchange/__init__.py
__init__.py
from enum import auto, Enum from zero_ex.contract_wrappers.exceptions import RichRevert # pylint: disable=missing-docstring class AssetProxyDispatchErrorCodes(Enum): # noqa: D101 (missing docstring) INVALID_ASSET_DATA_LENGTH = 0 UNKNOWN_ASSET_PROXY = auto() class BatchMatchOrdersErrorCodes(Enum): # noq...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/exchange/exceptions.py
exceptions.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/staking_proxy/__init__.py
__init__.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/erc20_token/__init__.py
__init__.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/zrx_token/__init__.py
__init__.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/erc721_token/__init__.py
__init__.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/erc20_bridge_proxy/__init__.py
__init__.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/coordinator/__init__.py
__init__.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/erc1155_proxy/__init__.py
__init__.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/staking/__init__.py
__init__.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/erc721_proxy/__init__.py
__init__.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/i_validator/__init__.py
__init__.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/static_call_proxy/__init__.py
__init__.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/multi_asset_proxy/__init__.py
__init__.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/erc20_proxy/__init__.py
__init__.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/dummy_erc20_token/__init__.py
__init__.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/forwarder/__init__.py
__init__.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/order_validator/__init__.py
__init__.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/i_asset_proxy/__init__.py
__init__.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/dutch_auction/__init__.py
__init__.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/zrx_vault/__init__.py
__init__.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/eth_balance_checker/__init__.py
__init__.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/erc1155_mintable/__init__.py
__init__.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/weth9/__init__.py
__init__.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/i_wallet/__init__.py
__init__.py
# pylint: disable=too-many-arguments import json from typing import ( # pylint: disable=unused-import Any, List, Optional, Tuple, Union, ) from eth_utils import to_checksum_address from mypy_extensions import TypedDict # pylint: disable=unused-import from hexbytes import HexBytes from web3 impo...
0x-contract-wrappers
/0x_contract_wrappers-2.0.0-py3-none-any.whl/zero_ex/contract_wrappers/coordinator_registry/__init__.py
__init__.py
from os import path import json from typing import Mapping from pkg_resources import resource_string import jsonschema from stringcase import snakecase class _LocalRefResolver(jsonschema.RefResolver): """Resolve package-local JSON schema id's.""" def __init__(self): """Initialize a new instance.""" ...
0x-json-schemas
/0x_json_schemas-2.1.0-py3-none-any.whl/zero_ex/json_schemas/__init__.py
__init__.py
from functools import singledispatch from typing import Dict, List, Set, Tuple, Union from eth_account import Account, messages from eth_account.signers.local import LocalAccount from eth_keys.datatypes import PrivateKey from hexbytes import HexBytes @singledispatch def _to_account(private_key_or_account): """Get...
0x-middlewares
/0x_middlewares-1.0.0-py3-none-any.whl/zero_ex/middlewares/local_message_signer.py
local_message_signer.py
import re from typing import Any, List from mypy_extensions import TypedDict from eth_abi import encode_abi from web3 import Web3 from .type_assertions import assert_is_string, assert_is_list class MethodSignature(TypedDict, total=False): """Object interface to an ABI method signature.""" method: str ...
0x-order-utils
/0x_order_utils-4.0.1-py3-none-any.whl/zero_ex/dev_utils/abi_utils.py
abi_utils.py
from typing import Any from eth_utils import is_address from web3.providers.base import BaseProvider def assert_is_string(value: Any, name: str) -> None: """If :param value: isn't of type str, raise a TypeError. >>> try: assert_is_string(123, 'var') ... except TypeError as type_error: print(str(type_er...
0x-order-utils
/0x_order_utils-4.0.1-py3-none-any.whl/zero_ex/dev_utils/type_assertions.py
type_assertions.py
from typing import NamedTuple import eth_abi from deprecated.sphinx import deprecated from zero_ex.dev_utils import abi_utils from zero_ex.dev_utils.type_assertions import assert_is_string, assert_is_int ERC20_ASSET_DATA_BYTE_LENGTH = 36 ERC721_ASSET_DATA_MINIMUM_BYTE_LENGTH = 53 SELECTOR_LENGTH = 10 class ERC20...
0x-order-utils
/0x_order_utils-4.0.1-py3-none-any.whl/zero_ex/order_utils/asset_data_utils.py
asset_data_utils.py
r"""Order utilities for 0x applications. Setup ----- Install the package with pip:: pip install 0x-order-utils Some methods require the caller to pass in a `Web3.BaseProvider`:code: object. For local testing one may construct such a provider pointing at an instance of `ganache-cli <https://www.npmjs.com/package...
0x-order-utils
/0x_order_utils-4.0.1-py3-none-any.whl/zero_ex/order_utils/__init__.py
__init__.py
import requests import optparse import urllib HOST = "https://api.0x.org" class ZeroEx: """ 0x API ... Attributes ---------- Methods ------- """ def __init__(self, host="https://api.0x.org", verbose=False): self.host = host self.verbose = verbose ...
0x-python
/0x_python-1.0.16-py3-none-any.whl/ZeroEx/ZeroEx.py
ZeroEx.py
# 0x-sra-client A Python client for interacting with servers conforming to [the Standard Relayer API specification](https://github.com/0xProject/0x-monorepo/tree/development/packages/sra-spec). Read the [documentation](http://0x-sra-client-py.s3-website-us-east-1.amazonaws.com/) # Schemas The [JSON schemas](http://...
0x-sra-client
/0x-sra-client-4.0.0.tar.gz/0x-sra-client-4.0.0/README.md
README.md
from __future__ import absolute_import import datetime import json import mimetypes from multiprocessing.pool import ThreadPool import os import re import tempfile # python 2 and python 3 compatibility library import six from six.moves.urllib.parse import quote from zero_ex.sra_client.configuration import Configura...
0x-sra-client
/0x-sra-client-4.0.0.tar.gz/0x-sra-client-4.0.0/src/zero_ex/sra_client/api_client.py
api_client.py
from __future__ import absolute_import import io import json import logging import re import ssl import certifi # python 2 and python 3 compatibility library import six from six.moves.urllib.parse import urlencode try: import urllib3 except ImportError: raise ImportError("OpenAPI Python client requires ur...
0x-sra-client
/0x-sra-client-4.0.0.tar.gz/0x-sra-client-4.0.0/src/zero_ex/sra_client/rest.py
rest.py
# flake8: noqa r"""A Python client for interacting with SRA-compatible Relayers. 0x Protocol is an open standard. Many Relayers opt to implementing a set of `Standard Relayer API (SRA) <http://sra-spec.s3-website-us-east-1.amazonaws.com/>`_ endpoints, to make it easier for anyone to source liquidity that conforms t...
0x-sra-client
/0x-sra-client-4.0.0.tar.gz/0x-sra-client-4.0.0/src/zero_ex/sra_client/__init__.py
__init__.py
from __future__ import absolute_import import copy import logging import multiprocessing import sys import urllib3 import six from six.moves import http_client as httplib class TypeWithDefault(type): def __init__(cls, name, bases, dct): super(TypeWithDefault, cls).__init__(name, bases, dct) cl...
0x-sra-client
/0x-sra-client-4.0.0.tar.gz/0x-sra-client-4.0.0/src/zero_ex/sra_client/configuration.py
configuration.py
# Web3.py [![Join the chat at https://gitter.im/ethereum/web3.py](https://badges.gitter.im/ethereum/web3.py.svg)](https://gitter.im/ethereum/web3.py?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://circleci.com/gh/ethereum/web3.py.svg?style=shield)](https://circleci....
0x-web3
/0x-web3-5.0.0a5.tar.gz/0x-web3-5.0.0a5/README.md
README.md
import json registrar_abi = json.loads('[{"constant":false,"inputs":[{"name":"_hash","type":"bytes32"}],"name":"releaseDeed","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_hash","type":"bytes32"}],"name":"getAllowedTime","outputs":[{"name":"timestamp...
0x-web3
/0x-web3-5.0.0a5.tar.gz/0x-web3-5.0.0a5/ens/contract_data.py
contract_data.py
from eth_utils import ( is_binary_address, is_checksum_address, to_checksum_address, ) from ens import abis from ens.constants import ( EMPTY_ADDR_HEX, REVERSE_REGISTRAR_DOMAIN, ) from ens.exceptions import ( AddressMismatch, UnauthorizedError, UnownedName, ) from ens.utils import ( ...
0x-web3
/0x-web3-5.0.0a5.tar.gz/0x-web3-5.0.0a5/ens/main.py
main.py
import copy import datetime import functools from eth_utils import ( is_same_address, remove_0x_prefix, to_normalized_address, ) import idna from ens.constants import ( ACCEPTABLE_STALE_HOURS, AUCTION_START_GAS_CONSTANT, AUCTION_START_GAS_MARGINAL, EMPTY_SHA3_BYTES, MIN_ETH_LABEL_LENGT...
0x-web3
/0x-web3-5.0.0a5.tar.gz/0x-web3-5.0.0a5/ens/utils.py
utils.py
ENS = [ { "constant": True, "inputs": [ { "name": "node", "type": "bytes32" } ], "name": "resolver", "outputs": [ { "name": "", "type": "address" } ], "payable": False, "type": "function" }, { "constant": True, "input...
0x-web3
/0x-web3-5.0.0a5.tar.gz/0x-web3-5.0.0a5/ens/abis.py
abis.py
from eth_account import ( Account, ) from eth_utils import ( apply_to_return_value, is_checksum_address, is_string, ) from hexbytes import ( HexBytes, ) from web3._utils.blocks import ( select_method_for_block_identifier, ) from web3._utils.decorators import ( deprecated_for, ) from web3._u...
0x-web3
/0x-web3-5.0.0a5.tar.gz/0x-web3-5.0.0a5/web3/eth.py
eth.py
from eth_utils import ( is_checksum_address, ) from web3._utils.toolz import ( assoc, ) from web3.module import ( Module, ) class Parity(Module): """ https://paritytech.github.io/wiki/JSONRPC-parity-module """ defaultBlock = "latest" def enode(self): return self.web3.manager....
0x-web3
/0x-web3-5.0.0a5.tar.gz/0x-web3-5.0.0a5/web3/parity.py
parity.py
import copy import itertools from eth_abi import ( decode_abi, ) from eth_abi.exceptions import ( DecodingError, ) from eth_utils import ( add_0x_prefix, encode_hex, function_abi_to_4byte_selector, is_list_like, is_text, to_tuple, ) from hexbytes import ( HexBytes, ) from web3._uti...
0x-web3
/0x-web3-5.0.0a5.tar.gz/0x-web3-5.0.0a5/web3/contract.py
contract.py