text
stringlengths
4
1.02M
meta
dict
from indico.modules.events.timetable.controllers.display import (RHTimetable, RHTimetableEntryInfo, RHTimetableExportDefaultPDF, RHTimetableExportPDF) from indico.modules.events.timetable.controllers.legacy import (RHLegacyTimetableAddBreak, ...
{ "content_hash": "4e32b2e39f9c24fb45eb90b85db5d874", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 120, "avg_line_length": 80.51388888888889, "alnum_prop": 0.6008280144902536, "repo_name": "pferreir/indico", "id": "9ad3def4c1773f51302e9afdb0377c79297bc081", "size": "6011...
config = {} config['webapp2_extras.sessions'] = { 'secret_key': 'my-key' } import webapp2 class MainHandler(webapp2.RequestHandler): def get(self): self.response.write('Hello world!') app = webapp2.WSGIApplication([ webapp2.Route('/', handler='user_profile.handler.index.index...
{ "content_hash": "9148993dbf467b2abbed264e5ce35a53", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 75, "avg_line_length": 20.38888888888889, "alnum_prop": 0.6512261580381471, "repo_name": "parmardhruv3041/salemybook", "id": "7559950318a836b54c3553f3528fd86b99995d54", "si...
import e32 import _recorder ENotReady = _recorder.ENotReady EOpen = _recorder.EOpen EPlaying = _recorder.EPlaying ERecording = _recorder.ERecording KMdaRepeatForever = _recorder.KMdaRepeatForever TTS_PREFIX = "(tts)" class Sound(object): def __init__(self): self._player=_recorder.Player() def open(fi...
{ "content_hash": "26d59b4bebc0ed5c97f1838dc3b0442c", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 90, "avg_line_length": 35.626168224299064, "alnum_prop": 0.5739769150052466, "repo_name": "pymo/pymo", "id": "8a3544c1a91abc160f35ef31721902815e33dd99", "size": "4422", ...
import pytest from marshmallow_jsonapi import utils @pytest.mark.parametrize( "tag,val", [ ("<id>", "id"), ("<author.last_name>", "author.last_name"), ("<comment.author.first_name>", "comment.author.first_name"), ("True", None), ("", None), ], ) def test_tpl(tag, v...
{ "content_hash": "d970636e06e6d736a08d2e509b7f98f4", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 69, "avg_line_length": 21.058823529411764, "alnum_prop": 0.547486033519553, "repo_name": "marshmallow-code/marshmallow-jsonapi", "id": "2e10ac499186d2cf5a52d798773e7f66ef854e...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Invitation.invited_at' db.add_column('core_invitation', 'invited_at', self.gf('django.db.model...
{ "content_hash": "c841c3378ec4740a2957887b713bed5e", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 158, "avg_line_length": 39.107142857142854, "alnum_prop": 0.5926940639269407, "repo_name": "jacobjbollinger/sorbet", "id": "ba5265997a6beca5f919367afeb5e1239438baa5", "size...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('push', '0014_auto_20161115_2310'), ] operations = [ migrations.CreateModel( name='ApplicationModel', fields=[ ...
{ "content_hash": "1987aa16cc0c162e3bc655b0fae26142", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 114, "avg_line_length": 30.346153846153847, "alnum_prop": 0.5754119138149556, "repo_name": "nnsnodnb/django-mbaas", "id": "ba91fd1037a66e610b93d06f5b650ac8f87b66b7", "size"...
from __future__ import unicode_literals from django.db import models, migrations from decimal import Decimal import django.db.models.deletion from django.conf import settings import django.core.validators class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AU...
{ "content_hash": "43d396c3dbf4c9e30df9e20e23371731", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 359, "avg_line_length": 48.516666666666666, "alnum_prop": 0.5623497080041223, "repo_name": "caktus/django-timepiece", "id": "51028b07507f3ab84ea80f8b08fcf0711cc75d29", "si...
""" An API to insert and retrieve metadata on cloud artifacts. No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: v1alpha1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint im...
{ "content_hash": "12cbdf1f5fbd7296cd14711c0abf1843", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 852, "avg_line_length": 48.421052631578945, "alnum_prop": 0.6526570048309178, "repo_name": "grafeas/client-python", "id": "779f18eb24705ad2ad6622ea0bc6c045e042c6ae", "size...
""" Utilities and compatibility abstraction. Licensed under MIT Copyright (c) 2015 - 2018 Isaac Muse <[email protected]> """ import sys import struct PY2 = (2, 0) <= sys.version_info < (3, 0) PY3 = (3, 0) <= sys.version_info < (4, 0) PY34 = (3, 4) <= sys.version_info PY36 = (3, 6) <= sys.version_info PY37 = (3, 7) ...
{ "content_hash": "da833869050aa8c8d68cda29b20f1a72", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 90, "avg_line_length": 25.75, "alnum_prop": 0.52701561840439, "repo_name": "archifix/settings", "id": "e3c9fa0fd9ea35865affcb269d915e6da7ff229c", "size": "4738", "binary...
import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS_MODULE", "notepad.settings") application = get_wsgi_application()
{ "content_hash": "0f38e5aee8bf98cbf306c0d4a9247e81", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 67, "avg_line_length": 27.666666666666668, "alnum_prop": 0.8012048192771084, "repo_name": "rajujha373/OurNoticeBoardv2.0", "id": "abca1d58a9c9d2cb8710316547639fdc18db2064", ...
from __future__ import print_function from . import tests import sys import unittest from ctypes import Structure, c_float, c_double, c_uint8, CFUNCTYPE from llvm import core as lc from llvm import ee as le from .support import (skip_if_win32, skip_if_not_win32, skip_if_not_32bits, skip_if_not_64...
{ "content_hash": "0e248650a7737560613545395f025280", "timestamp": "", "source": "github", "line_count": 685, "max_line_length": 79, "avg_line_length": 30.363503649635035, "alnum_prop": 0.5646906101254868, "repo_name": "llvmpy/llvmpy", "id": "5e48ea84df740e6a54de0548ea14302f1b82b9ba", "size": "20799...
import logging as _logging from scli import prompt from scli import config_file from scli.constants import ParameterName from scli.constants import ParameterSource from scli.constants import EnvironmentHealth from scli.constants import EnvironmentStatus from scli.constants import ServiceDefault from scli.constants im...
{ "content_hash": "dab3cfc4e0ccddb57af776a677ba68f4", "timestamp": "", "source": "github", "line_count": 499, "max_line_length": 134, "avg_line_length": 50.565130260521045, "alnum_prop": 0.540068167406468, "repo_name": "JoaoVasques/aws-devtool", "id": "8ffb18ea535aa4c649847d645c2815ba22a76d2a", "siz...
import asyncio import aiobotocore from datetime import datetime import io import umsgpack _records = [] _max_qlen = 0 _ev_flush = None def init(loop, opts): global _max_qlen, _ev_flush assert opts['codec'] in ('msgpack', 'text') ev = asyncio.Event(loop=loop) _ev_flush = ev interval = opts.get('flu...
{ "content_hash": "1c13660b3878fa8ea6bd8428ddca400b", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 81, "avg_line_length": 36.4264705882353, "alnum_prop": 0.5248284214775939, "repo_name": "lablup/logger", "id": "76bf9f2d093ccbcac605eec24b892b6db4118015", "size": "2502", ...
import random import gym import Traci_1_cross_env.Traci_1_cross_env import numpy as np from collections import deque from sklearn.linear_model import SGDRegressor from baselines import logger, logger_utils class LinearQFunction: def __init__(self, gamma, n_actions): # Hyperparameters self.gamma ...
{ "content_hash": "b302e8af57d9005293efb5e4d4c433d2", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 108, "avg_line_length": 34.1078431372549, "alnum_prop": 0.576889910893935, "repo_name": "peheje/baselines", "id": "0b387b725fb92b7b1ad4bda89dc88785c728800b", "size": "3545...
import sys import os import glob import heapq import codecs import cPickle; BINARY=1 import stemmer; _stemmer=stemmer from math import log, sqrt from time import time from random import random, choice from itertools import izip, chain from bisect import insort from StringIO import StringIO from codecs...
{ "content_hash": "91f84c7faaa88b744b2067a53ed62727", "timestamp": "", "source": "github", "line_count": 2051, "max_line_length": 114, "avg_line_length": 41.90443686006826, "alnum_prop": 0.5602122262816187, "repo_name": "decebel/dataAtom_alpha", "id": "49eb7ceef65df97b733f9699a18fe31df068401c", "siz...
import _plotly_utils.basevalidators class TickfontValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__( self, plotly_name="tickfont", parent_name="scatterternary.marker.colorbar", **kwargs, ): super(TickfontValidator, self).__init__( plotl...
{ "content_hash": "f9b87e32f114a1e63a0051dc087e6845", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 72, "avg_line_length": 37.73809523809524, "alnum_prop": 0.5356466876971608, "repo_name": "plotly/plotly.py", "id": "5857416b58f5290c747a0531d305260407fc0dce", "size": "1585...
import ast import logging import threading import time import unittest import six from plop.collector import Collector, PlopFormatter class CollectorTest(unittest.TestCase): def filter_stacks(self, collector): # Kind of hacky, but this is the simplest way to keep the tests # working after the inte...
{ "content_hash": "12863103d2c5e3dfe1e7c914a9e94524", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 82, "avg_line_length": 35.61818181818182, "alnum_prop": 0.5421133231240429, "repo_name": "omidraha/plop", "id": "d5e22c7cd0bb034ed5da73ad0d54793e7ab520a2", "size": "3918",...
import importlib.metadata import os # Sphinx extensions extensions = [ "sphinx.ext.autodoc", "sphinx.ext.viewcode", "sphinx.ext.napoleon", "sphinx.ext.intersphinx", "sphinxarg.ext", ] intersphinx_mapping = { "numpy": ("https://numpy.org/doc/stable/", None), "pandas": ("https://pandas.pydat...
{ "content_hash": "699edb1d3180269bc33b0e4a23f66020", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 79, "avg_line_length": 30.313432835820894, "alnum_prop": 0.6597735105859183, "repo_name": "ocefpaf/pyproj", "id": "66ba52e34eca2c551d92f342ab27e8c855f17611", "size": "2031"...
import polyadcirc.run_framework.domain as dom import polyadcirc.run_framework.random_wall as rmw import numpy as np adcirc_dir = '/work/01837/lcgraham/v50_subdomain/work' grid_dir = adcirc_dir + '/ADCIRC_landuse/Inlet/inputs/poly_walls' save_dir = adcirc_dir + '/ADCIRC_landuse/Inlet/runs/few_walls' basis_dir = adcirc_...
{ "content_hash": "7b5e2fcf991fec75d5a80ad042deb16b", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 84, "avg_line_length": 30.808823529411764, "alnum_prop": 0.7107398568019093, "repo_name": "UT-CHG/PolyADCIRC", "id": "441b6b4f55a385e22118a3de6c4501c6f69b4d05", "size": "21...
import glob import optparse import re def ParseTest(lines): r"""Parses section-based test. Args: lines: list of \n-terminated strings. Returns: List of string pairs (field name, field content) in order. Field content is concatenation of \n-terminated lines, so it's either empty or ends with \n. ...
{ "content_hash": "a74ccb8a12c0323b6c80abf51ac34fe6", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 80, "avg_line_length": 25.635071090047393, "alnum_prop": 0.6169347383989647, "repo_name": "CTSRD-SOAAP/chromium-42.0.2311.135", "id": "341d1f3366e4e063b8ca72b81117531fc847bd...
__author__ = "Simone Campagna" __all__ = [ 'create_file_dir', ] import os def create_file_dir(filename): dirname, filename = os.path.split(os.path.abspath(filename)) if not os.path.isdir(dirname): os.makedirs(dirname) return dirname
{ "content_hash": "b640f053a764bcd813837260f57e6818", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 63, "avg_line_length": 21.25, "alnum_prop": 0.6588235294117647, "repo_name": "simone-campagna/sheru", "id": "dff57dede037a9424378c66f26dc734af5a57069", "size": "863", "bi...
from __future__ import unicode_literals """ Misc. functions/utils """ import pandas as pd import numpy as np from hub.structures.frame import OdhType, OdhSeries from hub.odhql.functions.core import VectorizedFunction class NVL(VectorizedFunction): """ Gibt das zweite Argument zurück, falls das erste NULL i...
{ "content_hash": "253e2f73c88dfddd91ef421f57956a59", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 118, "avg_line_length": 26.826446280991735, "alnum_prop": 0.6275415896487985, "repo_name": "hsr-ba-fs15-dat/opendatahub", "id": "82bd35f8b54b0ec8dd2e499ac74183760cb23d99", ...
import itertools import toyplot import numpy as np from .Render import split_rgba_style from .NodeAssist import NodeAssist from .TreeStyle import COLORS1 from .utils import ToytreeError ITERABLE = (list, tuple, np.ndarray) """ Checks style dictionaries for types and size and builds out arguments into arrays for varia...
{ "content_hash": "3a35dfefee8bb4054101396410f58efb", "timestamp": "", "source": "github", "line_count": 532, "max_line_length": 102, "avg_line_length": 35.9078947368421, "alnum_prop": 0.5341569387007277, "repo_name": "eaton-lab/toytree", "id": "63879548afb57d615e04174431bb4a6c001ff5e0", "size": "19...
from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('articles', '0001_initial'), ] operations = [ mig...
{ "content_hash": "3dd4ba80543d4b542264dc8b0e91787a", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 88, "avg_line_length": 26.44, "alnum_prop": 0.6081694402420574, "repo_name": "wahuneke/django-skd-smoke", "id": "a065ffd48b38e255590fa5480ba61742abdcef4d", "size": "685", ...
""" On the Subject of Wires :Copyright: 2015 Jochen Kupperschmidt :License: MIT, see LICENSE for details. """ from ..templating import render_template def render_page(): return render_template('wires')
{ "content_hash": "c2ffd048c46a77ade4cee1487413a415", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 40, "avg_line_length": 17.5, "alnum_prop": 0.7285714285714285, "repo_name": "homeworkprod/better-bomb-defusal-manual", "id": "46306def7698e812422ca2e05467d6c58c60dd91", "si...
class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: # @param preorder, a list of integers # @param inorder, a list of integers # @return a tree node def buildTree(self, preorder, inorder): lookup = {} for i, ...
{ "content_hash": "1e9eb762ce5a7b2b0cc52d67e7d7c36c", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 111, "avg_line_length": 34.90625, "alnum_prop": 0.5989256938227395, "repo_name": "jaredkoontz/leetcode", "id": "e3196454d25ea8180353da88821cc51cff142b03", "size": "1334", ...
from __future__ import unicode_literals import annoying.fields from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('ERP', '0024_auto_20170328_1757'), ] operations = [ migrations.AlterField( model_name='modelgridfield', name='...
{ "content_hash": "175e6491bb9566ae43659dce2cec7c4e", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 116, "avg_line_length": 28.625, "alnum_prop": 0.61863173216885, "repo_name": "Pandaaaa906/ChemErpSystem", "id": "eca746229b4e31cce5e0227d92ebde8538ef44ed", "size": "760", ...
from supybot.test import * class NetworkTestCase(PluginTestCase): plugins = ['Network', 'Utilities'] def testNetworks(self): self.assertNotError('networks') def testCommand(self): self.assertResponse('network command %s echo 1' % self.irc.network, '1') # vim:s...
{ "content_hash": "52d36880f0593582ccfa7aa6679a2d02", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 75, "avg_line_length": 26.785714285714285, "alnum_prop": 0.648, "repo_name": "buildbot/supybot", "id": "bd0ab11bec917c24b9ccac95b73f2bd8199f188e", "size": "1964", "binary...
from __future__ import print_function import six from .initializer import Initializer, Xavier, Constant from .regularizer import WeightDecayRegularizer __all__ = [ 'ParamAttr', 'WeightNormParamAttr', ] class ParamAttr(object): """ Parameter attributes object. To fine-tuning network training process...
{ "content_hash": "b5eb5a4d6d7b4d6b8466bd730c9f8854", "timestamp": "", "source": "github", "line_count": 195, "max_line_length": 86, "avg_line_length": 33.63076923076923, "alnum_prop": 0.5867642573955474, "repo_name": "QiJune/Paddle", "id": "f0be794327f51cbbc4202b8b7b401b712b6d66a3", "size": "7171",...
import simtk.unit as units from intermol.decorators import accepts_compatible_units from intermol.forces.abstract_bond_type import AbstractBondType class G96BondType(AbstractBondType): __slots__ = ['length', 'k', 'order', 'c'] @accepts_compatible_units(None, None, length=units...
{ "content_hash": "3c686aa11ac07705fcb0281ac34a77df", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 85, "avg_line_length": 36.513513513513516, "alnum_prop": 0.5440414507772021, "repo_name": "ctk3b/InterMol", "id": "6adfadd978c0451b8d1d5b142aa9deac89d7a263", "size": "1351"...
'''serializer.py: common python serializer for heron''' from abc import abstractmethod try: import cPickle as pickle except: import pickle import heronpy.api.cloudpickle as cloudpickle class IHeronSerializer(object): """Serializer interface for Heron""" @abstractmethod def initialize(self, config): """...
{ "content_hash": "fa5d9589a7b1a640a525f58a6d170fba", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 55, "avg_line_length": 21.80851063829787, "alnum_prop": 0.7141463414634146, "repo_name": "ashvina/heron", "id": "6a922f63b8ad915d5af9f1d6ab4e6ec9cbfca806", "size": "1874", ...
""" This example is using the XKCD downloader (https://github.com/1995eaton/xkcd_downloader) """ import os import numpy as np import scipy.misc import plusminus import glob # Basic example with black theme class Basic(plusminus.PlusMinus): def __init__(self): plusminus.PlusMinus.__init__(self) self...
{ "content_hash": "d08cfb20579ed053fb4feb06b150a6b3", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 88, "avg_line_length": 32.21666666666667, "alnum_prop": 0.6032074495602691, "repo_name": "daurer/plusminus", "id": "d05c6da812bcbb9998120c9f9f0ed0b207d83508", "size": "1955...
c.auto_save.session = True # Enable smooth scrolling for web pages. Note smooth scrolling does not # work with the `:scroll-px` command. # Type: Bool c.scrolling.smooth = True ## The editor (and arguments) to use for the `open-editor` command. `{}` ## gets replaced by the filename of the file to be edited. ## Type: ...
{ "content_hash": "c86a1dc4c31a4444dd866b4c93efb287", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 101, "avg_line_length": 38.23076923076923, "alnum_prop": 0.6911468812877264, "repo_name": "mifix/dotfiles", "id": "5fc2cea1e39046f2e88425fd1f21283d5f2c5bb3", "size": "1099"...
import pdfkit import os from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter from pdfminer.converter import TextConverter from pdfminer.layout import LAParams from pdfminer.pdfpage import PDFPage from cStringIO import StringIO def convert_pdf_to_txt(path): rsrcmgr = PDFResourceManager() retst...
{ "content_hash": "6ba0f12985cce04debb0c7f85f33a506", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 125, "avg_line_length": 23.875, "alnum_prop": 0.6509598603839442, "repo_name": "samkit-jain/Textractor", "id": "8d6259159123b3d1ec4b4720c68746062cf2717f", "size": "2292", ...
def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('numpy',parent_package,top_path) config.add_subpackage('distutils') config.add_subpackage('testing') config.add_subpackage('f2py') config.add_subpackage('core') conf...
{ "content_hash": "4047f58331fda074c6f0f556adce4b73", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 59, "avg_line_length": 36.78260869565217, "alnum_prop": 0.6867612293144209, "repo_name": "chadnetzer/numpy-gaurdro", "id": "52580ca4163751919f019d5af42252b0fca30843", "size...
from flask import session from flask_yoloapi import endpoint, parameter from findex_gui.web import app KEYS = [ "search_display_view" ] VALUES = [ "table", "fancy" ] @app.route("/api/v2/session/set", methods=["POST"]) @endpoint.api( parameter("key", type=str, required=True), parameter("val", type=s...
{ "content_hash": "5eefdd364c573dd37a4f408384359d1e", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 74, "avg_line_length": 24.846153846153847, "alnum_prop": 0.6357069143446853, "repo_name": "skftn/findex-gui", "id": "3ef4ea1660af83b5f69cad63963b32cdfd581d1b", "size": "969...
"""Validate the locations in the downloaded checklists. Validation Tests: Location: 1. the location is a dict. LocationIdentifier (optional): 1. identifier is a string. 2. identifier is set. 3. identifier does not have leading/trailing whitespace. LocationName: 1. name is...
{ "content_hash": "e8aec4f1349c96916ca015efd1b6dc63", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 79, "avg_line_length": 33.45238095238095, "alnum_prop": 0.6366548042704626, "repo_name": "StuartMacKay/checklists_scrapers", "id": "340bcf887b75a3baee9bcfff571167cddd4096c9"...
"""Setup script for PyGreSQL version 4.0 Authors and history: * PyGreSQL written 1997 by D'Arcy J.M. Cain <[email protected]> * based on code written 1995 by Pascal Andre <[email protected]> * setup script created 2000/04 Mark Alexander <[email protected]> * tweaked 2000/05 Jeremy Hylton <[email protected]> * wi...
{ "content_hash": "c7ed44980b1129cde798d1a0d9ced757", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 96, "avg_line_length": 35.666666666666664, "alnum_prop": 0.6457760674363203, "repo_name": "ashwinstar/gpdb", "id": "205fd0df65e65dc9641c684527debc8a0b99bd6d", "size": "553...
from datetime import datetime from django.conf import settings from django.core import exceptions from django.db import models from django.db.models import permalink from django.utils.translation import ugettext_lazy as _ from django.utils.functional import cached_property from model_utils.fields import MonitorField ...
{ "content_hash": "436444c9a75891d983c2dd152097b79f", "timestamp": "", "source": "github", "line_count": 894, "max_line_length": 148, "avg_line_length": 39.727069351230426, "alnum_prop": 0.5795697713706498, "repo_name": "phani00/tovp", "id": "1563ca7031e93d135d228ba4d07bf363c4846b26", "size": "35516...
from functools import wraps import re import socket import struct import time import gevent import requests def tz_hours(): delta = time.localtime().tm_hour - time.gmtime().tm_hour sign = '-' if delta < 0 else '' return "%s%02d.00" % (sign, abs(delta)) def is_dst(): return 1 if time.localtime().tm_...
{ "content_hash": "614e92682b54391eaa2460bdc2b372eb", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 124, "avg_line_length": 24.8, "alnum_prop": 0.6209677419354839, "repo_name": "fritz-fritz/ouimeaux", "id": "8d57675367dbc64766056af08ec00d121a82c6fc", "size": "2232", "bi...
""" Simulation class that implements n-population discrete-time replicator dynamics Classes: :py:class:`NPopDiscreteReplicatorDynamics` implements n-population discrete time replicator dynamics Functions: :py:func:`stable_state_handler` Default handler for 'stable state' and 'force stop' events ...
{ "content_hash": "e3f099b1ccd5437a78647b5fdd8a0abc", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 116, "avg_line_length": 28.551136363636363, "alnum_prop": 0.6075621890547264, "repo_name": "gsmcwhirter/simulations", "id": "256c01aee09dbb2b29968371e9d6affa1374c93f", "si...
from asic_la.sharded_probability_function.utils import ( permute, relative_permutation, invert_permutation, remove_and_reduce, send_to_left_side, send_to_right_side, ) from asic_la.sharded_probability_function.sharded_probability_function import ( ShardedProbabilityFunction, ) from asic_la.s...
{ "content_hash": "f054a87d339a0b0a641b61a9fc139ab4", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 88, "avg_line_length": 31.285714285714285, "alnum_prop": 0.773972602739726, "repo_name": "google/distla_core", "id": "02c1beba64e06d469912ff6127a433b07751a256", "size": "11...
from sicpythontask.PythonTaskInfo import PythonTaskInfo from sicpythontask.PythonTask import PythonTask from sicpythontask.InputPort import InputPort from sicpythontask.OutputPort import OutputPort from sicpythontask.data.Int32 import Int32 from sicpythontask.data.Control import Control @PythonTaskInfo(generator=True)...
{ "content_hash": "a942f8f712d1d9ec2b561e6e2e23d90f", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 105, "avg_line_length": 35.41379310344828, "alnum_prop": 0.7049659201557936, "repo_name": "systemincloud/sic-examples", "id": "e3175828e131dae55e00b68ba6827e55d4d0dab6", "s...
import json import os import string from runtime.diagnostics import SQLFlowDiagnostic from runtime.pai import pai_model JOB_ARCHIVE_FILE = "job.tar.gz" PARAMS_FILE = "params.txt" ENTRY_FILE = "entry.py" def get_pai_tf_cmd(cluster_config, tarball, params_file, entry_file, model_name, oss_model_pat...
{ "content_hash": "046837200cabfacb4968ec1ecd3bdac4", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 78, "avg_line_length": 36.875, "alnum_prop": 0.6211212516297262, "repo_name": "sql-machine-learning/sqlflow", "id": "d5ad79e53a6412d8b07686ae925a98373997d9fe", "size": "44...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import tensorflow.contrib.slim as slim from tensorflow.contrib.slim import losses from tensorflow.contrib.slim import arg_scope import numpy as np from layer_utils.snippets import gene...
{ "content_hash": "0d8c55f827c46c12acfe0be7dd6c502b", "timestamp": "", "source": "github", "line_count": 396, "max_line_length": 124, "avg_line_length": 45.89393939393939, "alnum_prop": 0.5862220754924617, "repo_name": "junranhe/tf-faster-rcnn", "id": "648585635bb6f8d105c105ea5a12dc9c915581db", "siz...
import json import select import subprocess import time import uuid from apiclient.discovery import build from airflow.contrib.hooks.gcp_api_base_hook import GoogleCloudBaseHook from airflow.utils.log.logging_mixin import LoggingMixin # This is the default location # https://cloud.google.com/dataflow/pipelines/speci...
{ "content_hash": "8f10bd117beaeb9f6a54c219f2427712", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 89, "avg_line_length": 38.64754098360656, "alnum_prop": 0.5270413573700954, "repo_name": "yk5/incubator-airflow", "id": "a7c75e133bca72f9cdafab61abd152da299b7d55", "size":...
import unittest from io import StringIO from ..helperfunctions import _xml_to_list from ...worksheet import Worksheet from ...format import Format from ...sharedstrings import SharedStringTable class TestAssembleWorksheet(unittest.TestCase): """ Test assembling a complete Worksheet file. """ def test...
{ "content_hash": "02eb59a8232177a87a21b99ffd2da0a0", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 171, "avg_line_length": 35.847328244274806, "alnum_prop": 0.5106473594548552, "repo_name": "jmcnamara/XlsxWriter", "id": "8ae573318cc530a1ecfeeb44fa9df2d50b68fea1", "size"...
""" sentry.db.models ~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import logging from django.db import models from django.db.models import signals from .fields.bounded import Boun...
{ "content_hash": "788f94cacb9db139a6e74d7a08cc26e3", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 75, "avg_line_length": 26.017391304347825, "alnum_prop": 0.5778743315508021, "repo_name": "daevaorn/sentry", "id": "2a6e6a861b3cecf262ca7e8609d3f6a0959513f6", "size": "299...
import copy import inspect import logging from django.core import urlresolvers from django import forms from django.forms.forms import NON_FIELD_ERRORS # noqa from django import template from django.template.defaultfilters import linebreaks # noqa from django.template.defaultfilters import safe # noqa from django.t...
{ "content_hash": "ee67c3a91e23405eaa8b34ecf7fb938a", "timestamp": "", "source": "github", "line_count": 862, "max_line_length": 79, "avg_line_length": 37.75986078886311, "alnum_prop": 0.5869611969645765, "repo_name": "openstack-ja/horizon", "id": "9412a35241bc962db3669e722c14ff6e99b2eef6", "size": ...
from datetime import datetime from django import forms from django.contrib import admin, messages from django.contrib.admin import SimpleListFilter from django.utils.translation import ugettext_lazy as _ from treeadmin.admin import TreeAdmin from arkestra_utilities.admin_mixins import GenericModelAdmin, GenericModel...
{ "content_hash": "06ba4834a1c6f0578c5cab81625f7091", "timestamp": "", "source": "github", "line_count": 251, "max_line_length": 174, "avg_line_length": 45.37051792828685, "alnum_prop": 0.6171408500175624, "repo_name": "evildmp/Arkestra", "id": "710c280f4b8fc9a104c84343620aa0b32edd0e7b", "size": "11...
""" Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
{ "content_hash": "024d67bbb576e677920d1223545afeb6", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 114, "avg_line_length": 34.10126582278481, "alnum_prop": 0.7754268745360059, "repo_name": "arenadata/ambari", "id": "bca007b467382c103cdc6d880caf25b53a6481d1", "size": "269...
import gevent.monkey gevent.monkey.patch_all() # noqa import logging from cfgm_common import BGP_RTGT_MIN_ID from vnc_cfg_api_server.tests import test_case from vnc_cfg_api_server.vnc_cfg_types import RouteTargetServer logger = logging.getLogger(__name__) class TestRouteTargetBase(test_case.ApiServerTestCase): ...
{ "content_hash": "2abc3177362d399a722efbe3b3ef6e61", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 79, "avg_line_length": 38.943661971830984, "alnum_prop": 0.5674502712477396, "repo_name": "eonpatapon/contrail-controller", "id": "79b15679878b5ee40edf15b54b6880d360e20ad7", ...
import clr clr.AddReference('RevitAPI') from Autodesk.Revit.DB import * clr.AddReference("RevitServices") import RevitServices from RevitServices.Persistence import DocumentManager doc = DocumentManager.Instance.CurrentDBDocument dynunittype = IN[0] if IN[1] > 2021: if str(dynunittype.GetType()) == "Autodesk.Revit.D...
{ "content_hash": "a37a759147efb17435b55423e7f3903d", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 66, "avg_line_length": 36.372093023255815, "alnum_prop": 0.7615089514066496, "repo_name": "andydandy74/ClockworkForDynamo", "id": "0afe12d7d3c0c832a8985e62c21f05af66d13b2b", ...
import requests import json from collections import OrderedDict from test_framework.test_framework import OpenBazaarTestFramework, TestFailure class UploadListingTest(OpenBazaarTestFramework): def __init__(self): super().__init__() self.num_nodes = 1 def setup_network(self): self.set...
{ "content_hash": "d440da3d4a28e2792961f6cd4c2d0535", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 123, "avg_line_length": 41.829787234042556, "alnum_prop": 0.6230925737538149, "repo_name": "gubatron/openbazaar-go", "id": "f607d64aa0db1545a6f1ef949d8ab6fcc1e059e8", "size...
import unittest from PyQt4.Qt import * import sys from eigen import * from atom import * from bond import * from molecule import * from fragment import * from cube import * from residue import * from mesh import * from primitivelist import * from pluginmanager import * from toolgroup import * from tool import * from ...
{ "content_hash": "9972fdcb63d1f8e2ece05c302ff8990e", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 114, "avg_line_length": 38.32, "alnum_prop": 0.7865344467640919, "repo_name": "jjenki11/blaze-chem-rendering", "id": "7475cc9e9a902a7514bc3c80abe58e5e1ee6f58f", "size": "19...
"""Module for testing the update network command.""" import unittest if __name__ == "__main__": import utils utils.import_depends() from brokertest import TestBrokerCommand class TestUpdateNetwork(TestBrokerCommand): def test_100_update(self): command = ["update", "network", "--network", "excx...
{ "content_hash": "d4ba7966e7a275f4c70977aa061646bf", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 91, "avg_line_length": 39.21621621621622, "alnum_prop": 0.5809786354238456, "repo_name": "quattor/aquilon", "id": "2a301554d3f4cdd611875b204bbd419a618c977d", "size": "3647"...
import copy from decimal import Decimal import inspect from urlparse import urljoin from jfr_playoff.dto import Match, Team from jfr_playoff.logger import PlayoffLogger class ResultInfoClient(object): def __init__(self, settings, database=None): self.settings = settings self.database = database ...
{ "content_hash": "d483545180076ecba6c621fd02aa4657", "timestamp": "", "source": "github", "line_count": 332, "max_line_length": 112, "avg_line_length": 41.147590361445786, "alnum_prop": 0.5261693873069322, "repo_name": "emkael/jfrteamy-playoff", "id": "6e6f36c8814ca9aa5f84472ff79f2cd952ac8409", "si...
import unittest import os from conans.test.utils.tools import TestClient, TestBufferConanOutput from conans.test.utils.test_files import hello_source_files from conans.client.manager import CONANFILE from conans.model.ref import ConanFileReference, PackageReference import shutil from conans.paths import CONANINFO from ...
{ "content_hash": "5d7c84a585de678a43aa803efd2394c5", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 93, "avg_line_length": 45.208, "alnum_prop": 0.5793664838081756, "repo_name": "tivek/conan", "id": "decbec13bc26538e0a2afb561cc378405e0d2b98", "size": "5651", "binary": ...
""" error types Copyright (c) 2010-2012 Mika Eloranta See LICENSE for details. """ class Error(Exception): """error""" class InvalidProperty(Error): """invalid property""" class MissingProperty(Error): """missing property""" class UserError(Error): """user error""" class InvalidRange(Error): ...
{ "content_hash": "9b8d4b0b7b2cc4bd26f352b0663886b9", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 42, "avg_line_length": 17.724137931034484, "alnum_prop": 0.6741245136186771, "repo_name": "ohmu/poni", "id": "ad6814fac263f5b76918b8ac263abe0db67b26c3", "size": "1028", "...
ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'version': '1.0'} DOCUMENTATION = """ --- module: vertica_configuration version_added: '2.0' short_description: Updates Vertica configuration parameters. description: - Updates Vertica configuration para...
{ "content_hash": "944fc68f4d25f2536d5b3379e8a196bc", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 125, "avg_line_length": 32.53191489361702, "alnum_prop": 0.6362001308044474, "repo_name": "nwiizo/workspace_2017", "id": "c99627a021d7fd241d919b5db80c668f1ec8a858", "size"...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import re import logging from flexget import plugin from flexget.event import event from flexget.components.sites.urlrewriting import UrlRewritingError from flexget.utils....
{ "content_hash": "819b5d67de0a6fdd7ea49d45229706f7", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 94, "avg_line_length": 36.14754098360656, "alnum_prop": 0.5619047619047619, "repo_name": "tobinjt/Flexget", "id": "3c08027be8d270915ee92d81f2c64f43f906fea6", "size": "2205"...
""" VCAP Services module This module initializes the database connection String from VCAP_SERVICES in Bluemix if Found """ import os import json def get_database_uri(): """ Initialized MySQL database connection This method will work in the following conditions: 1) In Bluemix with Redis bound throug...
{ "content_hash": "6ff9eb030736c36dba361910b1c0341c", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 74, "avg_line_length": 30.243243243243242, "alnum_prop": 0.6291331546023236, "repo_name": "nyu-devops-echo/shopcarts", "id": "8a1a063e408efa6468517c21836a3d4dd0cc86d7", "si...
from __future__ import absolute_import, division, print_function, with_statement import tornado.escape from tornado.escape import utf8, xhtml_escape, xhtml_unescape, url_escape, url_unescape, to_unicode, json_decode, json_encode from tornado.util import u, unicode_type, bytes_type from tornado.test.util import unittes...
{ "content_hash": "a905b206a3dec7f7b055e9572ad9bca0", "timestamp": "", "source": "github", "line_count": 214, "max_line_length": 212, "avg_line_length": 46.700934579439256, "alnum_prop": 0.5952571542925755, "repo_name": "andr-kun/ncss-murder", "id": "0370d77dada9b2dddd5ca8b1a7039de8c6117aaa", "size"...
try: from calendarserver.tools.agent import AgentRealm from calendarserver.tools.agent import InactivityDetector from twistedcaldav.test.util import TestCase from twisted.internet.task import Clock from twisted.web.resource import IResource from twisted.web.resource import ForbiddenResource exc...
{ "content_hash": "d9d6573382ed863fb3e28d7322e304c6", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 71, "avg_line_length": 29.50980392156863, "alnum_prop": 0.5993355481727575, "repo_name": "macosforge/ccs-calendarserver", "id": "69d82427e61c906f2f3e315c00ff50f4cd5c87f7", ...
import base64 import logging import netaddr from ryu.ofproto import ether from ryu.ofproto import inet from ryu.ofproto import ofproto_v1_3 from ryu.ofproto import ofproto_v1_3_parser from ryu.lib import hub LOG = logging.getLogger('ryu.lib.ofctl_v1_3') DEFAULT_TIMEOUT = 1.0 def str_to_int(src): if isinstance...
{ "content_hash": "f8a134aa6bc8c285a8677ee19cce9226", "timestamp": "", "source": "github", "line_count": 1094, "max_line_length": 85, "avg_line_length": 35.40036563071298, "alnum_prop": 0.5213540590787028, "repo_name": "ttsubo/ryu", "id": "94a3a3384f53b3e25409d692d3ca41e249c6ea67", "size": "39338", ...
''' See also: ''' import re, os, time import calendar from datetime import date; from dateutil.relativedelta import * from itertools import * from wsgiref.util import shift_path_info, request_uri from dateutil.parser import parse import amara from amara.lib.iri import join from akara.services import simple_service ...
{ "content_hash": "939f923fb9d9f89ccb04e60ef40232da", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 119, "avg_line_length": 34, "alnum_prop": 0.5997179693795326, "repo_name": "uogbuji/akara", "id": "8cb965d226ab4c31f1db1764c95ab46d70ca3262", "size": "4990", "binary": f...
from django.core.urlresolvers import reverse from seahub.test_utils import BaseTestCase class ConvertCmmtDescLinkTest(BaseTestCase): def setUp(self): self.login_as(self.user) def test_can_render(self): pass # resp = self.client.get(reverse('convert_cmmt_desc_link') + '?repo_id=' + sel...
{ "content_hash": "91dae7cfbad58c5432e4ba6c839f21d9", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 125, "avg_line_length": 31.615384615384617, "alnum_prop": 0.6715328467153284, "repo_name": "saukrIppl/seahub", "id": "398eb091d4742ff10dc8aad01a03f2297cd34d17", "size": "41...
import os import random import logging class LocalFileShuffle: initialized = False @classmethod def initializeIfNeeded(cls): if cls.initialized: return localDirRoot = "/tmp/mdpark/" tries = 0 foundLocalDir = False while tries < 10: path = o...
{ "content_hash": "3b1849426ae05d621cc0b7574a1a8e6f", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 74, "avg_line_length": 26.30188679245283, "alnum_prop": 0.5946915351506457, "repo_name": "zzl0/mdpark", "id": "bc343f70f86ed73da8065cde3f49982449eb0c73", "size": "1411", ...
from django.test import TestCase, Client from django.core.urlresolvers import reverse from django.utils import timezone from geoposition import Geoposition from seshdash.data.db.influx import Influx from seshdash.models import Sesh_Site, Sesh_User class DataAnalysisTestCase(TestCase): """ Testing the functio...
{ "content_hash": "77ba60d96daf62ee93d64d7e1c12e4ee", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 99, "avg_line_length": 36.542857142857144, "alnum_prop": 0.49452697419859265, "repo_name": "GreatLakesEnergy/sesh-dash-beta", "id": "b6ef2cbfc58466c1360bc3d9a19ec8d018266e03"...
"""Graphs the age of the newest index segment on a nutch instance. Needs statistics.jsp installed on the nutch server.""" # Created 2009 by Olaf Wozniak for Hudora import sys import httplib2 import re import datetime if len(sys.argv) == 2 and sys.argv[1] == "config": print """graph_title Last Modified graph_vla...
{ "content_hash": "d0f13d9b958583c54c1f9d1b433a9205", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 108, "avg_line_length": 31.28125, "alnum_prop": 0.6703296703296703, "repo_name": "mdornseif/hd-munin-plugins", "id": "f859578922624434f1ca42e8ed901484d916346e", "size": "10...
''' This script defines colors and rcParams for matplotlib.pyplot . It is imported by the figure generation scripts to set the general style of the plots. ''' import matplotlib.pyplot as plt # define some gray levels black = (0.0,0.0,0.0) darkgray = (0.25, 0.25, 0.25) midgray = (0.5, 0.5, 0.5) lightgra...
{ "content_hash": "c227b0ac44001c703e042a3f90fa866c", "timestamp": "", "source": "github", "line_count": 189, "max_line_length": 101, "avg_line_length": 34.03703703703704, "alnum_prop": 0.5625680087051143, "repo_name": "INM-6/Python-Module-of-the-Week", "id": "c56d6077c9dbb46567c7d6a1cc2948b0d5e31f45"...
import json import cli (options, args) = cli.getOptions() hadcrut4 = open(options.source, "r") output = {} output['name'] = options.name hadcrutData = [] output['data'] = hadcrutData for line in hadcrut4.readlines(): currentMonth = {} data = line.split() yearMonth = data[0].split('/') year = int(yearM...
{ "content_hash": "e075b152ac8547a5082bff96dd270bcd", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 59, "avg_line_length": 32.6, "alnum_prop": 0.6809815950920245, "repo_name": "Penson122/Third-Year-Project", "id": "9eb0e35d7d70ecacc7b3140d368dffe9e248601b", "size": "1304"...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import unittest from pants.build_graph.address import Address from pants.engine.exp.objects import ValidationError from pants.engine.exp.struct import Struct class ...
{ "content_hash": "ef36b28269ee1ca12739328934201e42", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 93, "avg_line_length": 39.322916666666664, "alnum_prop": 0.5035761589403973, "repo_name": "dturner-tw/pants", "id": "53dcfdae02dfccca224649c5afdf48394593671d", "size": "392...
import mock from heat.common import template_format from heat.engine.clients.os import senlin from heat.engine.resources.openstack.senlin import profile as sp from heat.engine import scheduler from heat.tests import common from heat.tests import utils profile_stack_template = """ heat_template_version: 2016-04-08 de...
{ "content_hash": "e8b9f49e47995232311090f23d0ffd07", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 77, "avg_line_length": 31.77227722772277, "alnum_prop": 0.6011218448114678, "repo_name": "noironetworks/heat", "id": "2a0001a9d3fffc26ac1f19894832d5b9e2d11d82", "size": "3...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('taskmanager', '0002_auto_20170704_2106'), ] operations = [ migrations.CreateModel( name='Tag', ...
{ "content_hash": "fa2a57e7de0e44ce1ecb046db7ee5786", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 157, "avg_line_length": 32.774193548387096, "alnum_prop": 0.5492125984251969, "repo_name": "caithess/taskbuster", "id": "7f0d353c40f720c855b49d75cf31249b90b79e8e", "size": ...
from openerp import SUPERUSER_ID from openerp.osv import osv class mail_thread(osv.AbstractModel): """ Update of mail_mail class, to add the signin URL to notifications. """ _inherit = 'mail.thread' def _get_inbox_action_xml_id(self, cr, uid, context=None): """ For a given message, return an acti...
{ "content_hash": "65614716bc641fb3d86c2f7aa21d1bb2", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 94, "avg_line_length": 46.09090909090909, "alnum_prop": 0.6380670611439843, "repo_name": "cristianquaglio/odoo", "id": "44bc4d0bde8875889c59ad63d1f226b4828cb408", "size": "...
"""Utility methods for working with WSGI servers.""" import copy import os import socket import eventlet import eventlet.wsgi import greenlet from paste import deploy import routes.middleware import webob.dec import webob.exc from oslo_log import log as logging from oslo_service._i18n import _ from oslo_service impo...
{ "content_hash": "1677d72cb66af528bf04810e0ce4da00", "timestamp": "", "source": "github", "line_count": 337, "max_line_length": 79, "avg_line_length": 34.795252225519285, "alnum_prop": 0.5937233498209108, "repo_name": "openstack/oslo.service", "id": "8b518bd295f61528092413eb2b1a1767d4de6491", "size...
import sys from PIL import Image import os try: impath = sys.argv[1] size_x = int(sys.argv[2]) size_y = int(sys.argv[3]) except Exception as e: print "Usage: purgeImageSize.py [directory] [min x size] [min y size]" imagelist = [i for i in os.listdir(impath) if (i.endswith((".jpg",".png",".JPG",".PNG"...
{ "content_hash": "d8485998cf6aba40fff876938513d4d2", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 90, "avg_line_length": 27.8, "alnum_prop": 0.5884892086330935, "repo_name": "SezLux/earthporn-wallpaper-manager", "id": "ff155be1b9d6378e7dc905e6fb92a50c2ab71022", "size": ...
"""Tests for Vanderbilt SPC binary sensor platform.""" from homeassistant.components.binary_sensor import spc async def test_setup_platform(hass): """Test autodiscovery of supported device types.""" added_entities = [] zone_defs = [{ 'id': '1', 'type': '3', 'zone_name': 'Kitchen s...
{ "content_hash": "ed1c264869dadcbcc2e5f422e6dd277f", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 69, "avg_line_length": 29.10909090909091, "alnum_prop": 0.5153029356652092, "repo_name": "persandstrom/home-assistant", "id": "ec0886aeed8307a98c93ecfdc389fe3eb58f0e4e", "s...
from typing import Union class WorksContainer: """ WorksContainer: Class for working with works results :rtype: list Usage:: from habanero import Crossref, WorksContainer cr = Crossref() res = cr.works(ids=['10.1136/jclinpath-2020-206745', '10.1136/esmoopen-2020...
{ "content_hash": "c6d32828cc0416ffbde2fef6ded09d37", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 104, "avg_line_length": 31.61627906976744, "alnum_prop": 0.47811695476278043, "repo_name": "sckott/habanero", "id": "c1e255e10c8a97bfea388813da72450e3795528b", "size": "271...
""" The MIT License (MIT) Copyright (c) 2015-present Rapptz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merg...
{ "content_hash": "775cf1dbf687fb02076f79162a0cd1c4", "timestamp": "", "source": "github", "line_count": 1644, "max_line_length": 138, "avg_line_length": 42.02068126520681, "alnum_prop": 0.6004313714136823, "repo_name": "Harmon758/discord.py", "id": "3ec0d93f2f0697674046948b21840f9f5a26aa7a", "size"...
''' Production Configurations - Use djangosecure - Use Amazon's S3 for storing static files and uploaded media - Use sendgrid to send emails - Use MEMCACHIER on Heroku ''' from __future__ import absolute_import, unicode_literals from django.utils import six from .common import * # noqa # SECRET CONFIGURATION # ---...
{ "content_hash": "ac7d80aa036a7c09ec31ab3839a4bc85", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 100, "avg_line_length": 38.3469387755102, "alnum_prop": 0.6221394358701436, "repo_name": "narayanaditya95/Robotix", "id": "69af85ae295ece9eeac00cd9036d649cc1be1749", "size"...
from __future__ import print_function import sys sys.path.insert(1,"../../../") from tests import pyunit_utils import h2o import threading from h2o.utils.typechecks import assert_is_type def h2ocluster_shutdown(): """ Python API test: h2o.cluster().shutdown(prompt=False) """ try: bthread = thre...
{ "content_hash": "ea5451cfe8fb5ef9cab5a2d34fc260a5", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 109, "avg_line_length": 30.871794871794872, "alnum_prop": 0.6694352159468439, "repo_name": "spennihana/h2o-3", "id": "65caf0b07441f74daadddbd1d4fbe9a875c28032", "size": "12...
from .base import * from .controller import *
{ "content_hash": "0649aecfc22c3329724dcd29442d3fc1", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 25, "avg_line_length": 23, "alnum_prop": 0.7391304347826086, "repo_name": "altio/foundation", "id": "a1be7bfe56aed3d3015c982e453bf68c61da8311", "size": "46", "binary": fal...
import os from generic import obj from simulation import Simulation,SimulationInput,SimulationAnalyzer from debug import * class Convert4qmcInput(SimulationInput): def __init__(self, app_name = 'convert4qmc', prefix = None, gamess_ascii ...
{ "content_hash": "57258d89705a8c94c7a24a8f5534156c", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 96, "avg_line_length": 30.130208333333332, "alnum_prop": 0.5636992221261884, "repo_name": "habanero-rice/hcpp", "id": "9fa70383793698fc833064baf04a8f97af58cca2", "size": "...
import errno import os import re import sys from collections import defaultdict from pathlib import Path import click import yaml from packaging.version import Version from setuptools.config import read_configuration START_MARKER = '# BEGIN GENERATED REQUIREMENTS' END_MARKER = '# END GENERATED REQUIREMENTS' def _f...
{ "content_hash": "cfef611d508389e0516ca14da992f2d3", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 118, "avg_line_length": 28.95959595959596, "alnum_prop": 0.5866759679107081, "repo_name": "ThiefMaster/indico-plugins", "id": "c669e74e39b1f8d30a96e4b6d60cc8eb393671cd", "s...
from pyspark.ml.util import keyword_only from pyspark.ml.wrapper import JavaEstimator, JavaModel from pyspark.ml.param.shared import * from pyspark.mllib.common import inherit_doc __all__ = ['KMeans', 'KMeansModel'] class KMeansModel(JavaModel): """ Model fitted by KMeans. """ def clusterCenters(sel...
{ "content_hash": "1a78863ee874db002d66ce1465bf9fd6", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 100, "avg_line_length": 35.922077922077925, "alnum_prop": 0.5905639913232104, "repo_name": "tophua/spark1.52", "id": "cb4c16e25a7a3100a170de3fa50ba48404c201c4", "size": "6...
def tk_processor(request): PORTAL_URL = request.scheme + '://' + request.get_host() return {'PORTAL_URL': PORTAL_URL}
{ "content_hash": "5e02626570e46b4c5c523f32bec7353e", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 60, "avg_line_length": 42, "alnum_prop": 0.6428571428571429, "repo_name": "samitnuk/talks_keeper", "id": "5432bccea882c5dbcabaab62bb5d5a19d09f0836", "size": "126", "binary...
from pytest import mark from translate.storage.placeables import base, general, parse, xliff, StringElem class TestStringElem: ORIGSTR = u'Ģët <a href="http://www.example.com" alt="Ģët &brand;!">&brandLong;</a>' def setup_method(self, method): self.elem = parse(self.ORIGSTR, general.parsers) de...
{ "content_hash": "a2ebfda22fbb114ba5457cb8493c26c8", "timestamp": "", "source": "github", "line_count": 195, "max_line_length": 132, "avg_line_length": 37.42564102564103, "alnum_prop": 0.6042751438750342, "repo_name": "rlr/fjord", "id": "ab7f9cb2c997e0e9ae8c584c18381d9c64558ac8", "size": "8097", ...
from temboo.core.choreography import Choreography from temboo.core.choreography import InputSet from temboo.core.choreography import ResultSet from temboo.core.choreography import ChoreographyExecution import json class ListApplications(Choreography): def __init__(self, temboo_session): """ Creat...
{ "content_hash": "9bb4dbbb420c5e051e1a6ac693711e0c", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 176, "avg_line_length": 43.80246913580247, "alnum_prop": 0.6964487034949267, "repo_name": "jordanemedlock/psychtruths", "id": "5a63e46d8172e5f9743d34230dee09e4f7c86518", "s...
import sys from oslo.config import cfg from neutron.agent import securitygroups_rpc as sg_rpc from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api from neutron.api.v2 import attributes from neutron.common import constants as q_const from neutron.com...
{ "content_hash": "bafaa9e6a1b51479562a545ba2ebb4ba", "timestamp": "", "source": "github", "line_count": 619, "max_line_length": 79, "avg_line_length": 47.135702746365105, "alnum_prop": 0.5653425643486307, "repo_name": "oeeagle/quantum", "id": "450ce3dd241230bd2806a7b65c74fc4a754447ea", "size": "301...
ENTRY_ID_PREFIX = 'sss_' # The below asset type specific strings are appended to the standard # ENTRY_ID_PREFIX when generating Sisense Entry IDs. ENTRY_ID_PART_DASHBOARD = 'db_' ENTRY_ID_PART_FOLDER = 'fd_' ENTRY_ID_PART_WIDGET = 'wg_' # Name of the column used to store fields metadata in Data Catalog entries. ENTRY_...
{ "content_hash": "7b8ad12acf05f06b72de48e9b5586586", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 78, "avg_line_length": 43.142857142857146, "alnum_prop": 0.7731788079470199, "repo_name": "GoogleCloudPlatform/datacatalog-connectors-bi", "id": "01a9639de487d3c715e3c1d29a7d...
""" .. module:: Leader Leader ************* :Description: Leader Algorithm Clustering :Authors: bejar :Version: :Created on: 07/07/2014 8:29 """ __author__ = 'bejar' import numpy as np from sklearn.base import BaseEstimator, ClusterMixin, TransformerMixin from sklearn.metrics.pairwise import euclid...
{ "content_hash": "4698739399a008a9e5cf1f1f15a814a2", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 95, "avg_line_length": 25.417910447761194, "alnum_prop": 0.5504991192014093, "repo_name": "bejar/kemlglearn", "id": "149d69e54a8da7297b52cd9950cd9fd875b88a98", "size": "34...
"""Descriptors essentially contain exactly the information found in a .proto file, in types that make this information accessible in Python. """ __author__ = '[email protected] (Will Robinson)' import threading import warnings import six from google.protobuf.internal import api_implementation _USE_C_DESCRIPTORS =...
{ "content_hash": "2b0503aaae1409377a04d92596aac769", "timestamp": "", "source": "github", "line_count": 1112, "max_line_length": 107, "avg_line_length": 38.40467625899281, "alnum_prop": 0.6758066782185173, "repo_name": "scheib/chromium", "id": "7583ea39f7a2ee5cd2f6e2f763a9d8c7c610b1db", "size": "44...
from django.conf.urls import url from django.contrib import admin from .views import ( post_list, post_create, post_detail, post_update, post_delete, ) urlpatterns = [ url(r'^$', post_list, name='list'), url(r'^create/$', post_create, name='create'), url(r'^(?P<slug>[\w-]+)/$', post_detail, name='detai...
{ "content_hash": "362d5911ca2a66c772993c0a879f39cd", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 67, "avg_line_length": 27.157894736842106, "alnum_prop": 0.6007751937984496, "repo_name": "DJMedhaug/BizSprint", "id": "9c2474bd6f3f265224bea00427aa147828f5c87c", "size": "...
import sys import pytest from pathlib import Path from unittest import mock from growler.middleware.renderer import StringRenderer from growler.http.response import HTTPResponse @pytest.fixture def res(): return mock.create_autospec(HTTPResponse) @pytest.fixture def ren(res): return StringRenderer() @pytes...
{ "content_hash": "90a96945d0bfe7ead25dafc62c786739", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 54, "avg_line_length": 20.558139534883722, "alnum_prop": 0.6934389140271493, "repo_name": "pyGrowler/Growler", "id": "a9f7fba18169b4c3d0b8225e4705123b86c46519", "size": "10...
import os from bruker2nifti._utils import bruker_read_files from bruker2nifti._getters import get_list_scans, get_subject_name from bruker2nifti._cores import scan2struct, write_struct class Bruker2Nifti(object): """ Facade to collect users preferences on the conversion and accessing the core methods for the...
{ "content_hash": "07a01c5016e4d07f6ad0d5ad629280ea", "timestamp": "", "source": "github", "line_count": 218, "max_line_length": 119, "avg_line_length": 42.51376146788991, "alnum_prop": 0.6159905049633146, "repo_name": "SebastianoF/bruker2nifti", "id": "d529ac216fa3f64c8b62b54f70eafe3c8cc2e729", "si...
from setuptools import setup import twitter_utils setup(name='twitter_utils', version=twitter_utils.version, description='Series of utility functions for twitter', url='http://github.com/geosoco/twitter_utils', author='John Robinson', author_email='[email protected]', license='BSD...
{ "content_hash": "870b6b65582c72d54edb44c18c5f2208", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 60, "avg_line_length": 31.941176470588236, "alnum_prop": 0.6353591160220995, "repo_name": "emCOMP/twitter_utils", "id": "1df255b70fdbc9d1b78546d9fe85cfb9aa3ca04c", "size": ...
import web from anvillib.avatar import avatar, logo import common from hashlib import sha256 import user class ProjectError(Exception): def __init__(self, value): self.parameter = value def __str__(self): return repr(self.parameter) def count_proj(): counts = common.db.query("SELECT COUNT...
{ "content_hash": "ed06f87e91a3b3fff49e282810455f49", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 92, "avg_line_length": 31.557894736842105, "alnum_prop": 0.5583722481654436, "repo_name": "Etenil/anvil", "id": "36d84c8b18e7152f2b61ae7c46302786c06ad1dc", "size": "2998", ...
""" Grammar and AST for query expressions. """ from __future__ import unicode_literals import re import pypeg2 from pypeg2 import Keyword, Symbol, attr, blank import sqlalchemy # Regex for value strings in clauses. value_regex = re.compile(r'[^()\s]+') # Check symbols for not being a keyword. Symbol.check_keywo...
{ "content_hash": "b7f66f2f7684b357fc6ae449c1e5b78b", "timestamp": "", "source": "github", "line_count": 546, "max_line_length": 78, "avg_line_length": 24.675824175824175, "alnum_prop": 0.6020188525198545, "repo_name": "varda/varda", "id": "d90aa6077c71f229ac98d0fc19f12b949d39648e", "size": "13473",...