text
stringlengths
0
1.05M
meta
dict
from doajtest.helpers import DoajTestCase from portality.migrate.continuations import restructure_archiving_policy from portality.migrate.continuations import extract_continuations from portality import models from copy import deepcopy import time class TestMigration(DoajTestCase): def test_01_archiving_policy(se...
{ "repo_name": "DOAJ/doaj", "path": "portality/migrate/continuations/test_migration.py", "copies": "1", "size": "5444", "license": "apache-2.0", "hash": 37969704344553050, "line_mean": 31.6047904192, "line_max": 86, "alpha_frac": 0.4702424688, "autogenerated": false, "ratio": 3.612475116124751, ...
from doajtest.helpers import DoajTestCase from nose.tools import assert_raises from werkzeug.datastructures import MultiDict from wtforms import StringField, Form, validators from portality import models from portality.forms import validate class TestReservedUsernames(DoajTestCase): def setUp(self): cla...
{ "repo_name": "DOAJ/doaj", "path": "doajtest/unit/test_reserved_usernames.py", "copies": "1", "size": "1582", "license": "apache-2.0", "hash": -2906025972634711600, "line_mean": 39.5641025641, "line_max": 103, "alpha_frac": 0.6801517067, "autogenerated": false, "ratio": 3.9748743718592965, "con...
from doajtest.helpers import DoajTestCase from portality import models from portality.forms.application_forms import JournalFormFactory from portality.forms.application_processors import EditorJournalReview from portality import lcc from doajtest.fixtures import JournalFixtureFactory ###############################...
{ "repo_name": "DOAJ/doaj", "path": "doajtest/unit/application_processors/test_editor_journal_review.py", "copies": "1", "size": "4410", "license": "apache-2.0", "hash": -1688738522400827000, "line_mean": 37.3565217391, "line_max": 118, "alpha_frac": 0.6163265306, "autogenerated": false, "ratio": ...
from Dobot import Dobot import time import math # import numpy as np # import matplotlib.pyplot as plt dobot = Dobot('/dev/tty.usbmodem1421', 115200) dobot.Open() time.sleep(1) successes = 0 i = 0 while True: ret = dobot.isReady() if ret[0] and ret[1]: successes += 1 if successes > 10: print "Dobot ready!" br...
{ "repo_name": "maxosprojects/open-dobot", "path": "legacy/application_ramps_arduino_ino/python/example.py", "copies": "1", "size": "1134", "license": "mit", "hash": -8018364440553676000, "line_mean": 22.1428571429, "line_max": 84, "alpha_frac": 0.6111111111, "autogenerated": false, "ratio": 2.470...
from docar.exceptions import BackendDoesNotExist from docar.fields import ForeignDocument, CollectionField from docar.backends import Backend class DjangoBackendManager(Backend): backend_type = 'django' def _to_dict(self, document): if not self.instance: #FIXME: Handle not fetched instanc...
{ "repo_name": "30loops/python-docar", "path": "docar/backends/django.py", "copies": "1", "size": "11265", "license": "bsd-3-clause", "hash": 4748269491583082000, "line_mean": 41.6704545455, "line_max": 84, "alpha_frac": 0.5438970262, "autogenerated": false, "ratio": 4.791578051892811, "config_t...
from docar.exceptions import BackendError import pymongo class ConnectionMeta(type): def __new__(meta, classname, bases, class_dict): klass = type.__new__(meta, classname, bases, class_dict) # We don't do anything special when the normal Connection class is # defined if classname...
{ "repo_name": "crito/docar-backend-mongodb", "path": "docar_backend_mongo/__init__.py", "copies": "1", "size": "2498", "license": "bsd-3-clause", "hash": 7054727828999639000, "line_mean": 30.225, "line_max": 77, "alpha_frac": 0.5864691753, "autogenerated": false, "ratio": 4.9760956175298805, "c...
from docar import Document, Collection from docar import fields from docar.backends.http import HttpBackendManager from libthirty.state import uri, app_uri, service_uri, resource_collection_uri from libthirty.validators import naming, max_25_chars, naming_with_dashes import os HttpBackendManager.SSL_CERT = os.path....
{ "repo_name": "30loops/libthirty", "path": "libthirty/documents.py", "copies": "1", "size": "6039", "license": "bsd-3-clause", "hash": 7915899893174023000, "line_mean": 28.4585365854, "line_max": 78, "alpha_frac": 0.6779268091, "autogenerated": false, "ratio": 3.941906005221932, "config_test": ...
from docar import fields, Document, Collection ### First define the document structure used in this example class Category(Document): name = fields.StringField() class Meta: identifier = 'name' class Editor(Document): id = fields.NumberField(default=1, render=False) name = fields.StringFiel...
{ "repo_name": "30loops/python-docar", "path": "tests/factory.py", "copies": "1", "size": "2382", "license": "bsd-3-clause", "hash": 3149814017597251000, "line_mean": 22.82, "line_max": 72, "alpha_frac": 0.6826196474, "autogenerated": false, "ratio": 3.937190082644628, "config_test": false, "h...
from docar import fields, Document, Collection try: import json except ImportError: import simplejson as json MEDIA_TYPES = {} def register_media_type(media_type, serializer): """Register a media types with their handlers. :param media_type: The media type, eg: 'application/json' :param seriali...
{ "repo_name": "30loops/python-docar", "path": "docar/serializers.py", "copies": "1", "size": "7470", "license": "bsd-3-clause", "hash": -8075848422677097000, "line_mean": 28.6428571429, "line_max": 83, "alpha_frac": 0.5346720214, "autogenerated": false, "ratio": 4.571603427172582, "config_test"...
from docassemble.base.config import daconfig from sqlalchemy import Column, ForeignKey, Boolean, Integer, String, Text, DateTime, func, create_engine, or_, and_, true, false, delete, select from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship, sessionmaker from sqlalchemy.dial...
{ "repo_name": "jhpyle/docassemble", "path": "docassemble_webapp/docassemble/webapp/jsonstore.py", "copies": "1", "size": "3478", "license": "mit", "hash": -1085272877263072100, "line_mean": 43.5897435897, "line_max": 144, "alpha_frac": 0.6992524439, "autogenerated": false, "ratio": 3.834619625137...
from docassemble.base.error import DAError import docassemble.base.config if not docassemble.base.config.loaded: docassemble.base.config.load() from docassemble.base.config import daconfig import os if 'db' not in daconfig: daconfig['db'] = dict() dbuser = daconfig['db'].get('user', None) dbpassword = daconfig...
{ "repo_name": "jhpyle/docassemble", "path": "docassemble_webapp/docassemble/webapp/database.py", "copies": "1", "size": "2573", "license": "mit", "hash": -289221809543064640, "line_mean": 33.7702702703, "line_max": 130, "alpha_frac": 0.6743101438, "autogenerated": false, "ratio": 3.46765498652291...
from docassemble.base.functions import word, get_currency_symbol, url_action, comma_and_list, server, custom_types from docassemble.base.util import format_date, format_datetime from docassemble.base.filter import markdown_to_html, get_audio_urls, get_video_urls, audio_control, video_control, noquote, to_text, my_escap...
{ "repo_name": "jhpyle/docassemble", "path": "docassemble_base/docassemble/base/standardformatter.py", "copies": "1", "size": "210561", "license": "mit", "hash": -1338642605273351000, "line_mean": 74.412965616, "line_max": 823, "alpha_frac": 0.5435923497, "autogenerated": false, "ratio": 3.9620827...
from docassemble.base.logger import logmessage from docassemble.base.generate_key import random_string import collections.abc as abc from collections import OrderedDict from functools import reduce import re import os import codecs #import redis import sys import shutil import inspect import yaml import pycurl import j...
{ "repo_name": "jhpyle/docassemble", "path": "docassemble_base/docassemble/base/core.py", "copies": "1", "size": "226592", "license": "mit", "hash": 7694194030036528000, "line_mean": 44.555287495, "line_max": 710, "alpha_frac": 0.5777388434, "autogenerated": false, "ratio": 4.024653203317881, "c...
from docassemble.base.logger import logmessage import re import os import PyPDF2 import tempfile import importlib try: from urllib.request import urlopen, Request except ImportError: from urllib2 import urlopen, Request import mimetypes from PIL import Image import xml.etree.ElementTree as ET import docassembl...
{ "repo_name": "jhpyle/docassemble", "path": "docassemble_webapp/docassemble/webapp/file_access.py", "copies": "1", "size": "16355", "license": "mit", "hash": 3404798731390854000, "line_mean": 47.53115727, "line_max": 452, "alpha_frac": 0.5809844084, "autogenerated": false, "ratio": 3.971588149587...
from docassemble.base.util import DAObject, DAList, DAFileCollection, interview_url_action, DADict, word, message, noun_singular, noun_plural, today, current_datetime, Person, DAEmailRecipient, comma_and_list, interface, value, send_email, background_action, reconsider, force_ask, background_response, device import ran...
{ "repo_name": "jhpyle/docassemble", "path": "docassemble_demo/docassemble/demo/sign.py", "copies": "1", "size": "9883", "license": "mit", "hash": -504642621566746400, "line_mean": 48.415, "line_max": 309, "alpha_frac": 0.6300718405, "autogenerated": false, "ratio": 3.915610142630745, "config_te...
from docassemble.base.util import DARedis, user_info, DAObject, get_config, interview_url, response, message, log from docassemble.base.generate_key import random_alphanumeric import oauth2client.client import json import string import random import httplib2 import re import codecs __all__ = ['DAOAuth'] def safeid(te...
{ "repo_name": "jhpyle/docassemble", "path": "docassemble_base/docassemble/base/oauth.py", "copies": "1", "size": "7815", "license": "mit", "hash": -7029758349155537000, "line_mean": 40.7914438503, "line_max": 166, "alpha_frac": 0.5761996161, "autogenerated": false, "ratio": 3.9075, "config_test...
from docassemble.webapp.app_object import app from docassemble.webapp.db_object import db from docassemble.base.config import daconfig, hostname, in_celery from docassemble.webapp.files import SavedFile, get_ext_and_mimetype from docassemble.base.logger import logmessage from docassemble.webapp.users.models import User...
{ "repo_name": "jhpyle/docassemble", "path": "docassemble_webapp/docassemble/webapp/backend.py", "copies": "1", "size": "58111", "license": "mit", "hash": 3106036909967763500, "line_mean": 47.9561920809, "line_max": 536, "alpha_frac": 0.6106761198, "autogenerated": false, "ratio": 3.73488013368468...
from docassemble.webapp.config import daconfig from docassemble.base.core import DAObject import psycopg2 import base64 import json import random #drop table if exists survey_answers; create table survey_answers (submissiontime timestamp default now(), content text); class Storage(DAObject): def init(self): ...
{ "repo_name": "jhpyle/docassemble-pla", "path": "docassemble/pla/objects.py", "copies": "1", "size": "10561", "license": "mit", "hash": 9119335768245238000, "line_mean": 44.7186147186, "line_max": 785, "alpha_frac": 0.5710633463, "autogenerated": false, "ratio": 4.190873015873016, "config_test"...
from docassemble.webapp.core.models import MachineLearning from docassemble.base.core import DAObject, DAList, DADict from docassemble.webapp.db_object import db from sqlalchemy import or_, and_, select, delete from sklearn.datasets import load_iris from sklearn.ensemble import RandomForestClassifier import pandas as p...
{ "repo_name": "jhpyle/docassemble", "path": "docassemble_webapp/docassemble/webapp/machinelearning.py", "copies": "1", "size": "35497", "license": "mit", "hash": -7673837438569946000, "line_mean": 56.718699187, "line_max": 443, "alpha_frac": 0.6220525678, "autogenerated": false, "ratio": 3.879877...
from docassemble.webapp.db_object import db from docassemble.base.config import daconfig, dbtableprefix from docassemble.webapp.database import dbprefix from sqlalchemy import true, false import docassemble.webapp.users.models from sqlalchemy.dialects.postgresql.json import JSONB class Uploads(db.Model): __tablena...
{ "repo_name": "jhpyle/docassemble", "path": "docassemble_webapp/docassemble/webapp/core/models.py", "copies": "1", "size": "6208", "license": "mit", "hash": -6505029515033296000, "line_mean": 46.7538461538, "line_max": 143, "alpha_frac": 0.6812177835, "autogenerated": false, "ratio": 3.2829190904...
from docassemble.webapp.db_object import db import docassemble.webapp.users.models import docassemble.webapp.core.models from docassemble.base.config import daconfig, dbtableprefix class Package(db.Model): __tablename__ = dbtableprefix + 'package' id = db.Column(db.Integer, primary_key=True, unique=True) n...
{ "repo_name": "jhpyle/docassemble", "path": "docassemble_webapp/docassemble/webapp/packages/models.py", "copies": "1", "size": "1934", "license": "mit", "hash": 3899532695199416000, "line_mean": 52.7222222222, "line_max": 114, "alpha_frac": 0.7032057911, "autogenerated": false, "ratio": 3.3989455...
from docassemble.webapp.db_object import db, UserMixin from docassemble.base.config import daconfig, dbtableprefix class UserModel(db.Model, UserMixin): __tablename__ = dbtableprefix + 'user' id = db.Column(db.Integer, primary_key=True) social_id = db.Column(db.String(255), nullable=False, unique=True) ...
{ "repo_name": "jhpyle/docassemble", "path": "docassemble_webapp/docassemble/webapp/users/models.py", "copies": "1", "size": "5666", "license": "mit", "hash": -6807277908375428000, "line_mean": 55.66, "line_max": 137, "alpha_frac": 0.6962583833, "autogenerated": false, "ratio": 3.271362586605081, ...
from Docblock import Docblock class PHPDocblock(Docblock): """ PHP Docblock generator """ opt = { 'line_ending': '\n', 'prefix': '/**', 'infix': ' * ', 'suffix': ' */', 'command': '@', # docblock formatting definitions for other...
{ "repo_name": "bobthecow/CodaDocblock", "path": "src/Support/Library/PHPDocblock.py", "copies": "1", "size": "6693", "license": "mit", "hash": -7140483708592193000, "line_mean": 31.023923445, "line_max": 269, "alpha_frac": 0.3732257583, "autogenerated": false, "ratio": 4.279411764705882, "confi...
from Docblock import Docblock class PyDocblock(Docblock): """ Python Docblock generator """ opt = { 'line_ending': '\n', 'prefix': '## ', 'infix': '# ', 'suffix': None, 'command': '@', 'signatures': { 'function': { ...
{ "repo_name": "bobthecow/CodaDocblock", "path": "src/Support/Library/PyDocblock.py", "copies": "1", "size": "5738", "license": "mit", "hash": -9004662633094939000, "line_mean": 31.9770114943, "line_max": 255, "alpha_frac": 0.3832345765, "autogenerated": false, "ratio": 4.4003067484662575, "conf...
from .docdecs import params @params(layers=(dict, "Dictionary tree"), path=(list, "Path to walk down"), returns=(tuple, "The leaf and remainder of the path.")) def path_walker(layers, path): """Recursively walk the given path and return what is left. Walk through the given ``layers``, a dicti...
{ "repo_name": "Nekroze/nekrobox", "path": "nekrobox/tree.py", "copies": "1", "size": "1326", "license": "mit", "hash": -1061461990978223100, "line_mean": 32.15, "line_max": 77, "alpha_frac": 0.6229260935, "autogenerated": false, "ratio": 3.934718100890208, "config_test": false, "has_no_keywor...
from doc.gallery import * def test_parse_docstring_info(): assert 'error' in parse_docstring_info("No Docstring") assert 'error' in parse_docstring_info("'''No Docstring Title'''") assert 'error' in parse_docstring_info( "'''No Sentence\n======\nPeriods'''" ...
{ "repo_name": "KeyWeeUsr/kivy", "path": "kivy/tests/test_doc_gallery.py", "copies": "17", "size": "1278", "license": "mit", "hash": -8511310327823185000, "line_mean": 32.6315789474, "line_max": 74, "alpha_frac": 0.6541471049, "autogenerated": false, "ratio": 3.736842105263158, "config_test": fa...
from ..docgen.doc import Doc from ..elements import registry from .. import bbcode from .. import pilot from .. import namespaces from ..compat import text_type from fs.path import join, splitext from collections import defaultdict from operator import itemgetter class Extracter(object): """Extract documentati...
{ "repo_name": "moyaproject/moya", "path": "moya/docgen/extracter.py", "copies": "1", "size": "9183", "license": "mit", "hash": 6319080810712112000, "line_mean": 38.7532467532, "line_max": 88, "alpha_frac": 0.517804639, "autogenerated": false, "ratio": 4.095896520963426, "config_test": false, ...
from .doc import Doc SPEC = Doc({ "$schema": "http://json-schema.org/draft-04/schema#", "description": "Schema for Vega-lite specification", "type": "object", "required": ["marktype","encoding","data"], "properties": { "data": { "type": "object", "properties": { ...
{ "repo_name": "freeman-lab/altair", "path": "altair/spec.py", "copies": "5", "size": "57181", "license": "bsd-3-clause", "hash": -6213476069614819000, "line_mean": 53.7186602871, "line_max": 293, "alpha_frac": 0.2949231388, "autogenerated": false, "ratio": 6.296080158555385, "config_test": fals...
from docker.api import APIClient from docker.errors import APIError from docker.types import SwarmSpec from .resource import Model class Swarm(Model): """ The server's Swarm state. This a singleton that must be reloaded to get the current state of the Swarm. """ def __init__(self, *args, **kwargs)...
{ "repo_name": "dimaspivak/docker-py", "path": "docker/models/swarm.py", "copies": "9", "size": "5827", "license": "apache-2.0", "hash": 2075545574461584600, "line_mean": 38.6394557823, "line_max": 79, "alpha_frac": 0.5792002746, "autogenerated": false, "ratio": 4.411052233156699, "config_test":...
from docker.api import APIClient from docker.errors import APIError from .resource import Model class Swarm(Model): """ The server's Swarm state. This a singleton that must be reloaded to get the current state of the Swarm. """ id_attribute = 'ID' def __init__(self, *args, **kwargs): ...
{ "repo_name": "vdemeester/docker-py", "path": "docker/models/swarm.py", "copies": "4", "size": "7997", "license": "apache-2.0", "hash": 3444433248546542000, "line_mean": 42.4619565217, "line_max": 79, "alpha_frac": 0.5874703014, "autogenerated": false, "ratio": 4.358038147138965, "config_test":...
from ..docker_client import DockerClient from .resource import Model, Collection import os class Host(Model): attr_names = Model.attr_names + ['name', 'size', 'ipv4_address', 'client_key', 'client_cert'] def docker(self): self._store_certs() return DockerClient( base_url='https://...
{ "repo_name": "orchardup/python-orchard", "path": "orchard/models/host.py", "copies": "1", "size": "1392", "license": "apache-2.0", "hash": 6360607006784253000, "line_mean": 31.3720930233, "line_max": 97, "alpha_frac": 0.5804597701, "autogenerated": false, "ratio": 3.3221957040572794, "config_t...
from dockercloud import ApiError from gevent import monkey; monkey.patch_all() import os import time import signal import dockercloud import sys import pyping import re import gevent import psutil node_short_uuid = re.compile(r"\/(\w+)-") polling_period = int(os.getenv("POLLING_PERIOD", 5)) my_container_short_uuid = n...
{ "repo_name": "fermayo/dockercloud-network-tester", "path": "test.py", "copies": "2", "size": "2052", "license": "apache-2.0", "hash": 7485029888228699000, "line_mean": 37.7169811321, "line_max": 110, "alpha_frac": 0.6442495127, "autogenerated": false, "ratio": 3.460370994940978, "config_test":...
from docker.errors import APIError as DockerAPIError import logging import uuid log = logging.getLogger("harpoon.ship.network") class NetworkManager(object): def __init__(self, docker_api): self.networks = {} self.docker_api = docker_api def register(self, conf, container_name): if n...
{ "repo_name": "delfick/harpoon", "path": "harpoon/ship/network.py", "copies": "1", "size": "1614", "license": "mit", "hash": 2062120246597839600, "line_mean": 34.8666666667, "line_max": 88, "alpha_frac": 0.5954151177, "autogenerated": false, "ratio": 4.2362204724409445, "config_test": false, ...
from docker.errors import APIError from .common_fixtures import * # NOQA from .docker_common import * # NOQA @if_docker def test_image_list(): c = docker_client() images = c.images(all=True) if len(images) == 0: c.pull('busybox') images = c.images(all=True) assert 'Id' in images[0] ...
{ "repo_name": "sonchang/python-agent", "path": "tests/test_docker_images.py", "copies": "1", "size": "11621", "license": "apache-2.0", "hash": 6733548272557778000, "line_mean": 31.4608938547, "line_max": 79, "alpha_frac": 0.5313656312, "autogenerated": false, "ratio": 3.9500339904826647, "confi...
from docker.errors import APIError from flask import request, jsonify, make_response from flask_restplus import Resource, fields, Namespace, Api from proxy.exceptions import RequestException from proxy.interceptor import Interceptor from proxy.utils import validate_graphql_request, execute_graphql_request from security...
{ "repo_name": "alexisrolland/data-quality", "path": "api/init/proxy/routes.py", "copies": "1", "size": "2442", "license": "apache-2.0", "hash": 7894188834334856000, "line_mean": 37.15625, "line_max": 104, "alpha_frac": 0.6228501229, "autogenerated": false, "ratio": 5.004098360655738, "config_te...
from docker.errors import DockerException from errors import PyGenException from metrics import Summary, Counter from utils import get_logger logger = get_logger('pygen-actions') # metrics execution_strategy_summary = Summary( 'pygen_action_execution_strategy_seconds', 'Action execution metrics by strategy', ...
{ "repo_name": "rycus86/docker-pygen", "path": "src/actions.py", "copies": "1", "size": "5529", "license": "mit", "hash": -3326310348389381600, "line_mean": 30.5942857143, "line_max": 110, "alpha_frac": 0.6172906493, "autogenerated": false, "ratio": 4.363851617995264, "config_test": false, "ha...
from docker.errors import DockerException from .testcases import DockerClientTestCase from .testcases import no_cluster from compose.const import LABEL_PROJECT from compose.const import LABEL_VOLUME from compose.volume import Volume class VolumeTest(DockerClientTestCase): def setUp(self): self.tmp_volume...
{ "repo_name": "vdemeester/compose", "path": "tests/integration/volume_test.py", "copies": "3", "size": "4301", "license": "apache-2.0", "hash": 2952985615609343000, "line_mean": 34.2540983607, "line_max": 92, "alpha_frac": 0.6184608231, "autogenerated": false, "ratio": 3.8678057553956835, "conf...
from dockerfile_parse import DockerfileParser import requests import sys import os import logging import re def send_comment(comment): if 'GITHUB_STATUS_TOKEN' not in os.environ: logging.info(str({ 'comment': str(comment), })) return logging.warn('Send comment: %s' % (str(co...
{ "repo_name": "osallou/test1", "path": "ci/jenkins_container_spec_check.py", "copies": "1", "size": "6957", "license": "apache-2.0", "hash": 6906558347572645000, "line_mean": 37.4364640884, "line_max": 218, "alpha_frac": 0.6248382924, "autogenerated": false, "ratio": 3.7443487621097953, "config...
from dockerfile_parse import DockerfileParser import requests import sys import os import logging import re def send_comment(comment): logging.warn('Send comment: %s' % (str(comment))) repo = os.environ['DRONE_REPO'] commit = os.environ['DRONE_COMMIT_SHA'] headers = { 'Accept': 'application/vnd...
{ "repo_name": "osallou/test1", "path": "ci/container_spec_check.py", "copies": "1", "size": "7001", "license": "apache-2.0", "hash": 7172214281568257000, "line_mean": 37.679558011, "line_max": 218, "alpha_frac": 0.6306241965, "autogenerated": false, "ratio": 3.667365112624411, "config_test": fa...
from dockerfile_parse import DockerfileParser import requests import sys import os import logging import re def send_status(software, status, msg=None): repo = os.env['DRONE_REPO_NAME'] commit = os.env['DRONE_COMMIT_SHA'] info = 'Checking recipe metadata' if msg: info = ', '.join(msg) is_su...
{ "repo_name": "osallou/test1", "path": "container_spec_check.py", "copies": "1", "size": "2632", "license": "apache-2.0", "hash": 7350669825565703000, "line_mean": 28.9090909091, "line_max": 216, "alpha_frac": 0.6409574468, "autogenerated": false, "ratio": 3.696629213483146, "config_test": fals...
from docker import Client as DockerClient import concurrent.futures from swarmci.util import get_logger from swarmci.docker import Container from swarmci.errors import TaskFailedError logger = get_logger(__name__) class RunnerBase(object): def __init__(self): self.tasks = [] self.logger = get_log...
{ "repo_name": "ghostsquad/swarmci", "path": "swarmci/runners.py", "copies": "1", "size": "3025", "license": "apache-2.0", "hash": -889178576026762400, "line_mean": 30.8421052632, "line_max": 102, "alpha_frac": 0.6251239669, "autogenerated": false, "ratio": 3.964613368283093, "config_test": fals...
from docker import Client as DockerClient import os import uuid from io import BytesIO import tarfile class container(object): def __init__(self, image, name=None, cwd=None, remove=True, docker_cli=None, docker_sock='unix://var/r...
{ "repo_name": "ghostsquad/seasalt", "path": "src/seasalt/__init__.py", "copies": "1", "size": "2790", "license": "mit", "hash": -5188135464004005000, "line_mean": 28.6808510638, "line_max": 79, "alpha_frac": 0.5172043011, "autogenerated": false, "ratio": 3.72, "config_test": false, "has_no_ke...
from docker import Client from docker.errors import NotFound class Volume(object): """ Represents a volume in nap """ # vol is a list ['host_path:container/path:rw', '/home:/var:ro'] def __init__(self, vol): self.vol = vol @classmethod def create(cls, url, version, name, driver='...
{ "repo_name": "icsnju/nap-core", "path": "nap_rest/orchestration/container_api/volume.py", "copies": "1", "size": "1097", "license": "apache-2.0", "hash": 4690922224858123000, "line_mean": 25.756097561, "line_max": 68, "alpha_frac": 0.5989061076, "autogenerated": false, "ratio": 3.917857142857142...
from docker import Client from docker import tls as docker_tls import ssl import os import warnings from . import errors def docker_client(tls=None, tls_ca_cert=None, tls_cert=None, tls_key=None, tls_verify=None): """ Returns a docker-py client configured using environment variables according to the same ...
{ "repo_name": "jgrowl/compose", "path": "compose/cli/docker_client.py", "copies": "1", "size": "1987", "license": "apache-2.0", "hash": -251888481683338340, "line_mean": 39.5510204082, "line_max": 122, "alpha_frac": 0.6180171112, "autogenerated": false, "ratio": 3.5293072824156306, "config_test...
from docker import Client from docker import tls import ssl import os def docker_client(): """ Returns a docker-py client configured using environment variables according to the same logic as the official Docker client. """ cert_path = os.environ.get('DOCKER_CERT_PATH', '') if cert_path == '':...
{ "repo_name": "josephpage/compose", "path": "compose/cli/docker_client.py", "copies": "23", "size": "1194", "license": "apache-2.0", "hash": 1958190011284989700, "line_mean": 31.2702702703, "line_max": 95, "alpha_frac": 0.6038525963, "autogenerated": false, "ratio": 3.4310344827586206, "config_...
from docker import client from docker import tls import inspect import six import functools from config import cfg CONF = cfg.CONF DEFAULT_TIMEOUT_SECONDS = 120 DEFAULT_DOCKER_API_VERSION = '1.21' docker_opts = [ cfg.StrOpt('root_directory', default='/var/lib/docker', help='Path to...
{ "repo_name": "HybridF5/hybrid-jacket", "path": "wormhole/docker_client.py", "copies": "1", "size": "4170", "license": "apache-2.0", "hash": -718778300686238100, "line_mean": 34.0420168067, "line_max": 77, "alpha_frac": 0.5585131894, "autogenerated": false, "ratio": 4.182547642928786, "config_t...
from docker import Client from docker.utils import kwargs_from_env import os import errno import json def mkdir_p(path): try: os.makedirs(path) except OSError as exc: # Python >2.5 if exc.errno == errno.EEXIST and os.path.isdir(path): pass else: raise def get_image_metadata...
{ "repo_name": "Duke-GCB/cwl-freezer", "path": "docker_io.py", "copies": "1", "size": "1325", "license": "mit", "hash": -9181446829701242000, "line_mean": 32.9743589744, "line_max": 77, "alpha_frac": 0.6716981132, "autogenerated": false, "ratio": 3.4149484536082473, "config_test": false, "has_...
from docker import Client from docker.utils import kwargs_from_env from subprocess import call cli = Client(**kwargs_from_env(assert_hostname=False)) def scale(container, cpu_usage, scale_dict): scale_num = scale_dict[container] if (cpu_usage > 30): print("Will scale [%s] to %d instances." % (container, sc...
{ "repo_name": "mwellner/voting", "path": "autoscale.py", "copies": "1", "size": "2050", "license": "mit", "hash": -2730153850258478000, "line_mean": 42.6170212766, "line_max": 122, "alpha_frac": 0.647804878, "autogenerated": false, "ratio": 3.3387622149837135, "config_test": false, "has_no_ke...
from docker import Client from io import BytesIO from pyramid.config import Configurator from pyramid.events import NewRequest from pyramid.response import Response from requests.exceptions import ReadTimeout from urllib.parse import unquote_plus from wsgiref.simple_server import make_server import tarfile IP = '0.0...
{ "repo_name": "lightning18/kompiler", "path": "kompiler.py", "copies": "1", "size": "4226", "license": "mit", "hash": 2014488212974776600, "line_mean": 29.4028776978, "line_max": 79, "alpha_frac": 0.6003312825, "autogenerated": false, "ratio": 3.618150684931507, "config_test": true, "has_no_k...
from docker import Client from mock import create_autospec from dockerrotate.containers import determine_containers_to_remove from dockerrotate.main import parse_arguments from utils import created_container_entry, exited_container_entry, \ dead_container_entry, running_container_entry, mins_ago, \ ...
{ "repo_name": "locationlabs/docker-rotate", "path": "tests/test_containers.py", "copies": "1", "size": "3859", "license": "apache-2.0", "hash": -7215051190756491000, "line_mean": 40.0531914894, "line_max": 89, "alpha_frac": 0.703291008, "autogenerated": false, "ratio": 3.3295944779982745, "conf...
from docker import Client import etcd import time import os from subprocess import call from jinja2 import Environment, PackageLoader POLL_TIMEOUT=60 ETCD_HOST = os.environ["ETCD_HOST"] HOST_IP = os.environ["HOST_IP"] DOCKER_HOST = os.environ["DOCKER_HOST"] DOMAIN_NAME = os.environ["DOMAIN_NAME"] env = Environment(loa...
{ "repo_name": "Dockerlover/docker-discover", "path": "discover.py", "copies": "1", "size": "2485", "license": "apache-2.0", "hash": -8552133579791814000, "line_mean": 27.2386363636, "line_max": 122, "alpha_frac": 0.6277665996, "autogenerated": false, "ratio": 3.534850640113798, "config_test": f...
from docker import Client import etcd import time import os POLL_TIMEOUT=60 ETCD_HOST = os.environ["ETCD_HOST"] HOST_IP = os.environ["HOST_IP"] DOCKER_HOST = os.environ["DOCKER_HOST"] def get_images(): c = Client(base_url=DOCKER_HOST) images = c.images() return images def get_containers(): c = Client(base_...
{ "repo_name": "Dockerlover/docker-discover", "path": "register.py", "copies": "2", "size": "4386", "license": "apache-2.0", "hash": -1891744593472209200, "line_mean": 26.5849056604, "line_max": 136, "alpha_frac": 0.6395348837, "autogenerated": false, "ratio": 3.4562647754137115, "config_test": ...
from docker import Client import influxdb import time import docker.tls as tls from os import path import os import pprint import subprocess import json import os.path from sys import platform as _platform import time import requests pp = pprint.PrettyPrinter(indent=4) ############################################ # V...
{ "repo_name": "Juniper/open-nti", "path": "tests/test_main.py", "copies": "1", "size": "11565", "license": "apache-2.0", "hash": -4013952769017351000, "line_mean": 27.4852216749, "line_max": 100, "alpha_frac": 0.587202767, "autogenerated": false, "ratio": 3.169361468895588, "config_test": true,...
from docker import Client import open_nti_input_syslog_lib import docker.tls as tls import influxdb import time from os import path import os import shutil import pprint import subprocess import json import os.path from sys import platform as _platform import time import requests import filecmp import sys from kafka i...
{ "repo_name": "Juniper/open-nti", "path": "tests/test_input_syslog.py", "copies": "1", "size": "2286", "license": "apache-2.0", "hash": 3739504673430822000, "line_mean": 25.5813953488, "line_max": 80, "alpha_frac": 0.6640419948, "autogenerated": false, "ratio": 3.08502024291498, "config_test": ...
from docker import Client import requests import time from orchestration.container_api import client from orchestration.nap_api import app_info from orchestration import config def get_container_load(username, project_name, service_name, container_name): usage = app_info.container_resource_usage(username, project...
{ "repo_name": "icsnju/nap-core", "path": "nap_rest/orchestration/update_weight.py", "copies": "1", "size": "4830", "license": "apache-2.0", "hash": 4284643846380358700, "line_mean": 37.3333333333, "line_max": 134, "alpha_frac": 0.6204968944, "autogenerated": false, "ratio": 2.9237288135593222, ...
from docker import Client import sidekick.checks as checks from sidekick.checks import error_messages import os import redis import sys import time import logging from sidekick.manage import ContainerTracker REDIS="REDIS_PORT" root = logging.getLogger() root.setLevel(logging.INFO) ch = logging.StreamHandler(sys.stdo...
{ "repo_name": "deleidos/de-schema-wizard", "path": "interpretation-engine-sidekick/src/main/python/sidekick/sidekick.py", "copies": "1", "size": "5533", "license": "apache-2.0", "hash": -8218235977929968000, "line_mean": 39.6838235294, "line_max": 136, "alpha_frac": 0.5853967106, "autogenerated": f...
from docker import Client class Docker: def __init__(self, client_url='unix://var/run/docker.sock', client_version='auto', timeout=50, client_tls=False): self.client = Client(base_url=client_url, version=client_version, tls=client_tls) self.all_containers = self.client.containers() self.a...
{ "repo_name": "Verigreen/jenkins-tomcat-nginx", "path": "tests/jtests/environment/Docker.py", "copies": "3", "size": "1412", "license": "apache-2.0", "hash": 5957963820948651000, "line_mean": 29.7173913043, "line_max": 117, "alpha_frac": 0.6090651558, "autogenerated": false, "ratio": 3.6298200514...
from docker import Client eng_list = [] eng_active = [] lh = True def create_new(): pass def list_container(): pass def connect(): def show(): if len(eng_list) < 0: print('No docker-engine connected ') else: print('List of Engine are:') j = 1 ...
{ "repo_name": "srjkumar/DockerPy", "path": "test.py", "copies": "1", "size": "1985", "license": "mpl-2.0", "hash": -5324881128909849000, "line_mean": 24.7792207792, "line_max": 108, "alpha_frac": 0.479093199, "autogenerated": false, "ratio": 3.993963782696177, "config_test": false, "has_no_ke...
from docker import constants from . import fake_stat CURRENT_VERSION = 'v{0}'.format(constants.DEFAULT_DOCKER_API_VERSION) FAKE_CONTAINER_ID = '3cc2351ab11b' FAKE_IMAGE_ID = 'e9aa60c60128' FAKE_EXEC_ID = 'd5d177f121dc' FAKE_NETWORK_ID = '33fb6a3462b8' FAKE_IMAGE_NAME = 'test_image' FAKE_TARBALL_PATH = '/path/to/tarb...
{ "repo_name": "vdemeester/docker-py", "path": "tests/unit/fake_api.py", "copies": "3", "size": "18076", "license": "apache-2.0", "hash": 3832409392701194000, "line_mean": 26.5548780488, "line_max": 78, "alpha_frac": 0.5735782253, "autogenerated": false, "ratio": 3.334440140195536, "config_test"...
from ..docker import containers, events from urlparse import urlparse from ..config import config from libmproxy import controller, proxy from libmproxy.proxy.server import ProxyServer from libmproxy.proxy.config import ServerSpec, Address import threading registry = {} address = urlparse(config.docker_address).hostn...
{ "repo_name": "iamdork/dork", "path": "dork/services/proxy.py", "copies": "1", "size": "1799", "license": "mit", "hash": 7563304419616791000, "line_mean": 28.4918032787, "line_max": 78, "alpha_frac": 0.6320177877, "autogenerated": false, "ratio": 3.997777777777778, "config_test": true, "has_n...
from docker import DockerClient, APIClient import time import re def docker_container_id(container_name): """ Uses the container name to return the container ID. :param container_name: The full name of the docker container. :type container_name: ``str`` :return: Returns the container ID or None i...
{ "repo_name": "knodir/son-emu", "path": "src/emuvim/api/openstack/docker_util.py", "copies": "1", "size": "7551", "license": "apache-2.0", "hash": -154123441206956320, "line_mean": 34.7867298578, "line_max": 114, "alpha_frac": 0.6321017084, "autogenerated": false, "ratio": 3.4797235023041475, "...
from docker_loader.provisioner import Provisioner class AptProvisioner(Provisioner): APT_GET = 'apt-get' class AptUpdate(AptProvisioner): def __str__(self): return "Update APT cache." def provision(self, container): container.run([self.APT_GET, 'update']) class AptClear(AptProvisione...
{ "repo_name": "msiedlarek/docker-loader", "path": "docker_loader/provisioners/apt.py", "copies": "1", "size": "1427", "license": "apache-2.0", "hash": -4604645797726633500, "line_mean": 25.4259259259, "line_max": 78, "alpha_frac": 0.6145760336, "autogenerated": false, "ratio": 3.649616368286445, ...
from docker_loader.provisioner import Provisioner class ShellCommand(Provisioner): def __init__(self, command, cleanup_command=None, **additional_configuration): self.command = command self.cleanup_command = cleanup_command self.additional_configuration = additional_configurat...
{ "repo_name": "msiedlarek/docker-loader", "path": "docker_loader/provisioners/shell.py", "copies": "1", "size": "1581", "license": "apache-2.0", "hash": -3355749407476383000, "line_mean": 32.6382978723, "line_max": 76, "alpha_frac": 0.6274509804, "autogenerated": false, "ratio": 4.491477272727272...
from docker_node import * class BmDockerSwitch( DockerSwitch ): def __init__( self, name, model_dir=None, pcap_dump=False, **kwargs ): self.pcap_dump = pcap_dump if model_dir is None: self.model_dir = '/p4factory/targets/switch/' else: self.model_dir = model_dir ...
{ "repo_name": "p4lang/p4factory", "path": "mininet/docker/p4model.py", "copies": "1", "size": "3955", "license": "apache-2.0", "hash": 358773462996865100, "line_mean": 36.6666666667, "line_max": 116, "alpha_frac": 0.5256637168, "autogenerated": false, "ratio": 3.363095238095238, "config_test": ...
from dockerspawner import DockerSpawner from jupyter_client.localinterfaces import public_ips from tornado import gen import base64, os import os.path, pwd import socket, random, errno class _Spawner(DockerSpawner): def _volumes_to_binds(self, *args, **kwargs): binds = super(_Spawner, self)._volumes_to_bin...
{ "repo_name": "radiasoft/salt-conf", "path": "srv/salt/jupyterhub/jupyterhub_config.py", "copies": "2", "size": "2593", "license": "apache-2.0", "hash": 5541115038185481000, "line_mean": 43.7068965517, "line_max": 135, "alpha_frac": 0.6883918241, "autogenerated": false, "ratio": 2.830786026200873...
from dockerspawner import DockerSpawner from jupyter_client.localinterfaces import public_ips import base64 c.Authenticator.admin_users = set(['vagrant']) c.DockerSpawner.http_timeout = 120 c.DockerSpawner.container_image = 'radiasoft/beamsim-jupyter' c.DockerSpawner.remove_containers = True c.DockerSpawner.use_intern...
{ "repo_name": "elventear/containers", "path": "radiasoft/jupyterhub/test_jupyterhub_config.py", "copies": "1", "size": "1806", "license": "apache-2.0", "hash": -5632404058036299000, "line_mean": 40.0454545455, "line_max": 137, "alpha_frac": 0.7624584718, "autogenerated": false, "ratio": 2.6326530...
from dockerspawner import DockerSpawner from textwrap import dedent from traitlets import ( Integer, Unicode, ) class SystemUserSpawner(DockerSpawner): host_homedir_format_string = Unicode( "/home/{username}", config=True, help=dedent( """ Format string for...
{ "repo_name": "minrk/dockerspawner", "path": "dockerspawner/systemuserspawner.py", "copies": "1", "size": "4790", "license": "bsd-3-clause", "hash": -5175543139035259000, "line_mean": 31.3648648649, "line_max": 92, "alpha_frac": 0.5916492693, "autogenerated": false, "ratio": 4.227714033539276, ...
from dockerstack.docopt_command import get_handler from dockerstack.utils import get_version_info from inspect import getdoc class StackCommand(object): """An utility to Dockerize your applications and generate minimal docker requires files. Usage: docker-stack [options] [COMMAND] [ARGS...] d...
{ "repo_name": "emulienfou/docker-stack", "path": "dockerstack/command/StackCommand.py", "copies": "1", "size": "4274", "license": "mit", "hash": -4831143047275825000, "line_mean": 29.5285714286, "line_max": 76, "alpha_frac": 0.4840898456, "autogenerated": false, "ratio": 5.063981042654029, "con...
from docker.utils import create_host_config from common_fixtures import * # NOQA import websocket as ws from test_container import assert_execute, assert_stats, assert_ip_inject CONTAINER_APPEAR_TIMEOUT_MSG = 'Timed out waiting for container ' \ 'to appear. Name: [%s].' NATIVE_TEST_IMA...
{ "repo_name": "cjellick/validation-tests", "path": "tests/validation_v2/cattlevalidationtest/core/test_native_docker.py", "copies": "5", "size": "16585", "license": "apache-2.0", "hash": 2254968553010610200, "line_mean": 40.8813131313, "line_max": 79, "alpha_frac": 0.5283690081, "autogenerated": fa...
from docker.utils.socket import next_frame_size from docker.utils.socket import read_exactly from .base import BaseAPIIntegrationTest, BUSYBOX class ExecTest(BaseAPIIntegrationTest): def test_execute_command(self): container = self.client.create_container(BUSYBOX, 'cat', ...
{ "repo_name": "auready/docker-py", "path": "tests/integration/api_exec_test.py", "copies": "3", "size": "4594", "license": "apache-2.0", "hash": 3126471896459994000, "line_mean": 36.3495934959, "line_max": 78, "alpha_frac": 0.5737919025, "autogenerated": false, "ratio": 3.7624897624897624, "con...
from dockit.admin.objecttools import ObjectTool from django.template.loader import get_template from django.template import Context class MixinObjectTool(ObjectTool): template_name = 'dockitcms/mixin_object_tool.html' def __init__(self, mixin): self.mixin = mixin def render(self, request...
{ "repo_name": "zbyte64/django-dockitcms", "path": "dockitcms/mixins.py", "copies": "1", "size": "2946", "license": "bsd-3-clause", "hash": -7677169320521940000, "line_mean": 34.0714285714, "line_max": 77, "alpha_frac": 0.6235573659, "autogenerated": false, "ratio": 3.986468200270636, "config_te...
from dockit.backends import get_document_backend, get_document_router, get_index_router import re from django.conf import settings from django.db.models.options import get_verbose_name from django.utils.translation import activate, deactivate_all, get_language, string_concat from django.utils.encoding import smart_st...
{ "repo_name": "zbyte64/django-dockit", "path": "dockit/schema/options.py", "copies": "1", "size": "8066", "license": "bsd-3-clause", "hash": -8369636929475332000, "line_mean": 38.3463414634, "line_max": 137, "alpha_frac": 0.6126952641, "autogenerated": false, "ratio": 4.19012987012987, "config_...
from dockit.backends.indexer import BaseIndexer from backend import MongoIndexStorage try: from bson.objectid import ObjectId except ImportError: from pymongo.objectid import ObjectId class MongoIndexer(BaseIndexer): def _get_key_value(self): dotpath = self.filter_operation.dotpath() valu...
{ "repo_name": "zbyte64/django-dockit", "path": "dockit/backends/mongo/indexers.py", "copies": "1", "size": "1716", "license": "bsd-3-clause", "hash": -5318781683818540000, "line_mean": 25, "line_max": 57, "alpha_frac": 0.6777389277, "autogenerated": false, "ratio": 3.7142857142857144, "config_t...
from dockitcms.fields import BaseFieldEntry, ListFieldMixin from dockit import schema import properties IMAGE_FORMATS = [('JPEG', '.jpg'), ('PNG', '.png'),] CROP_CHOICES = [('smart', 'Smart'), ('scale', 'Scale'),] class ThumbnailFieldEntrySchema(schema.Schema): key = schema.Slu...
{ "repo_name": "zbyte64/django-dockitcms", "path": "dockitcms/contrib/thumbnailfield/fields.py", "copies": "1", "size": "2248", "license": "bsd-3-clause", "hash": 8474380052486647000, "line_mean": 33.0606060606, "line_max": 120, "alpha_frac": 0.6116548043, "autogenerated": false, "ratio": 4.102189...
from dockitcms.mixins import AdminInlineMixin from dockitcms.models import BaseViewPoint, VirtualDocumentCollection from dockit import schema from django.utils.translation import ugettext_lazy as _ from dockitcms.viewpoints.exceptions import HttpForbidden class AuthConfiguration(schema.Schema): authenticated_us...
{ "repo_name": "zbyte64/django-dockitcms", "path": "dockitcms/viewpoints/mixins.py", "copies": "1", "size": "2232", "license": "bsd-3-clause", "hash": 510751099953554750, "line_mean": 36.2, "line_max": 124, "alpha_frac": 0.6702508961, "autogenerated": false, "ratio": 4.148698884758364, "config_t...
from dockitcms.models import create_document_mixin from dockitcms.mixins import SchemaExtensionMixin from dockit import schema from django.utils import unittest MIXINS = {} mixin_mixin = create_document_mixin(MIXINS) class MockedDocument(schema.Document, mixin_mixin): pass class SimpleSchema(schema.Schema): ...
{ "repo_name": "zbyte64/django-dockitcms", "path": "dockitcms/tests/mixins_tests.py", "copies": "1", "size": "1889", "license": "bsd-3-clause", "hash": -8031294916079822000, "line_mean": 33.9814814815, "line_max": 123, "alpha_frac": 0.6961355214, "autogenerated": false, "ratio": 3.8788501026694044...
from dockitcms.models import Subsite, Application, ModelCollection from dockitcms import fields from dockitcms.viewpoints.listpoint import ListingViewPoint from dockitcms.resources.virtual import site from dockit import schema from django.utils import unittest from django.contrib.auth.models import User from django.c...
{ "repo_name": "zbyte64/django-dockitcms", "path": "dockitcms/tests/viewpoints/listpoint_tests.py", "copies": "1", "size": "2109", "license": "bsd-3-clause", "hash": -5182643879993247000, "line_mean": 36, "line_max": 99, "alpha_frac": 0.6396396396, "autogenerated": false, "ratio": 4.07142857142857...
from dockitcms.models import VirtualDocumentCollection, Application from dockitcms.fields import CharField from dockitcms.mixins import AdminObjectToolMixin, AdminInlineMixin, AdminFormMixin from dockit import schema from django.utils import unittest class MockedCollection(VirtualDocumentCollection): active_mixi...
{ "repo_name": "zbyte64/django-dockitcms", "path": "dockitcms/tests/collections_tests.py", "copies": "1", "size": "4119", "license": "bsd-3-clause", "hash": 2520019201708283400, "line_mean": 37.1388888889, "line_max": 112, "alpha_frac": 0.6620538966, "autogenerated": false, "ratio": 4.228952772073...
from dockitcms.resources.common import CMSDocumentResource from dockitcms.models.index import FilteredVirtualDocumentIndex, FilteredModelIndex from hyperadmin.resources.models import ModelResource as BaseModelResource class CMSCollectionMixin(object): collection = None def get_indexes(self): ind...
{ "repo_name": "zbyte64/django-dockitcms", "path": "dockitcms/resources/collection.py", "copies": "1", "size": "1526", "license": "bsd-3-clause", "hash": -3714813032134070300, "line_mean": 37.15, "line_max": 93, "alpha_frac": 0.7201834862, "autogenerated": false, "ratio": 4.298591549295774, "con...
from dockitcms.resources.public import PublicEndpoint from django.template.response import TemplateResponse class BaseViewPointEndpoint(PublicEndpoint): configuration = None def get_template_names(self): if hasattr(self.view_point, 'get_template_names'): return self.view_point.get_templa...
{ "repo_name": "zbyte64/django-dockitcms", "path": "dockitcms/viewpoints/endpoints.py", "copies": "1", "size": "1259", "license": "bsd-3-clause", "hash": 5253553213478034000, "line_mean": 39.6129032258, "line_max": 105, "alpha_frac": 0.6957903098, "autogenerated": false, "ratio": 4.087662337662338...
from dockitcms.viewpoints.forms import TemplateFormMixin from dockitcms.viewpoints.common import TemplateMixin, IndexMixin, LIST_CONTEXT_DESCRIPTION, DETAIL_CONTEXT_DESCRIPTION from dockitcms.viewpoints.endpoints import ListEndpoint, DetailEndpoint from dockitcms.models import ViewPoint from dockit import schema from...
{ "repo_name": "zbyte64/django-dockitcms", "path": "dockitcms/viewpoints/baseviewpoints.py", "copies": "1", "size": "2701", "license": "bsd-3-clause", "hash": 2822727377350593000, "line_mean": 31.1547619048, "line_max": 119, "alpha_frac": 0.6886338393, "autogenerated": false, "ratio": 4.0253353204...
from dockitcms.widgetblock.templatetags.widgetblocks import WidgetBlock, RenderWidgets from dockitcms.widgetblock.common import WidgetBlockScopeDisplay from dockitcms.scope import Scope, ScopeList from django.utils import unittest class MockedScope(Scope): processors = [] def get_scope_processors(self)...
{ "repo_name": "zbyte64/django-dockitcms", "path": "dockitcms/widgetblock/tests/templatetags.py", "copies": "1", "size": "2621", "license": "bsd-3-clause", "hash": 4457115388745850000, "line_mean": 31.7625, "line_max": 90, "alpha_frac": 0.666157955, "autogenerated": false, "ratio": 3.9592145015105...
from dockit import schema from dockit.backends import get_document_backend from django.db import models from django.conf import settings from django.contrib.auth.models import User from copy import deepcopy import datetime class SchemaProxyDict(dict): def __getitem__(self, key): val = dict.__getitem__(s...
{ "repo_name": "zbyte64/django-dockit", "path": "dockit/models.py", "copies": "1", "size": "3300", "license": "bsd-3-clause", "hash": -6184404605993512000, "line_mean": 33.7368421053, "line_max": 80, "alpha_frac": 0.6757575758, "autogenerated": false, "ratio": 4.325032765399738, "config_test": f...
from dockit import schema from dockit.backends.queryindex import QueryFilterOperation from django.db.models import Q from dockitcms.models.collection import VirtualDocumentCollection, ModelCollection from dockitcms.models.mixin import create_document_mixin from hyperadmin.indexes import Index as ResourceIndex INDE...
{ "repo_name": "zbyte64/django-dockitcms", "path": "dockitcms/models/index.py", "copies": "1", "size": "6457", "license": "bsd-3-clause", "hash": -5447455952083558000, "line_mean": 30.9653465347, "line_max": 101, "alpha_frac": 0.6459656187, "autogenerated": false, "ratio": 4.163120567375887, "co...
from dockit import schema from hyperadmin.clients.views import ListView, DetailView from dockitcms.viewpoints.views import ConfigurableTemplateResponseMixin from dockitcms.models import Collection from dockitcms.scope import Scope from django.utils.translation import ugettext_lazy as _ from django.template import Te...
{ "repo_name": "zbyte64/django-dockitcms", "path": "dockitcms/viewpoints/common.py", "copies": "1", "size": "2715", "license": "bsd-3-clause", "hash": -4837567271577740000, "line_mean": 32.9375, "line_max": 99, "alpha_frac": 0.6791896869, "autogenerated": false, "ratio": 3.9177489177489178, "con...
from dockit.models import DockitPermission from dockit.schema.signals import document_registered from dockit.schema.loading import get_documents from django.contrib.auth import models as auth_app from django.contrib.contenttypes.models import ContentType from django.db.utils import DatabaseError from django.db.transac...
{ "repo_name": "zbyte64/django-dockit", "path": "dockit/auth.py", "copies": "1", "size": "2345", "license": "bsd-3-clause", "hash": -1411409055183390500, "line_mean": 34, "line_max": 110, "alpha_frac": 0.6908315565, "autogenerated": false, "ratio": 3.908333333333333, "config_test": false, "has...
from dockit.paginator import Paginator from django.core.exceptions import ImproperlyConfigured from django.views.generic import list as listview class MultipleObjectMixin(listview.MultipleObjectMixin): paginator_class = Paginator document = None def get_queryset(self): """ Get the lis...
{ "repo_name": "zbyte64/django-dockit", "path": "dockit/views/list.py", "copies": "1", "size": "1064", "license": "bsd-3-clause", "hash": 4493647414822884000, "line_mean": 34.4666666667, "line_max": 80, "alpha_frac": 0.6484962406, "autogenerated": false, "ratio": 4.771300448430493, "config_test"...
from dockit.schema.exceptions import DotPathNotFound class UnSet(object): def __nonzero__(self): return False class DotPathTraverser(object): def __init__(self, dotpath): self.dotpath = dotpath self.remaining_paths = dotpath.split('.') self.resolved_paths = list() #part, value,...
{ "repo_name": "zbyte64/django-dockit", "path": "dockit/schema/common.py", "copies": "1", "size": "5963", "license": "bsd-3-clause", "hash": 7372906917711292000, "line_mean": 31.0591397849, "line_max": 86, "alpha_frac": 0.5505617978, "autogenerated": false, "ratio": 4.196340605207601, "config_te...
from dockit.schema.fields import BaseField as Field from django.db.models.fields.files import FieldFile, FileDescriptor from django.utils.encoding import force_unicode, smart_str from django.utils.translation import ugettext_lazy from django.core.files.storage import default_storage from django.core.files import File ...
{ "repo_name": "zbyte64/django-dockit", "path": "dockit/schema/file_fields.py", "copies": "1", "size": "3141", "license": "bsd-3-clause", "hash": -3698062487400595000, "line_mean": 33.9, "line_max": 107, "alpha_frac": 0.6555237186, "autogenerated": false, "ratio": 4.1492734478203435, "config_tes...
from dockit.schema.fields import BaseField from django.db.models.fields import BLANK_CHOICE_DASH REGISTERED_BASE_SCHEMA_DESIGNS = dict() class SchemaDesignChoiceField(BaseField): ''' A choice field representing base documents that schemamaker recognizes The choices will be populate from two sources: ...
{ "repo_name": "zbyte64/django-dockitcms", "path": "dockitcms/models/properties.py", "copies": "1", "size": "1754", "license": "bsd-3-clause", "hash": -6999910790067608000, "line_mean": 39.7906976744, "line_max": 121, "alpha_frac": 0.6545039909, "autogenerated": false, "ratio": 4.320197044334975, ...
from dockit.schema import Document, Schema, ModelReferenceField, \ TextField, DictField, SchemaField, FileField, IntegerField, \ ReferenceField, ListField, GenericSchemaField, CharField, DateField from django.contrib.auth.models import User class Author(Document): user = ModelReferenceField(User) inte...
{ "repo_name": "zbyte64/django-dockit", "path": "test_environment/books/models.py", "copies": "1", "size": "2637", "license": "bsd-3-clause", "hash": -5938588114044260000, "line_mean": 22.7567567568, "line_max": 71, "alpha_frac": 0.6522563519, "autogenerated": false, "ratio": 3.924107142857143, ...
from dockit.schema import fields from dockit.schema.common import DotPathList, DotPathSet, DotPathDict from django.utils import unittest from django.contrib.contenttypes.models import ContentType import datetime from decimal import Decimal from common import SimpleSchema, SimpleDocument class BaseFieldTestCase(unit...
{ "repo_name": "zbyte64/django-dockit", "path": "dockit/tests/schema/fields_tests.py", "copies": "1", "size": "8709", "license": "bsd-3-clause", "hash": -7421213204265734000, "line_mean": 33.01953125, "line_max": 110, "alpha_frac": 0.6801010449, "autogenerated": false, "ratio": 3.7233860624198374,...
from dockit.schema.schema import create_document from dockit import schema SCHEMA_MIXINS = {} class ManageUrlsMixin(object): """ Links the document to the resource """ @classmethod def get_admin_client(cls): #TODO this should be configurable from hyperadminclient.urls import admin_...
{ "repo_name": "zbyte64/django-dockitcms", "path": "dockitcms/models/mixin.py", "copies": "1", "size": "8907", "license": "bsd-3-clause", "hash": -5550186812140019000, "line_mean": 36.582278481, "line_max": 146, "alpha_frac": 0.5859436398, "autogenerated": false, "ratio": 4.396347482724581, "con...
from dockit.schema.schema import create_schema, create_document from dockit import schema from django.utils.translation import ugettext_lazy as _ from django.utils.text import capfirst from django.utils.datastructures import SortedDict from dockitcms.models.properties import SchemaDesignChoiceField class FieldEntry(...
{ "repo_name": "zbyte64/django-dockitcms", "path": "dockitcms/models/design.py", "copies": "1", "size": "4041", "license": "bsd-3-clause", "hash": 6850883369753557000, "line_mean": 31.8536585366, "line_max": 84, "alpha_frac": 0.5963870329, "autogenerated": false, "ratio": 4.298936170212766, "con...
from dockit.schema.schema import create_schema from django.template.loader import render_to_string class ExpandedSchemas(object): def __init__(self, base_schema, original_schemas): self.base_schema = base_schema self.original_schemas = original_schemas self.schemas = dict() def __...
{ "repo_name": "zbyte64/django-dockitcms", "path": "dockitcms/widgetblock/common.py", "copies": "1", "size": "1464", "license": "bsd-3-clause", "hash": -8038141422091590000, "line_mean": 35.6, "line_max": 109, "alpha_frac": 0.6297814208, "autogenerated": false, "ratio": 3.989100817438692, "confi...
from dockwrkr import (Command) from dockwrkr.console import PassThroughParser class Exec(Command): def getParserClass(self): return PassThroughParser def getShellOptions(self, optparser): optparser.add_option("-t", "--tty", dest="tty", help="Allocate a pseudo-TTY...
{ "repo_name": "turbulent/dockwrkr", "path": "dockwrkr/command/exec.py", "copies": "1", "size": "1785", "license": "apache-2.0", "hash": -3178876655263569400, "line_mean": 38.6666666667, "line_max": 97, "alpha_frac": 0.5798319328, "autogenerated": false, "ratio": 4.343065693430657, "config_test"...
from dockwrkr import (Command) class Remove(Command): def getShellOptions(self, optparser): optparser.add_option("-a", "--all", dest="allc", help="Apply to defined containers", default=False, action="store_true") optparser.add_option("-f", "--force", dest="force", ...
{ "repo_name": "turbulent/dockwrkr", "path": "dockwrkr/command/remove.py", "copies": "1", "size": "1124", "license": "apache-2.0", "hash": -6389006916250565000, "line_mean": 42.2307692308, "line_max": 132, "alpha_frac": 0.6085409253, "autogenerated": false, "ratio": 4.072463768115942, "config_te...
from dockyard.driver.manager import Manager from dockyard.driver.user import User from tornado.gen import coroutine from tornado.web import RequestHandler from dockyard.const import APIStatus from dockyard.var import GLOBAL import pkgutil class BaseHandler(RequestHandler): def initialize(self): RequestHan...
{ "repo_name": "galileo-project/Galileo-dockyard", "path": "server/dockyard/service/interface/__init__.py", "copies": "1", "size": "3938", "license": "mit", "hash": 1649965850005358600, "line_mean": 28.3880597015, "line_max": 100, "alpha_frac": 0.5566277298, "autogenerated": false, "ratio": 3.9979...
from dockyard.driver.sys import System from dockyard.service.interface import BaseHandler from dockyard.utils.wrapper import auth from tornado.gen import coroutine class PublicGitHubHandeler(BaseHandler): @coroutine def get(self, path, *args, **kwargs): if path == "auth": self.authorize() @auth ...
{ "repo_name": "galileo-project/Galileo-dockyard", "path": "server/dockyard/service/interface/github/_handler/__init__.py", "copies": "1", "size": "1117", "license": "mit", "hash": 1681091048567553300, "line_mean": 32.8787878788, "line_max": 109, "alpha_frac": 0.6222023277, "autogenerated": false, ...
from dockyard.utils.driver import Driver from dockyard.driver.app import App from dockyard.var import GLOBAL from dockyard.utils.github import GitHubClient from dockyard.driver.user._model import User from dockyard.const import APIStatus from dockyard.utils import encrypt class UserDriver(Driver, User): def __ini...
{ "repo_name": "galileo-project/Galileo-dockyard", "path": "server/dockyard/driver/user/_user.py", "copies": "1", "size": "2268", "license": "mit", "hash": -3732999208202726400, "line_mean": 29.2533333333, "line_max": 67, "alpha_frac": 0.55335097, "autogenerated": false, "ratio": 3.857142857142857...