text
stringlengths
4
1.02M
meta
dict
import tweepy import json import codecs import sys busqueda="" class Twitter_tiempo_real: #Constructor def __init__(self,consumer_key,consumer_secret,access_token_key,access_token_secret): self.consumer_key = consumer_key self.consumer_secret =consumer_secret self.access_token...
{ "content_hash": "207d93b8a415f260165fc49f4739a3b7", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 247, "avg_line_length": 32.48031496062992, "alnum_prop": 0.5204848484848484, "repo_name": "Ernesttt/content_analysis", "id": "2934c217c96595269d4cabf9e39fc6a4c9850bfc", "s...
import unittest import numpy import chainer from chainer.backends import cuda from chainer import gradient_check from chainer import initializers from chainer.links.connection import deconvolution_nd from chainer import testing from chainer.testing import attr from chainer.testing import condition from chainer.testin...
{ "content_hash": "fafe398e76f5ca367616a614e5493c7b", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 75, "avg_line_length": 32.74809160305343, "alnum_prop": 0.5885780885780886, "repo_name": "aonotas/chainer", "id": "12cf14d2381b5a0eafac46d5aa94f6db9ead221a", "size": "4290...
"""Logic to update a TensorFlow model graph with quantization operations.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import re from tensorflow.contrib.quantize.python import common from tensorflow.contrib.quantize.python import graph_matcher from te...
{ "content_hash": "711dac736f2294fba0b6f6fad69fca8c", "timestamp": "", "source": "github", "line_count": 773, "max_line_length": 80, "avg_line_length": 38.10866752910737, "alnum_prop": 0.6600923348496164, "repo_name": "alshedivat/tensorflow", "id": "92ca3f203954414159954f7f5d220f95b17967d0", "size":...
from django import forms from django.forms import DateTimeField from .models import Article class ArticleForm(forms.ModelForm): created_on = DateTimeField(widget=forms.widgets.DateTimeInput()) class Meta: model = Article fields = '__all__'
{ "content_hash": "d54fd8cc7847804f6b55a86c396b26e8", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 68, "avg_line_length": 22.333333333333332, "alnum_prop": 0.7126865671641791, "repo_name": "pfskiev/lisbon", "id": "347c3c2aca72312a99e5366a20a1e97827170bc0", "size": "268",...
from __future__ import annotations import enum from collections.abc import Sequence __all__ = ['AddressPart', 'MatchType', 'SizeComparator', 'str_list', 'unquote'] class AddressPart(enum.Enum): LOCALPART = enum.auto() DOMAIN = enum.auto() ALL = enum.auto() @classmethod def of(cls, flag: str | N...
{ "content_hash": "c604fa26eb66699ec0bed47c0f55a29e", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 79, "avg_line_length": 24.02777777777778, "alnum_prop": 0.5531791907514451, "repo_name": "icgood/pymap", "id": "c69ef0d5e3001f75e8d5146b83c9ab176d9c894d", "size": "1731", ...
import pytest import numpy as np import nnabla as nn import nnabla.functions as F from nnabla.ext_utils import get_extension_context, list_extensions from nnabla.utils.inspection import NanInfTracer from .models import simple_cnn def _refresh_inputs_grad(f): for i in f.inputs: i.grad.zero() @pytest.m...
{ "content_hash": "09736c0fe752d164c75c088237f5e046", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 79, "avg_line_length": 33.348837209302324, "alnum_prop": 0.599721059972106, "repo_name": "sony/nnabla", "id": "78efc986dcdca3af71bcea957d699e88a0962a0b", "size": "3455", ...
from collections import namedtuple from scipy.optimize import newton Flow = namedtuple('Flow', ['period','positive', 'negative']) def netflow(flow): return sum(flow.positive) - sum(flow.negative) def present_value(flow, rate): return netflow(flow)/((1 + rate)**flow.period) def net_present_value(rate,flows)...
{ "content_hash": "dfba89eecb1ac7ea6e4b4ed3b57ff2bc", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 79, "avg_line_length": 28.523809523809526, "alnum_prop": 0.6928213689482471, "repo_name": "mitra-varuna/supply_chain_network", "id": "af61ead81954543506217f8b494ee925f2a0c2e4...
import os import sys import zipfile try: from urllib import urlretrieve except ImportError: from urllib.request import urlretrieve BASEURL = 'http://www.citygml.org/fileadmin/count.php?f=fileadmin/citygml/docs/' FILES = [ 'geoRES_testdata_v1.0.0', 'waldbruecke_v1.0.0', 'CityGML_2.0_Test_Dataset_20...
{ "content_hash": "001e4e84ce251de972cb4a82f860b26f", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 120, "avg_line_length": 31.897435897435898, "alnum_prop": 0.6366559485530546, "repo_name": "ctu-yfsg/2015-f-citygml", "id": "4f594e021503f7d51b97d2acb7a2517f032960a2", "siz...
import mock from nova.tests.virt.xenapi import stubs from nova import utils from nova.virt.xenapi.client import objects class XenAPISessionObjectTestCase(stubs.XenAPITestBaseNoDB): def setUp(self): super(XenAPISessionObjectTestCase, self).setUp() self.session = mock.Mock() self.obj = obje...
{ "content_hash": "2bc476838c960396f6f0ca78798b0117", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 79, "avg_line_length": 34.70873786407767, "alnum_prop": 0.6187412587412587, "repo_name": "afrolov1/nova", "id": "a4e5d35804d1245a6d1103e2fadd7b9b1acdc3dd", "size": "4212",...
import os import sys from warnings import warn from pathlib import Path import shutil import click from .pypeit_make_1d_notebook import make_viz_notebook inf = float('inf') coadd1d_template = """ [coadd1d] coaddfile = '{basename}.fits' flux_value = False ex_value = {ext_mode} coadd1d read {file_ext_pairs}...
{ "content_hash": "83900d649057a7c698886994e506bb3b", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 87, "avg_line_length": 31.165137614678898, "alnum_prop": 0.5825728584044746, "repo_name": "eteq/erikutils", "id": "b3d833da2b8c2b1d06488156504b7d932d16938e", "size": "3397...
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 model 'ContactMessage' db.create_table(u'pages_contactmessage', ( (u'id', self.gf('django.db.models.fields.Auto...
{ "content_hash": "a0d69921b77ea3d1fceff4777d868340", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 187, "avg_line_length": 78.27272727272727, "alnum_prop": 0.5629113433991483, "repo_name": "gannetson/sportschooldeopenlucht", "id": "70201461593978be58f05dcd5b37d17411237798...
""" tests.__init__ ~~~~~~~~~~~~~~ Tests initialization. """ import betamax from homeassistant import util from homeassistant.util import location with betamax.Betamax.configure() as config: config.cassette_library_dir = 'tests/cassettes' # Automatically called during different setups. Too often forgotten # so m...
{ "content_hash": "8a0767cce9936ab9926dc2972d5e9ab3", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 67, "avg_line_length": 24.03125, "alnum_prop": 0.6892067620286085, "repo_name": "coteyr/home-assistant", "id": "1f18116b24baf7b896b1647c509e82d76f4e40e0", "size": "769", ...
""" Testing for the forest module (sklearn.ensemble.forest). """ # Authors: Gilles Louppe, # Brian Holt, # Andreas Mueller, # Arnaud Joly # License: BSD 3 clause import pickle from collections import defaultdict from itertools import combinations from itertools import product import numpy ...
{ "content_hash": "bdb4c7c0f91cd065bc3de29fe3508edc", "timestamp": "", "source": "github", "line_count": 1211, "max_line_length": 86, "avg_line_length": 35.49215524360033, "alnum_prop": 0.6254158814359834, "repo_name": "ldirer/scikit-learn", "id": "b964ed768d85e2e1570e39c44f9e415d6b859457", "size": ...
import urllib2 import json def google_search(search_term): """ Searches for a `search_term` which should be a string or a value convertable to string. Parameters: - str `search_term`: a string to search for Returns a tuple (on success): - first value is a list of search results for t...
{ "content_hash": "2612d6ca85e23d2af1c2717060bc465d", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 113, "avg_line_length": 32.58536585365854, "alnum_prop": 0.6714071856287425, "repo_name": "Jacob-Gray/WelcomeBot", "id": "803a02152a4486c669137f2b0c059f78176cf82e", "size":...
try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages from cloudplaya import VERSION PACKAGE_NAME = 'cloudplaya' setup(name=PACKAGE_NAME, version=VERSION, license='MIT', ...
{ "content_hash": "bbf803f5a2fec0a96a9ff9bfe3eade61", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 62, "avg_line_length": 27.926829268292682, "alnum_prop": 0.5912663755458515, "repo_name": "chipx86/cloudplaya", "id": "cc06aebd90c0dbdc32036d7745d684b021126680", "size": "1...
"""Stacking classifier and regressor.""" # Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com> # License: BSD 3 clause from abc import ABCMeta, abstractmethod from copy import deepcopy from numbers import Integral import numpy as np from joblib import Parallel import scipy.sparse as sparse from ..base import clone...
{ "content_hash": "17326241f4296f9b15e1c573c15f1e5f", "timestamp": "", "source": "github", "line_count": 946, "max_line_length": 88, "avg_line_length": 38.07188160676533, "alnum_prop": 0.6003442914260329, "repo_name": "anntzer/scikit-learn", "id": "2b43dd5c0a2e3889581f21ffeb3440545d977149", "size": ...
class Solution: # @param head, a ListNode # @return a ListNode def deleteDuplicates(self, head): if head is None: return None if head.next is None: return head result = ListNode(0) p = head q = result flag = True while p.next is...
{ "content_hash": "53ff5a624da7c92922bf6416ee2b24bf", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 44, "avg_line_length": 25.5, "alnum_prop": 0.40784313725490196, "repo_name": "richard912611428iop/leetcode-py", "id": "013597e0c12fad2073faa861717316cd390d3c27", "size": "9...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('events', '0007_auto_20160202_1001'), ] operations = [ migrations.AlterField( model_name='event', name='prettyUrl', ...
{ "content_hash": "c05ed41e926911919f9f768a7f610c3c", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 187, "avg_line_length": 28.666666666666668, "alnum_prop": 0.6375968992248062, "repo_name": "DesjardinsLab/event-kiosk", "id": "c0cedb270b553cea09934aee7ca2e8ee9aac41d9", "s...
import logging import os import shutil import tempfile import time import traceback from collections import OrderedDict # We don't have an explicit pathlib dependency because this code only works with # the interactive target installed which has an indirect dependency on pathlib # through ipython>=5.9.0. from pathlib i...
{ "content_hash": "7a7ee95636e3659a7d11a74e1457d88c", "timestamp": "", "source": "github", "line_count": 516, "max_line_length": 85, "avg_line_length": 36.77713178294574, "alnum_prop": 0.6609580017916425, "repo_name": "axbaretto/beam", "id": "fc8a8aa4476895cee3feb755742e2e38cf24aedb", "size": "19783...
"""Commands for updating backend services. There are separate alpha, beta, and GA command classes in this file. """ import copy from googlecloudsdk.api_lib.compute import backend_services_utils from googlecloudsdk.api_lib.compute import base_classes from googlecloudsdk.calliope import base from googlecloudsdk.cal...
{ "content_hash": "16b7f05b093196e6ebd83e24e2ca6516", "timestamp": "", "source": "github", "line_count": 299, "max_line_length": 79, "avg_line_length": 34.22742474916388, "alnum_prop": 0.6996286886847762, "repo_name": "KaranToor/MA450", "id": "79c9dd905d8d1d229eb47ac58ef6bfc73300a0dd", "size": "1082...
import _plotly_utils.basevalidators class FamilyValidator(_plotly_utils.basevalidators.StringValidator): def __init__(self, plotly_name="family", parent_name="pie.title.font", **kwargs): super(FamilyValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
{ "content_hash": "c8f405d20d417b530157e35836cd6b04", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 85, "avg_line_length": 39.285714285714285, "alnum_prop": 0.5963636363636363, "repo_name": "plotly/plotly.py", "id": "04cb80f5b4192fe12f6733afce317dc62a76cc9d", "size": "550...
import sys import os import hashlib import py_compile def flag_checker(candidate): random = b"aes-128-ecb" key = hashlib.sha512(random).digest() correct = bytearray([242, 122, 104, 129, 95, 139, 6, 78, 89, 144, 165, 79, 212, 62, 71, 57, 211, 116, 128]) candidate = bytearray(bytes(candidate, "utf-8")) for i i...
{ "content_hash": "d6c7ac878e7eeac7bb0ecd547b4d7854", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 109, "avg_line_length": 25.147058823529413, "alnum_prop": 0.6526315789473685, "repo_name": "google/google-ctf", "id": "045f51f1ee838bf002bc452db4d61d8afe5e09cc", "size": "8...
import math, string import numpy as np from prettytable import PrettyTable import unsupervised.hungarian # -------------------------------------------------------------- # Ranking Similarity # -------------------------------------------------------------- class JaccardBinary: """ Simple binary Jaccard-based ranki...
{ "content_hash": "b7d95948446ea0cee7f8994f24f11661", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 98, "avg_line_length": 27.5, "alnum_prop": 0.6242424242424243, "repo_name": "derekgreene/topic-stability", "id": "bf19af68cd7a3602e403b5d7f7b4bbf9e747a0ae", "size": "4950"...
import six import os def print_arguments(args): print('----------- Configuration Arguments -----------') for arg, value in sorted(six.iteritems(vars(args))): print('%s: %s' % (arg, value)) print('------------------------------------------------') def mkdir(path): if not os.path.isdir(path):...
{ "content_hash": "4b394c8d93f0dacc68aafba6bd60d58b", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 61, "avg_line_length": 19.44, "alnum_prop": 0.5185185185185185, "repo_name": "kuke/models", "id": "9da8571f2c47b6e87219b8c579ae3a7645f6afd5", "size": "486", "binary": fal...
from django.db import models from django.contrib.auth.models import User, Group from django.utils.translation import ugettext_lazy as _ from django.core.validators import RegexValidator from django.conf import settings class Repository(models.Model): """ Git repository """ # basic info name = mode...
{ "content_hash": "cd78c01d833faaa502e374bb540c271c", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 103, "avg_line_length": 30.341176470588234, "alnum_prop": 0.5994571539356339, "repo_name": "gitmill/gitmill", "id": "7cee1128a247caa3fe76fe914ef7542e1be27c51", "size": "257...
from caspy.lw import Lightweight as Base from caspy import str class Currency(Base): _fields = 'cur_code', 'shortcut', 'symbol', 'long_name' class Book(Base): _fields = 'book_id', 'name', 'created_at' def __str__(self): return str(self.name) class AccountType(Base): _fields = 'account_typ...
{ "content_hash": "faa4e875560fc34ac0a50a79e9488421", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 65, "avg_line_length": 24.555555555555557, "alnum_prop": 0.5859728506787331, "repo_name": "altaurog/django-caspy", "id": "a0f4cabd34c233e28c85303637702395a915130b", "size":...
class Form(object): ''' classdocs ''' def __init__(self, action, method = 'GET'): ''' Constructor ''' self.fields = [] self.action = action self.method = method def add_select_field(self, Name, param, options, multiple = False, default = N...
{ "content_hash": "4ff99a4789887c8d0c24d03be2ecfadb", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 171, "avg_line_length": 28.426470588235293, "alnum_prop": 0.4469736161407139, "repo_name": "ankeshanand/benchmark", "id": "8f752f59ba7ba3bbf7e0fc2b397cc77453f40e5b", "size"...
"""Utilities for pre-processing classification data.""" from absl import logging from official.nlp.xlnet import data_utils SEG_ID_A = 0 SEG_ID_B = 1 class PaddingInputExample(object): """Fake example so the num input examples is a multiple of the batch size. When running eval/predict on the TPU, we need to pad...
{ "content_hash": "a781843a283c34fdd649874e0ee1068f", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 80, "avg_line_length": 32.486486486486484, "alnum_prop": 0.6485024958402662, "repo_name": "tombstone/models", "id": "64363e322633f7ae43d6ffc65c99ee1beff36827", "size": "54...
"""Benchmarks for LossScaleOptimizer.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import time from tensorflow.python.distribute import distribution_strategy_context from tensorflow.python.distribute import mirrored_strategy from tensorflow.python.eag...
{ "content_hash": "af7741cd5da6fb2daba96ded1e29597f", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 85, "avg_line_length": 40.738255033557046, "alnum_prop": 0.6630971993410214, "repo_name": "aldian/tensorflow", "id": "4ebc360b973811ee1659a6c38254e3d58eab3e4a", "size": "6...
from .forms import BugReportForm def bug_report_form(request): return { "bug_report_form": BugReportForm( initial={"source_url": request.path, "source": "wheredoivote"} ) }
{ "content_hash": "8f35d997bce6749577e96ff6324d16a2", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 74, "avg_line_length": 23.444444444444443, "alnum_prop": 0.6066350710900474, "repo_name": "DemocracyClub/UK-Polling-Stations", "id": "3e67c99f6142a3505babb8d07a5c02391bc0eed9"...
from __future__ import unicode_literals import datetime from django.conf import settings from django.core.exceptions import ValidationError from django.core.urlresolvers import reverse from django.db import models from django.db.models.signals import post_init, post_save from django.utils.encoding import python_2_uni...
{ "content_hash": "77e8cb44656918cb65ed28380a634225", "timestamp": "", "source": "github", "line_count": 356, "max_line_length": 148, "avg_line_length": 38.25561797752809, "alnum_prop": 0.6313238857478523, "repo_name": "pyohio/symposion", "id": "1972b8758ee75c86975edb17037f910f20be51de", "size": "13...
from src.core.page import Page, ResourceLoader, iOSPage from src.core.r import Resource class MeFindFriendsSearch(Page, iOSPage): followUserBtn = ResourceLoader(Resource.followUserBtn) unfollowUserBtn = ResourceLoader(Resource.unfollowUserBtn) searchUsersBtn = ResourceLoader(Resource.searchUsersBtn) ...
{ "content_hash": "de506238f52cccb25f8e3b4b869b8603", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 64, "avg_line_length": 28.78048780487805, "alnum_prop": 0.6779661016949152, "repo_name": "azoft-dev-team/imagrium", "id": "0ef26ccdb454479d02f303001bae5c27646429a0", "size"...
from cs231n.layers import * from cs231n.fast_layers import * def affine_relu_forward(x, w, b): """ Convenience layer that perorms an affine transform followed by a ReLU Inputs: - x: Input to the affine layer - w, b: Weights for the affine layer Returns a tuple of: - out: Output from the ReLU - cache...
{ "content_hash": "52670dbc2a5afd115cfa7d88190dd249", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 72, "avg_line_length": 27.08888888888889, "alnum_prop": 0.6833470057424118, "repo_name": "5hubh4m/CS231n", "id": "8baa9627ec5dc4632d80947cc6913799baca5d6b", "size": "2438",...
from unittest import skipIf import os from django.db import IntegrityError from django.test import TransactionTestCase from django_migration_testcase import MigrationTest EXAMPLE_CORRUPTION = bool(os.environ.get('EXAMPLE_CORRUPTION', False)) class Test0002AwesomeModelUniqueName(MigrationTest): app_name = 'testi...
{ "content_hash": "684771d79c8cc5d42956e6e85704e4a9", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 120, "avg_line_length": 39.96969696969697, "alnum_prop": 0.7376800606520091, "repo_name": "jrobichaud/django-awesome-presentations", "id": "a389d76695b3a22d4bd71438cca6904600...
import mock import pytest import unittest from addons.base.tests.models import (OAuthAddonNodeSettingsTestSuiteMixin, OAuthAddonUserSettingTestSuiteMixin) from addons.github.models import NodeSettings from addons.github.tests import factories from osf_tests.factories import Projec...
{ "content_hash": "e77aa49b862add7343b82e8b29eabade", "timestamp": "", "source": "github", "line_count": 336, "max_line_length": 100, "avg_line_length": 37.68154761904762, "alnum_prop": 0.6534239001658637, "repo_name": "mluo613/osf.io", "id": "54118a7d76be076401d129ce1e27250a9dbe31d5", "size": "1268...
""" sdata.py this file contains a class sdata which stores sparse data in a tree like structure that mimics an n dimensional array. """ import cPickle class sdata: def __init__(self, shape=(1,)): self.shape = shape self._data = [] self._indice = [] def save(self, fname): ...
{ "content_hash": "1ed4e0ef19a5b2d7aba4eeec62c452af", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 75, "avg_line_length": 30.401234567901234, "alnum_prop": 0.44243654822335027, "repo_name": "lsiemens/iprocess-projects", "id": "a394e6ffeb0cf75fded63bb5383f8b3dd8069fec", ...
import random import sys import gdb # List of colors used for printing messages RED = "\033[1;31m" BLUE = "\033[1;34m" CYAN = "\033[1;36m" GREEN = "\033[0;32m" RESET = "\033[0;0m" BOLD = "\033[;1m" REVERSE = "\033[;7m" def error_output(massage): """Print out a red output""" sys.stdout.write(BOLD + RED) p...
{ "content_hash": "413d543c6692c5cd85d62de90c074583", "timestamp": "", "source": "github", "line_count": 522, "max_line_length": 114, "avg_line_length": 37.93869731800766, "alnum_prop": 0.5621086649161785, "repo_name": "timtian090/Playground", "id": "a5b30a23bfe817c27597103943955f5434f3a524", "size"...
import time from json import dumps, loads import warnings from unittest import mock from webtest import TestApp from six import b as b_ from six import u as u_ import webob from pecan import Pecan, expose, abort, Request, Response from pecan.rest import RestController from pecan.hooks import PecanHook, HookController...
{ "content_hash": "1ed6f442ea1dae7c89d6563f8f196371", "timestamp": "", "source": "github", "line_count": 1448, "max_line_length": 79, "avg_line_length": 34.533149171270715, "alnum_prop": 0.540976721862251, "repo_name": "pecan/pecan", "id": "3fbcd8877f0feb9c2fd5d4108b4859b17f4551fb", "size": "50004",...
from postgresapi import models, managers from . import _base class CreateTestCase(_base.TestCase): def setUp(self): super(CreateTestCase, self).setUp() self._drop_test_db() def tearDown(self): super(CreateTestCase, self).tearDown() self._drop_test_db() def test_success(s...
{ "content_hash": "52f3de113a44bde4fcee1ca2a784484c", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 73, "avg_line_length": 36.08695652173913, "alnum_prop": 0.5662650602409639, "repo_name": "RichardKnop/postgres-api", "id": "ea9aa8a90513465a803f75d5290b9c41d7e6e156", "size...
import _plotly_utils.basevalidators class ShowticklabelsValidator(_plotly_utils.basevalidators.BooleanValidator): def __init__( self, plotly_name="showticklabels", parent_name="sunburst.marker.colorbar", **kwargs ): super(ShowticklabelsValidator, self).__init__( ...
{ "content_hash": "5388b2ee4b9015440a5e625ab7302a60", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 77, "avg_line_length": 30.823529411764707, "alnum_prop": 0.5935114503816794, "repo_name": "plotly/python-api", "id": "13f7f5dff1723f212e54432b50ccbcc70fb88207", "size": "52...
''' Created on 2013-12-22 @author: Wei ''' import utils.serialize from utils.rst_lib import * class CRFTreeFeatureWriter: def __init__(self, verbose): self.features = set() self.verbose = verbose self.cue_phrases = utils.serialize.loadData('cue_phrases') ...
{ "content_hash": "52d1decffc1addefd8f67f51f3f556fa", "timestamp": "", "source": "github", "line_count": 346, "max_line_length": 134, "avg_line_length": 44.7514450867052, "alnum_prop": 0.5044562128648928, "repo_name": "habernal/feng-hirst-rst-parser-acl-2014", "id": "395fa288ce5b082b62ba2e5ea70ee65bef...
from nova.notifications.objects import base from nova.objects import base as nova_base from nova.objects import fields @nova_base.NovaObjectRegistry.register_notification class KeypairPayload(base.NotificationPayloadBase): SCHEMA = { 'user_id': ('keypair', 'user_id'), 'name': ('keypair', 'name'), ...
{ "content_hash": "d8347c3017f9ae6228eaa42edb5a6881", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 57, "avg_line_length": 33.35897435897436, "alnum_prop": 0.6617986164488855, "repo_name": "jianghuaw/nova", "id": "44df1a0732b268e4e77426042a70fe570263db2f", "size": "1874",...
import uuid import copy import sys import os import random from collections import defaultdict import prettytable from output import (LargeItem, IngredientBase, Liquid, return_instance, is_ingredient_in_list) from pie_logger import get_lo...
{ "content_hash": "974bef65ec519d8bff81a327899c8b0c", "timestamp": "", "source": "github", "line_count": 383, "max_line_length": 89, "avg_line_length": 31.83812010443864, "alnum_prop": 0.5743808430375594, "repo_name": "brianray/chipy_phaser_flask", "id": "91f236764614c660d4fa595cbd6a7a032d6ccf03", "...
import sys from django.utils.six.moves import input from kolibri.core.auth.models import AdHocGroup from kolibri.core.auth.models import FacilityDataset from kolibri.core.auth.models import FacilityUser from kolibri.core.auth.models import Membership from kolibri.core.logger.models import AttemptLog from kolibri.core...
{ "content_hash": "929194d3becb93d2ca69c4cccce78f5d", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 102, "avg_line_length": 37.8859649122807, "alnum_prop": 0.6253762445010419, "repo_name": "indirectlylit/kolibri", "id": "594037c533329e3f68ec137593f17039b24dd4d3", "size":...
""" (c) RIKEN 2015. All rights reserved. Author: Keitaro Yamashita This software is released under the new BSD License; see LICENSE. """ from __future__ import print_function from __future__ import unicode_literals import sys from cctbx.array_family import flex from cctbx import miller from yamtbx.dataproc.xds.xds_...
{ "content_hash": "b97e40aac77c39d9da14e41d0282491a", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 89, "avg_line_length": 30.244444444444444, "alnum_prop": 0.5635562086700955, "repo_name": "keitaroyam/yamtbx", "id": "de9bdef6e5072ef12e269d7e87c127e9b9a498a4", "size": "13...
import mock from oslo.config import cfg from webob import exc from neutron.common import constants from neutron.db import api as db_api from neutron.db import external_net_db from neutron.db import l3_db from neutron.db import l3_gwmode_db from neutron.db import models_v2 from neutron.extensions import l3 from neutron...
{ "content_hash": "81abdb8521115389507e51a1f80b4979", "timestamp": "", "source": "github", "line_count": 404, "max_line_length": 77, "avg_line_length": 42.57920792079208, "alnum_prop": 0.5835367980467387, "repo_name": "Comcast/neutron", "id": "ac2fd5171e0d2cec743bbcc46fe93018602bf5e0", "size": "1793...
import logging try: import torch from transformers import AutoModelForSeq2SeqLM, AutoTokenizer except ImportError: # No installation required if not using this function pass from nlpaug.model.lang_models import LanguageModels import nlpaug.util.text.tokenizer as text_tokenizer class Bart(LanguageMo...
{ "content_hash": "bc7bc43fac067a0d4e4593778595a245", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 127, "avg_line_length": 38.03921568627451, "alnum_prop": 0.6376288659793814, "repo_name": "makcedward/nlpaug", "id": "05d2e0e9ccc7ae082790ca56b9a93c33321c373a", "size": "3...
import commands def test(data_path): # parameters folder_data = ['dmri/'] file_data = ['bvecs.txt'] # define command cmd = 'sct_dmri_transpose_bvecs -i ' + data_path + folder_data[0] + file_data[0] # return return commands.getstatusoutput(cmd) if __name__ == "__main__": # call mai...
{ "content_hash": "d8c0b9931510fdb14ec6af0215161701", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 84, "avg_line_length": 17.94736842105263, "alnum_prop": 0.5953079178885631, "repo_name": "3324fr/spinalcordtoolbox", "id": "e7e66a7d4e4689b53f9081ca3e0fff5b2f80c62a", "size...
import json import re import click import jsonschema import utils @click.command() @click.argument("schema", type=click.File("r"), required=True) @click.argument("jsonfiles", type=click.Path(exists=True), required=True) def validate_path(schema, jsonfiles): schema = json.loads(schema.read()) for path in ut...
{ "content_hash": "a39bb6e340ffa3ca2a09f4561f337bee", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 86, "avg_line_length": 25, "alnum_prop": 0.6672, "repo_name": "OpenBounds/Processing", "id": "b8b5df26064903cb6c7020e2781daea3bd2791bb", "size": "648", "binary": false, ...
""" Most of the jokes are from https://viccfaktor.hu/cimke/programozo-viccek/, and https://gremmedia.hu/programozo-viccek // A viccek nagy része a https://viccfaktor.hu/cimke/programozo-viccek/ weboldalról és a https://gremmedia.hu/programozo-viccek weboldalról származik """ neutral = [ "- Miért keveri a programoz...
{ "content_hash": "c4d8080a497c30571b5ee261dbe2ddd4", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 146, "avg_line_length": 49.07692307692308, "alnum_prop": 0.6841692789968652, "repo_name": "pyjokes/pyjokes", "id": "ce9de8a063551e97f1ec3b2c37a587a56420937c", "size": "1355...
import StringIO import json import logging import random import urllib import urllib2 import multipart # стандартные модули для Google Engine from google.appengine.api import urlfetch from google.appengine.ext import ndb import webapp2 # Две следующие строчки необходимы для иморта сторонних библиотек из папки libs #...
{ "content_hash": "278179d254e7f10909a81ded209b2576", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 152, "avg_line_length": 30.50537634408602, "alnum_prop": 0.5188579485371871, "repo_name": "subpath/TelegramBot", "id": "a4450b423dd0b4a9b7eff2f3efc67df36cfedf37", "size": ...
from django.db import migrations def add_choose_permission_to_admin_groups(apps, _schema_editor): ContentType = apps.get_model('contenttypes.ContentType') Permission = apps.get_model('auth.Permission') Group = apps.get_model('auth.Group') # Get document content type document_content_type, _create...
{ "content_hash": "7e2d44315721f687e838244726fcee54", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 146, "avg_line_length": 37.1578947368421, "alnum_prop": 0.6940509915014165, "repo_name": "torchbox/wagtail", "id": "1c902a6d4c2108210c2dffbae1dfefe606d6d352", "size": "3579...
from __future__ import unicode_literals import datetime import re from decimal import Decimal from django.core.exceptions import FieldError from django.db import connection from django.db.models import ( F, Aggregate, Avg, Count, DecimalField, DurationField, FloatField, Func, IntegerField, Max, Min, Sum, Valu...
{ "content_hash": "74e72d23c2f38d45e51e9e21d0251b0b", "timestamp": "", "source": "github", "line_count": 1089, "max_line_length": 155, "avg_line_length": 39.637281910009186, "alnum_prop": 0.5392100081084211, "repo_name": "adelton/django", "id": "5b0bcb82bc015abdb970ed554e2fef834b5589c2", "size": "43...
""" This file is part of the TheLMA (THe Laboratory Management Application) project. See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information. Target table. """ from sqlalchemy import Column from sqlalchemy import ForeignKey from sqlalchemy import Integer from sqlalchemy import Table __docformat__...
{ "content_hash": "1fc665cea0d7d978c01a7834fa9c7241", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 80, "avg_line_length": 32.148148148148145, "alnum_prop": 0.6693548387096774, "repo_name": "helixyte/TheLMA", "id": "c21e56dfe6f9f876b42d6da2123e6a18e7e5cd8a", "size": "868"...
import os from twilio.rest import Client # Your Account Sid and Auth Token from twilio.com/user/account # To set up environmental variables, see http://twil.io/secure account_sid = os.environ['TWILIO_ACCOUNT_SID'] auth_token = os.environ['TWILIO_AUTH_TOKEN'] client = Client(account_sid, auth_token) document = client....
{ "content_hash": "b9ca20ededc9b887fc5971bc0bcb8cc9", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 62, "avg_line_length": 30.133333333333333, "alnum_prop": 0.745575221238938, "repo_name": "TwilioDevEd/api-snippets", "id": "75335ec6a8f3982cf82c3ee01a46f6b8bdaef519", "size...
import pytest def raising_checker(value, system): from snovault.auditor import AuditFailure if not value.get('checker1'): raise AuditFailure('testchecker', 'Missing checker1') def returning_checker(value, system): from snovault.auditor import AuditFailure if not value.get('checker1'): ...
{ "content_hash": "8a63da2102aedd56b4d070c1f7ec08f9", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 93, "avg_line_length": 34.55384615384615, "alnum_prop": 0.6705253784505788, "repo_name": "T2DREAM/t2dream-portal", "id": "62a103caaa7a82c6ece2342236d65fbb0417948e", "size"...
"""This is generic driver class implementation.""" from functools import partial import re import logging import pexpect from condoor.actions import a_send, a_connection_closed, a_stays_connected, a_unexpected_prompt, a_expected_prompt from condoor.fsm import FSM from condoor.exceptions import ConnectionError, Comman...
{ "content_hash": "32badd7bf8dc916030c4a5ebfc037760", "timestamp": "", "source": "github", "line_count": 330, "max_line_length": 115, "avg_line_length": 40.43333333333333, "alnum_prop": 0.5952934122760998, "repo_name": "kstaniek/condoor-ng", "id": "c11e3b2585177aa4a58e37972f0390fe3f9ea886", "size": ...
"""oAuth2 functions and classes for Geocaching API integration.""" from __future__ import annotations from typing import Any from homeassistant.components.application_credentials import ( AuthImplementation, AuthorizationServer, ClientCredential, ) from homeassistant.core import HomeAssistant from .const...
{ "content_hash": "ca83470d630b6993b2c5dee7a8b12567", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 97, "avg_line_length": 35.22727272727273, "alnum_prop": 0.6163440860215054, "repo_name": "w1ll1am23/home-assistant", "id": "848c4fce66cd8000b80e7024a120441003404254", "size...
"""Use the HTMLParser library to parse HTML files that aren't too bad.""" # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. __all__ = [ 'HTMLParserTreeBuilder', ] from html.parser import HTMLParser try: from html.parser import HTMLParseError except Imp...
{ "content_hash": "5d38bd03feb5c51230fb613e03a7d9f3", "timestamp": "", "source": "github", "line_count": 314, "max_line_length": 318, "avg_line_length": 36.97133757961783, "alnum_prop": 0.584460332500646, "repo_name": "williamfeng323/py-web", "id": "907d355b65926f31254c53eb7ebc2a28042f436b", "size":...
import os import sys from xml.dom import minidom from termcolor import colored def find_root_maven_dir_from_current_dir(): cwd = os.getcwd() dirs = cwd.split('/') highest_dir_with_pom = None if 'pom.xml' in os.listdir(cwd): highest_dir_with_pom = cwd #print 'ABOUT TO LOOP' for i i...
{ "content_hash": "7c67f5afc6d4af32993fbe9b4082e920", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 81, "avg_line_length": 28.142857142857142, "alnum_prop": 0.6153412295544275, "repo_name": "digitaldarwin/jiver", "id": "9e98c1f8ddf038d85274c2035b565569e14bef80", "size": "...
class Tile: def __init__(self, unk1Instance): self.unk1Instance = unk1Instance def Draw(self, camera): [translation, zoom] = camera.GetTransform()
{ "content_hash": "ef23d5cde76a5f0bf82653c489eb5eaa", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 51, "avg_line_length": 24.714285714285715, "alnum_prop": 0.6358381502890174, "repo_name": "simply-jos/birth-of-the-toolkit", "id": "0407d1c5dd0cac1545715b36e9c321f40c669c03", ...
import unittest from unittest.mock import Mock, patch from airflow import models from airflow.configuration import load_test_config from airflow.models.xcom import MAX_XCOM_SIZE from airflow.operators.google_api_to_s3_transfer import GoogleApiToS3Transfer from airflow.utils import db class TestGoogleApiToS3Transfer(...
{ "content_hash": "4806f0a206e986ca2d67a72d04fa9452", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 109, "avg_line_length": 43.79333333333334, "alnum_prop": 0.6227736337342061, "repo_name": "Fokko/incubator-airflow", "id": "b942a2223ca543ffd71fc51b716d87db5624613d", "siz...
from anki.template.template import Template from anki.template.view import View def render(template, context=None, **kwargs): context = context and context.copy() or {} context.update(kwargs) return Template(template, context).render()
{ "content_hash": "173ad696c645f5c5d324a955bd7fd3d9", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 47, "avg_line_length": 35.57142857142857, "alnum_prop": 0.7469879518072289, "repo_name": "jlitven/vexer", "id": "955518123d9e1c05238fb90da73c8df320da379d", "size": "249", ...
import os import re import fnmatch import glob import time import logging import mimetypes import subprocess import textwrap import uuid from io import StringIO from pathlib import Path from datetime import date import warnings import jinja2 from ruamel.yaml import YAML try: import github3 _have_github3 = Tru...
{ "content_hash": "ff30ae5228e2bb8e742e983e3687483b", "timestamp": "", "source": "github", "line_count": 1343, "max_line_length": 79, "avg_line_length": 36.63440059568131, "alnum_prop": 0.5610772357723577, "repo_name": "apache/arrow", "id": "d5ce6143136ae7b27add254edf96348723aade50", "size": "49986"...
class TileCacheException(Exception): pass import sys, cgi, time, os, traceback, email, ConfigParser import Cache, Caches import Layer, Layers # Windows doesn't always do the 'working directory' check correctly. cfgfiles = ("/etc/tilecache.cfg", os.path.join("..", "tilecache.cfg"), "tilecache.cfg") class Capabilities...
{ "content_hash": "f8e538388d00a350f7e544762e5c06ce", "timestamp": "", "source": "github", "line_count": 482, "max_line_length": 166, "avg_line_length": 40.91078838174274, "alnum_prop": 0.5668644454586946, "repo_name": "pcucurullo/groot", "id": "37958285e604a371558d649b1275060e1e989925", "size": "19...
import copy from pony.orm import * from pony import orm from typing import Optional from horsefax.telegram.services.command import Command from ..core import HorseFaxBot, ModuleTools, BaseModule from ..db import db class Alias(db.Entity): id = PrimaryKey(int, auto=True) alias = Required(str, unique=True) ...
{ "content_hash": "5bcb47db23991fd94fe43c3a4c7a7fce", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 111, "avg_line_length": 36.8955223880597, "alnum_prop": 0.6302588996763754, "repo_name": "TallonRain/horsefaxbot", "id": "85898a5ca3d9176f41d5961ea1d15cc814119e91", "size":...
""" Van der Grinten =============== The Van der Grinten projection, presented by Alphons J. van der Grinten in 1904, is neither equal-area nor conformal. Central meridian and Equator are straight lines; other meridians are arcs of circles. The scale is true along the Equator only. Its main use is to show the entire wo...
{ "content_hash": "0ed356c86ab11b1a1b72c2e929811e29", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 84, "avg_line_length": 37.35, "alnum_prop": 0.6934404283801874, "repo_name": "GenericMappingTools/gmt-python", "id": "a297b950c396524e6e23fd78c4a8574c2ae32ff9", "size": "74...
import os import logging help = 'Import mcu to pgen. Provide a valid project file, pgen will parse to create mcu definition' from ..tools_supported import ToolsSupported from ..targets import mcu_create def run(args): root = os.getcwd() tool = ToolsSupported().get_tool(args.tool) if tool is None: ...
{ "content_hash": "25012a7773647f14ca096cf2db6cacb9", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 113, "avg_line_length": 35, "alnum_prop": 0.6738095238095239, "repo_name": "molejar/project_generator", "id": "4ed07cc55410520b2220a220c3d9e0b8eccc80a3", "size": "1412", ...
from django.contrib.auth import get_user_model from decimal import Decimal from questions.models import UserAnswer, Question from django.db.models import Q # User = get_user_model() # users = User.objects.all() #[user1 ,user2] # all_user_answers = UserAnswer.objects.all().order_by("user_id") def get_match(user_a, ...
{ "content_hash": "c1170e1864a2acd1471f94a99ef91e09", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 106, "avg_line_length": 34.24561403508772, "alnum_prop": 0.5932377049180327, "repo_name": "hungtt57/matchmaker", "id": "86a061e6cc8c69443826ef8772e917892a5662aa", "size": "...
""" Django settings for django_email_or_username project. Generated by 'django-admin startproject' using Django 1.8.4. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ ...
{ "content_hash": "2bf2d07d06d740cd77b5f3428f4e7c5b", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 77, "avg_line_length": 26.72897196261682, "alnum_prop": 0.6926573426573427, "repo_name": "ScottyMJacobson/django-email-or-username", "id": "6c8e433cc5ae7d68b144737d919628b42...
import unittest import utils from testbin import TestBin class TestBinCostart(TestBin, unittest.TestCase): def setUp(self): self.bin = 'co-start' self.do_not_test_running = True def tearDown(self): pass
{ "content_hash": "77e150eaebdb655ef2586ded51b78133", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 49, "avg_line_length": 19.833333333333332, "alnum_prop": 0.6722689075630253, "repo_name": "compatibleone/accords-platform", "id": "ae0ab07199d14261e32c8d2828419b361c51c294", ...
import graphene from graphene_django import DjangoObjectType from share import models from share.graphql.base import AbstractShareObject def Agent(): from share.graphql.agent import AbstractAgent return AbstractAgent def CreativeWork(): from share.graphql.work import AbstractCreativeWork return Ab...
{ "content_hash": "06df996d361f74fe1ace6ebae7bccaa2", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 171, "avg_line_length": 27.440677966101696, "alnum_prop": 0.7195799876466955, "repo_name": "laurenbarker/SHARE", "id": "6653168ec3c82d54e7c45fe685492b7115f064e1", "size": "...
""" Manage mentions and their attributes. """ from cort.core import mention_property_computer from cort.core import spans __author__ = 'smartschat' class Mention: """ A mention is an expression in a document which is potentially referring. Attributes: document (CoNLLDocument): The document the men...
{ "content_hash": "74b9c56dbb65020be8ed73095137bdb9", "timestamp": "", "source": "github", "line_count": 366, "max_line_length": 80, "avg_line_length": 36.90710382513661, "alnum_prop": 0.5542641397690258, "repo_name": "smartschat/cort", "id": "0ca80f734725b357a6e35cb8e0c067dc718bc118", "size": "1350...
import sys from webtest import TestApp from minimal2.application import make_wsgi class TestAltStack(object): @classmethod def setup_class(cls): try: del sys.modules['minimal2.views'] del sys.modules['minimal2.components.news.views'] del sys.modules['newscomp4.vi...
{ "content_hash": "0f0a5eb95865662aa6affd618911bd17", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 65, "avg_line_length": 25.015151515151516, "alnum_prop": 0.5923682616596002, "repo_name": "level12/blazeweb", "id": "97dd40a56eba4a6b811931c03eebe716bd8d6156", "size": "165...
""" Onshape REST API The Onshape REST API consumed by all clients. # noqa: E501 The version of the OpenAPI document: 1.113 Contact: api-support@onshape.zendesk.com Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import re # noqa: F401 import sys # noqa:...
{ "content_hash": "9c3d2c00c978ae5a1bfeb27ce4b2ce21", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 123, "avg_line_length": 34.63636363636363, "alnum_prop": 0.5879265091863517, "repo_name": "onshape-public/onshape-clients", "id": "a0044d4d2040f52672103940d819406f072553f5",...
r"""Mako template to Hjson register description """ import sys import argparse from io import StringIO from mako.template import Template def main(): parser = argparse.ArgumentParser(prog="reg_timer") parser.add_argument( 'input', nargs='?', metavar='file', type=argparse.FileT...
{ "content_hash": "f53f707e66d4fc142411caf36189d79e", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 74, "avg_line_length": 23.186046511627907, "alnum_prop": 0.6028084252758275, "repo_name": "chipsalliance/Surelog", "id": "420906058fe00846ad671ec0faf94a345313f46a", "size":...
import itk import re import sys from itk.support.template_class import itkTemplate from optparse import OptionParser ctypes = [ "double", "float", "signed_char", "signed_short", "signed_long", "unsigned_char", "unsigned_short", "unsigned_long", "char", "short", "long", ...
{ "content_hash": "f87f7b73024f124dcd84c43d2207e000", "timestamp": "", "source": "github", "line_count": 248, "max_line_length": 85, "avg_line_length": 26.842741935483872, "alnum_prop": 0.6062791047018177, "repo_name": "vfonov/ITK", "id": "9a02b64238b6c42ab0e224b1e4da4fe9ca2b2c89", "size": "7412", ...
import time from ginga import trcalc from ginga.misc.Bunch import Bunch from .CanvasMixin import CanvasMixin __all__ = ['DrawingMixin'] class DrawingMixin(object): """The DrawingMixin is a mixin class that adds drawing capability for some of the basic CanvasObject-derived types. The set_surface method is ...
{ "content_hash": "5c1259660a189545452ca916dfb7973e", "timestamp": "", "source": "github", "line_count": 735, "max_line_length": 85, "avg_line_length": 35.477551020408164, "alnum_prop": 0.5256557754256788, "repo_name": "pllim/ginga", "id": "678ab4f1240aa6d1ff7230b129f7177b3be04377", "size": "26240",...
from flask import request, abort, jsonify, Flask from werkzeug.contrib.cache import SimpleCache, RedisCache from datetime import datetime import pytz import cPickle import eetlijst import calendar import functools # App definition app = Flask(__name__) app.debug = True # Use simple cache for cli-mode. For WSGI mod...
{ "content_hash": "5d8cf3b4e67a21edad597b008a2b07d9", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 80, "avg_line_length": 25.945945945945947, "alnum_prop": 0.60546875, "repo_name": "basilfx/Happening-eetlijst", "id": "68c465377d35531e9e16d6581c54995311f17a29", "size": "...
""" wakatime.base ~~~~~~~~~~~~~ wakatime module entry point. :copyright: (c) 2013 Alan Hamlett. :license: BSD, see LICENSE for more details. """ from __future__ import print_function import base64 import logging import os import platform import re import sys import time import traceback import s...
{ "content_hash": "1e59769a1fd3fb7670cbbeee23bf2eaf", "timestamp": "", "source": "github", "line_count": 495, "max_line_length": 106, "avg_line_length": 36.448484848484846, "alnum_prop": 0.5692273583859883, "repo_name": "gandarez/wakatime", "id": "b8d925c458edd5836942b367c17abe13c3828764", "size": "...
""" Permissions for profiles """ from rest_framework import permissions from open_discussions.permissions import is_staff_user def is_owner_or_privileged_user(obj_user, request): """Returns True if the given user matches the requesting user, or the given user is superuser/staff""" return ( obj_user =...
{ "content_hash": "98ba1196a3e6c49633879e56b3eb1a7d", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 106, "avg_line_length": 31.78048780487805, "alnum_prop": 0.6884113584036838, "repo_name": "mitodl/open-discussions", "id": "1895b6dc15484ea2f77357487c25d1f6cc1cec45", "size...
import collections import numpy as np import util import tensorflow as tf def _tf_int64_feature(value): return tf.train.Feature(int64_list=tf.train.Int64List(value=[value])) def _tf_float_feature(value): """Returns a float_list from a float / double.""" return tf.train.Feature(float_list=tf.train.FloatList(va...
{ "content_hash": "6f3d46b7dbdde90914ae99cd34dd2eb5", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 136, "avg_line_length": 45.10294117647059, "alnum_prop": 0.573850668405608, "repo_name": "dselsam/neurocore-public", "id": "870e5adf0381c33d2ad8f551f67992b735f7506b", "siz...
"""Multi-credential file store with lock support. This module implements a JSON credential store where multiple credentials can be stored in one file. That file supports locking both in a single process and across processes. The credential themselves are keyed off of: * client_id * user_agent * scope The format of ...
{ "content_hash": "3d561c0caef865372aaa454160a5c862", "timestamp": "", "source": "github", "line_count": 365, "max_line_length": 86, "avg_line_length": 29.671232876712327, "alnum_prop": 0.6478301015697138, "repo_name": "aadityabhatia/testzone2011-ScatterGraph", "id": "cf43dd9bc860e65afde76c8282ea912a8...
import copy import logging import os import re import reportlab from reportlab.lib.enums import TA_LEFT from reportlab.lib.fonts import addMapping from reportlab.lib.pagesizes import landscape, A4 from reportlab.lib.styles import ParagraphStyle from reportlab.pdfbase import pdfmetrics from reportlab.pdfbase.ttfonts im...
{ "content_hash": "cad34b35e178bd63313d956968174681", "timestamp": "", "source": "github", "line_count": 932, "max_line_length": 121, "avg_line_length": 36.26609442060086, "alnum_prop": 0.5387869822485207, "repo_name": "orbitvu/xhtml2pdf", "id": "b8e6a56e608423d3e0dcf0daeb289240026fcb39", "size": "3...
"""This code example gets all image creatives. The statement retrieves up to the maximum page size limit of 500. To create an image creative, run create_creatives.py.""" __author__ = 'api.shamjeff@gmail.com (Jeff Sham)' # Locate the client library. If module was installed via "setup.py" script, then # the following t...
{ "content_hash": "b2fa07b9220b42a25a480130b9c4f732", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 80, "avg_line_length": 31.58695652173913, "alnum_prop": 0.6799724707501721, "repo_name": "lociii/googleads-python-lib", "id": "f9aa040c70e85df33de8113be5ae3d78207b4970", "s...
import time from cumulusci.robotframework.pageobjects import BasePage from cumulusci.robotframework.pageobjects import pageobject from BaseObjects import BaseNPSPPage from cumulusci.robotframework.utils import capture_screenshot_on_error from selenium.webdriver.common.keys import Keys from NPSP import npsp_lex_locators...
{ "content_hash": "ad7471d320e03d022001d9af39bc31be", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 125, "avg_line_length": 43.2183908045977, "alnum_prop": 0.6734042553191489, "repo_name": "SalesforceFoundation/Cumulus", "id": "aa5a0eaf79593974d4b2afb095af242e2fd6bbfc", "...
import pytest @pytest.mark.xfail def test_delete_bookmark(): raise NotImplementedError
{ "content_hash": "0371026e2b5d4d18ad6ce0a19eb01ec3", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 29, "avg_line_length": 15.5, "alnum_prop": 0.7741935483870968, "repo_name": "globus/globus-sdk-python", "id": "2a01c948a13a2c756327c8d6098314788df7229a", "size": "93", "bi...
from SCons.Script import * import os import re import string import datetime # ----------------------------------------------------------------------------- class FunctionScanner: # FIXME correct handling of strings and comments commentFilter = re.compile(r"/\*.*?\*/", re.DOTALL) # find any function 'void test*(...
{ "content_hash": "1f0bfc1e8916a835ce12a7f3d708bad9", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 97, "avg_line_length": 26.08053691275168, "alnum_prop": 0.5998455995882656, "repo_name": "jrahlf/3D-Non-Contact-Laser-Profilometer", "id": "3e6047a4561a5fdcc3600f90e21c4b3b3...
"""Accesses the google.logging.v2 LoggingServiceV2 API.""" import functools import pkg_resources import warnings from google.oauth2 import service_account import google.api_core.gapic_v1.client_info import google.api_core.gapic_v1.config import google.api_core.gapic_v1.method import google.api_core.grpc_helpers impor...
{ "content_hash": "50b3e031e3ca739d29db1e0d4baceaff", "timestamp": "", "source": "github", "line_count": 701, "max_line_length": 155, "avg_line_length": 45.05135520684736, "alnum_prop": 0.5855419397739147, "repo_name": "dhermes/gcloud-python", "id": "692f01f290a62e1165297583a652b297b75f371b", "size"...
from __future__ import absolute_import from envisage.ui.single_project.project_factory import *
{ "content_hash": "507463a7d35edb222b1507441be45eda", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 56, "avg_line_length": 48, "alnum_prop": 0.8020833333333334, "repo_name": "enthought/etsproxy", "id": "d99764ba434b8d3afa5ef10ef7cb12849e1836af", "size": "111", "binary": ...
import argparse # Parameters parser = argparse.ArgumentParser(description='Catcher') parser.add_argument('--grid', dest='grid', type=int, default=11, help='Game grid size.') parser.add_argument('--memory', dest='memory', type=int, default=500, help='Experience replay memory length') parser.add_argument('--epoch', dest...
{ "content_hash": "5ec0291bc31b93e17c1b16484933cecc", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 136, "avg_line_length": 45.86538461538461, "alnum_prop": 0.7488469601677149, "repo_name": "EderSantana/X", "id": "3c3b12b4d54233a6ae3d7dee8a275614c90ac26e", "size": "2385",...
from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Session from sqlalchemy import create_engine import requests, json Base = automap_base() # engine, suppose it has two tables 'user' and 'address' set up #engine = create_engine('mssql+pyodbc://devel:n***********d@NEIL-DESKTOP/FRESH?d...
{ "content_hash": "c7e4eba0bfd352440149bcca85462066", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 133, "avg_line_length": 32.70967741935484, "alnum_prop": 0.7001972386587771, "repo_name": "nkenealy/shopify-product-load", "id": "a55c61c2e674873c50f8d7daed156a29990d0ff1", ...
import unittest from biicode.common.utils.serializer import Serializer, DictDeserializer from biicode.common.model.brl.block_cell_name import BlockCellName class DummyA(object): a = None b = None def __init__(self, *args, **kwargs): self.a = 1 self.b = 2 def serialize(self): ...
{ "content_hash": "f8e6d9865ebf89fcfb22b91586a26050", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 90, "avg_line_length": 30.97826086956522, "alnum_prop": 0.47134502923976607, "repo_name": "biicode/common", "id": "f8850b16cebf4bf8781bc346ccf9f1199aaef65e", "size": "4275...
from django.contrib import admin # Register your models here. from pedidovenda.models import Categoria from pedidovenda.models import Produto from pedidovenda.models import Pedido from pedidovenda.models import ItemPedido from pedidovenda.models import Mesa from pedidovenda.models import Usuario from django.contrib i...
{ "content_hash": "4f7072f01c967fd7d2bdbe6ba8727fd6", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 91, "avg_line_length": 29.0625, "alnum_prop": 0.7670250896057348, "repo_name": "thaleslima/WS-pedido-venda", "id": "513d6ba52a61d4329298e08ec3d0c858eff1a693", "size": "1395...
import logging def make_logger(configuration): pass
{ "content_hash": "4adcd9ca856ed3707ea3839fe37c060a", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 31, "avg_line_length": 11.4, "alnum_prop": 0.7543859649122807, "repo_name": "tokyo-jesus/aniracetam", "id": "304c02c84ec61c8016f760f25f161af168f7bee0", "size": "82", "bina...
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineRespon...
{ "content_hash": "799d7fadbb064e57d5d88d7ff52cbe47", "timestamp": "", "source": "github", "line_count": 382, "max_line_length": 255, "avg_line_length": 42.78010471204188, "alnum_prop": 0.6464325052013218, "repo_name": "Azure/azure-sdk-for-python", "id": "539ab71c846e8a3294b1bc5271e7bd7637e40057", "...
VERSION='0.1' # very early develop version
{ "content_hash": "2855de095a68db9d8ca1be8f37a407bc", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 42, "avg_line_length": 43, "alnum_prop": 0.7441860465116279, "repo_name": "pyKun/nova-thousands", "id": "2a3c4ab61958ec5b99e51432a13b069d9b1266db", "size": "135", "binary"...
from distutils.core import setup from Cython.Build import cythonize setup( ext_modules = cythonize("gen_walk.pyx", language="c++") )
{ "content_hash": "6e7d4c2dfbccc127cc69f22ceeb949e1", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 63, "avg_line_length": 24.333333333333332, "alnum_prop": 0.6917808219178082, "repo_name": "gear/motifwalk", "id": "fc75f2d11a5d4a50494a5e146601b00e24c8a8cd", "size": "146", ...
from unittest import mock from heat.engine.clients.os import zaqar from heat.tests import common from heat.tests import utils class ZaqarClientPluginTest(common.HeatTestCase): def test_create(self): context = utils.dummy_context() plugin = context.clients.client_plugin('zaqar') client = ...
{ "content_hash": "5f5c6731d870101e4c37a59e57fd0716", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 78, "avg_line_length": 37.303030303030305, "alnum_prop": 0.6246953696181966, "repo_name": "openstack/heat", "id": "bd588c7c913f85ce4cb7221f9c09de9dba2b8f5f", "size": "1806"...
""" ==================================================================== Decoding in sensor space data using the Common Spatial Pattern (CSP) ==================================================================== Decoding applied to MEG data in sensor space decomposed using CSP. Here the classifier is applied to feature...
{ "content_hash": "8283db475bd11270a575d4d381aabf42", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 79, "avg_line_length": 36.55140186915888, "alnum_prop": 0.646637688570698, "repo_name": "mne-tools/mne-tools.github.io", "id": "da1ad28ddcebe89dd7920e4a0d5c129fbfd100c1", ...