code
stringlengths
1
199k
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Product', fields=[ ('id', models.AutoField(auto_created=T...
'''Basic Authorization tests for the OSF.''' from __future__ import absolute_import import unittest import mock from nose.tools import * # noqa PEP8 asserts from website.addons.twofactor.tests import _valid_code from tests.base import OsfTestCase from tests.factories import ProjectFactory, AuthUserFactory class TestAu...
from ansible.module_utils.basic import * import os try: from dciclient.v1.api import context as dci_context from dciclient.v1.api import user as dci_user except ImportError: dciclient_found = False else: dciclient_found = True DOCUMENTATION = ''' --- module: dci_user short_description: An ansible module...
__author__ = 'Nick Apperley' class InvalidCredentialsError(Exception): pass
""" Management of user accounts. ============================ The user module is used to create and manage user settings, users can be set as either absent or present .. code-block:: yaml fred: user.present: - fullname: Fred Jones - shell: /bin/zsh - home: /home/fred - uid: 400...
import os import time import argparse try: from urllib.parse import urlencode except ImportError: from urllib import urlencode try: import urllib.request as urllib2 except ImportError: import urllib2 try: import configparser except ImportError: import ConfigParser as configparser __author__ = 'i...
from fabric.api import * import logging import requests from common_docker import stop_docker_compose, log_files import random import filelock import uuid import subprocess import os import pytest import distutils.spawn import log logging.getLogger("requests").setLevel(logging.CRITICAL) logging.getLogger("paramiko").se...
class AggregationResponse: def __init__(self, key: str, count: int): self.key = key self.count = count
from mininet.net import Mininet from mininet.node import Controller, RemoteController, OVSKernelSwitch, IVSSwitch, UserSwitch from mininet.link import Link, TCLink from mininet.cli import CLI from mininet.log import setLogLevel from mininet.link import Intf import time def topology(): net = Mininet(controller=Contr...
''' http://pymolwiki.org/index.php/FindSurfaceResidues ''' from pymol import cmd def findAtomExposure(selection="all"): """ DESCRIPTION Finds those atoms on the surface of a protein that have at least 'cutoff' exposed A**2 surface area. USAGE findSurfaceAtoms [ selection, [ cutoff ]] SEE ALSO findSu...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('app', '0009_class'), ] operations = [ migrations.AddField( model_name='ability', name='cls', field=models.ForeignKey(...
import os import numpy as np import tensorflow as tf def get_weight(shape, stddev, reg, name): wd = 0.0 # init = tf.random_normal_initializer(stddev=stddev) init = tf.contrib.layers.xavier_initializer() if reg: regu = tf.contrib.layers.l2_regularizer(wd) filt = tf.get_variable(name, shape, initializer=i...
import os import time from io import StringIO from threading import Event from numpy import polyfit, array, average, uint8, zeros_like from skimage.color import gray2rgb from skimage.draw import circle from traits.api import Any, Bool from pychron.core.ui.gui import invoke_in_main_thread from pychron.core.ui.thread imp...
import logging from typing import TYPE_CHECKING, Optional from twisted.web.server import Request from sydent.db.accounts import AccountStore from sydent.http.servlets import MatrixRestError, get_args from sydent.terms.terms import get_terms if TYPE_CHECKING: from sydent.sydent import Sydent from sydent.users.ac...
from django.db import migrations, models WEBHOOK_CONTENTTYPE_CHOICES = ( (1, 'application/json'), (2, 'application/x-www-form-urlencoded'), ) def webhook_contenttype_to_slug(apps, schema_editor): Webhook = apps.get_model('extras', 'Webhook') for id, slug in WEBHOOK_CONTENTTYPE_CHOICES: Webhook.o...
"""External user permission utilities.""" from clusterfuzz._internal.base import memoize from clusterfuzz._internal.base import utils from clusterfuzz._internal.datastore import data_handler from clusterfuzz._internal.datastore import data_types from clusterfuzz._internal.datastore import fuzz_target_utils from cluster...
from flask import Flask from flask.ext.bootstrap import Bootstrap from flask.ext.mail import Mail from flask.ext.moment import Moment from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.login import LoginManager from flask.ext.pagedown import PageDown from config import config bootstrap = Bootstrap() mail = Mail...
from __future__ import unicode_literals import unittest import mock from mopidy_lastfm import Extension class ExtensionTest(unittest.TestCase): def test_get_default_config(self): ext = Extension() config = ext.get_default_config() self.assertIn('[lastfm]', config) self.assertIn('enab...
import os import sys if len(sys.argv) < 2 or len(sys.argv) > 3: print("This tool requires one parameter. ") sys.exit(-1) fname = sys.argv[1] foutput = sys.argv[2] output = open(foutput, 'w') isTagOpened = False isSentenceOpen = True previousClass = "" sentenceCount = 1 isFirstToken = True isFirstSentenceToken =...
"""This module provides functions to copy Topic Maps constructs from one topic map to another without creating duplicates (ie, merging where appropriate). It is a port of the Java code written by Lars Heuer for the tinyTiM project (http://tinytim.sourceforget.net/). """ from topic import Topic from merge_utils import m...
import json import logging import re from django.core.urlresolvers import reverse from django.http import HttpResponse, Http404 from django.utils.translation import ugettext as _ from thrift.transport.TTransport import TTransportException from desktop.context_processors import get_app_name from jobsub.parameterization ...
import os import sys from sqlalchemy import Column, ForeignKey, Integer, String from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship from sqlalchemy import create_engine Base = declarative_base() """ NOTES: - Add image_url field [DONE] - Add script to drop old DB """ class Use...
import logging from mock import Mock from slippinj.cli.objects.wf_configuration_object import WfConfigurationObject from slippinj.cli.scripts.cooper import Cooper class TestCooper: def test_script_can_be_configured(self): mocked_args_parser = Mock() mocked_args_parser.add_parser = Mock(return_value=...
'''Example HalfAckingTopology''' import sys import heronpy.api.api_constants as constants from heronpy.api.topology import TopologyBuilder from heronpy.api.stream import Grouping from examples.src.python.spout import WordSpout from examples.src.python.bolt import HalfAckBolt if __name__ == '__main__': if len(sys.argv...
import gym from gym.spaces import Discrete import numpy as np from typing import Optional, Tuple from ray.rllib.models.torch.misc import SlimFC from ray.rllib.models.torch.torch_modelv2 import TorchModelV2 from ray.rllib.utils.framework import get_activation_fn, try_import_torch from ray.rllib.utils.typing import Model...
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ from setuptools import setup setup()
from abc import ABC from dataclasses import asdict, dataclass from datetime import date, datetime from distutils.util import strtobool from enum import Enum from typing import Any, Dict, List, Optional from dqm import errors class DataType(Enum): STRING = 'str' LIST = 'list' BOOLEAN = 'boolean' DATE = 'date' ...
from keystoneauth1 import exceptions as ks_exc import mock import six import nova.conf from nova import context from nova import exception from nova import objects from nova.objects import base as obj_base from nova.scheduler.client import report from nova import test from nova.tests import uuidsentinel as uuids CONF =...
r"""Search symbolic functionals on a single machine. """ import json import time from absl import app from absl import flags from absl import logging from ml_collections import config_flags import numpy as np import tensorflow.compat.v1 as tf from symbolic_functionals.syfes import loss from symbolic_functionals.syfes.e...
from panda3d.core import Point3, Vec3, Vec4 from toontown.coghq.SpecImports import * GlobalEntities = {1000: {'type': 'levelMgr', 'name': 'LevelMgr', 'comment': '', 'parentEntId': 0, 'cogLevel': 0, 'farPlaneDistance': 1500, 'modelFilename': 'phase_12/models/bossbotHQ/Boss...
import unittest import logging import os import uuid from socket import error from cornice.util import json_error from couchdb import Server from munch import munchify from mock import patch, MagicMock from openprocurement.edge.utils import ( VALIDATE_BULK_DOCS_ID, VALIDATE_BULK_DOCS_UPDATE, prepare_couchdb...
"""Component loader and editor.""" import copy import itertools import json from typing import Any, Tuple, Dict import brax from brax.experimental.composer.components import register_component from brax.experimental.composer.components import register_default_components from google.protobuf import text_format from goog...
import time import logging from .users import Users from .groups import Groups from .config import Config from .ldapconnection import LdapConnection logger = logging.getLogger(__name__) class Ldappy(object): """ Wrapper to the ldap lib, one that will make you happy. ldap docs: https://www.python-ldap.org/do...
from __future__ import absolute_import import sys import copy import codecs import itertools from . import TypeSlots from .ExprNodes import not_a_constant import cython cython.declare(UtilityCode=object, EncodedString=object, bytes_literal=object, Nodes=object, ExprNodes=object, PyrexTypes=object, Builti...
import socket import time import sys def enviar_para_unity (msg): TCP_IP = '127.0.0.1' TCP_PORT = 12598 #porta do servidor Unity BUFFER_SIZE = 1024 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((TCP_IP, TCP_PORT)) s.send(msg) data = s.recv(BUFFER_SIZE) s.close() ret...
from __future__ import print_function import io import json import os import sys import time import zipfile import boto3 import botocore import botocore.exceptions import click import pywren import pywren.runtime from pywren import ec2standalone @click.group() @click.option('--filename', default=pywren.wrenconfig.get_d...
import boto3 import json import os import subprocess import sure # noqa # pylint: disable=unused-import import time from moto.ssm.utils import convert_to_tree def retrieve_by_path(client, path): print(f"Retrieving all parameters from {path}. " f"AWS has around 14000 parameters, and we can only retrieve 1...
"""Module that will handle `ISO 8601:2004 Representation of dates and times <http://www.iso.org/iso/catalogue_detail?csnumber=40874>`_ date parsing and formatting. """ __version__ = '1.0' __copyright__ = """Copyright 2011 Lance Finn Helsten (helsten@acm.org)""" __license__ = """ Licensed under the Apache License, Versi...
import backends, build import uuid, os, sys class XCodeBackend(backends.Backend): def __init__(self, build, interp): super().__init__(build, interp) self.project_uid = self.environment.coredata.guid.replace('-', '')[:24] self.project_conflist = self.gen_id() self.indent = ' ' ...
import time from heatclient import client as heat_client_pkg from oslo_log import log as logging LOG = logging.getLogger(__name__) HEAT_VERSION = '1' def create_client(keystone_client, os_region_name, cacert): orchestration_api_url = keystone_client.service_catalog.url_for( service_type='orchestration', reg...
"""Data models collection.""" import pymongo from pymongo.database import Database def latest_datamodel(database: Database): """Return the latest data model.""" if data_model := database.datamodels.find_one(sort=[("timestamp", pymongo.DESCENDING)]): # pragma: no cover-behave data_model["_id"] = str(dat...
from __future__ import unicode_literals from django.db import models, migrations try: import fir_artifacts ops = [ migrations.AddField( model_name='irmascan', name='artifacts', field=models.ManyToManyField(related_name='irmascans', to='fir_artifacts.Artifact'), ...
import sys import eventlet from oslo.config import cfg from dnrm.common import config from dnrm.service import WsgiService def main(): eventlet.monkey_patch() # the configuration will be read into the cfg.CONF global data structure config.parse(sys.argv[1:]) if not cfg.CONF.config_file: sys.exit...
""" Server API Reference for Server API (REST/Json) OpenAPI spec version: 2.0.3 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys import unittest import kinow_client from kinow_client.rest import ApiException from kinow_clien...
import matplotlib.pyplot as plt import pandas as pd from datetime import timedelta from nilmtk.consts import SECS_PER_DAY from nilmtk.timeframe import TimeFrame class TimeFrameGroup(list): """A collection of nilmtk.TimeFrame objects.""" def __init__(self, timeframes=None): if isinstance(timeframes, pd.P...
import datetime import os import time from typing import List, Dict, Optional, Union from urllib.parse import urljoin import requests from pykechain.defaults import ASYNC_REFRESH_INTERVAL, ASYNC_TIMEOUT_LIMIT, API_EXTRA_PARAMS from pykechain.enums import ( ActivityType, ActivityStatus, Category, Activit...
""" Sample of plugin for Aodh. For more Aodh related benchmarks take a look here: github.com/openstack/rally/blob/master/rally/benchmark/scenarios/aodh/ About plugins: https://rally.readthedocs.io/en/latest/plugins/index.html Rally concepts https://wiki.openstack.org/wiki/Rally/Concepts """ from rally.benchmark.scenari...
""" Phaxio API API Definition for Phaxio OpenAPI spec version: 2.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class ListPhoneNumbersResponse(object): """ NOTE: This class is auto generated by the swagger c...
import logging from django.conf import settings from django.views.generic import View from django.shortcuts import render, redirect from django.http import (HttpResponseRedirect, JsonResponse, HttpResponseForbidden) from django.contrib.auth.decorators import login_requi...
import httplib import uuid import mock import stubout from google.apputils import app from google.apputils import basetest from simian.mac import models from simian.mac.admin import host from simian.mac.admin import main as gae_main from simian.mac.common import auth from tests.simian.mac.common import test class HostM...
"""Wrappers around standard crypto data elements. Includes root and intermediate CAs, SSH key_pairs and x509 certificates. """ from __future__ import absolute_import import base64 import binascii import os from Crypto.PublicKey import RSA from cryptography import exceptions from cryptography.hazmat import backends from...
class PoisonPill(object): ''' A poison pill is sent to an actor to force it to stop. ''' def __init__(self): super(PoisonPill, self).__init__()
from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('ebooks', '0025_initialize_section_interal_oder_index'), ] operations = [ migrations.RemoveField( model_name='section', name='overwrite', ), ]
import nose import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), "..")) from modules import service_layer
from __future__ import print_function from __future__ import unicode_literals from __future__ import division from django.db import transaction from apps.home.training.utils import get_quiz_or_404 from apps.users.views.group import group_list_page from apps.users.models import TrainingResult def groups_to_follow(reques...
import datetime import decimal import uuid from hazelcast.serialization.base import BaseSerializationService from hazelcast.serialization.objects import ( CanonicalizingHashSet, IdentifiedAddress, IdentifiedMapEntry, ReliableTopicMessage, ) from hazelcast.serialization.portable.classdef import FieldType...
from model.contact import Contact, clean def test_add_contact(app,json_contacts, db, check_ui): contact = json_contacts old_contacts = db.get_contact_list() app.contact.create(contact) new_contacts = db.get_contact_list() assert len(old_contacts) + 1 == len(new_contacts) old_contacts.append(cont...
from logging import getLogger from sis_provisioner.management.commands import SISProvisionerCommand from restclients.exceptions import DataFailureException from astra.loader import Accounts class Command(SISProvisionerCommand): help = "Load Canvas Accounts" def handle(self, *args, **options): try: ...
import time,threading def loop(): print('thread %s is runing...' % threading.current_thread().name) n = 0 while n < 5: n = n + 1 print('thread %s >>> %s' % (threading.current_thread().name,n)) time.sleep(1) print('thread %s ended.' % threading.current_thread().name) print('th...
from thrift.protocol import TBinaryProtocol from thrift.protocol import TMultiplexedProtocol import thrift.Thrift from thrift.transport import TSocket from thrift.transport import TTransport import importlib import re import socket import struct import sys class ThriftClient(object): MATCH_SPEC_T = "_match_spec_t" ...
"""RequestContext: context for requests that persist through all of wormhole.""" import copy import uuid import six from wormhole import exception from wormhole.i18n import _ from wormhole.common import local from wormhole.common import log as logging from wormhole.common import timeutils LOG = logging.getLogger(__name...
import os import subprocess import logging import shutil from .common import KnowledgeDeployer logger = logging.getLogger() class uWSGIDeployer(KnowledgeDeployer): _registry_keys = ['uwsgi'] COMMAND = "uwsgi {protocol} --plugin python --wsgi-file {{path}} --callable app --master --processes {{processes}} --thre...
"Shared functions" import numpy as np from pathlib import Path import shutil def load_dataset(version, dataset_name, shard): path = "datasets/%s/%s/%s.npz" % (version, dataset_name, shard) d = np.load(path) return d['x'], d['y'] def clean_dir(fpath): "delete previous content and recreate dir" dpath ...
from django.core.urlresolvers import reverse from django.http import HttpRequest import hashlib import inspect import logging import os import thread class NexusModule(object): # base url (pattern name) to show in navigation home_url = None # generic permission required permission = None media_root ...
import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union from google.api_core import grpc_helpers from google.api_core import gapic_v1 import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials...
from amqplib import client_0_8 as amqp from sqlite3 import dbapi2 as sqlite import json AMQP_HOST = "localhost:5672" AMQP_USER = "guest" AMQP_PASS = "guest" AMQP_VHOST = "/" AMQP_QUEUE = "riak.publish" DB_CONN = None def connect(): ''' Connect to RabbitMQ ''' return amqp.Connection( host=AMQP_HOST, ...
"""A module with RDF value wrappers for timeline protobufs.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import os from future.builtins import map from typing import Iterator from grr_response_core.lib.rdfvalues import structs as rdf_structs from grr_...
from collections import OrderedDict from typing import Dict, Type from .base import SchemaServiceTransport from .grpc import SchemaServiceGrpcTransport from .grpc_asyncio import SchemaServiceGrpcAsyncIOTransport _transport_registry = OrderedDict() # type: Dict[str, Type[SchemaServiceTransport]] _transport_registry["gr...
from flask import Blueprint from flask import abort from flask import render_template from flask import request from flask import jsonify from flask import redirect from flask import url_for from flask import send_file from flask.ext.login import login_required from flask.ext.login import current_user from wtforms impo...
"""Support for VersaSense MicroPnP devices.""" import logging import pyversasense as pyv import voluptuous as vol from homeassistant.const import CONF_HOST from homeassistant.core import HomeAssistant from homeassistant.helpers import aiohttp_client import homeassistant.helpers.config_validation as cv from homeassistan...
''' Testing NMF initialization and various methods using scikit learn and NIMFA ''' import os, sys, glob, re import datetime from matplotlib.dates import date2num, num2date import numpy as np from calendar import monthrange import h5py from sklearn import decomposition sys.path.insert(0,'/home/wu-jung/code_git/mi-instr...
import struct import tensorrt as trt import os, sys sys.path.insert(0, os.getcwd()) from code.common import logging, dict_get from code.common.builder import BenchmarkBuilder from importlib import import_module MobileNetCalibrator = import_module("code.mobilenet.tensorrt.calibrator").MobileNetCalibrator class MobileNet...
print("Guessing game. You will attempt to guess the randomly generated number") from random import randint number_to_guess = randint(0,20) guessed = False while not guessed: user_guess = input("Guess the number between 1 and 20 \n") user_guess = int(user_guess) if user_guess == number_to_guess: gues...
from abc import abstractmethod, ABCMeta import socket from util import Host from vpp_neighbor import VppNeighbor class VppInterface(object): """Generic VPP interface.""" __metaclass__ = ABCMeta @property def sw_if_index(self): """Interface index assigned by VPP.""" return self._sw_if_ind...
import collections import logging import keras.backend as keras_backend import numpy as np import os import random import sklearn.datasets import sklearn.metrics import sys from attention_lstm import AttentionLSTM from reader import ScienceIEBratReader from extras import VSM from representation import IndexListMapper f...
import pytest from copy import deepcopy from sovrin_node.test import waits from stp_core.loop.eventually import eventually from plenum.common.constants import VERSION, NAME from plenum.common.util import randomString from plenum.test.test_node import checkNodesConnected from sovrin_common.constants import SHA256, CANCE...
import unittest from mock import Mock, patch from pay_with_amazon.login_with_amazon import LoginWithAmazon class LoginWithAmazonClientTest(unittest.TestCase): def setUp(self): self.maxDiff = None self.lwa_client = LoginWithAmazon( client_id='client_id', region='na', ...
from __future__ import print_function from __future__ import division from __future__ import absolute_import import traceback from oslo_log import log as logging import webob import webob.dec from congress.api import webservice from congress.dse2 import data_service LOG = logging.getLogger(__name__) API_SERVICE_NAME = ...
from .. import FileRenderer import os class AudioRenderer(FileRenderer): def __init__(self, max_width=None): self.max_width = max_width def _detect(self, file_pointer): _, ext = os.path.splitext(file_pointer.name) return ext.lower() in ['.wav', '.mp3'] def _render(self, file_pointer,...
import wx from wx import xrc class MyApp(wx.App): def OnInit(self): self.res = xrc.XmlResource('dynamic.xrc') self.frame = self.res.LoadFrame(None, 'mainFrame') self.frame.Show() return True if __name__ == '__main__': app = MyApp(False) app.MainLoop()
""" SignalFx client library. This module makes interacting with SignalFx from your Python scripts and applications easy by providing a full-featured client for SignalFx's APIs. Basic usage for reporting data: import signalfx sfx = signalfx.SignalFx().ingest('your_api_token') sfx.send( gauges=[ ...
""" imikolov's simple dataset. This module will download dataset from http://www.fit.vutbr.cz/~imikolov/rnnlm/ and parse training set and test set into paddle reader creators. """ from __future__ import print_function import paddle.dataset.common import collections import tarfile import six __all__ = ['train', 'test', ...
""" Utilities for working with pandas objects. """ from contextlib import contextmanager from copy import deepcopy from itertools import product import operator as op import warnings import numpy as np import pandas as pd from distutils.version import StrictVersion pandas_version = StrictVersion(pd.__version__) def jul...
import unittest import numpy as np import pandas as pd from pandas.api.types import CategoricalDtype from pyspark import pandas as ps from pyspark.pandas.config import option_context from pyspark.pandas.tests.data_type_ops.testing_utils import TestCasesUtils from pyspark.pandas.typedef.typehints import extension_object...
import os from oslo_log import log from oslo_utils import excutils from oslo_utils import importutils from oslo_utils import strutils import retrying import rfc3986 import six from six.moves import urllib from ironic.common import exception from ironic.common.i18n import _ from ironic.conf import CONF sushy = importuti...
"""This code example updates activity groups. To determine which activity groups exist, run get_all_activity_groups.py. Tags: ActivityGroupService.getActivityGroup Tags: ActivityGroupService.updateActivityGroups """ __author__ = ('Nicholas Chen', 'Joseph DiLallo') from googleads import dfp ACTIVITY_GROUP_...
""" Sample script to extract and set level thumbnails. """ import argparse import io import os import sys from dustmaker import DFReader, DFWriter from dustmaker.cmd.common import ( run_utility, CliUtility, ) from dustmaker.variable import VariableBool class Thumbnail(CliUtility): """CLI utility for adjusti...
import StringIO import cgi import csv import logging from handlers.BaseHandler import BaseHandler from model.Attendee import Attendee class PagesHandlers(BaseHandler): CONFERENCE = "Enigma_2015" # Hardcoded for now def lookup(self): """ Lookup a given attendee either by registration id or by na...
"""Manifest Modifications admin handler.""" import httplib import json from google.appengine.api import users from google.appengine.ext import db from simian import settings from simian.mac import admin from simian.mac import common from simian.mac import models from simian.mac.common import auth from simian.mac.common...
import time, os, sys __PATH__ = os.path.dirname(os.path.abspath(__file__)).replace('\\','/') sys.path.append(os.path.dirname(__PATH__)) from auana import Preprocess p = Preprocess(u"E:/16data") print "Title: PreWork Demo" print "This demo will extracct the informations from reference files and save them. \n For Recogni...
""" testTextIndex.py Author: Tony Papenfuss Date: Thu May 29 11:44:36 EST 2008 """ import os, sys from fasta import FastaFile filename = 'tumour_sample.fa' f = FastaFile(filename, indexed=True, clobber=True, method='db')
from __future__ import absolute_import from .celery import app as celery_app celery_app
import boxm_batch; import multiprocessing import Queue import time import os; import optparse; from xml.etree.ElementTree import ElementTree import sys class dbvalue: def __init__(self, index, type): self.id = index # unsigned integer self.type = type # string class boxm_job(): def __init__(self,mode...
import xml.etree.ElementTree as ET from pathlib import Path from configparser import ConfigParser _generated_str = "Generated by BEASTling" _config_file_str = "Original config file:" _proggen_str = "Configuration built programmatically" _do_not_edit_str = "Please DO NOT manually edit this file" _data_file_str = "BEASTl...
import numpy as np dimensions = 5 starters = np.linspace(0, 2 * np.pi, dimensions + 1)[:-1] bVectors = np.array([(np.cos(t), np.sin(t)) for t in starters]) phi = (1 + np.sqrt(5)) / 2 shifts = np.array((-1, 1, -1.5, 0.65, 0.85)) translation = bVectors * shifts[:, np.newaxis] print(translation) samples = 1000 span = 10 x...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Scribble.slug' db.alter_column('scribbler_scribble', 'slug', self.gf('django.db.models.fields.SlugField')(max_length=...
NAME = "ZenPacks.iXsystems.TrueNAS" VERSION = "2.0.0" AUTHOR = "Faycal Noushi" LICENSE = "" NAMESPACE_PACKAGES = ['ZenPacks', 'ZenPacks.iXsystems'] PACKAGES = ['ZenPacks', 'ZenPacks.iXsystems', 'ZenPacks.iXsystems.TrueNAS'] INSTALL_REQUIRES = ['ZenPacks.zenoss.ZenPackLib'] COMPAT_ZENOSS_VERS = "" PREV_ZENPACK_NAME = ""...
""" Environment variable configuration loading class. Using a class here doesn't really model anything but makes state passing (in a situation requiring it) more convenient. This module is currently considered private/an implementation detail and should not be included in the Sphinx API documentation. """ import os fro...
import datetime from django.conf import settings from django.contrib.auth.models import User from django.db import models from django.db.models.signals import post_save from django.utils.translation import ugettext_lazy from guardian.conf import settings as guardian_settings from guardian.shortcuts import get_perms_for...
import asynchat import smtpd from concurrent import futures from .tls import TLSHandshaker try: from multiprocessing import cpu_count except ImportError: # some platforms don't have multiprocessing def cpu_count(): return 1 import sys try: import ssl except ImportError: class ssl: SS...