text
stringlengths
4
1.02M
meta
dict
"""Provides the speed releasing table.""" from __future__ import print_function from __future__ import division from __future__ import absolute_import import collections import json import urllib from google.appengine.ext import ndb from dashboard import alerts from dashboard.common import datastore_hooks from dashb...
{ "content_hash": "c8bb3529b478e9f827e790fe7883557a", "timestamp": "", "source": "github", "line_count": 480, "max_line_length": 80, "avg_line_length": 34.672916666666666, "alnum_prop": 0.6596166556510245, "repo_name": "endlessm/chromium-browser", "id": "8edd09a36b537ff60063560c74420153dc9fec50", "s...
class PumpScheduler(object): """A wrapper for managing pump scheduling.""" def __init__(self, clock, sleep_windows): """Creates new PumpScheduler wrapper. Args: clock: A clock interface sleep_windows: A tuple of tuples, each consisting of a sleep window....
{ "content_hash": "88696e7f0306a18f50b95e35db0fed9f", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 75, "avg_line_length": 34.925925925925924, "alnum_prop": 0.5673382820784729, "repo_name": "mtlynch/GreenPiThumb", "id": "a1a3d74318f28f78213c82d178a9e96e097cd54e", "size": ...
"""Main Nvim interface.""" import os from msgpack import ExtType from .buffer import Buffer from .common import (DecodeHook, Remote, RemoteMap, RemoteSequence, SessionFilter, SessionHook, walk) from .tabpage import Tabpage from .window import Window from ..compat import IS_PYTHON3 __all__ = ('N...
{ "content_hash": "cc2229ab4588310eb643012fe5e70eb1", "timestamp": "", "source": "github", "line_count": 279, "max_line_length": 79, "avg_line_length": 34.204301075268816, "alnum_prop": 0.620873939012889, "repo_name": "0x90sled/python-client", "id": "f12287a3dc981c17991458e4eec4f93d8168be4b", "size"...
import _plotly_utils.basevalidators class AutotypenumbersValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="autotypenumbers", parent_name="layout.xaxis", **kwargs ): super(AutotypenumbersValidator, self).__init__( plotly_name=plotly_name, ...
{ "content_hash": "f406d1b82051b8514161f940ed5db2f4", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 81, "avg_line_length": 36.714285714285715, "alnum_prop": 0.6186770428015564, "repo_name": "plotly/plotly.py", "id": "5862fc718f33c7af2d9d3e1ec615a7df0dfae625", "size": "514...
"""Tests for the volume system implementation using pyvshadow.""" import unittest from dfvfs.path import os_path_spec from dfvfs.path import qcow_path_spec from dfvfs.path import vshadow_path_spec from dfvfs.volume import vshadow_volume_system from tests import test_lib as shared_test_lib @shared_test_lib.skipUnle...
{ "content_hash": "c5640a16d61f7236956a88211fbe59f7", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 80, "avg_line_length": 37.65909090909091, "alnum_prop": 0.7027761013880507, "repo_name": "dc3-plaso/dfvfs", "id": "3807ae286d28267affdb5009e38ddc098b97f165", "size": "3356"...
from base import BaseGraph from reg import RegressionLine from ..graphics import Canvas from ..graphics.shapes import Circle, Line, Rectangle, Sector, Path, Square from ..graphics.group import Group, Grouping from ..graphics.utils import ViewBox from ..graphics.color import white from ..utils.struct import Vector as ...
{ "content_hash": "58e49af9b415ff74f8ff6fd30d8935c6", "timestamp": "", "source": "github", "line_count": 484, "max_line_length": 107, "avg_line_length": 32.97314049586777, "alnum_prop": 0.5368130835265368, "repo_name": "ksetyadi/Sahana-Eden", "id": "0ad60bf3d04b991f9bd2ff43e14a5417acb78142", "size":...
""" Description : This file implements the LogMine algorithm for log parsing Author : LogPAI team License : MIT """ import sys import re import os import alignment import copy import hashlib import pandas as pd from datetime import datetime from collections import defaultdict class partition(...
{ "content_hash": "12a634ec6f1f288e9c323d77407d47b1", "timestamp": "", "source": "github", "line_count": 206, "max_line_length": 149, "avg_line_length": 38.66990291262136, "alnum_prop": 0.5293748430831032, "repo_name": "logpai/logparser", "id": "0221703ed9726bb5ea314936e4e173ceb590238b", "size": "79...
import unittest import os import sys import time import traceback from precip import AzureExperiment from azure_config import AzureConfig class TestAzureExperiment(unittest.TestCase): def setUp(self): try: home = os.path.expanduser('~') filepath = os.path.join(home, 'git', 'azur...
{ "content_hash": "47de3fffe4eeae7dca402f4d3826eaf0", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 80, "avg_line_length": 30.727272727272727, "alnum_prop": 0.5046022353714661, "repo_name": "rika/precip", "id": "7b2e65535c8d3e90cf44b672bdc7baef0e70e351", "size": "3064", ...
import argparse, sys import numpy as np import kabsch from utilities import * def get_spec_sol_rot(spec_file, sol_csv): if spec_file.rfind('.csv') != -1: spec_pts = read_csv_points(spec_file) elif spec_file.rfind('.json') != -1: with open(spec_file, 'r') as file: spec_pts = np.asarr...
{ "content_hash": "d20743e7468e5ad03de8dd3674eaa289", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 74, "avg_line_length": 28.384615384615383, "alnum_prop": 0.6422764227642277, "repo_name": "joy13975/elfin", "id": "b1741942171c07883d1b3bd9a523c970bd4341ca", "size": "1130"...
import os import shutil import tempfile import time from pyspark.sql import Row from pyspark.sql.functions import lit from pyspark.sql.types import StructType, StructField, IntegerType, StringType from pyspark.testing.sqlutils import ReusedSQLTestCase class StreamingTests(ReusedSQLTestCase): def test_stream_trig...
{ "content_hash": "c3f62933664f6d6108c49eaa4a20c036", "timestamp": "", "source": "github", "line_count": 613, "max_line_length": 100, "avg_line_length": 37.582381729200655, "alnum_prop": 0.5893306710651967, "repo_name": "xuanyuanking/spark", "id": "87e35641f648a0ffbc26866210ba4fc288979c24", "size": ...
import requests, json, argparse, sys, time, datetime import codecs UTF8Writer = codecs.getwriter('utf8') sys.stdout = UTF8Writer(sys.stdout) parser = argparse.ArgumentParser() parser.add_argument("--host", help="Host to connect to", default="localhost") parser.add_argument("--port", type=int, help="Port to connect to...
{ "content_hash": "bbec159dc450f4e6b33efad0f77f0162", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 146, "avg_line_length": 46.32098765432099, "alnum_prop": 0.6143390191897654, "repo_name": "magapp/domoticz-cli", "id": "0a35c21e461850d780f1e013045634538a80b359", "size": ...
import datetime import mongoengine as mongo import httplib2 import pickle import base64 from StringIO import StringIO from oauth2client.client import Error as OAuthError from xml.etree.ElementTree import Element, SubElement, Comment, tostring from lxml import etree from django.db import models from django.contrib.auth....
{ "content_hash": "f0a4f6f2265db79d851f1447fdef7714", "timestamp": "", "source": "github", "line_count": 427, "max_line_length": 141, "avg_line_length": 40.857142857142854, "alnum_prop": 0.5417860827696893, "repo_name": "Einsteinish/PyTune3", "id": "d36c8e8b441715ab2c4e8292172fdcfdf799ee99", "size":...
import os, lxml, io, re, subprocess, tempfile import lxml.etree as etree from net.ecromedos.error import ECMDSPluginError def getInstance(config): """Returns a plugin instance.""" return Plugin(config) #end function class Plugin(): def __init__(self, config): # init counter self.counter =...
{ "content_hash": "fab905aac5200c12b2dbe33ec3b4bae6", "timestamp": "", "source": "github", "line_count": 225, "max_line_length": 81, "avg_line_length": 29.68, "alnum_prop": 0.5450733752620545, "repo_name": "tobijk/ecromedos", "id": "8851efab7b6703053d1e209f7e5cb687396e9832", "size": "6878", "binar...
import os import logging import redis import urlparse from flask import Flask from flask import render_template from raven.contrib.flask import Sentry from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.basicauth import BasicAuth from flask.ext.login import LoginManager from lrutils import dateformat, datetime...
{ "content_hash": "af28a435438b6fdbfcbb0ff70dcb41cb", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 82, "avg_line_length": 27.336734693877553, "alnum_prop": 0.746173945502053, "repo_name": "LandRegistry/service-frontend-alpha", "id": "34c1981e3ff85ddee83799a370fa3f09bb120d5...
"""Extracts features for different models.""" import functools import tensorflow as tf from deeplab.core import xception slim = tf.contrib.slim # A map from network name to network function. networks_map = { 'xception_65': xception.xception_65, } # A map from network name to network arg scope. arg_scopes_map ...
{ "content_hash": "112710cc363d87d72febb8c707968624", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 80, "avg_line_length": 33.42622950819672, "alnum_prop": 0.6764753964361615, "repo_name": "jiaphuan/models", "id": "1ef93568d95d1ddd4127b5f0bc6f46b4b0c4d17d", "size": "6806...
__all__ = [ "BatfishAssertException", "BatfishAssertWarning", "BatfishException", "QuestionValidationException", ] class BatfishException(Exception): """Base exception for Batfish-related errors.""" class BatfishAssertException(BatfishException): """Raised if a pybatfish assertion fails. ...
{ "content_hash": "59c4213fe17fdacb691596393042149a", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 65, "avg_line_length": 23.785714285714285, "alnum_prop": 0.7102102102102102, "repo_name": "batfish/pybatfish", "id": "9ef5c392764e0a0ca2acccdddbb0e0d05bdc7674", "size": "12...
""" Support for Modbus switches. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.modbus/ """ import logging import blumate.components.modbus as modbus from blumate.helpers.entity import ToggleEntity _LOGGER = logging.getLogger(__name__) DEPENDENC...
{ "content_hash": "eb04bd11377e7c8d38dc3cec40994594", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 76, "avg_line_length": 33.58267716535433, "alnum_prop": 0.5097303634232122, "repo_name": "bdfoster/blumate", "id": "e1ec45690550350cee073eea676ae785dd4aa61d", "size": "426...
import sys from collections import defaultdict import hasher import in_generator import name_utilities import template_expander from in_file import InFile def _symbol(tag): # FIXME: Remove this special case for the ugly x-webkit-foo attributes. if tag['name'].startswith('-webkit-'): return tag['name...
{ "content_hash": "051fbf3d1b087bf2f7c69c0f10919c3e", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 124, "avg_line_length": 33.37894736842105, "alnum_prop": 0.6035950804162725, "repo_name": "google-ar/WebARonARCore", "id": "c6b4063eccf44e5e715889d12024eb7b0abfdcc4", "size...
import sys import os print('Creating database tables for AllSpeak...') if os.path.abspath(os.curdir) not in sys.path: sys.path.append(os.path.abspath(os.curdir)) # Create the database tables, add some initial data, and commit to the database from project import db from project.models import User # Drop all of...
{ "content_hash": "fa4234960ce38e77a3110a5a9eb4533f", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 79, "avg_line_length": 20.875, "alnum_prop": 0.7465069860279441, "repo_name": "allspeak/api.allspeak.eu", "id": "f0a12a8e33ea0f6cda09983286213610fca6bed4", "size": "726", ...
from __future__ import absolute_import, division, print_function, unicode_literals __metaclass__ = type # make all classes new-style in python2 from setuptools import setup, find_packages with open('README.md') as f: readme = f.read() with open('LICENSE') as f: license = f.read() setup( name='stringsea...
{ "content_hash": "5cc7d7132d466074082e3545d668b07f", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 82, "avg_line_length": 26.523809523809526, "alnum_prop": 0.6929982046678635, "repo_name": "enerqi/string-searching", "id": "abf45d15374b8f93cfaa5e5ff56dc15d69dee0d4", "size...
""" roseninputs.py -- inputs for testing the rosenbrock function for testsolvers_pyre.py """ from mystic.models import rosen as cost from mystic.termination import * ND = 3 # for Differential Evolution: NP = 30 from numpy import inf from mystic.tools import random_seed random_seed(123) x0 = [0.8, 1.2, 0.5] # use...
{ "content_hash": "6219956c041cb2030c19cf5483995f15", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 84, "avg_line_length": 21.214285714285715, "alnum_prop": 0.7255892255892256, "repo_name": "jcfr/mystic", "id": "2306dfd542ed446a4c07afcf3db0d30290b3bf29", "size": "945", ...
from django.contrib import admin from .models import Match from .models import Tip def delete_tips(modeladmin, request, queryset): for match in queryset: tips = Tip.objects.filter(match = match) for tip in tips: tip.score = 0 tip.scoring_field = "" tip.is_score_c...
{ "content_hash": "8afebee6322b6355af203c03f843d6b6", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 79, "avg_line_length": 30.68421052631579, "alnum_prop": 0.660377358490566, "repo_name": "leventebakos/football-ech", "id": "19c2249a2894599f90b71c587737d891ee06b11c", "size...
from __future__ import unicode_literals AUTHOR = u'Kai Blin' SITENAME = u'PhDOps' SITESUBTITLE = u'Tales from the underfunded cousin of DevOps, while trying to get research done.' SITEURL = u'//phdops.kblin.org' PATH = 'content' TIMEZONE = 'Europe/Paris' DEFAULT_LANG = u'en' # Feed generation is usually not desire...
{ "content_hash": "8ba0144fb851578ccabaae2b3b263d79", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 97, "avg_line_length": 25.804347826086957, "alnum_prop": 0.6950294860994103, "repo_name": "kblin/phdops", "id": "568529119f4950ae620eaa755d60afeb2a795ebf", "size": "1235", ...
import os import sys from Crypto.Cipher import AES, PKCS1_OAEP from Crypto.PublicKey import RSA from Crypto.Util import strxor from django.conf import settings from django.contrib.auth.hashers import make_password, check_password from django.contrib.auth.models import Group, User from django.contrib.contenttypes.field...
{ "content_hash": "c64b1f750cfed6332465e89cc966b8e7", "timestamp": "", "source": "github", "line_count": 472, "max_line_length": 120, "avg_line_length": 34.29661016949152, "alnum_prop": 0.6146528292562392, "repo_name": "lampwins/netbox", "id": "6dcb5abee9f48250d76aab1351505b90902e10fa", "size": "161...
import os import datetime import subprocess def get_version(version=None): """Returns a PEP 386-compliant version number from VERSION.""" if version is None: from telemundo import VERSION as version else: assert len(version) == 5 assert version[3] in ('alpha', 'beta', 'rc', 'final')...
{ "content_hash": "ab4b51e3423f3f75eb9f8c9a45d68221", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 79, "avg_line_length": 34.11764705882353, "alnum_prop": 0.6304597701149425, "repo_name": "telemundo/telemundo-py", "id": "23d155253ebd4970aafc5623e4c41e52771042c2", "size":...
click(Pattern("Flmnduana.png").targetOffset(34,0)) exit(0)
{ "content_hash": "3b89a6c2fe7ca6f41d0e4cc9046afcae", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 50, "avg_line_length": 29, "alnum_prop": 0.7586206896551724, "repo_name": "silverbulleters/vanessa-behavoir", "id": "2de7769052fa60f3759ffe91b3431672f0abd2c2", "size": "132"...
"""Support for Homekit covers.""" import logging from homekit.model.characteristics import CharacteristicsTypes from homeassistant.components.cover import ( ATTR_POSITION, ATTR_TILT_POSITION, SUPPORT_CLOSE, SUPPORT_CLOSE_TILT, SUPPORT_OPEN, SUPPORT_OPEN_TILT, SUPPORT_SET_POSITION, SUPP...
{ "content_hash": "805e8367c69e2ac3c9ebb6b6ca47da18", "timestamp": "", "source": "github", "line_count": 278, "max_line_length": 88, "avg_line_length": 32.05755395683453, "alnum_prop": 0.6160233393177738, "repo_name": "leppa/home-assistant", "id": "7e5591d9505ea5df516a9c594b4af74061d60e41", "size": ...
''' Main test harness: process a directory with a specified front-end. Record the pass/fail counts and print a latex table with the pass rate. Example use: (1) Specify the Pythohn front-ends and the apps to process: qualitas_test.py 2.7 3.5 gramps astropy # Two versions, two apps (2) Proc...
{ "content_hash": "1facdfac465094e97e715410e8b29e9b", "timestamp": "", "source": "github", "line_count": 248, "max_line_length": 97, "avg_line_length": 41.46774193548387, "alnum_prop": 0.5994749124854143, "repo_name": "MalloyPower/python-compliance", "id": "11f4d388fd9e972dba0f2a4d68dec039fce60fc3", ...
from django.db import migrations # This migration only made sense earlier in the git history, during # the player->account transition. Now it will do nothing since players.PlayerDB # no longer exists. def forwards(apps, schema_editor): try: apps.get_model("players", "PlayerDB") except LookupError: ...
{ "content_hash": "259ef67777c5737820c4f0e9ede8ae1f", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 79, "avg_line_length": 35.05128205128205, "alnum_prop": 0.6627651792245793, "repo_name": "jamesbeebop/evennia", "id": "dbe39353fb3a0c69b3b28d3f7e62f77509c9edd8", "size": "1...
""" new_summary.py -- Run the sample analyses for the remapping summary figure. Created by Joe Monaco on 2010-06-21. Copyright (c) 2010 Johns Hopkins University. All rights reserved. """ from grid_remap.analysis.two_rooms import SampleRemap from scipy.stats import ks_2samp from numpy import pi, empty, arange, array i...
{ "content_hash": "8d722952d7cac53f05093a8ebc685caf", "timestamp": "", "source": "github", "line_count": 290, "max_line_length": 105, "avg_line_length": 41.275862068965516, "alnum_prop": 0.5995822890559732, "repo_name": "jdmonaco/grid-remapping-model", "id": "1e1bfc8ca8d3ec389250a6f4125be631db6a4584",...
class TypeCheckError(TypeError): """Error type to indicate all errors regarding runtime typechecking. """ pass class InputTypeError(TypeCheckError): """Error type to indicate errors regarding failing typechecks of function or method parameters. """ pass class ReturnTypeError(TypeCheckErr...
{ "content_hash": "76a122411c2d703e91648eb28657d1de", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 72, "avg_line_length": 22.75438596491228, "alnum_prop": 0.7139552814186585, "repo_name": "Stewori/pytypes", "id": "f809b4eb23c3cdefcc782a588983bd89de62d5e9", "size": "1895"...
from error_messages import * from extra import * from fields import FieldsTests from forms import * from formsets import * from input_formats import * from media import * from models import * from regressions import * from util import * from validators import TestFieldWithValidators from widgets import * from regressi...
{ "content_hash": "3a02be658d8f26207cc99a97d0a54ec6", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 52, "avg_line_length": 24.21153846153846, "alnum_prop": 0.7680698967434472, "repo_name": "mitsuhiko/django", "id": "cb5f83cdaca72514364b54677d047c32da13bf72", "size": "1259...
"""Deploys Dataflow job of inbound pub/sub. Script used by Cloud Build to deploy dataflow jobs via DeploymentTool. Typical usage example: python3 ./deploy_dataflow_inbound_pubsub.py -s $_SCOPE_FILE -e $BRANCH_NAME -d $_DOMAIN -c $$CFG """ import argparse import sys from deployment_configuration import ...
{ "content_hash": "9d9e5570a297d58c5a5b92bd6bb70781", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 80, "avg_line_length": 28.123456790123456, "alnum_prop": 0.6483757682177349, "repo_name": "google/grizzly", "id": "acb918fbf4d6a0cea2058a90f51592f1fbefbe60", "size": "2854"...
from django.apps import AppConfig class CustomersConfig(AppConfig): name = 'customers'
{ "content_hash": "f03e90f978e4877f14ef7192f4878e19", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 33, "avg_line_length": 16.333333333333332, "alnum_prop": 0.7244897959183674, "repo_name": "kaiocesar/django-eshop", "id": "60d3fe04481a0c23e149f1ec60eff2c98e38fb8e", "size":...
import matplotlib matplotlib.use('Agg') import numpy as np import netCDF4 from datetime import datetime import pyroms import pyroms_toolbox import sys year = int(sys.argv[1]) def create_HYCOM_file(name): global nc print 'Creating file %s' %name #create netCDF file nc = netCDF4.Dataset(name, 'w', fo...
{ "content_hash": "9e71b58266be1f677eb215421e0c871d", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 110, "avg_line_length": 32.314465408805034, "alnum_prop": 0.631957960295835, "repo_name": "kshedstrom/pyroms", "id": "4a3536c1a7713b3ba151001b542af25fa472979c", "size": "5...
from setuptools import setup, find_packages from rest_any_permissions import __version__ import os def get_package_data(package): """ Return all files under the root package, that are not in a package themselves. """ walk = [(dirpath.replace(package + os.sep, '', 1), filenames) for dir...
{ "content_hash": "37806f1b448aad189d8a9a420d326c9c", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 76, "avg_line_length": 32.054054054054056, "alnum_prop": 0.6382799325463744, "repo_name": "kevin-brown/drf-any-permissions", "id": "4d873dde0bd049b9140573b0c28ff9494bab8025",...
__authors__ = ['Joel Wright'] from plugins_base import TestPlugin class TestPlugin1(TestPlugin): __name__ = "TestPlugin1" __version__ = 0.01 def __init__(self): self.initialised = True def config(self): self.configured = True def start(self): print("Started TestP...
{ "content_hash": "25c6b93136fc4d8467aaf4cb14fe8b82", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 36, "avg_line_length": 19.4, "alnum_prop": 0.5902061855670103, "repo_name": "joel-wright/DDRPi", "id": "322284a3c09310f46597eae73b26b9cc1af047ac", "size": "388", "binary"...
from google.appengine.ext import db from mcfw.properties import unicode_property, long_property from mcfw.serialization import s_long, ds_long, s_unicode, ds_unicode, get_list_serializer, get_list_deserializer, \ s_bool, ds_bool, CustomProperty from rogerthat.to import TO try: from cStringIO import StringIO e...
{ "content_hash": "fae93bd59ceca3663776f64fc8850492", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 117, "avg_line_length": 30.556016597510375, "alnum_prop": 0.6455730581205866, "repo_name": "rogerthat-platform/rogerthat-backend", "id": "045c3f80c6afd4872595dcb51a3fec3e01a...
""" Fakes For Scheduler tests. """ import mox from nova.compute import instance_types from nova.compute import vm_states from nova import db from nova.scheduler import filter_scheduler from nova.scheduler import host_manager COMPUTE_NODES = [ dict(id=1, local_gb=1024, memory_mb=1024, vcpus=1, ...
{ "content_hash": "520f3a9e64d9d308a7a086ae88bfa787", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 75, "avg_line_length": 33.99173553719008, "alnum_prop": 0.587892049598833, "repo_name": "NoBodyCam/TftpPxeBootBareMetal", "id": "84424c1c78812330b2c8afb20a0f5229fb1a2a4b", ...
import zeit.cms.testing import zeit.content.text.testing class PythonScriptTest(zeit.cms.testing.FunctionalTestCase): layer = zeit.content.text.testing.ZCML_LAYER def create(self, text): py = zeit.content.text.python.PythonScript() py.uniqueId = 'http://xml.zeit.de/py' py.text = text...
{ "content_hash": "734d551bfff0999ebc3cdbc85d216096", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 60, "avg_line_length": 28.16216216216216, "alnum_prop": 0.6161228406909789, "repo_name": "ZeitOnline/zeit.content.text", "id": "b5911499b360d2ad64a89590d1c047bf68b8be85", "...
''' Production Configurations - Use djangosecure ''' from __future__ import absolute_import, unicode_literals import ldap from django_auth_ldap.config import LDAPSearch, GroupOfNamesType from .common import * # noqa # SECRET CONFIGURATION # -----------------------------------------------------------------------...
{ "content_hash": "292ca13a0d492009e782c684d64c22f4", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 112, "avg_line_length": 34.6219512195122, "alnum_prop": 0.6819302571327932, "repo_name": "hmrc/wristband", "id": "438340759b32e2daace07ebc3985062995cb8ab3", "size": "2863",...
import string import os from fabric.api import task from conf import settings from fabric.context_managers import lcd from fabric.operations import local as lrun, prompt from fabric.colors import red, green from fabric.tasks import Task @task def install(horizon_path=settings.HORIZON_ROOT): """Download and instal...
{ "content_hash": "bb3809828a16e05170c5048fbcba1c7c", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 156, "avg_line_length": 43.425, "alnum_prop": 0.5808865860679332, "repo_name": "Plexical/fiware-idm", "id": "9ad6c63207016f4a4dc2bb38d8a55b64319fc28e", "size": "7551", "...
""" auto rule template ~~~~ :author: LoRexxar <[email protected]> :homepage: https://github.com/LoRexxar/Kunlun-M :license: MIT, see LICENSE for more details. :copyright: Copyright (c) 2017 LoRexxar. All rights reserved """ from utils.api import * class CVI_1002(): """ rule cla...
{ "content_hash": "0f0e638014f154b2c918a9087e71bb88", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 65, "avg_line_length": 21.384615384615383, "alnum_prop": 0.5539568345323741, "repo_name": "LoRexxar/Cobra-W", "id": "a02322c692a320f8eceb272622507b56657af21b", "size": "117...
import os from setuptools import setup, find_packages from setuptools.command.develop import develop as STDevelopCmd class DevelopCmd(STDevelopCmd): def run(self): # add in requirements for testing only when using the develop command self.distribution.install_requires.extend([ 'mock', ...
{ "content_hash": "ab9e62bd36a42ac6f737dd5e4bbf8d33", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 88, "avg_line_length": 33.59183673469388, "alnum_prop": 0.6330498177399757, "repo_name": "marquisthunder/sqlalchemy-validation", "id": "db49bd34425ce1026e6e7930ed2a606d17d162...
import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def LocalizableMessage(vim, *args, **kwargs): '''''' obj = vim.client.factory.cre...
{ "content_hash": "9016662973c031a7fb1faf4cf54222d5", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 124, "avg_line_length": 30.03125, "alnum_prop": 0.5775234131113424, "repo_name": "xuru/pyvisdk", "id": "1aed78e6032e046e5feb2a7b09ea30e5a2e581bc", "size": "962", "binary"...
""" Output mapcache configuration information to `node-gyp` Configuration options are retrieved from environment variables set using `npm config set`. This allows for a simple `npm install mapcache` to work. """ from optparse import OptionParser import os import re import sys def warn(msg): print >> sys.stderr,...
{ "content_hash": "4b6b7b0e8bb66ebab3fbd04140545d9b", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 105, "avg_line_length": 31.49462365591398, "alnum_prop": 0.5689655172413793, "repo_name": "geo-data/node-mapcache", "id": "d4a5a9fa86bcc07a11b60ecb23a439eedef61345", "size...
import pandas as pd import pandas_datareader as pdr import datetime import matplotlib.pyplot as plt import pylab """ This one looks like a more reasonable tutorial using Yahoo data and pandas. https://ntguardian.wordpress.com/2016/09/19/introduction-stock-market-data-python-1/ """ from matplotlib.dates import DateFo...
{ "content_hash": "6e4434dab4844322195ae1af421c556b", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 260, "avg_line_length": 49.58181818181818, "alnum_prop": 0.605977264393106, "repo_name": "martinschaef/coinstuff", "id": "830780d501980612ba16bc4037d85046382f0523", "size"...
from __future__ import unicode_literals from django.apps import AppConfig class GatewayV1Config(AppConfig): name = 'gateway_v1'
{ "content_hash": "e87877b306801d7b139a00209ae46552", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 39, "avg_line_length": 19.285714285714285, "alnum_prop": 0.7555555555555555, "repo_name": "vinay-pad/commit_service", "id": "aff44d2dda1deb2e4c34707e58de7ea91c511b3a", "size...
import urllib import httplib import json class Topicsio(object): ''' Topics.io API Handler Parameters ---------- auth_api_key : string the Topics.io API Key. ''' API_URL = 'api.topics.io' def __init__(self, auth_api_key): self._auth_api_key = auth_api_key def make_api_ca...
{ "content_hash": "4def7848a901e97a890e675460304491", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 101, "avg_line_length": 34.29577464788732, "alnum_prop": 0.5613963039014374, "repo_name": "drano/python-topicsio", "id": "740dcd2f8dda45f023315b85fae0e8fa5d077019", "size":...
"""FMTK high-level maintenance procedures """ import os, os.path import sys from getopt import getopt, GetoptError from .provision import provide #import pdb def findpathwithchild(pathlist, childpath, limit=None): """Find a path from pathlist which has childpath underneath it. For example, '/this/path/lib/ha...
{ "content_hash": "b999e693156aca9688e41fe0c86df011", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 86, "avg_line_length": 33.351351351351354, "alnum_prop": 0.5790113452188006, "repo_name": "kwan0xfff/fmtk", "id": "553f2162c7f843d98b3a831692120442cf00ce2a", "size": "4983...
import collections import logging import inspect import pymel.core as pymel from classNode import Node from omtk import constants from omtk.libs import libAttr from omtk.libs import libPymel from omtk.libs import libRigging log = logging.getLogger('omtk') class BaseCtrl(Node): """ A Ctrl is the layer betwee...
{ "content_hash": "0d675a248b1983f719a0cfcbe3e3e8fa", "timestamp": "", "source": "github", "line_count": 650, "max_line_length": 146, "avg_line_length": 47.356923076923074, "alnum_prop": 0.6235137417971541, "repo_name": "SqueezeStudioAnimation/omtk", "id": "4b7b2609e4471b6fa814a8148fa89950a1bed3f2", ...
""" WARNING: This code is deprecated and will be removed. Keystone is the recommended solution for auth management. Nova authentication management """ import os import shutil import string # pylint: disable=W0402 import tempfile import uuid import zipfile from nova import context from nova import crypto from nova i...
{ "content_hash": "6a2f1c7f8eb050d62f854ae8f326521e", "timestamp": "", "source": "github", "line_count": 818, "max_line_length": 79, "avg_line_length": 37.36674816625917, "alnum_prop": 0.5639926715958908, "repo_name": "nii-cloud/dodai-compute", "id": "e0504464ee8df7e0f88b9766c4776edcb408b7d7", "size...
from typing import List import setuptools from setuptools import find_packages def get_requirements() -> List[str]: with open("requirements.txt") as f: requirements = f.read().splitlines() return requirements setuptools.setup( name="capitalone-dataprofiler-expectations", version="0.1.0", ...
{ "content_hash": "a4c6159b1a5fbbb5bd938422eac9c40c", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 56, "avg_line_length": 23.22222222222222, "alnum_prop": 0.7057416267942583, "repo_name": "great-expectations/great_expectations", "id": "3fe83cd9d3084d4f12b9efb99ef79a1de6c89...
from amon.apps.servers.models import server_model from amon.apps.processes.models import process_model from amon.apps.plugins.models import plugin_model
{ "content_hash": "25a3894b240a4b75c2ebbed42edf8ed2", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 52, "avg_line_length": 51, "alnum_prop": 0.8431372549019608, "repo_name": "martinrusev/amonone", "id": "f2cd2690169d97ef2885ff5857f29fa76d605511", "size": "153", "binary":...
""" Cascade decomposition ===================== This example script shows how to compute and plot the cascade decompositon of a single radar precipitation field in pysteps. """ from matplotlib import cm, pyplot as plt import numpy as np import os from pprint import pprint from pysteps.cascade.bandpass_filters impor...
{ "content_hash": "94dbdda270ece14ec19dc6321e90303e", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 86, "avg_line_length": 32.098591549295776, "alnum_prop": 0.6290039491004826, "repo_name": "pySTEPS/pysteps", "id": "a9f02799309783f3e9483e137b9ec495dccdebb9", "size": "457...
import os from setuptools import setup with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-eve-auth', version='0.0.1', ...
{ "content_hash": "642507d1cd24fd779696dfe538f2d674", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 78, "avg_line_length": 35.333333333333336, "alnum_prop": 0.6234276729559748, "repo_name": "bastianh/django-eve-auth", "id": "51ec4a16b644207c603a538ed0ed7856aad3fc78", "siz...
""" ORCID Member No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: Latest Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class PersonE...
{ "content_hash": "f5899791717ca389388a18e8b006a540", "timestamp": "", "source": "github", "line_count": 369, "max_line_length": 243, "avg_line_length": 30.1869918699187, "alnum_prop": 0.5885627076039142, "repo_name": "Royal-Society-of-New-Zealand/NZ-ORCID-Hub", "id": "3d41566184021c56aaa03f901f77046c...
from airflow.contrib.hooks.aws_hook import AwsHook from airflow.contrib.operators.sagemaker_base_operator import SageMakerBaseOperator from airflow.utils.decorators import apply_defaults from airflow.exceptions import AirflowException class SageMakerModelOperator(SageMakerBaseOperator): """ Create a SageMake...
{ "content_hash": "bf0d7b1fb51870e4b762f92ebb626996", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 95, "avg_line_length": 33.916666666666664, "alnum_prop": 0.6351351351351351, "repo_name": "r39132/airflow", "id": "df5670b78fc09096dd9cbdba02b8317696dfbcb5", "size": "2440"...
""" Standard "encodings" Package Standard Python encoding modules are stored in this package directory. Codec modules must have names corresponding to normalized encoding names as defined in the normalize_encoding() function below, e.g. 'utf-8' must be implemented by the module 'utf_8.py'. Ea...
{ "content_hash": "3ce4b41ad77ff943a9bbb7928a7d15f6", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 84, "avg_line_length": 33.33552631578947, "alnum_prop": 0.6189066508782317, "repo_name": "ArcherSys/ArcherSys", "id": "281b4f3edfcf7b039f8b7d94b61f13fae1595520", "size": "...
import os import sys import pyglet from pyglet.gl import * import squirtle config = pyglet.gl.Config(sample_buffers=1, samples=4) w = pyglet.window.Window(config=config, resizable=True) #w = pyglet.window.Window(800, 600) keys = pyglet.window.key.KeyStateHandler() w.push_handlers(keys) glClearColor(1,1,1,1) glEnabl...
{ "content_hash": "301ad2da05b4188423b64b289b62fe15", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 70, "avg_line_length": 23.536585365853657, "alnum_prop": 0.6435233160621762, "repo_name": "fathat/squirtle", "id": "954aa11b6084d313cb99e0a7f1aa72249b7940c0", "size": "1953...
import unittest import sys import os import argparse import logging import numpy as np import math import copy import itertools from teHmm.track import TrackData, CategoryMap from teHmm.hmm import MultitrackHmm from teHmm.cfg import MultitrackCfg from teHmm.trackIO import getMergedBedIntervals, readBedIntervals from t...
{ "content_hash": "69373f4371b716301793c599d3da22e3", "timestamp": "", "source": "github", "line_count": 382, "max_line_length": 97, "avg_line_length": 44.146596858638745, "alnum_prop": 0.5965962998102466, "repo_name": "glennhickey/teHmm", "id": "12ea04eae5cbc2ad750b891b02f1be0eb043c60d", "size": "1...
import os import sys root_path = os.path.split(os.path.dirname(__file__))[0] sys.path.insert(0, os.path.join(root_path, 'lib')) import ssl import tornado.ioloop import tornado.httpserver #import com.web #import com.config import com #from com.utils import make_cookie_secret def write_pid(): pidfile = '/var/run/...
{ "content_hash": "2b2362abd4d4722cd9c93715b176e732", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 66, "avg_line_length": 26.613636363636363, "alnum_prop": 0.6447480785653288, "repo_name": "dingzg/onepanel", "id": "5b03947d7ffc39e6b9a51458d22683dec121f70c", "size": "1789...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "skidom.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that the # issue is real...
{ "content_hash": "ed416edc8e111bbd4f8583aeef20ec7f", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 77, "avg_line_length": 37.23809523809524, "alnum_prop": 0.6202046035805626, "repo_name": "racmariano/skidom", "id": "61df74d3c73824eebfd8f688ea35ea457a5c4211", "size": "805...
from panoptes.pocs import dome from panoptes.utils import error from panoptes.utils import rs232 class AbstractSerialDome(dome.AbstractDome): """Abstract base class for controlling a dome via a serial connection. Takes care of a single thing: configuring the connection to the device. """ def __init_...
{ "content_hash": "ee3fb1601889f4bfb23dc0d224342a9b", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 94, "avg_line_length": 35.03658536585366, "alnum_prop": 0.6000696136442742, "repo_name": "panoptes/POCS", "id": "b52857b4f7f68a42af72cf09fce1cf137402d3d3", "size": "2873", ...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('landing', '0105_auto_20210816_1106'), ] operations = [ migrations.RemoveField( model_name='section', name='articles', ), migrations.AddField( ...
{ "content_hash": "2171021cf7ede17c8137fda4575faa54", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 116, "avg_line_length": 25.5, "alnum_prop": 0.5764705882352941, "repo_name": "flavoi/diventi", "id": "8a36b843ee2baa8baf8b1158c042ada7320a7b7e", "size": "560", "binary": ...
from __future__ import unicode_literals from django.db import migrations, models import uuid class Migration(migrations.Migration): dependencies = [ ('statuses', '0002_auto_20141009_0224'), ] operations = [ migrations.AlterModelOptions( name='status', options={'o...
{ "content_hash": "ca682528205e5fa853a097644efe8592", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 55, "avg_line_length": 22.565217391304348, "alnum_prop": 0.5703275529865125, "repo_name": "matthewlane/mesa", "id": "350e45bde68613f8312d60559598f66812fa42b0", "size": "543...
from ftplib import FTP f = FTP('ftp.ibiblio.org') f.login() f.cwd('/pub/academic/astronomy/') entries = [] f.dir(entries.append) print("%d entries:" % len(entries)) for entry in entries: print(entry) f.quit()
{ "content_hash": "8ef002a9c7ae52343ff2eb4b8c7bfd5e", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 35, "avg_line_length": 19.454545454545453, "alnum_prop": 0.677570093457944, "repo_name": "jac2130/BayesGame", "id": "a372552dfc69f0acb83d5c58cde620f77cf11e93", "size": "275...
from datetime import datetime class FpsSync: def __init__(self, fps=None): self.fps = fps if not self.fps: self.fps = 120.0 self._dtFrame = 1.0/self.fps self.reset() def start(self): self.reset() def reset(self): self.startTime = datetime.now(...
{ "content_hash": "112c653f69f45cbbf039ab5996c6aa4b", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 62, "avg_line_length": 21.457142857142856, "alnum_prop": 0.5699067909454061, "repo_name": "markkorput/PyMoCap", "id": "b4ab6b8e6ef2acf9f1778858f747b302d62f0f07", "size": "7...
""" Grafeas API An API to insert and retrieve annotations on cloud artifacts. # noqa: E501 OpenAPI spec version: v1alpha1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import grafeas from grafeas.models.api_list_no...
{ "content_hash": "89572071fdf363e4c5e9d91198054156", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 93, "avg_line_length": 23.763157894736842, "alnum_prop": 0.6954595791805094, "repo_name": "grafeas/client-python", "id": "d6d572f31d1175963a0775f6d3bca4edbe01a537", "size":...
from django.http.response import HttpResponseRedirect from django.shortcuts import render, render_to_response from django.urls.base import reverse from lykops.forms import Form_Login from lykops.views import Base class Privacy(Base): ''' 该功能用于保存用户的机密数据,但该版本暂时不需要使用,故暂时不做展示 ''' def detail(sel...
{ "content_hash": "eab6ebba89184bc87b2448b6a7a79764", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 243, "avg_line_length": 44.39393939393939, "alnum_prop": 0.5063139931740614, "repo_name": "lykops/lykops", "id": "370f114f1e4319dbaa89bceffb641e17554f2c7b", "size": "6304"...
from random import randint from os import listdir, chdir, makedirs from os.path import isdir, join, dirname, abspath from argh.decorators import arg from jinja2 import Template import yaml from colorama import Fore from elements import all help = "Bootstrap a service with all you need" @arg('name', default=all[randi...
{ "content_hash": "e4236d202915135446874aedbd1b61af", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 81, "avg_line_length": 34.583333333333336, "alnum_prop": 0.6295180722891566, "repo_name": "PressLabs/lithium", "id": "695288691f291651efe42ddc2c1a30b3b35fc836", "size": "16...
GEOJSON_GEOMETRY_SCHEMA = { "$schema": "http://json-schema.org/draft-04/schema#", "id": "http://json-schema.org/geojson/geometry.json#", "title": "geometry", "description": "One geometry as defined by GeoJSON", "type": "object", "required": ["type", "coordinates"], "oneOf": [ { ...
{ "content_hash": "2ef008b26d647f68cf272efa0fb455b1", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 88, "avg_line_length": 32.114754098360656, "alnum_prop": 0.40811638591117916, "repo_name": "6aika/issue-reporting", "id": "1571ac2886b0457b657e2df20a308a4f15173b57", "size...
from __future__ import unicode_literals import datetime from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('venues', '0001_initial'), ] operations = [ migrations.CreateModel( ...
{ "content_hash": "4b47228a518bcd7f92d2d1afd09966f3", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 132, "avg_line_length": 29.576923076923077, "alnum_prop": 0.6007802340702211, "repo_name": "FlowFX/reggae-cdmx", "id": "c3a8895992728383ac2f78c7e196bf2987c2a3e9", "size": "...
from multiprocessing.synchronize import Lock from PIL import Image from utils import * pathlock = Lock() # type: Lock class TextureConvert(object): def __init__(self): self.args = get_args() self.tool = "PVRTexToolCLI" pass def execute(self): print("BuildTool excute >") ...
{ "content_hash": "05fdf0d21ed0cf9c0b8a6b5ef7863299", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 154, "avg_line_length": 42.864754098360656, "alnum_prop": 0.5050196003442011, "repo_name": "guobin8205/texturetool", "id": "db22950e9039b681a52631da800dc13dd69243e8", "siz...
import unittest from spyne.client.zeromq import ZeroMQClient from spyne.test.interop._test_soap_client_base import SpyneClientTestBase from spyne.test.interop.server.soap11.soap_http_basic import soap11_application class TestSpyneZmqClient(SpyneClientTestBase, unittest.TestCase): def setUp(self): SpyneC...
{ "content_hash": "b2da10fa6cb90085db211c044ea7afd1", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 79, "avg_line_length": 31.764705882352942, "alnum_prop": 0.7425925925925926, "repo_name": "deevarvar/myLab", "id": "6bb69e7bff68705495541937aaec564d10582ad1", "size": "1336...
import unittest from programy.processors.pre.cleanup import CleanUpPreProcessor from programy.bot import Bot from programy.brain import Brain from programy.config import BrainConfiguration, BotConfiguration class PreCleanUpTests(unittest.TestCase): def setUp(self): self.bot = Bot(Brain(BrainConfiguration...
{ "content_hash": "facde1d1f1ece4fb8dcbe1ad9608b49e", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 78, "avg_line_length": 31.72222222222222, "alnum_prop": 0.7425569176882661, "repo_name": "Thielak/program-y", "id": "0063cba1f09209497305810ee6d1bda91c427ec6", "size": "571...
""" Copyright [1999-2016] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ...
{ "content_hash": "48756e5197095706e24add0dbbb78618", "timestamp": "", "source": "github", "line_count": 475, "max_line_length": 187, "avg_line_length": 33.45894736842105, "alnum_prop": 0.7107531617693325, "repo_name": "Ensembl/cttv024", "id": "f6925ba94a0788c9ee5ec17c56dc2164b2a1f454", "size": "159...
import json import unittest from netengine.backends.ssh import AirOS from ..settings import settings __all__ = ['TestSSHAirOS'] class TestSSHAirOS(unittest.TestCase): def setUp(self): self.host = settings['airos-ssh']['host'] self.username = settings['airos-ssh']['username'] self.pass...
{ "content_hash": "dd189ba35ae51fdd36bf65ec38de9774", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 88, "avg_line_length": 28.206349206349206, "alnum_prop": 0.63083849184018, "repo_name": "ninuxorg/netengine", "id": "bf17d1cb2f51db1b512ea9b7818d1ffa54ec9ef4", "size": "177...
from django.db import models # This is an auto-generated Django model module. # You'll have to do the following manually to clean this up: # * Rearrange models' order # * Make sure each model has one field with primary_key=True # Feel free to rename the models, but don't rename db_table values or field names....
{ "content_hash": "b1cf594a6acd6eadbd647564d27a2b19", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 87, "avg_line_length": 40.23880597014925, "alnum_prop": 0.7318249258160238, "repo_name": "quarkness/django-buckaroo", "id": "3df4802cb17bfba19d30bc2be26dae869fc2695d", "siz...
from django.db import models import datetime from django.utils import timezone class Book(models.Model): title = models.CharField(max_length=200) pub_year = models.IntegerField('year published', default=2000) def was_published_recently(self): return self.pub_year >= timezone.now().year - 1 ...
{ "content_hash": "f6ebfca93b9073508171e99273841fc9", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 66, "avg_line_length": 27.40625, "alnum_prop": 0.6590649942987458, "repo_name": "louridas/djbr", "id": "44e2de9169a2916458e441d873906aab84caee2d", "size": "877", "binary"...
"""Demonstrates controlling the timing of interactive authentication using InteractiveBrowserCredential. DeviceCodeCredential supports the same API. """ import os import sys from azure.identity import AuthenticationRequiredError, InteractiveBrowserCredential from azure.keyvault.secrets import SecretClient # This sa...
{ "content_hash": "d726009408026bd76214ec58072104bc", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 120, "avg_line_length": 49.54545454545455, "alnum_prop": 0.8012232415902141, "repo_name": "Azure/azure-sdk-for-python", "id": "584be63de237347fa6c8f9cdf52a4e377196845d", "s...
from mangopaysdk.entities.entitybase import EntityBase class BankAccount(EntityBase): """Bank Account entity.""" def __init__(self, id = None): self.UserId = None # Type of bank account self.Type = 'IBAN' self.OwnerName = None self.OwnerAddress = None # mus...
{ "content_hash": "cfbb0aa37c2aa9a7839a346a6dd5e42b", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 69, "avg_line_length": 31.09090909090909, "alnum_prop": 0.5935672514619883, "repo_name": "ebewe/mangopay2-python-sdk", "id": "49fa4065c244540bbb043f94191b28f433f560ec", "si...
import boto3 import sure # noqa import six from botocore.exceptions import ClientError from moto import mock_logs, settings from nose.tools import assert_raises _logs_region = 'us-east-1' if settings.TEST_SERVER_MODE else 'us-west-2' @mock_logs def test_log_group_create(): conn = boto3.client('logs', 'us-west-...
{ "content_hash": "802ee6242570f62335356f8f0f4a1cc9", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 74, "avg_line_length": 27.733870967741936, "alnum_prop": 0.6115149752835126, "repo_name": "botify-labs/moto", "id": "05bd3c8238443a9b7c95358b2dba68f6a564cd24", "size": "34...
import os.path import sys import vim class Citation(object): @staticmethod def connect(): """ Returns source from builder, printing any errors from python to the vim console. wrapping everything in "try: except:" is bad practise generally, but in this case ensures al...
{ "content_hash": "5a3d734ff514cc00568a355ff64b4994", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 76, "avg_line_length": 30.147058823529413, "alnum_prop": 0.6370731707317073, "repo_name": "rafaqz/citation.vim", "id": "4868efe97373caa295aa1d43430c6d3f978eedf3", "size": "...
""" Verbose and colourful traceback formatting. **ColorTB** I've always found it a bit hard to visually parse tracebacks in Python. The ColorTB class is a solution to that problem. It colors the different parts of a traceback in a manner similar to what you would expect from a syntax-highlighting text editor. Inst...
{ "content_hash": "989d0f7676959b56dec43917fb3b3932", "timestamp": "", "source": "github", "line_count": 1200, "max_line_length": 110, "avg_line_length": 38.266666666666666, "alnum_prop": 0.5799651567944251, "repo_name": "ipython/ipython", "id": "e83e2b4a0c11d1b1e0cee6b9a20f5f14189f7c3e", "size": "4...
from dispatch import Dispatcher from response import APIResponse __all__ = ( 'XmlRpcDispatcher', 'XmlRpcResponse', ) class XmlRpcResponse(APIResponse): def format(self, data): if isinstance(data, APIError): # convert to fault xmlrpc message pass else: ...
{ "content_hash": "7a6f4ca647ca9508f387cf4cd4506fb6", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 73, "avg_line_length": 26.175, "alnum_prop": 0.603629417382999, "repo_name": "miracle2k/genericapi", "id": "7f72d8043842852f3864b8abf5fb11f3aa59ef04", "size": "1049", "bi...
"""This package implements a very simple Qt GUI over the PythonCalc package to provide an example of how a package may add GUI elements including independent windows, menu items as well as dependency requirements. If you're interested in developing new modules for VisTrails, you should also consult the documentation i...
{ "content_hash": "2c62f254157d39577c53b61389fdf6b6", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 67, "avg_line_length": 34.05263157894737, "alnum_prop": 0.7836166924265843, "repo_name": "hjanime/VisTrails", "id": "3b8b0336de3fb6ac81cdd9836a97050419407807", "size": "256...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "octopus.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "42f86c8a49fa9714334242b341f0f0ec", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 71, "avg_line_length": 25.333333333333332, "alnum_prop": 0.7105263157894737, "repo_name": "gregorianzhang/octopus", "id": "f059f4215c9dcf20bdf9373257a223937be1a24a", "size":...
import random as r import math class Roller: '''Base class which handles die rolls and stat-to-mod calculations''' def do_roll(self, roll_string, modifier=0): ''' Takes a roll string (e.g. '2d4') and modifier, rolls, then returns the result as an integer. ''' num_dice, ...
{ "content_hash": "f34857a697abe8d1250b9d901d6e596d", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 75, "avg_line_length": 33.89473684210526, "alnum_prop": 0.5978260869565217, "repo_name": "etkirsch/dndarmy", "id": "a58488e7118b58462cef4da0d43bb5629827eda7", "size": "644"...
""" ctypesgen.ctypedescs contains classes to represent a C type. All of them classes are subclasses of CtypesType. Unlike in previous versions of ctypesgen, CtypesType and its subclasses are completely independent of the parser module. The most important method of CtypesType and its subclasses is the py_string method...
{ "content_hash": "784576a3c1e64ffe9c08f20cf7ce9ebb", "timestamp": "", "source": "github", "line_count": 382, "max_line_length": 90, "avg_line_length": 28.93455497382199, "alnum_prop": 0.5951325432009409, "repo_name": "davidjamesca/ctypesgen", "id": "8df3bbd39d675c9bb72ae4bdeb384c6ae38a6759", "size"...
from datetime import datetime from dateutil.tz import gettz, tzlocal def default_timezone(): """ Get the default timezone Based on user location settings location.timezone.code or the default system value if no setting exists. Returns: (datetime.tzinfo): Definition of the default timezone ...
{ "content_hash": "9dd88c998c36802a619fb7ce0d618997", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 76, "avg_line_length": 26.074468085106382, "alnum_prop": 0.6295389636882905, "repo_name": "Dark5ide/mycroft-core", "id": "cb1a4af114d2d4cd608f797faa377b44dd4771a2", "size":...
import os import sys import traceback import operator # Add the pulsar path thispath = os.path.dirname(os.path.realpath(__file__)) psrpath = os.path.join(os.path.dirname(thispath), "modules") sys.path.insert(0, psrpath) import pulsar as psr from pulsar.output import * from pulsar.testing import * from pulsar.math im...
{ "content_hash": "126e8be1db7abaa0f4d496b8b89ec8f5", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 97, "avg_line_length": 29.02777777777778, "alnum_prop": 0.594896331738437, "repo_name": "pulsar-chem/Pulsar-Core", "id": "0c4bc17a370504cd250bb386630da61eba3977ee", "size"...
from .base import * # noqa from .module import * # noqa from .pod import * # noqa from .queue import * # noqa from .queue_entry import * # noqa from .research import * # noqa from .resource import * # noqa from .user import * # noqa
{ "content_hash": "d75c5e044c39f54cf209511e6098e8a7", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 33, "avg_line_length": 29.125, "alnum_prop": 0.6866952789699571, "repo_name": "Nukesor/spacesurvival", "id": "407c5535820ecb97ef04cf23cb461d7f8ecb9419", "size": "233", "bi...
from . import main from flask import render_template, request, jsonify @main.app_errorhandler(404) def page_not_found(e): if request.accept_mimetypes.accept_json and \ not request.accept_mimetypes.accept_html: response = jsonify({'error': 'not found'}) response.status_code = 404 ...
{ "content_hash": "7940d171cb93ba64e4e5b3e5e02775f2", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 62, "avg_line_length": 33, "alnum_prop": 0.6790633608815427, "repo_name": "seagullbird/BLEXT", "id": "1ede3cd91055281dca9613b476dd6832ec97e900", "size": "750", "binary": ...
from django import forms from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.forms import ReadOnlyPasswordHashField from riskgame.models import * class UserCreationForm(forms.ModelForm): """A form for creating new users. Includes all the required fields, ...
{ "content_hash": "c9694d4e207ce244134ad9c37f826a53", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 197, "avg_line_length": 34.357723577235774, "alnum_prop": 0.6826786559394227, "repo_name": "whatsthehubbub/rippleeffect", "id": "91d77356bd1f663dae0f7006c1b2509379bb51b6", ...
import sys import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('../naginator_publisher')...
{ "content_hash": "7e445d9de224280e0089ffa4797ff6ea", "timestamp": "", "source": "github", "line_count": 249, "max_line_length": 115, "avg_line_length": 32.78313253012048, "alnum_prop": 0.7112581158887664, "repo_name": "thomasvandoren/jenkins-job-builder-naginator", "id": "6d5ffc643062f3b70a31b33c703e...
from kivy_ios.toolchain import PythonRecipe, shprint from os.path import join import sh import os class ClickRecipe(PythonRecipe): version = "7.1.2" url = "https://github.com/mitsuhiko/click/archive/{version}.zip" depends = ["python"] def install(self): arch = list(self.filtered_archs)[0] ...
{ "content_hash": "06be850f087810977b5f898fe7ffba5a", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 88, "avg_line_length": 31.304347826086957, "alnum_prop": 0.65, "repo_name": "kivy/kivy-ios", "id": "c2d2d59f4e154388d9bab0a1a107e45dd4d43809", "size": "801", "binary": fa...
"""MOMA Composer Robot Hand. Rationale and difference to `robot_base.RobotHand`: MoMa communicates to hardware (sim and real) though the Sensor and Actuator interfaces. It does not intend users (for example scripted policies) to perform these actions through the set_grasp function. While sim hardware can and should ...
{ "content_hash": "18c3612ffe85cae7f1872cce60d45fd7", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 80, "avg_line_length": 31.069444444444443, "alnum_prop": 0.753687974966473, "repo_name": "deepmind/dm_robotics", "id": "627b688ecfde131f76e0a47bdcbd0ec5da079dcf", "size": "...
import os import attest from os.path import join, isfile from acrylamid import core, log, utils, helpers from acrylamid.compat import iteritems from acrylamid.commands import compile from acrylamid.defaults import conf # supress warnings log.init('acrylamid', 40) options = type('Options', (object, ), { 'ignore':...
{ "content_hash": "8fcb4e44110f8f15efe868ba43a247aa", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 102, "avg_line_length": 31.185430463576157, "alnum_prop": 0.5582926311318751, "repo_name": "markvl/acrylamid", "id": "322aa6fce92242bb77f8a12d4adc2e8e8ee661ad", "size": "4...
from configure import Configuration from scriptparser import ScriptParser from PySide import QtGui, QtCore from view import mainwindow ## Controller class for the Main window class ControlMainWindow(QtGui.QMainWindow): ## The constructor. # # @param self The object pointer. # @param parent The parent ...
{ "content_hash": "6f93e7f625be8d808ba3f6e427e70632", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 104, "avg_line_length": 35.74418604651163, "alnum_prop": 0.5875081327260898, "repo_name": "oddurk/scriptviewer", "id": "4fa8af9a7e51a99c7fbd84899a03bc62cdcd7fc4", "size": "...