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 |
End of preview. Expand in Data Studio
Dataset Card for "pypi_clean"
All of the latest package versions from pypi. The original data came from here. I pulled the latest versions of each package, then extracted only md, rst, ipynb, and py files.
I then applied some cleaning:
- rendering notebooks
- removing leading comments/licenses
- Downloads last month
- 54