text
stringlengths
4
1.02M
meta
dict
from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String, Boolean, create_engine from sqlalchemy.orm import sessionmaker Base = declarative_base() class Factoid(Base): __tablename__ = 'factoids' id = Column(Integer, primary_key=True) keyword = Column(...
{ "content_hash": "22896315a1216a0a772fe42360958ae9", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 107, "avg_line_length": 31.145833333333332, "alnum_prop": 0.5806020066889632, "repo_name": "EntityReborn/SocBot", "id": "a72cbbe87046b09f3ddd0a363f2ee3a4dc12197f", "size": ...
import project_procurement import project_mrp # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
{ "content_hash": "2176a83213bf847c2cec4472e62c5b66", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 65, "avg_line_length": 28.25, "alnum_prop": 0.831858407079646, "repo_name": "chjw8016/GreenOdoo7-haibao", "id": "df4f0fa8a52af54f821964d3d80baff39993cbc5", "size": "1092", ...
import operator from sys import version_info from unittest import TestCase from xml.etree import ElementTree from genologics.entities import StepActions, Researcher, Artifact, \ Step, StepPlacements, StepPools, Container, Stage, ReagentKit, ReagentLot, Sample, Project from genologics.lims import Lims if version_i...
{ "content_hash": "d67e2938772caf4fc7825d5f149b4ae3", "timestamp": "", "source": "github", "line_count": 386, "max_line_length": 198, "avg_line_length": 44.91968911917098, "alnum_prop": 0.6330814925889613, "repo_name": "SciLifeLab/genologics", "id": "103abb40b0a02d11e391b4526af622df7f5ac1fe", "size"...
from ....testing import assert_equal from ..minc import Extract def test_Extract_inputs(): input_map = dict(args=dict(argstr='%s', ), count=dict(argstr='-count %s', sep=',', ), environ=dict(nohash=True, usedefault=True, ), flip_any_direction=dict(argstr='-any_direction', xor=(u...
{ "content_hash": "2835c494d455d9753e3cf66343c49dfc", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 170, "avg_line_length": 38.109375, "alnum_prop": 0.6252562525625256, "repo_name": "carolFrohlich/nipype", "id": "4b634a76757ddcc70103dd8e34033ec12e5ca559", "size": "4932",...
"""Internal class for endpoint discovery retry policy implementation in the Azure Cosmos database service. """ import logging from azure.cosmos.documents import _OperationType logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) log_formatter = logging.Formatter('%(levelname)s:%(message)s') log_handler ...
{ "content_hash": "f720be9adb6b2c069d79dbf4ed6a58c5", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 106, "avg_line_length": 44.3125, "alnum_prop": 0.7063469675599435, "repo_name": "Azure/azure-documentdb-python", "id": "dbc1e41f845f76353e98e39af2454e714a65d363", "size": "...
import abc import collections import imp import os from oslo_config import cfg from oslo_log import log as logging import routes import six import webob.dec import webob.exc from neutron.common import exceptions from neutron.common import repos import neutron.extensions from neutron.i18n import _LE, _LI, _LW from neu...
{ "content_hash": "f52699eded6e58b32cbb76b64cb8e3c5", "timestamp": "", "source": "github", "line_count": 666, "max_line_length": 79, "avg_line_length": 37.68318318318318, "alnum_prop": 0.5848109335777184, "repo_name": "javaos74/neutron", "id": "1246087f90d820f014ddba1c0e8e375dcfc373a4", "size": "257...
import _plotly_utils.basevalidators class RoughnessValidator(_plotly_utils.basevalidators.NumberValidator): def __init__( self, plotly_name="roughness", parent_name="isosurface.lighting", **kwargs ): super(RoughnessValidator, self).__init__( plotly_name=plotly_name, par...
{ "content_hash": "efb115823c4aa0a523dd95acde3731b6", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 82, "avg_line_length": 33.666666666666664, "alnum_prop": 0.5861386138613861, "repo_name": "plotly/plotly.py", "id": "c16be5b024d04a5d85a08532dab58eeb5efa63a0", "size": "505...
import collections import os import shutil import subprocess import tempfile import xml.sax.handler import xml.sax.saxutils import xml.sax.xmlreader def transform(source, layers): filename_layers_visible = collections.defaultdict(lambda: [False] * len(layers)) for index, layer in enumerate(layers): if...
{ "content_hash": "bd1932bd535fb0ffd7d692ce989b09b3", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 92, "avg_line_length": 33.42253521126761, "alnum_prop": 0.6451748841129372, "repo_name": "kosova-holy/Ant", "id": "5bd32abf467ace6b6f407d98349cda7db9dd8103", "size": "5369...
import netaddr import netaddr.core as netexc from oslo.config import cfg import six from webob import exc from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova import context as nova_context from nova import exception from nova.i18n import _ from nova.i18n import _LE import nova.netwo...
{ "content_hash": "bd376c1550a4da8782642a8af2a9d0cc", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 76, "avg_line_length": 36.308457711442784, "alnum_prop": 0.5976979994519046, "repo_name": "badock/nova", "id": "90d3c29b730ddfd6300251cc7361b5695d0b946a", "size": "7935", ...
"""Objects relating to sourcing secrets from AWS Secrets Manager""" from typing import Optional import boto3 from cached_property import cached_property from airflow.secrets import BaseSecretsBackend from airflow.utils.log.logging_mixin import LoggingMixin class SecretsManagerBackend(BaseSecretsBackend, LoggingMix...
{ "content_hash": "700e64f08d13c6189381daa7f60b1ee5", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 106, "avg_line_length": 37.50704225352113, "alnum_prop": 0.6370634622606083, "repo_name": "airbnb/airflow", "id": "37005e2ed0c27cb4097ad6d53c16d6c0c32a3774", "size": "6113...
import json from pulsar.apps.test import test_timeout from lux.utils import test class TestSqlite(test.AppTestCase): config_file = 'tests.auth' config_params = {'DATASTORE': 'sqlite://'} def test_backend(self): backend = self.app.auth_backend self.assertTrue(backend) self.assert...
{ "content_hash": "0e725d3dcc052da0093b4c603fc06993", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 77, "avg_line_length": 38.44642857142857, "alnum_prop": 0.5496980956804459, "repo_name": "tazo90/lux", "id": "c9a1091b4c86ced68fdea88459dc592939e27ced", "size": "4306", ...
from __future__ import annotations from dataclasses import dataclass from typing import Any from pants.bsp.spec.base import BuildTargetIdentifier # ----------------------------------------------------------------------------------------------- # Compile Request # See https://build-server-protocol.github.io/docs/spec...
{ "content_hash": "9295d6543826bea95672ced08d8edff3", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 110, "avg_line_length": 32.81481481481482, "alnum_prop": 0.5918735891647856, "repo_name": "benjyw/pants", "id": "7c080f24eb20231ba5056d595ad7fe81843f579b", "size": "4561",...
from django.test import TestCase from mtr.sync.lib.helpers import column_name, column_index, \ model_attributes, process_attribute, cell_value from mtr.sync.tests import SyncTestMixin from mtr.sync.lib.processors import csv from ...models import Person, Office, Tag class HelpersTest(SyncTestMixin, TestCase): ...
{ "content_hash": "16383c8e1c542b10d21c92c5e45228ed", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 74, "avg_line_length": 35.74626865671642, "alnum_prop": 0.5620041753653444, "repo_name": "mtrgroup/django-mtr-sync", "id": "f1bb941162d89b68bc3886bd811d3f228918b077", "size...
from csc.nl.euro import StemmedEuroNL def NL(): return StemmedEuroNL('hu')
{ "content_hash": "ea82877fef2cca792252d29a379bfd84", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 37, "avg_line_length": 20, "alnum_prop": 0.725, "repo_name": "pbarton666/buzz_bot", "id": "39784ace7eedad0c2ba8151b1b12257bdc2a921b", "size": "80", "binary": false, "cop...
""" Build a combined news file from news fragments. """ from __future__ import absolute_import, division, print_function import os import click import sys from datetime import date from ._settings import load_config_from_options, ConfigError from ._builder import find_fragments, split_fragments, render_fragments fr...
{ "content_hash": "d1cb1ac8ad3584b95b54f70762a07ec9", "timestamp": "", "source": "github", "line_count": 195, "max_line_length": 91, "avg_line_length": 27.984615384615385, "alnum_prop": 0.5924500641378047, "repo_name": "hawkowl/towncrier", "id": "2f02eec222dcae52d7c4212f301cdb1f043e5e23", "size": "5...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.db import IntegrityError, models, transaction from sentry.utils.query import RangeQuerySetWrapperWithProgressBar class Migration(DataMigration): # Flag to indicate if this migration is too ri...
{ "content_hash": "af6c4d05bf78f220d5e8509fa4472f7f", "timestamp": "", "source": "github", "line_count": 1055, "max_line_length": 233, "avg_line_length": 90.6388625592417, "alnum_prop": 0.5784531080063582, "repo_name": "looker/sentry", "id": "a469cb2d5f490886f12242ddb233b699c795c468", "size": "95648...
import logging from mmcv.utils import get_logger def get_root_logger(log_file=None, log_level=logging.INFO): return get_logger("teter", log_file, log_level)
{ "content_hash": "606cdba13ab63ea71a37461b632796a0", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 59, "avg_line_length": 27.166666666666668, "alnum_prop": 0.7484662576687117, "repo_name": "SysCV/tet", "id": "cd9407ca8414bc9c5b2c3a0de6d3609f36098989", "size": "163", "bi...
raise NotImplementedError("urllib2 is not yet implemented in Skulpt")
{ "content_hash": "32e11439855e14375339fb5a4117abce", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 69, "avg_line_length": 70, "alnum_prop": 0.8285714285714286, "repo_name": "ArcherSys/ArcherSys", "id": "b066b301407b362d39723225eeb4658ca150f3f1", "size": "70", "binary": ...
import pkg_resources from nova.api.openstack.compute import extensions as computeextensions from nova.api.openstack import extensions from nova.openstack.common.plugin import plugin from nova import test class StubController(object): def i_am_the_stub(self): pass class StubControllerExtension(extensio...
{ "content_hash": "401c92522e1893f1665281a73915e4e1", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 78, "avg_line_length": 29.541666666666668, "alnum_prop": 0.6389280677009873, "repo_name": "maheshp/novatest", "id": "3aac638c685c08356c2159459ad580599874c7a5", "size": "276...
__all__ = ['entropy_vn', 'entropy_linear', 'entropy_mutual', 'negativity', 'concurrence', 'entropy_conditional', 'entangling_power', 'entropy_relative'] from numpy import conj, e, inf, imag, inner, real, sort, sqrt from numpy.lib.scimath import log, log2 from qutip.qobj import ptrace from qutip.s...
{ "content_hash": "3c20bf54fcedcb1f8a8d73047d018a13", "timestamp": "", "source": "github", "line_count": 378, "max_line_length": 79, "avg_line_length": 28.132275132275133, "alnum_prop": 0.596482979123566, "repo_name": "qutip/qutip", "id": "2bf068db67e059bf670f35ebaee19bf865737cd9", "size": "10634", ...
from datetime import datetime from time import sleep from django.test import TestCase from django.http import Http404 from django.db import models from documents.models import Document, DocumentPartF, DocumentPartB from documents.retrospection import now, set_now from documents.fields import DocumentForeignKey # mo...
{ "content_hash": "466ee79d2695a1983cd9bd0843d3b1ae", "timestamp": "", "source": "github", "line_count": 1045, "max_line_length": 79, "avg_line_length": 29.921531100478468, "alnum_prop": 0.6117436356658564, "repo_name": "chtd/doc-versions", "id": "db909962e896553407177efb6516ae9f1b4fa335", "size": "...
class UrlNotAvailable(Exception): pass class CommandFailed(Exception): pass
{ "content_hash": "a13913e440417657e3f7dbc128549758", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 33, "avg_line_length": 14.333333333333334, "alnum_prop": 0.7441860465116279, "repo_name": "nebril/fuel-web", "id": "186bb0331433268a8c1b0582033ab287c234b4c0", "size": "697",...
"""Upgrader for Python scripts according to an API change specification.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import ast import collections import os import re import shutil import sys import tempfile import traceback import pasta import six ...
{ "content_hash": "1b5d6d0fe21f08029e1358a2619e9d9b", "timestamp": "", "source": "github", "line_count": 1099, "max_line_length": 80, "avg_line_length": 36.101000909918106, "alnum_prop": 0.6327410207939509, "repo_name": "renyi533/tensorflow", "id": "fa1e8def53dce52a7ea43c008d5cb8620152632f", "size":...
"""Test imageactions.py for vimiv's test suite.""" import os import shutil import time from unittest import TestCase, main import vimiv.imageactions as imageactions from gi import require_version require_version('GdkPixbuf', '2.0') from gi.repository import GdkPixbuf from vimiv_testcase import compare_files class ...
{ "content_hash": "a7cad6625f5723b5f3ad52a457e97cae", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 74, "avg_line_length": 37.35294117647059, "alnum_prop": 0.6377952755905512, "repo_name": "karlch/vimiv", "id": "e6fc3388a6e354104a0bbcb1f85e2dd972b6addb", "size": "3860", ...
''' Dynamically generating the 4th movement of Ruth Crawford Seeger's String Quartet 1931 ''' from music21 import converter from music21 import meter from music21 import note from music21 import stream import copy def lowerLines(): restLengths = [0, 16, 12, 11, 10, 7, 6, 7, 6, 5, 4, 3, 8, 10, 12,...
{ "content_hash": "b18e6f7375012f67e1fc279b4e514fbe", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 103, "avg_line_length": 43.02325581395349, "alnum_prop": 0.55, "repo_name": "arnavd96/Cinemiezer", "id": "cc25f0a0e286aec11defa9da89d248bc929ea0d9", "size": "3725", "bina...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: azure_rm_rediscache_facts version_added: "2.8" short_descr...
{ "content_hash": "41ae6ffd4794132fbe09fff2860d2642", "timestamp": "", "source": "github", "line_count": 328, "max_line_length": 150, "avg_line_length": 30.823170731707318, "alnum_prop": 0.5539070227497527, "repo_name": "SergeyCherepanov/ansible", "id": "0c5c32447c4ce643840d3048502ecfb9f8b696f3", "s...
"""Module to access site configuration in siteconfig.ini.""" from ConfigParser import ConfigParser from flask import g FILENAME = '/srv/oclubs/siteconfig.ini' def _done(commit=True): if g.get('siteconfigParser', None): if commit: if g.get('siteconfigHasWrites', False): with...
{ "content_hash": "3408c472b5c85e6b6e7125585ff81f65", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 71, "avg_line_length": 26.192307692307693, "alnum_prop": 0.6696035242290749, "repo_name": "SHSIDers/oclubs", "id": "ef3bd2fa1f49bc8b19fb926c981691c79c55a3b3", "size": "1411...
import unittest import math # Given two squares on a two-dimensional plane, find a line that would cut # these two squares in half. Assume that the top and the bottom sides of # the square run parallel to the x-axis. class Point(object): def __init__(self, x, y): self.x = x self.y = y def __eq__(self, p): if...
{ "content_hash": "541995f0a663ca5ba7ccddb91763d19d", "timestamp": "", "source": "github", "line_count": 258, "max_line_length": 336, "avg_line_length": 30.228682170542637, "alnum_prop": 0.6617515066034106, "repo_name": "honghaoz/CrackingTheCodingInterview", "id": "f6825e0f0d34e2e20f533ddf3d95f2617ad0...
import zmq import json import random import time import sys import datetime #client side def push_messages(workernum): """ generates rngs and pushes """ context = zmq.Context() socket = context.socket(zmq.PUB) name = "worker%i" % workernum print "Starting %s." % name socket.setsockopt(zmq...
{ "content_hash": "18fba43324daaed85a64ab76706674c1", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 72, "avg_line_length": 27.7027027027027, "alnum_prop": 0.5785365853658536, "repo_name": "bjorskog/majordomo", "id": "8d415389513f8953081954ee0198bf25d516edf5", "size": "107...
"""Auto-generated file, do not edit by hand. TC metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_TC = PhoneMetadata(id='TC', country_code=1, international_prefix='011', general_desc=PhoneNumberDesc(national_number_pattern='[5689]\\d{9}', possible_number_pattern='\...
{ "content_hash": "555408e19fb5390c491d262d70b540b8", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 181, "avg_line_length": 96.68181818181819, "alnum_prop": 0.7169722614010343, "repo_name": "ayushgoel/FixGoogleContacts", "id": "8c8ec06d469ed9809ad917dbf429124c9612e345", "...
from django.db import models from django_yubin import constants try: from django.utils.timezone import now except ImportError: import datetime now = datetime.datetime.now class QueueMethods(object): """ A mixin which provides extra methods to a QuerySet/Manager subclass. """ def exclude...
{ "content_hash": "8b23543b1b4a440f2e6259198abec9e2", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 76, "avg_line_length": 27.752688172043012, "alnum_prop": 0.6392870980240217, "repo_name": "sergei-maertens/django-yubin", "id": "abd38f307aa36997cfd1aace3ab69101e41e02a5", ...
import unittest import os import sys import shlex, subprocess import urllib, commands, time, getpass, re, json, shlex import oeqa.utils.ftools as ftools from oeqa.selftest.base import oeSelfTest from oeqa.utils.commands import runCmd sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../../.....
{ "content_hash": "37d3ed497b7f6855d0eaf0dcaee9f4a3", "timestamp": "", "source": "github", "line_count": 445, "max_line_length": 161, "avg_line_length": 41.63370786516854, "alnum_prop": 0.6594699627570573, "repo_name": "wwright2/dcim3-angstrom1", "id": "1cf28a0144960e54b17727b59a9178f810f5fe57", "si...
@register_line_magic def lifelines(line): s = ("from pandas import DataFrame, Series\n" "import lifelines\n" "from lifelines import KaplanMeierFitter, NelsonAalenFitter, AalenAdditiveFitter, CoxPHFitter" ) _ip.run_code(s) # %stats @register_line_magic def stats(line): _ip.run_code("...
{ "content_hash": "1c19321fe9a4cadcc7ba4eb37c5628ab", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 102, "avg_line_length": 25.9375, "alnum_prop": 0.6867469879518072, "repo_name": "CamDavidsonPilon/StartupFiles", "id": "d5d01593732e7b4438fe6d3fc5975f76aca280d1", "size": "...
"""Service descriptor.""" from cached_property import cached_property from docbuilder.descriptors.base import Descriptor from docbuilder.descriptors.model import Model class Service(Descriptor): """Service descriptor.""" @classmethod def collect(cls): """Collects all application services.""" from ggr...
{ "content_hash": "dd61f132ec34226bf388302e9f94af72", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 65, "avg_line_length": 23, "alnum_prop": 0.6770186335403726, "repo_name": "josthkko/ggrc-core", "id": "c7b0aaf43f354242618aa1e96458bb7253d56f05", "size": "1079", "binary"...
from django.db.models import signals DUMMY_BMP_DATA = b'BM:\x00\x00\x00\x00\x00\x00\x006\x00\x00\x00(\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x18\x00\x00\x00\x00\x00\x04\x00\x00\x00\x13\x0b\x00\x00\x13\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' def signals_switch(): pre_save = signa...
{ "content_hash": "454f139a24e3e4139317cfd0a78e6e9b", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 237, "avg_line_length": 40.85245901639344, "alnum_prop": 0.6480738362760835, "repo_name": "mattcongy/itshop", "id": "2a8a4855aafa04b0cd8d59933e221024ffadddbf", "size": "348...
import numpy as np import ray.experimental.array.remote as ra import ray BLOCK_SIZE = 10 class DistArray: def __init__(self, shape, object_refs=None): self.shape = shape self.ndim = len(shape) self.num_blocks = [ int(np.ceil(1.0 * a / BLOCK_SIZE)) for a in self.shape ]...
{ "content_hash": "5bd695384ac1c043187880ab0f8c8cdb", "timestamp": "", "source": "github", "line_count": 285, "max_line_length": 79, "avg_line_length": 37.97894736842105, "alnum_prop": 0.5619918699186992, "repo_name": "robertnishihara/ray", "id": "e2cd11a15d7f5693598b1cafe69ebbc12bce0edc", "size": "...
from django.conf.urls import url from kitsune.products import api # API urls urlpatterns = [ url(r'^$', api.ProductList.as_view(), name='product-list'), url(r'^(?P<product>[^/]+)/topic/?$', api.TopicList.as_view(), name='topic-list'), url(r'^(?P<product>[^/]+)/topic/(?P<topic>[^/]+)/?$', api.Topi...
{ "content_hash": "17ec226a449e8b19f5d177f880c328cb", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 85, "avg_line_length": 28.53846153846154, "alnum_prop": 0.5876010781671159, "repo_name": "anushbmx/kitsune", "id": "9f82c160df567c19dc388308bd4186743de187b5", "size": "371"...
from fjord.base.templatetags.jinja_helpers import locale_name, urlparams from fjord.base.tests import TestCase class TestLocaleName(TestCase): def test_english(self): data = [ (u'en-US', u'English (US)'), (u'es', u'Spanish'), (u'gd', u'Gaelic (Scotland)'), (...
{ "content_hash": "7117c54029d0f6688a034738737ccb71", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 72, "avg_line_length": 32.78125, "alnum_prop": 0.5567206863679695, "repo_name": "mozilla/fjord", "id": "cf9d6cdc701ec4c41e142982a6b18b111b92ec4c", "size": "1049", "binary...
from autobahn.twisted.wamp import ApplicationSession, ApplicationSessionFactory, ApplicationRunner from twisted.internet import reactor import multiprocessing from f1.s.core.multiprocess import Multiprocess class WampServerRunner: def __init__(self): self.url = u'ws://127.0.0.1:8080/ws' self.realm...
{ "content_hash": "907ab9f3cd931291022f635316a91982", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 98, "avg_line_length": 33.535714285714285, "alnum_prop": 0.6059637912673056, "repo_name": "filemakergarage/zeroclient", "id": "d232c4b78e7c0195cbfca94112b06bf6cbb8f5a0", "s...
from django.db import models from datetime import date class Position(models.Model): title = models.CharField(max_length=100) date = models.DateField(default=date.today()) content = models.TextField() def __unicode__(self): return self.title
{ "content_hash": "e83dfdf2d91db6a026eea1a0920e9001", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 49, "avg_line_length": 24.454545454545453, "alnum_prop": 0.6988847583643123, "repo_name": "Hackfmi/Diaphanum", "id": "a27af75af3f4825251df37a005c456209f9404e8", "size": "29...
from __future__ import annotations import pytest from poetry.core.constraints.generic import AnyConstraint from poetry.core.constraints.generic import Constraint from poetry.core.constraints.generic import MultiConstraint from poetry.core.constraints.generic import UnionConstraint from poetry.core.constraints.generic...
{ "content_hash": "65421ee227e51d153a57cc34c5e5af87", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 86, "avg_line_length": 30.508474576271187, "alnum_prop": 0.5916666666666667, "repo_name": "python-poetry/poetry-core", "id": "2707fd92f0abd83ecaf9707a54fb5463bac398da", "si...
from twisted.conch import recvline from fake_switches.terminal import TerminalController class SwitchSSHShell(recvline.HistoricRecvLine): def __init__(self, user, switch_core): self.user = user self.switch_core = switch_core self.session = None self.awaiting_keystroke = None #...
{ "content_hash": "0033d258301cfc0fb1c8f6d2270b81c9", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 94, "avg_line_length": 33.486111111111114, "alnum_prop": 0.6433015346329324, "repo_name": "stephanerobert/fake-switches", "id": "71c75351354e79a93298725a4d83280191dbfd39", ...
from setuptools import setup, find_packages import os try: from setuptest import test except ImportError: from setuptools.command.test import test version = __import__('filer').__version__ def read(fname): # read the contents of a text file return open(os.path.join(os.path.dirname(__file__), fname))....
{ "content_hash": "e60797a2f5bdc3fe13964020bf52203e", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 111, "avg_line_length": 30.897959183673468, "alnum_prop": 0.6221928665785997, "repo_name": "neoascetic/django-filer", "id": "324851ba97b643c196f57d04074da51c9d5971ba", "siz...
import re import sys from datetime import datetime from subprocess import check_output import httpx import semantic_version from packaging.version import parse __all__ = [ "is_major_update", "is_minor_update", "is_patch_update", "sorted_versions", "get_categorized_package_data", "get_parsed_en...
{ "content_hash": "b8fca7860c21f2f56481a0fde4a2cb86", "timestamp": "", "source": "github", "line_count": 287, "max_line_length": 120, "avg_line_length": 31.045296167247386, "alnum_prop": 0.6016835016835017, "repo_name": "nezhar/updatable", "id": "2f91e02b5218135bf9fbdd31c79fa2f8d17ab239", "size": "8...
from __future__ import unicode_literals from django.db import migrations def set_original_fk(apps, schema_editor): Document = apps.get_model("document", "Document") Attachment = apps.get_model("foirequest", "FoiAttachment") for att in Attachment.objects.filter(document__isnull=False): Document.o...
{ "content_hash": "8340a68f64dad745e41ba610fe0222bd", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 78, "avg_line_length": 27.217391304347824, "alnum_prop": 0.6853035143769968, "repo_name": "fin/froide", "id": "be18f17a3139c2a82b112cbec9a71a139208d7b8", "size": "700", "...
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from urllib.parse import parse_qs, urljoin, urlparse from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, map_error, ) from azur...
{ "content_hash": "077133973998d17977783d9968cc0f29", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 122, "avg_line_length": 44.83892617449664, "alnum_prop": 0.6591827570722946, "repo_name": "Azure/azure-sdk-for-python", "id": "1cd2a71810c11fd5b7fe0308ebd9c2c4605fc419", "...
"""Functional tests for aggregate operations.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import copy import numpy as np from tensorflow.python.eager import context from tensorflow.python.framework import constant_op from tensorflow.python.framewor...
{ "content_hash": "d6295beaba4ab7f136e6ce3e5ce6b2c3", "timestamp": "", "source": "github", "line_count": 449, "max_line_length": 118, "avg_line_length": 44.69487750556793, "alnum_prop": 0.6072353996412199, "repo_name": "alsrgv/tensorflow", "id": "3ddf9852ba8945f2fc299c034d56d409573735bf", "size": "2...
import numpy as np from cs231n.layers import * from cs231n.rnn_layers import * class CaptioningRNN(object): """ A CaptioningRNN produces captions from image features using a recurrent neural network. The RNN receives input vectors of size D, has a vocab size of V, works on sequences of length T, has an RN...
{ "content_hash": "63c6e83160b0f018d2992140611ebc33", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 80, "avg_line_length": 47.35245901639344, "alnum_prop": 0.5738272459754198, "repo_name": "zauonlok/cs231n", "id": "703ba507702e3a770330efb3579fda14644cd185", "size": "1155...
import numpy from chainer import cuda from chainer import function from chainer.utils import type_check if cuda.cudnn_enabled: cudnn = cuda.cudnn libcudnn = cudnn.cudnn _mode = libcudnn.CUDNN_ACTIVATION_SIGMOID class Sigmoid(function.Function): """Logistic sigmoid function.""" def __init__(sel...
{ "content_hash": "7f8a04c68aacd48ae4407b2da8028ce0", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 79, "avg_line_length": 33.03658536585366, "alnum_prop": 0.5485418973791066, "repo_name": "muupan/chainer", "id": "21824f3309e1110f27bbcbe05e9fc68647610110", "size": "2709",...
from ._IntegerNative import IntegerNative from Cryptodome.Util.number import long_to_bytes, bytes_to_long from Cryptodome.Util._raw_api import (load_pycryptodome_raw_lib, create_string_buffer, get_raw_buffer, backend, ...
{ "content_hash": "7f4c88bc8cf9bb4662987c3f1dc444b1", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 78, "avg_line_length": 30.876543209876544, "alnum_prop": 0.5493802479008396, "repo_name": "kawamon/hue", "id": "b626014dbe57d5846d868465eed582fb1d9ced6f", "size": "4016", ...
from __future__ import unicode_literals from django.apps import apps from django.core import checks from django.core.checks.registry import registry from django.core.management.base import BaseCommand, CommandError class Command(BaseCommand): help = "Checks the entire Django project for potential problems." ...
{ "content_hash": "1cd68fc03dd084e2aa50036f7498a739", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 91, "avg_line_length": 39.30555555555556, "alnum_prop": 0.6480565371024735, "repo_name": "dhoffman34/django", "id": "be9b49d54a83e4265656dfe98d7f045e6f3e7bd5", "size": "143...
import time import glob import os import platform import webbrowser import pygame import re import json import subprocess import urllib2 if platform.system() == "Windows": import pygameWindowInfo from pygame.locals import * from pygame_helpers import * from collections import defaultdict import string class ItemInfo...
{ "content_hash": "5d6ce4da31b88b23971e7623542534ca", "timestamp": "", "source": "github", "line_count": 708, "max_line_length": 172, "avg_line_length": 41.820621468926554, "alnum_prop": 0.5950893309466716, "repo_name": "Brett824/RebirthItemTracker", "id": "917a57aa8fe3a591f58c57f34b37836d0ad06b56", ...
import setuptools setuptools.setup( setup_requires=['pbr'], pbr=True)
{ "content_hash": "f5a10bb57283eb248cbf83d66a27aa7d", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 27, "avg_line_length": 20.5, "alnum_prop": 0.6585365853658537, "repo_name": "mr-uuid/snippets", "id": "734058dc029609783fdcbfad25bce7f077b16382", "size": "82", "binary": f...
import os import json import time import socket from importlib import import_module import jujuresources from path import Path from jujubigdata import utils import requests from urllib.parse import urljoin from subprocess import call from charmhelpers.core import unitdata, hookenv, host from charmhelpers import fetch...
{ "content_hash": "a101cc148da14681802acb4547c94e5d", "timestamp": "", "source": "github", "line_count": 319, "max_line_length": 111, "avg_line_length": 41.57680250783699, "alnum_prop": 0.6058961019377215, "repo_name": "juju-solutions/layer-apache-zeppelin", "id": "c79e3942fa56c61fec363953a8706bbc1f21...
"""Tests for google.protobuf.internal.service_reflection.""" __author__ = 'petar@google.com (Petar Petrov)' from google.apputils import basetest from google.protobuf import unittest_pb2 from google.protobuf import service_reflection from google.protobuf import service class FooUnitTest(basetest.TestCase): def te...
{ "content_hash": "a0d7abd23135f54343dfb1e7dabc5357", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 80, "avg_line_length": 33.74038461538461, "alnum_prop": 0.6907950983186093, "repo_name": "meghana0507/grpc-java-poll", "id": "d066ae707bb7c53410c48aa0b919941461b8a47c", "s...
"""This code example updates contact addresses. To determine which contacts exist, run get_all_contacts.py. The LoadFromStorage method is pulling credentials and properties from a "googleads.yaml" file. By default, it looks for this file in your home directory. For more information, see the "Caching authentication in...
{ "content_hash": "317a5a345ac56065dce19b6e30edf04b", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 77, "avg_line_length": 30.3015873015873, "alnum_prop": 0.676794133053955, "repo_name": "dietrichc/streamline-ppc-reports", "id": "1aa2b6a97972ab1c1172f9caa2dabdecf31d4403", ...
from wtforms import TextField, SelectMultipleField, SelectField from wtforms.validators import DataRequired, NumberRange, Email from ..datacenter import DatacenterCheckForm class CheckForm(DatacenterCheckForm): ''' Monitor form for cloudflare traffic increase monitoring ''' title = "CloudFlare: Increase in Tr...
{ "content_hash": "13fe815ad71fc52d6421812834f4fac1", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 365, "avg_line_length": 42.32203389830509, "alnum_prop": 0.672006407689227, "repo_name": "Runbook/runbook", "id": "fd773006987149c9b0041db28e701c21bb48ca61", "size": "2791"...
""" This module contains a helper function to fill erfa.astrom struct and a ScienceState, which allows to speed up coordinate transformations at the expense of accuracy. """ import warnings import erfa import numpy as np import astropy.units as u from astropy.time import Time from astropy.utils.exceptions import Astr...
{ "content_hash": "b0d4c78c714659388172b32cc667ae66", "timestamp": "", "source": "github", "line_count": 394, "max_line_length": 104, "avg_line_length": 38.03045685279188, "alnum_prop": 0.6074479444741057, "repo_name": "lpsinger/astropy", "id": "df217a8f14492a78af3598eca974e13da31ca49c", "size": "15...
import unittest from cassandra import OperationTimedOut, WriteTimeout from cassandra.cluster import Cluster, ExecutionProfile, ResponseFuture, EXEC_PROFILE_DEFAULT, NoHostAvailable from cassandra.query import SimpleStatement from cassandra.policies import ConstantSpeculativeExecutionPolicy, RoundRobinPolicy, RetryPoli...
{ "content_hash": "7dd927aaf64f2bcae1dffbfe3c0fd08c", "timestamp": "", "source": "github", "line_count": 448, "max_line_length": 137, "avg_line_length": 40.44642857142857, "alnum_prop": 0.6374172185430463, "repo_name": "datastax/python-driver", "id": "6d0d081889ad50f85865a8a6d1e72b7c283b1b72", "size...
__all__ = ["ProcessResponse"]
{ "content_hash": "b61da6d6688f85614a20627de05afb39", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 29, "avg_line_length": 30, "alnum_prop": 0.6, "repo_name": "MaxMorgenstern/EmeraldAI", "id": "d4523331b3b70ba369e09661a77c2fa548a0a29e", "size": "30", "binary": false, "...
from __future__ import print_function from ast import parse import os from setuptools import setup from sys import version_info def version(): """Return version string from pattern/__init__.py.""" with open(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'pattern', ...
{ "content_hash": "ab8d8fa6231027ba6acdba35c6baa7ab", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 104, "avg_line_length": 38.90909090909091, "alnum_prop": 0.5021028037383177, "repo_name": "shubhangiKishore/pattern", "id": "5199dd2ce28c190711fb5bc16b35c9cd138ec096", "si...
""" erppeek.py -- Odoo / OpenERP client library and command line tool Author: Florent Xicluna (derived from a script by Alan Bell) """ import _ast import atexit import csv import functools import optparse import os import re import shlex import sys import time import traceback try: # Python 3 im...
{ "content_hash": "52b6e23b313e61c68d775144f0515019", "timestamp": "", "source": "github", "line_count": 1681, "max_line_length": 79, "avg_line_length": 38.55502676977989, "alnum_prop": 0.5540263226921356, "repo_name": "Endika/erppeek", "id": "05635a36f19fa157b9626f6a693eea052449fd33", "size": "6485...
from signbank.pages.models import * from django.template import loader, RequestContext from django.shortcuts import get_object_or_404, render_to_response from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotFound from django.conf import settings from django.utils.safestring import mark_safe from d...
{ "content_hash": "c0ccd8ca22529fcdbd4a93d9205d2fa8", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 111, "avg_line_length": 39.024096385542165, "alnum_prop": 0.6356900277863539, "repo_name": "Signbank/NGT-signbank", "id": "020baea60196c653a5410820442468b1d0a1e2f6", "size"...
from lean_workbench.core import db company_tags_association = db.Table('company_tags_association', db.Column('company_id', db.Integer, db.ForeignKey('crunchbase_company.id')), db.Column('tag_id', db.Integer, db.ForeignKey('tag.id')) ) class CrunchbaseCompanyModel(db.Model): __tablename__ = "crunchbase_compan...
{ "content_hash": "f760f0d97ea19f53e59226461eb41672", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 80, "avg_line_length": 30.77777777777778, "alnum_prop": 0.7129963898916968, "repo_name": "wigginslab/lean-workbench", "id": "bb7eb24061ccb79f30da57a7d36d51b3d50d1740", "siz...
"""Services for questions data model.""" import logging from core.domain import question_domain from core.platform import models import feconf (question_models,) = models.Registry.import_models([models.NAMES.question]) # This takes additional 'title' parameters. CMD_CREATE_NEW = 'create_new' def _create_question(...
{ "content_hash": "268e2c09cc5d9a009fae30cca6327477", "timestamp": "", "source": "github", "line_count": 187, "max_line_length": 79, "avg_line_length": 35.6096256684492, "alnum_prop": 0.6601591830605196, "repo_name": "terrameijar/oppia", "id": "27f0defb20e949667fffbb4e4e51e2e5c5a868ae", "size": "728...
from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('topics', '0007_auto_20160829_0859'), ] operations = [ migrations.AlterField( ...
{ "content_hash": "5df71e2ae7f725574689197a158e3881", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 110, "avg_line_length": 24.82608695652174, "alnum_prop": 0.6252189141856392, "repo_name": "emelkrml/dictionary2", "id": "e96ebee7ef98b9ced930ae59fd2907137fac1525", "size": ...
"""A module providing information about the necessity of brackets""" from __future__ import print_function, division from sympy.core.function import _coeff_isneg # Default precedence values for some basic types PRECEDENCE = { "Lambda": 1, "Xor": 10, "Or": 20, "And": 30, "Relational": 35, "Add...
{ "content_hash": "1c200af039b01cfcce8f9cb56177b160", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 79, "avg_line_length": 25.025, "alnum_prop": 0.6366966366966367, "repo_name": "lindsayad/sympy", "id": "83e503dc21026cbc61eee408c4cacf2740b3c005", "size": "3003", "binar...
"""Simple helper script to run pytype on GPU Python code.""" import os import sys # We can't depend on gpu_path_util, otherwise pytype's dependency graph ends up # finding a cycle. GPU_DIR = os.path.abspath(os.path.dirname(__file__)) CHROMIUM_SRC_DIR = os.path.realpath(os.path.join(GPU_DIR, '..', '..', '..')) sys.pa...
{ "content_hash": "dbc57de07f202344d58ebe21ad8d7b59", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 80, "avg_line_length": 29.30188679245283, "alnum_prop": 0.6297488731487444, "repo_name": "nwjs/chromium.src", "id": "86266026adc7ec73849f21dbb9db693b66b4a1c5", "size": "171...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding unique constraint on 'OrderedProduct', fields ['list', 'product'] db.create_unique(u'pro...
{ "content_hash": "66bff66aec0fa4714c623bd67f0b172e", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 233, "avg_line_length": 83.26382978723404, "alnum_prop": 0.5651862830275464, "repo_name": "marcoantoniooliveira/labweb", "id": "d1a6baf867fa2091049119f95f060135fcf36c72", ...
from setuptools import setup, find_packages long_description = "\n".join( ( open("README.rst", encoding="utf-8").read(), open("CHANGES.txt", encoding="utf-8").read(), ) ) setup( name="more.jinja2", version="0.3.dev0", description="Jinja2 template integration for Morepath", long...
{ "content_hash": "da2751f4a391748810c7fb16ef5c046a", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 73, "avg_line_length": 32.916666666666664, "alnum_prop": 0.610126582278481, "repo_name": "morepath/more.jinja2", "id": "b84502b1897955a3fc0c259f8518986cbb549f6c", "size": "...
__all__ = ['SOAPCallbackHandler', 'SOAPHandlerChainFactory'] from turboengine.errors import TException try: from ZSI.twisted import wsgi from ZSI.twisted.reverse import ReverseHandlerChain from ZSI.twisted.reverse import DataHandler except ImportError: raise TException('If you want to use webserv...
{ "content_hash": "35e150491987c1ead8c858b885c9b557", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 118, "avg_line_length": 39.27906976744186, "alnum_prop": 0.5855535820011841, "repo_name": "carlitux/turboengine", "id": "7501c77a3740d6a774b878394e845f964f0a4935", "size": ...
from django.db.models.signals import pre_delete, pre_save from django.dispatch import receiver from ampadb.support import signal_clean from .models import Profile, UnregisteredUser @receiver(pre_save, sender=Profile) def profile_pre_save(sender, **kwargs): signal_clean(sender, **kwargs) @receiver(pre_delete, se...
{ "content_hash": "45f93d6bad7c8d6faa70861d5abbe170", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 62, "avg_line_length": 30, "alnum_prop": 0.7347222222222223, "repo_name": "victorg590/ampadb", "id": "bf350a10d8b0a7d5da8f45d8b2f021a3c90077a1", "size": "754", "binary": ...
import json import os from dataset.utils import fix_needless_new_line def run(inputs: str, output: str): output_abs = os.path.abspath(output) data = [] for input_ in inputs: input_abs = os.path.abspath(input_) data += json.load(open(input_abs)) for i, data_per_paper in enumerate(data): data[i]["s...
{ "content_hash": "3ab9a13fafb8ef70ff4ab2bc16b439b8", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 66, "avg_line_length": 25.88235294117647, "alnum_prop": 0.6659090909090909, "repo_name": "n-kats/arxiv2vec", "id": "d6ea34cd16b1258010afa5cca973f8f29dda62d0", "size": "440"...
""" Blender API for querying mesh data. Animation data is also handled here since Three.js associates the animation (skeletal, morph targets) with the geometry nodes. """ import operator import re from bpy import data, types, context from . import material, texture, animation from . import object as object_ from .. im...
{ "content_hash": "e3aaf872166e704046d5be2cc9cfd4e5", "timestamp": "", "source": "github", "line_count": 1101, "max_line_length": 125, "avg_line_length": 26.24704813805631, "alnum_prop": 0.5636030175098623, "repo_name": "MasterJames/three.js", "id": "1f46962634022dc5546076d4c3d205e17b31a7f1", "size"...
import numpy as np __all__ = ["points_normals_from" ,"ply_from_array"] def points_normals_from(filename): array = np.genfromtxt(filename) return array[:,0:3], array[:,3:6] def ply_from_array(points, faces, output_file): num_points = len(points) num_triangles = len(faces) header = """ply format...
{ "content_hash": "001ba3a58fa86f733af264a14f9d29e2", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 93, "avg_line_length": 23.875, "alnum_prop": 0.5832460732984294, "repo_name": "mmolero/pypoisson", "id": "4c6ce468313613ba8a2c1fcf1284109ffad5f9dc", "size": "955", "binar...
''' baseline: after: true before: false counts: 30 detector: H1 mass: 39.59 default_fits: nominal multicollect: counts: 60 detector: H1 isotope: Ar40 peakcenter: after: false before: false detector: H1 isotope: Ar40 equilibration: inlet: R outlet: O inlet_delay: 3 eqtime: 20 use_extrac...
{ "content_hash": "ac098204df1247e8f908a61dda6cb827", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 104, "avg_line_length": 26.565891472868216, "alnum_prop": 0.648964108549752, "repo_name": "NMGRL/pychron", "id": "bea12508409bb97a0caf8e91d5f2b1515bdada66", "size": "3441"...
from ._operations import AppComponentOperations from ._operations import ServerMetricsOperations from ._operations import TestOperations from ._operations import TestRunOperations from ._patch import __all__ as _patch_all from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import from ._patch impor...
{ "content_hash": "c0c2cad87f735947edafc103fe0a8c34", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 78, "avg_line_length": 31.88235294117647, "alnum_prop": 0.7324723247232472, "repo_name": "Azure/azure-sdk-for-python", "id": "b602fd14d33620451908ff87afc39fc73d8f13a1", "si...
import base64 import hashlib import pickle import time import uuid from abc import ABCMeta, abstractmethod from collections import defaultdict _MetaDatabase = ABCMeta('_MetaDatabase', (object,), {}) class ABCDatabase(_MetaDatabase): class Conflict(Exception): """Raises in case of conflict updates""" ...
{ "content_hash": "89637f59202274f7a11db1dbf57307cd", "timestamp": "", "source": "github", "line_count": 238, "max_line_length": 81, "avg_line_length": 30.008403361344538, "alnum_prop": 0.5278633436012321, "repo_name": "kxepal/replipy", "id": "364aee2a6924ff49c6be029bb6cd99cf89b11b22", "size": "7359...
from ..libs.view_helpers import * from ..libs import log from .base_command import TypeScriptBaseTextCommand class TypescriptFormatOnKey(TypeScriptBaseTextCommand): """ Format on ";", "}", or "\n"; called by typing these keys in a ts file in the case of "\n", this is only called when no completion dialogu...
{ "content_hash": "9744e4cf2fc88f65f9d7c28cd123ae70", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 114, "avg_line_length": 39.85964912280702, "alnum_prop": 0.6126760563380281, "repo_name": "hoanhtien/TypeScript-Sublime-Plugin", "id": "9f03a76b269039955525df3d39e4bb39cbe3d...
from __future__ import print_function import imp import optparse import os import pipes ycm_module_path = os.path.normpath( os.path.join(os.path.dirname(os.path.abspath(__file__)), '../vim/chromium.ycm_extra_conf.py')) ycm_extra_conf = imp.load_source('ycm_extra_conf', ycm_module_path) def main(): usage = ...
{ "content_hash": "519142e89e157de3768006617833f873", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 68, "avg_line_length": 29.470588235294116, "alnum_prop": 0.6656686626746507, "repo_name": "ric2b/Vivaldi-browser", "id": "6912b6f3c0fc40bad80b2648c478fbd47160c37c", "size":...
""" App Engine config """ """ def gae_mini_profiler_should_profile_production(): # Uncomment the first two lines to enable GAE Mini Profiler on production for admin accounts # from google.appengine.api import users # return users.is_current_user_admin() return False def webapp_add_wsgi_middleware(app...
{ "content_hash": "ef5da14608100c66ceba3be4a92c269d", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 96, "avg_line_length": 26.352941176470587, "alnum_prop": 0.7254464285714286, "repo_name": "expl0si0nn/cf-tracker", "id": "193ebb0f68d043e54b7eb1fc01d15a64765428c0", "size":...
import warnings import numpy as np from _felzenszwalb_cy import _felzenszwalb_grey def felzenszwalb(image, scale=1, sigma=0.8, min_size=20): """Computes Felsenszwalb's efficient graph based image segmentation. Produces an oversegmentation of a multichannel (i.e. RGB) image using a fast, minimum spanning...
{ "content_hash": "3c98b9e80948982155d808b919c43a82", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 79, "avg_line_length": 39.33766233766234, "alnum_prop": 0.6599537801254539, "repo_name": "fgregg/felzenszwalb", "id": "a3a692cf6892cb72bdf1e096807dee0470c7dea4", "size": "3...
from django.conf.urls import patterns, include, url from django.views.generic import TemplateView from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), url(r'^$', TemplateView.as_view(template_name="index.html"), name='index'), (r'^a...
{ "content_hash": "6384bf23670ccd3b656a4dd2165c790d", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 79, "avg_line_length": 22.64516129032258, "alnum_prop": 0.5641025641025641, "repo_name": "arruda/sauron", "id": "efa21a74c00c8db6198fba325dea5640e08546ce", "size": "702", ...
class ModuleDocFragment(object): # Standard files documentation fragment DOCUMENTATION = """ options: mode: required: false default: null choices: [] description: - mode the file or directory should be, such as 0644 as would be fed to I(chmod). As of version 1.8, the mode may be specifi...
{ "content_hash": "a85830cbb9132a0897fd5daa53f8a22d", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 195, "avg_line_length": 29.916666666666668, "alnum_prop": 0.6456824512534819, "repo_name": "marcusramberg/dotfiles", "id": "adff1f2f1bf2a878abfebe94e736c50872b61455", "size...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' name: tower plugin_type: inventory author: - Matthew Jones (@matburt) - Yunfan Zhang (@YunfanZhang42) short_description: Ansible dynamic inventory plugin for Ansible Tower. description: - Reads inventor...
{ "content_hash": "06953d6c77a0caf89bdd7e03e7e1869a", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 117, "avg_line_length": 44.1578947368421, "alnum_prop": 0.6633558469076943, "repo_name": "GoogleCloudPlatform/sap-deployment-automation", "id": "7dc4aaa1a3fa5271dcd0d6af34df...
import logging import re from urllib.parse import parse_qsl, urlparse, urlunparse from streamlink.plugin import Plugin, PluginError from streamlink.plugin.api import useragents, validate from streamlink.plugin.api.utils import itertags, parse_query from streamlink.stream import HLSStream, HTTPStream from streamlink.st...
{ "content_hash": "6495a2cb1cb5ff1e22b007a7687178a8", "timestamp": "", "source": "github", "line_count": 352, "max_line_length": 125, "avg_line_length": 37.01420454545455, "alnum_prop": 0.5035689615473176, "repo_name": "beardypig/streamlink", "id": "ae06fe01774048b39c43ffe97456e5e3897714c1", "size":...
""" WSGI config for favor project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "favor.settings") from django.core.wsgi ...
{ "content_hash": "6f59c61ddfeb89732313573aa8d28fd2", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 27.5, "alnum_prop": 0.7714285714285715, "repo_name": "gianpaima/favorless", "id": "b970fe9eff4839c9e0747cd54efb59276154e298", "size": "385", "binar...
import wx from wx.lib.mixins.listctrl import ListCtrlAutoWidthMixin import os.path from robotide.controller.filecontrollers import (ResourceFileController, TestCaseFileController) from robotide.pluginapi import (Plugin, ActionInfo, RideOpenSuite, RideOpenResourc...
{ "content_hash": "60cce38ca1397715c4ff308a8565ab5d", "timestamp": "", "source": "github", "line_count": 392, "max_line_length": 124, "avg_line_length": 37.1530612244898, "alnum_prop": 0.6160395495742927, "repo_name": "fingeronthebutton/RIDE", "id": "69d0951d87ede07be2744cebdaee3681f4722ad8", "size"...
from .rules import Rules import json from urlparse import urlparse, parse_qs class Referrer: class Types: INDIRECT = 'indirect' DIRECT = 'direct' SEARCH = 'search' SOCIAL = 'social' EMAIL = 'email' rules = Rules() @staticmethod def parse_direct(raw_url, direct_domains, url=None)...
{ "content_hash": "9241ef5d4abe11acd0b9e24ab324232a", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 94, "avg_line_length": 28.355263157894736, "alnum_prop": 0.6176334106728538, "repo_name": "snormore/pyreferrer", "id": "24d8f314d3286ef48f132e435232f7caffaa5741", "size": ...
from django.http import HttpResponse from django.template import loader from django.http import JsonResponse from django.core import serializers from django.shortcuts import redirect from OmniDB import settings import json import sys import OmniDB_app.include.Spartacus as Spartacus import OmniDB_app.include.Spartacus...
{ "content_hash": "5519f1078cbd4872766c67cb34c170b2", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 72, "avg_line_length": 27.39156626506024, "alnum_prop": 0.6624147789751484, "repo_name": "OmniDB/OmniDB", "id": "955bb385074c8b4f8c44f0b451da23f555991a6e", "size": "4547",...
import json import math import re from decimal import Decimal from django.contrib.gis.db.models import functions from django.contrib.gis.geos import ( GEOSGeometry, LineString, Point, Polygon, fromstr, ) from django.contrib.gis.measure import Area from django.db import connection from django.db.models import Sum f...
{ "content_hash": "084fd5cc33d9149bad2663b5c06fa2ec", "timestamp": "", "source": "github", "line_count": 565, "max_line_length": 118, "avg_line_length": 48.19823008849558, "alnum_prop": 0.6243390129259695, "repo_name": "taaviteska/django", "id": "6e4a87f2126371f64e27971981ac37d91d0edf7b", "size": "2...
import sys import subprocess
{ "content_hash": "7a0239b96eefdffee281d0e88c4a988c", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 17, "avg_line_length": 14.5, "alnum_prop": 0.8620689655172413, "repo_name": "theboocock/fine_mapping_pipeline", "id": "1bf5e2847c9f59c7107b37561cf046e16573f2df", "size": "55...
""" Copyright 2012 GroupDocs. 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 agreed to in w...
{ "content_hash": "2350b45ef0cd7c151c80c1383284046c", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 77, "avg_line_length": 30.864864864864863, "alnum_prop": 0.648861646234676, "repo_name": "liosha2007/temporary-groupdocs-python3-sdk", "id": "75289f736c722d7b47edb5ccad3d840e...
import pytest from example.app.models import * # noqa from model_mommy import mommy from django.utils import timezone @pytest.mark.django_db def test_simple(es_client): now = timezone.now() test = SimpleObject.objects.create( foo=1, bar="Bar", baz="baz", published=now ) ...
{ "content_hash": "398545327f56fc4e661032e64bd630f1", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 95, "avg_line_length": 26.676258992805757, "alnum_prop": 0.5957389428263214, "repo_name": "theonion/djes", "id": "353fff3c2fb79213cb5849ff6481ba68c27e013b", "size": "3708"...
from abc import abstractmethod import numpy as np from seizures.prediction.PredictorBase import PredictorBase from sklearn.ensemble import AdaBoostClassifier from sklearn.tree import DecisionTreeClassifier class AdaBoostTrees(PredictorBase): """" AdaBoost + Decision trees. See http://scikit-learn.org/stab...
{ "content_hash": "09a09abd707e5b5d59d193694d1bea0c", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 90, "avg_line_length": 26.390625, "alnum_prop": 0.6068679692125518, "repo_name": "vincentadam87/gatsby-hackathon-seizure", "id": "0377e58e788036866b0c1acb2ea1ffbabed4101b", ...
import datetime from django.core.files.uploadedfile import SimpleUploadedFile from django.forms import * from django.http import QueryDict from django.template import Template, Context from django.utils.datastructures import MultiValueDict, MergeDict from django.utils.safestring import mark_safe from django.utils.unit...
{ "content_hash": "18a85a73bfbe37c7a93e2097114d55b3", "timestamp": "", "source": "github", "line_count": 1776, "max_line_length": 516, "avg_line_length": 60.344031531531535, "alnum_prop": 0.6224351736943763, "repo_name": "mixman/djangodev", "id": "4e9cc16f235f8a1bea38b58e21068d30e71ed755", "size": "...
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import os from io import StringIO from unittest import TestCase from po_localization.parser import Parser, ParseError, parse_po_file, parse_po_filename from po_localization.po_file import PoFile class ...
{ "content_hash": "de734354e095fc17839fb9e751c1ed33", "timestamp": "", "source": "github", "line_count": 350, "max_line_length": 87, "avg_line_length": 27.94, "alnum_prop": 0.6540546068105123, "repo_name": "kmichel/po-localization", "id": "fb57aed2dd7637abf150b857e184ef1932c66cd5", "size": "9797", ...
""" Scenariocompare: compare two scenarios, concentrating on csv files in the outputs/data subfolders """ import os import pathlib import sys import numpy as np import pandas as pd from sklearn.metrics import mean_squared_error def main(s1, s2): print(f"FILE, FIELD, RMSE, ERROR") after_root = pathlib.Path(s...
{ "content_hash": "1dbf3e5ba778a06672115545849e8251", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 111, "avg_line_length": 33.94117647058823, "alnum_prop": 0.5680242634315424, "repo_name": "architecture-building-systems/CEAforArcGIS", "id": "06dca4dfc7356cf767f544158b66b29...
import os import shutil import json from pelican import generators from pelican import signals import datastore class AssetGenerator(generators.Generator): """Generates downloadable assets from a Pelican Datastore.""" def __init__(self, *args, **kwargs): super(AssetGenerator, self).__init__(*args, *...
{ "content_hash": "51b88d5fa720df52f0991768d0a75eda", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 87, "avg_line_length": 33.348837209302324, "alnum_prop": 0.6290097629009763, "repo_name": "cybergreen-net/stats", "id": "924cc1931b0b6ae9e77a6eebc92a2f78a30a5582", "size": ...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/dungeon/shared_trash_container.iff" result.attribute_template_id = -1 result.stfName("obj_n","trash_container") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "ca40a97dcc343659994a5109663e37bf", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 71, "avg_line_length": 23.307692307692307, "alnum_prop": 0.6963696369636964, "repo_name": "anhstudios/swganh", "id": "705896a1a57f44211490da2e5060c2a525fdb735", "size": "44...