text
stringlengths
4
1.02M
meta
dict
from unittest import mock import civis from civis.resources import API_SPEC import pytest @pytest.mark.parametrize('schema_tablename', [ 'foo.bar', '"foo".bar', 'foo."bar"', '"foo"."bar"' ]) def test_get_table_id(schema_tablename): """Check that get_table_id handles quoted schema.tablename correctly.""" ...
{ "content_hash": "cdd2bbc45c85c12c61cd040c9ff9a3a2", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 79, "avg_line_length": 30.15686274509804, "alnum_prop": 0.6599479843953185, "repo_name": "civisanalytics/civis-python", "id": "8dd543ef1cb2fef0e6af808b7ca3a7cdb3e5cda6", "s...
import pytest from api.base.settings.defaults import API_BASE from api.providers.permissions import GroupHelper from osf_tests.factories import ( AuthUserFactory, ) from osf.utils import permissions as osf_permissions from api_tests.reviews.mixins.filter_mixins import ReviewActionFilterMixin from api_tests.review...
{ "content_hash": "5dc69205df985e75968e91c6da40decf", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 86, "avg_line_length": 32.898305084745765, "alnum_prop": 0.6548171045852653, "repo_name": "sloria/osf.io", "id": "d96b71a623569bb37d09c076db6e1ac4cee111d0", "size": "1941",...
import re import ast from setuptools import setup, find_packages _version_re = re.compile(r'__version__\s+=\s+(.*)') with open('withings_cli/cli.py', 'rb') as f: __version__ = str(ast.literal_eval(_version_re.search( f.read().decode('utf-8')).group(1))) setup( name="withings-cli", author="Kim Blo...
{ "content_hash": "f05daf3e1ba0d032c2b02fa57baaa5f1", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 85, "avg_line_length": 29.18918918918919, "alnum_prop": 0.6092592592592593, "repo_name": "kblomqvist/withings-cli", "id": "4302555384571f2ddbe3be15a3ea8c5d6bbee461", "size"...
from __future__ import absolute_import import mock import unittest import bs4 import bokeh.embed as embed from bokeh.plotting import figure, curdoc from bokeh.resources import CDN, JSResources, CSSResources from bokeh.util.string import encode_utf8 from jinja2 import Template from six import string_types _embed_tes...
{ "content_hash": "a370ff6e913b59647e3c6d8fc25660a1", "timestamp": "", "source": "github", "line_count": 485, "max_line_length": 114, "avg_line_length": 39.315463917525776, "alnum_prop": 0.580029368575624, "repo_name": "DuCorey/bokeh", "id": "9cec1d48344f9b8ebd76649e2b9caed0d2246dca", "size": "19068...
""" @package mi.dataset.driver.adcps_jln.stc.driver @file marine-integrations/mi/dataset/driver/adcps_jln/stc/driver.py @author Maria Lutz @brief Driver for the adcps_jln_stc Release notes: Release 0.0.3 Driver modified to incorporate the recovered data using ADCPS JLN parser to parse bindary PD0 files modificat...
{ "content_hash": "415f407096ec34c93ae26fc4a90941b6", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 102, "avg_line_length": 39.134453781512605, "alnum_prop": 0.6175649559802447, "repo_name": "ooici/marine-integrations", "id": "df48423e85f05325ef99d2e50b18a84de6fbbf5d", "...
from django.contrib import admin from .models import Term, Context, Flashcard, Category, FlashcardAnswer from proso_models.admin import pretty_date class TermAdmin(admin.ModelAdmin): list_display = ('id', 'identifier', 'lang', 'name') search_fields = ('identifier', 'name') list_filter = ('lang',) class ...
{ "content_hash": "dfc21f3fe4cc18a141834278d83d2e1d", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 71, "avg_line_length": 26.08974358974359, "alnum_prop": 0.6103194103194103, "repo_name": "adaptive-learning/proso-apps", "id": "ebfca961a07ac8179b6780506fe39f8e7e05aa88", "...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('imager_profile', '0004_auto_20170119_1916'), ] operations = [ migrations.AlterField( model_name='imagerprofile', name='addre...
{ "content_hash": "d2eca126098835e1df0bd10a8e988414", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 73, "avg_line_length": 27.607142857142858, "alnum_prop": 0.5808538163001293, "repo_name": "JSchatzman/django-imager", "id": "7a84915d71f8d2233b196c54c36b4786e238ffd6", "siz...
""" Shows how many fractions are available in the worldgrid for a given tile Example invocation:: python rastercube/scripts/show_available_fractions.py --tile=h10v09 --worldgrid=hdfs:///user/terrai/worldgrid/ """ from __future__ import division import os import sys import argparse import numpy as...
{ "content_hash": "22df546ebc6f33d958db661bc50c4a13", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 78, "avg_line_length": 31.407894736842106, "alnum_prop": 0.6351068286552157, "repo_name": "terrai/rastercube", "id": "23f08c97edc1d0e766ccfd658d7eee505bc27c04", "size": "23...
import time from django.core.management.base import BaseCommand from api.util import expire_inboxes, expire_items, expire_requests class Command(BaseCommand): help = 'Background cleanup task' def handle(self, *args, **options): inboxes = expire_inboxes() print('expired %d inboxes' % inboxes) # expire items o...
{ "content_hash": "56066a42a5be3ac3a969af9bc87190f8", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 67, "avg_line_length": 31.130434782608695, "alnum_prop": 0.7039106145251397, "repo_name": "fanout/webhookinbox", "id": "db42a1c4da62f83ae0b09fed18611bc1ae96e3d2", "size": "...
from datetime import date from typing import List import pytest from netsgiro import ( AssignmentType, AvtaleGiroRegistrationType, RecordType, ServiceCode, TransactionType, ) from netsgiro.records import ( AssignmentEnd, AssignmentStart, AvtaleGiroAgreement, Record, Transaction...
{ "content_hash": "709c3423cb414a894076ea6dcd4b70f3", "timestamp": "", "source": "github", "line_count": 434, "max_line_length": 94, "avg_line_length": 34.40783410138249, "alnum_prop": 0.7226947030067635, "repo_name": "otovo/python-netsgiro", "id": "cf846240479f77040256d5c0888a6cbfa595f532", "size":...
from django import template from django.conf import settings from django.urls import reverse from django.utils.html import format_html from django_gravatar.helpers import get_gravatar_url register = template.Library() @register.simple_tag def user_link(user): gravatar_url = get_gravatar_url(user.email, size=16) ...
{ "content_hash": "abb7750477175cf189a180003aaa4c5c", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 139, "avg_line_length": 36.84615384615385, "alnum_prop": 0.7181628392484343, "repo_name": "portnov/assethub", "id": "9df9a352bff77bab4aaf788ae4564587ae8b1093", "size": "958...
from unittest import TestCase, main import os import time import sys import tempfile import difflib import svtools.varlookup class IntegrationTest_varlookup(TestCase): def run_integration_test(self): test_directory = os.path.dirname(os.path.abspath(__file__)) test_data_dir = os.path.join(test_direc...
{ "content_hash": "65546435a72437455718c1f80f9eaa09", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 118, "avg_line_length": 47.56603773584906, "alnum_prop": 0.6295120983736613, "repo_name": "hall-lab/svtools", "id": "c931e62ee32c8a2216391c72daa2845f602a8fe1", "size": "252...
from abc import abstractmethod class Configurable(object): class ConfigureResult(object): def __init__(self): self.message = "" self.successed = True @abstractmethod def init_from_config(self, configure, **kwargs): pass @abstractmethod def get_from_conte...
{ "content_hash": "17d82f85951f657657e356311ea3c2a9", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 52, "avg_line_length": 17.12, "alnum_prop": 0.6051401869158879, "repo_name": "squall1988/lquant", "id": "c6515909008a98cc7c339cc6b7af4abf356b181a", "size": "444", "binary...
""" Imageio is a Python library that provides an easy interface to read and write a wide range of image data, including animated images, volumetric data, and scientific formats. It is cross-platform, runs on Python 2.x and 3.x, and is easy to install. Main website: http://imageio.github.io """ __version__ = '1.4' ...
{ "content_hash": "f6debeb6951234068ea63e1273e97c02", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 74, "avg_line_length": 29.37142857142857, "alnum_prop": 0.754863813229572, "repo_name": "patricksnape/imageio", "id": "4a43edcaed254751b0a992669f6a76e1ee1999a0", "size": "1...
from django.db import models class Category(models.Model): title = models.CharField(max_length=200) def __unicode__(self): return self.title
{ "content_hash": "f756518ff710e1cb86a1c83cd0312c40", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 44, "avg_line_length": 20, "alnum_prop": 0.68125, "repo_name": "mozillazg/django-simple-projects", "id": "517e52df7dd0147c17c478cbed077b6556b50ad2", "size": "207", "binary...
from neutron_lib.api.definitions import network_ip_availability from neutron_lib.db import utils as db_utils from neutron_lib import exceptions import neutron.db.db_base_plugin_v2 as db_base_plugin_v2 import neutron.db.network_ip_availability_db as ip_availability_db class NetworkIPAvailabilityPlugin(ip_availability...
{ "content_hash": "c8b4c750931c6c2f9e58eb0fd6b2ab95", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 76, "avg_line_length": 39.255319148936174, "alnum_prop": 0.6693766937669376, "repo_name": "mahak/neutron", "id": "f95679ae763b03efb2a7fc0eb6e002375c172435", "size": "2429",...
import sys import os import re from paste.script.templates import var from paste.script.templates import Template from collective.generic.skel.buildout.common import boolify class Package(Template): """ Package template to do a double namespace egg. Althout it prentends to do that, it is a base for sub ...
{ "content_hash": "eff58ea735aff27f81c4caf598b5b977", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 165, "avg_line_length": 37.09722222222222, "alnum_prop": 0.6038936727817297, "repo_name": "collective/collective.generic.webbuilder", "id": "ea719edc68477b2b0d20f6061571e0aba...
""" Licensed under CC Attribution http://creativecommons.org/licenses/by/3.0/ Copyright 2011, Steve Engledow """ def do_round(votes, counts = {}, loser=None): for vote in votes: for i in range(len(vote)): if not loser: if vote[i] not in counts: counts[vote[i]...
{ "content_hash": "0e2272513b4002bcb6e1d40c12db9bfb", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 114, "avg_line_length": 28.547169811320753, "alnum_prop": 0.5181758096497026, "repo_name": "stilvoid/av", "id": "4a2368e7af4c8acc2321130b1493ba8f88acc213", "size": "1513", ...
"""Cms portfolio views""" from datetime import datetime from django import http from django.contrib import messages from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.http.response import HttpResponseRedirect from django.utils.translation import ugettext_...
{ "content_hash": "82416dc6ae6e423f79fcce292cd16b7c", "timestamp": "", "source": "github", "line_count": 195, "max_line_length": 78, "avg_line_length": 29.6, "alnum_prop": 0.5812543312543312, "repo_name": "Alkemic/webpage", "id": "4d0722a82b151ba5881e6088abbbebcb3a2e5914", "size": "5796", "binary"...
from pyramid.response import Response from pyramid.view import view_config, forbidden_view_config from pyramid.security import authenticated_userid from pyramid.renderers import render_to_response from velruse import login_url from datetime import datetime import re import pyramid.httpexceptions as exc import logging ...
{ "content_hash": "ec1e2bf46c6ae3f1091fac9a6975feee", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 123, "avg_line_length": 34.63076923076923, "alnum_prop": 0.6688138605064415, "repo_name": "PeterGrace/pi_director", "id": "fd359b5f13c573ccde6104e7845c4feb16ffb7b5", "size...
import os import subprocess import pytest pytestmark = pytest.mark.girder @pytest.fixture def unavailableWorker(db): """ Make sure that Girder Worker can't be reached and times out quickly. """ from girder_worker.girder_plugin.constants import PluginSettings as WorkerSettings from girder.models...
{ "content_hash": "dcfeb119d868fd681e6faed14facd5cb", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 86, "avg_line_length": 29.698630136986303, "alnum_prop": 0.698339483394834, "repo_name": "girder/large_image", "id": "295ed9f1b782133f26b8680a87cc464dde4ffaa6", "size": "21...
"""added invoice model Revision ID: a15fe29fe566 Revises: bdb82b2b0eb0 Create Date: 2016-04-14 20:44:53.860856 """ # revision identifiers, used by Alembic. revision = 'a15fe29fe566' down_revision = 'bdb82b2b0eb0' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alem...
{ "content_hash": "ca04ffc3852363d153b8787234ab108a", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 63, "avg_line_length": 26.606060606060606, "alnum_prop": 0.6708428246013668, "repo_name": "skazi0/yaia", "id": "c9070390f832f89144869b4502ca39445ddca5b9", "size": "878", ...
from __future__ import print_function import logging, re, os import data, parser, util from pymake.globrelative import hasglob, glob from pymake import errors try: from cStringIO import StringIO except ImportError: from io import StringIO _log = logging.getLogger('pymake.data') _tabwidth = 4 class Location...
{ "content_hash": "c1ab9148be34215d890f27e81089ace1", "timestamp": "", "source": "github", "line_count": 1015, "max_line_length": 146, "avg_line_length": 33.02660098522168, "alnum_prop": 0.5958176719766124, "repo_name": "mozilla/pymake", "id": "833b06e73caf98ed9b63c22012c6f5d4ced56244", "size": "335...
import unittest import os from test.aiml_tests.client import TestClient from programy.config.brain import BrainFileConfiguration class BasicTestClient(TestClient): def __init__(self): TestClient.__init__(self) def load_configuration(self, arguments): super(BasicTestClient, self).load_configur...
{ "content_hash": "2e4db7b2e870c148d967bb8ec2ee992f", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 116, "avg_line_length": 42.61635220125786, "alnum_prop": 0.6790141676505312, "repo_name": "dkamotsky/program-y", "id": "26e8e54f2ce29635e7ef91b193d49c3101d35fcb", "size": ...
import numpy as np def extremum(points,comp): ext_x = 0. ext_y = 0. bleft = array([ext_x,ext_y]) for point in points: if comp(point[0],ext_x) < 0: ext_x = point[0] if comp(point[1], ext_y) < 0: ext_y = point[1] return bleft def upperight(points) return extremum(points,lambda x:-cmp(x)) def bottomlef...
{ "content_hash": "927adcc59f7bc2e1649c09147faae2fa", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 63, "avg_line_length": 24.317073170731707, "alnum_prop": 0.6820461384152458, "repo_name": "cwgreene/Nanostructure-Simulator", "id": "d32999fe9561b02ec597beeb3749f2b006b65e9c"...
from django.apps import AppConfig class SolveitappConfig(AppConfig): name = 'solveitapp'
{ "content_hash": "86f3d7532e9c047727d5ecb88b269cb5", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 34, "avg_line_length": 19, "alnum_prop": 0.7684210526315789, "repo_name": "kiss90benedek/solveit", "id": "52b8720a800625dec088f01e0d03683e15f35b41", "size": "95", "binary"...
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } INSTALLED_APPS = ( 'djcelery_email', 'appconf', ) SECRET_KEY = 'unique snowflake' # Django 1.7 throws dire warnings if this is not set. # We don't actually use any middleware, given that there ...
{ "content_hash": "bc1ed0da7a94e270024a4655be576092", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 70, "avg_line_length": 23.28, "alnum_prop": 0.6408934707903781, "repo_name": "pmclanahan/django-celery-email", "id": "e82c03e9ac9dbc61de27ef7878e00c30adda87ff", "size": "58...
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() from tastypie.api import Api from sxsw.api import PresenterResource, EventResource, TagResource from django.views.generic import RedirectView, TemplateView import settings # API resources v1_api = Api(api_name='v1...
{ "content_hash": "ba838ea40249c6d9171046cdb846b8b7", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 136, "avg_line_length": 31.666666666666668, "alnum_prop": 0.7035087719298245, "repo_name": "laud/upword-notes-sxsw", "id": "eb54a108e61a6601b450a9122f0d58d0a3c5c78a", "size...
import datetime from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound from workin.utils import importlib NOW = datetime.datetime.now class AuthHandlerMixin(object): def __init__(self, *args, **kwargs): super(AuthHandlerMixin, self).__init__(*args, **kwargs) ext_path = 'workin.ext...
{ "content_hash": "77d66ebde4f747ee5b57abda174f769f", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 80, "avg_line_length": 32.97872340425532, "alnum_prop": 0.5890322580645161, "repo_name": "knownsec/workin", "id": "4553939f4b8de8645064bbfd603a8c8bce847368", "size": "3147"...
import catoclient.catocommand from catoclient.param import Param class ListUsers(catoclient.catocommand.CatoCommand): Description = 'Lists Users' API = 'list_users' Examples = ''' _List all users_ cato-list-users _List all users with Administrator role_ cato-list-users -f "Administrator" ''' ...
{ "content_hash": "feb005d911ef8dcd4a7e5ea6f1b6a68e", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 151, "avg_line_length": 28.875, "alnum_prop": 0.6479076479076479, "repo_name": "cloudsidekick/catoclient", "id": "4a470f9e05e5c91e16d15d213faa9fb65fa9b24f", "size": "1419",...
"""Tests for tensorflow.ops.control_flow_ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import math import time import numpy as np from six.moves import xrange # pylint: disable=redefined-builtin from tensorflow.core.protobuf ...
{ "content_hash": "f08cd81bf4c6308361b366852e82fa09", "timestamp": "", "source": "github", "line_count": 3450, "max_line_length": 112, "avg_line_length": 36.526376811594204, "alnum_prop": 0.6117715210766886, "repo_name": "kobejean/tensorflow", "id": "d91a848e01350a92894811739257d529aad636ab", "size"...
from argyle.base import upload_template from argyle.system import restart_service from fabric.api import abort, sudo, task from fabric.contrib import files @task def remove_default_site(): """Remove the default Nginx site if it exists.""" disable_site('default') @task def upload_nginx_site_conf(site_name, ...
{ "content_hash": "f5ec7f9abe4a479f3e5d55fcc763f270", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 87, "avg_line_length": 30.333333333333332, "alnum_prop": 0.673992673992674, "repo_name": "mlavin/argyle", "id": "dadeb52198b6c986a4b595b6382c1f4e84bb5914", "size": "1365", ...
""" Django settings for DjangoQuickTour project. Generated by 'django-admin startproject' using Django 1.10.4. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ i...
{ "content_hash": "eb910c2eb329618655cd9e6d9c9fdfe3", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 91, "avg_line_length": 27.56390977443609, "alnum_prop": 0.6783960720130933, "repo_name": "mingyeh/DjangoQuickTour", "id": "79452e7dd21ddf621f9148e46f1468a09de9f939", "size...
""" __init__ Test Suite :copyright: (c) 2013 by Openlabs Technologies & Consulting (P) Limited :license: BSD, see LICENSE for more details. """ import unittest import trytond.tests.test_tryton from test_category import TestCategory def suite(): """ Define suite """ test_suite = try...
{ "content_hash": "af78da18035e96920ad3a342316cc7bf", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 74, "avg_line_length": 20.555555555555557, "alnum_prop": 0.6576576576576577, "repo_name": "openlabs/nereid-catalog-icecat", "id": "c66e5c3a63f9c11a1a2e1b4a993d32643dd2a234", ...
import io import unittest from unittest.mock import patch from kattis import k_methodicmultiplication ############################################################################### class SampleInput(unittest.TestCase): '''Problem statement sample inputs and outputs''' def test_sample_input_1(self): ...
{ "content_hash": "96f090c17ae4d7ca7b41f92b05d11be4", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 79, "avg_line_length": 34.56818181818182, "alnum_prop": 0.52465483234714, "repo_name": "ivanlyon/exercises", "id": "a6dff839abcf745e7a69dc03d4fad8be9f43560e", "size": "1521...
"""Engine related exceptions.""" class EngineManagerError(Exception): """Any exception related to engine manager.""" pass
{ "content_hash": "cbe64be2fe163e378097d59835df47e9", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 50, "avg_line_length": 22, "alnum_prop": 0.7045454545454546, "repo_name": "simphony/simphony-common", "id": "feb19fa5e7952dcec10242dcbbbc9e6b92d5f13f", "size": "132", "bin...
import uuid from django.db import connections from django.db.models import Model, UUIDField def _compiler_for_queryset(qs, which='SQLCompiler'): connection = connections[qs.db] Compiler = connection.ops.compiler(which) return Compiler(qs.query, connection, connection.alias) class RqlQueryProxy(object): """ ...
{ "content_hash": "b550a069a3cc3d5d72fd244a97cbac5a", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 72, "avg_line_length": 25.02173913043478, "alnum_prop": 0.6959165942658557, "repo_name": "d2rk/django-rethinkdb-engine", "id": "7efdf19fb15a0935f39edbd9fd289931b79a5b2a", "...
import logging import re from urllib.parse import urljoin from streamlink.plugin import Plugin from streamlink.plugin.api import validate from streamlink.stream import HLSStream, HTTPStream from streamlink.utils import parse_json, verifyjson log = logging.getLogger(__name__) class ard_live(Plugin): _url_re = re...
{ "content_hash": "39b299e3c75faa98e287f64e77979476", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 112, "avg_line_length": 35.382716049382715, "alnum_prop": 0.5436147941381717, "repo_name": "beardypig/streamlink", "id": "f1ec0b7e2c5bcc0815343d2c83f04086091c1956", "size":...
from functools import partial from flask import current_app, g from indico.modules.events.abstracts.compat import compat_abstract from indico.modules.events.abstracts.controllers import (abstract, abstract_list, boa, display, email_templates, management, review...
{ "content_hash": "97ae3fdf99823a437ec2a83a948fec7f", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 120, "avg_line_length": 69.78865979381443, "alnum_prop": 0.6773026072826649, "repo_name": "indico/indico", "id": "d7f2fcf39b04c37594608a00dba091f8b2b28d7e", "size": "13753...
import os import astropy.units as u from astropy.io import fits import numpy as np from astropy.cosmology import FlatLambdaCDM cosmo = FlatLambdaCDM(H0=70, Om0=0.3) from .operator import Operator from .. import standards from ..filters import surveysetup from ..external_links import file_humvi_compose from .. import ...
{ "content_hash": "924bfdbf6e673d7976d39b6093d2fa3c", "timestamp": "", "source": "github", "line_count": 237, "max_line_length": 151, "avg_line_length": 26.18143459915612, "alnum_prop": 0.6568896051571314, "repo_name": "aileisun/bubbleimg", "id": "7a109c7dba7598ea6b5fc2f3ffe4e4bd891387a8", "size": "...
import inspect import os import sys from datetime import datetime, date import time import logging import json from collections import Iterable import copy from bson.objectid import ObjectId from turbo.log import util_log try: basestring except Exception as e: basestring = str def to_list_str(value, encode...
{ "content_hash": "584fb83f3c391137975081c88b90b7c5", "timestamp": "", "source": "github", "line_count": 329, "max_line_length": 103, "avg_line_length": 23, "alnum_prop": 0.5784326681643981, "repo_name": "tao12345666333/app-turbo", "id": "a6e14b95ebe750f040b657b65f1ea52713825d2b", "size": "7605", ...
"""Dataset class for CleverHans """ # pylint: disable=missing-docstring from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import array import functools import gzip import operator import os import struct import tempfil...
{ "content_hash": "9d6dd508b6e3be9402b0ee9d61e43737", "timestamp": "", "source": "github", "line_count": 347, "max_line_length": 107, "avg_line_length": 28.95100864553314, "alnum_prop": 0.5932709536133784, "repo_name": "cleverhans-lab/cleverhans", "id": "53cdd70a0f74ff352abf0844137f2a6be9a2de18", "s...
from .card import Card class GoBackThreeSpaces(Card): ''' Go back three spaces. ''' def play(self, game, current_player): # We defer this import to avoid a circular reference... from ..game import Board # We move the player back three squares... current_player.state.sq...
{ "content_hash": "dae9b3ad90ee8966c60d7d603c945585", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 66, "avg_line_length": 25, "alnum_prop": 0.632, "repo_name": "richard-shepherd/monopyly", "id": "6048ef71b4f3d0848d8e07efd86dcc76e3c921d0", "size": "500", "binary": false...
import requests import time import sys import datetime import csv import random import re import json import traceback import os import telegram from pydblite import Base #The PyDbLite stuff import builtins messagesSent = 0 spamLimitTime = 15 spamArray = {} def helpResponse(): response = "/goodmorning - say he...
{ "content_hash": "ffefa544a561add9dd7efe990e96e3c5", "timestamp": "", "source": "github", "line_count": 435, "max_line_length": 244, "avg_line_length": 40.53793103448276, "alnum_prop": 0.5940229102869456, "repo_name": "magomez96/AdamTestBot", "id": "0888d49eda8d661ba831c8384cf0ec7cda7704ab", "size"...
""" This module provides an interface between the previous Pod API and outputs a kubernetes.client.models.V1Pod. The advantage being that the full Kubernetes API is supported and no serialization need be written. """ from __future__ import annotations import copy import hashlib import re import uuid from kubernetes.c...
{ "content_hash": "1b0d07daedeeead6d48ce5adfc3a05d4", "timestamp": "", "source": "github", "line_count": 286, "max_line_length": 103, "avg_line_length": 38.44405594405595, "alnum_prop": 0.6277398817644384, "repo_name": "apache/airflow", "id": "f08a6c45d223199f8aaeb7d68f82bca55853c6f6", "size": "1178...
import uuid import time import re import json import pytest from synapseclient.core.exceptions import SynapseHTTPError from synapseclient import Activity, Annotations, Column, File, Folder, Link, Project, Row, RowSet, Schema, Wiki import synapseclient.core.utils as utils import synapseutils # Add Test for UPDATE # ...
{ "content_hash": "a19b453963a4b916d416e0e65bd16e7b", "timestamp": "", "source": "github", "line_count": 346, "max_line_length": 120, "avg_line_length": 46.19364161849711, "alnum_prop": 0.6414940874679347, "repo_name": "thomasyu888/synapsePythonClient", "id": "91e32778638bccf4ea34ebf4a485360db90699cc"...
import gtk import gobject import os.path import debugger from util import * from editor_base import * from source_view_tab import SourceViewTab class SourceViewFileNotFoundTab(gtk.VBox): def __init__(self,file_handle): EditorTabInterface.validate_implementation(self) gtk.VBox.__init__(self,file) l = gtk...
{ "content_hash": "c6284b49b814f9f1b84c88fda40074d8", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 133, "avg_line_length": 37, "alnum_prop": 0.6495726495726496, "repo_name": "natduca/ndbg", "id": "ba5af1b4da2357d05ba1646fe2cff462bfba23ac", "size": "5009", "binary": fa...
import yaml import pytest import shutil import requests import tempfile from os import getenv as env from contextlib import contextmanager API_URL = env('GI_API_URL', 'https://api.ghostinspector.com/v1/') API_KEY = env('GI_API_KEY') START_URL = env('GI_START_URL') # Command-line Options def pytest_addoption(parser)...
{ "content_hash": "18c8d0a343f2294c740b2adce67b730f", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 77, "avg_line_length": 32.40573770491803, "alnum_prop": 0.5512836726950803, "repo_name": "harvard-dce/pytest-ghostinspector", "id": "c1766ce130dce176c02688d24f56b007f797d0d5...
"""Fichier contenant la fonction reussir_recette.""" from primaires.format.fonctions import supprimer_accents from primaires.scripting.fonction import Fonction from primaires.scripting.instruction import ErreurExecution class ClasseFonction(Fonction): """Fait progresser un membre de guilde dans son rang.""" ...
{ "content_hash": "236ca4f68fbc5c9db48adebb9c4fb3fd", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 74, "avg_line_length": 37.8125, "alnum_prop": 0.6603305785123967, "repo_name": "vlegoff/tsunami", "id": "b7a001b1ca2d5b5bbbcdafc637f01bbc81b1d577", "size": "4012", "binar...
from django.conf.urls import patterns, include, url urlpatterns = patterns('apps.basic_pages.views', #url(r'^home/$', 'view_homepage', name="view_homepage"), url(r'^support/$', 'view_support_page', name="view_support_page"), url(r'^best-practices/$', 'view_best_practices_page', name="view_best_practice...
{ "content_hash": "65d1422fef33a90292c30ebcfd1cc097", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 91, "avg_line_length": 28.3125, "alnum_prop": 0.6423841059602649, "repo_name": "bencomp/dataverse.org", "id": "b6de6975b78d75ecfdb21cc5b77c1a29885f97db", "size": "453", "...
""" Package declaration for content assertions test helper module """ import core
{ "content_hash": "306e1611848df9f04cbfa6a6e17eda83", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 61, "avg_line_length": 20.5, "alnum_prop": 0.7804878048780488, "repo_name": "bmedx/modulestore", "id": "fc6a0c4d9bf0af7946a7ce8fb0231b9eac561c8d", "size": "82", "binary": ...
from taskwarrior_capsules.capsule import CommandCapsule from taskwarrior_capsules.exceptions import CapsuleError from taskwarrior_capsules.data import BUILT_IN_COMMANDS class Context(CommandCapsule): """ Backports 'context' command Taskwarrior 2.4.2.""" MIN_VERSION = '0.2.5' MAX_VERSION = '1.0' MIN_T...
{ "content_hash": "f604819d96b79fcd3ea86cc50356f8dd", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 79, "avg_line_length": 32.694736842105264, "alnum_prop": 0.5872504829362524, "repo_name": "coddingtonbear/taskwarrior-context-capsule", "id": "6f0c1e9ac55f04c1e4b3d2b5afb4b63...
import os import sys sys.path.insert(0, os.path.abspath('.')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions...
{ "content_hash": "94da4c32d276f8229bd32cd38cd87433", "timestamp": "", "source": "github", "line_count": 342, "max_line_length": 103, "avg_line_length": 28.719298245614034, "alnum_prop": 0.6842801873345551, "repo_name": "Ingenico-ePayments/connect-sdk-python2", "id": "9e994ace69290d47c7b65b0004fdf5481...
import logging import os import re import subprocess import sys import tempfile import uuid from collections import namedtuple from django.db.backends.base.creation import TEST_DATABASE_PREFIX def is_testing(): return os.environ.get("CCHQ_TESTING") == "1" class SharedDriveConfiguration(object): def __init_...
{ "content_hash": "1e6afd2941c06fb8faff98ef8269953f", "timestamp": "", "source": "github", "line_count": 305, "max_line_length": 105, "avg_line_length": 34.445901639344264, "alnum_prop": 0.6099371787549971, "repo_name": "dimagi/commcare-hq", "id": "e1bd0fbba8901ee91cce5b6144ef435df0b640c6", "size": ...
from django.conf.urls import patterns, include, url from django.contrib import admin urlpatterns = patterns( '', # First arg to patterns is a namespace parameter. # A handful of views in a base app. url(r'^$', 'base_app.views.site_index'), url(r'^logout/$', 'base_app.views.logout'), url(r'^creat...
{ "content_hash": "62ade6533e99718556850726be7a983f", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 67, "avg_line_length": 32.90909090909091, "alnum_prop": 0.6588397790055248, "repo_name": "petwitter/petwitter", "id": "07b89e6f69705404e3b972a289d336dc75f735f2", "size": "7...
"""Renders policy source files into actual Access Control Lists.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals __author__ = 'pmoody@google.com' import copy import difflib import dircache import multiprocessing i...
{ "content_hash": "79750cfc1bde75f9eabd7bb478ce74b2", "timestamp": "", "source": "github", "line_count": 487, "max_line_length": 80, "avg_line_length": 31.917864476386036, "alnum_prop": 0.6405043746783324, "repo_name": "ryantierney513/capirca", "id": "e179cf0eec4fa59edcab6ff797fd2160e17fbda3", "size...
"""Checker models""" import tempfile import os from subprocess import Popen, PIPE, STDOUT from pysistem import app, db from pysistem.problems.model import Problem from pysistem.submissions.const import STR_RESULT, STR_STATUS, STATUS_CWAIT from pysistem.submissions.const import STATUS_WAIT, STATUS_COMPILEFAIL, STATUS...
{ "content_hash": "65a7d3909d9ab4181fedc1777a98fb00", "timestamp": "", "source": "github", "line_count": 239, "max_line_length": 97, "avg_line_length": 36.35146443514645, "alnum_prop": 0.58298802946593, "repo_name": "TsarN/pysistem", "id": "584adf2c8edde07b61871f3abe51c6e31104fe67", "size": "8713", ...
################################################################################ # # Copyright (C) 2020-2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal ...
{ "content_hash": "06953b1d54227807a3fb216abc729b87", "timestamp": "", "source": "github", "line_count": 299, "max_line_length": 120, "avg_line_length": 38.876254180602004, "alnum_prop": 0.5975567790777702, "repo_name": "ROCmSoftwarePlatform/Tensile", "id": "50b38dd2ef7be149427d00063d9db4acaea71fd4", ...
from taskbuffer.OraDBProxy import DBProxy import sys import json class NewDBProxy(DBProxy): ''' Class extending OraDBProxy to add some column name mapping utilites ''' def queryColumnSQL(self, sql, varMap = None, arraySize = 100, lowerCase = True): comment = ' /* cacheSchedConfig column query ...
{ "content_hash": "471e901f61291249b0f06ab9c3c944f9", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 84, "avg_line_length": 34.28125, "alnum_prop": 0.5154968094804011, "repo_name": "PanDAWMS/panda-cacheschedconfig", "id": "b2c3a3f4050978bbbdc659dbd8159378ec7306b8", "size":...
import re import mock import testtools from stackalytics.processor import mls EMAIL_CONTENT = ''' From sorlando at nicira.com Tue Jul 17 07:30:43 2012 From: sorlando at nicira.com (Salvatore Orlando) Date: Tue, 17 Jul 2012 00:30:43 -0700 Subject: [openstack-dev] [nova] [pci device passthrough] fails with "NameErr...
{ "content_hash": "a1cd2036d15ae5eb4429a072444ca5e7", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 77, "avg_line_length": 35.717948717948715, "alnum_prop": 0.6651112706389088, "repo_name": "0xf2/stackalytics", "id": "3e6a2d49dd727b2656a48c39aa30b6cdbec2a452", "size": "33...
import os import shutil import wmi import win32api import win32con from win32com.client import Dispatch #Copy files from removable drive to C:\Users\USER\AppData\Local\Microsoft\Windows\Explorer\temp #Create shortcuts pointing to keylog executable def copy(): user = os.environ.get("USERNAME") c = wmi.WMI() remov_di...
{ "content_hash": "6039ed363b6c41bcd0b3c73c48062e2b", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 96, "avg_line_length": 32.377049180327866, "alnum_prop": 0.7129113924050633, "repo_name": "Brunope/Keylogger", "id": "b1cf980f4a9c443f6f2792fd04db96ea50a841ab", "size": "19...
""" Test compiling and executing using the gdc tool. """ # # Copyright (c) 2001 - 2016 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including #...
{ "content_hash": "71533db17e8607ab10549270a960d3c9", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 109, "avg_line_length": 39.13513513513514, "alnum_prop": 0.7651933701657458, "repo_name": "EmanueleCannizzaro/scons", "id": "6e1773be73f70ad98c40b4065df6014773e4142d", "siz...
from __future__ import absolute_import, division, print_function, unicode_literals import os import specs.fbthrift as fbthrift import specs.folly as folly import specs.gmock as gmock from shell_quoting import ShellQuoted, path_join "fbcode_builder steps to build & test watchman" def fbcode_builder_spec(builder): ...
{ "content_hash": "ee15343b15d291cfe481f21800077f20", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 85, "avg_line_length": 31.372549019607842, "alnum_prop": 0.476875, "repo_name": "wez/watchman", "id": "e9fb6a2ac3bca6a716318083502f021ea5acf556", "size": "1622", "binary"...
from __future__ import absolute_import import sys import warnings from google.cloud.talent_v4beta1 import types from google.cloud.talent_v4beta1.gapic import application_service_client from google.cloud.talent_v4beta1.gapic import company_service_client from google.cloud.talent_v4beta1.gapic import completion_client f...
{ "content_hash": "45fd1495bd082c6983cdf5f56b93e4ce", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 84, "avg_line_length": 32.7, "alnum_prop": 0.7553516819571865, "repo_name": "tswast/google-cloud-python", "id": "0d10d0bed3783cbe87d5e3ab1eb85178a994abf0", "size": "2892", ...
from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe.model.naming import append_number_if_name_exists from frappe.website.utils import cleanup_page_name from frappe.utils import now from frappe.modules import get_module_name, load_doctype_module from frappe.websi...
{ "content_hash": "edff35b72af7130e305f0443178f4f86", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 99, "avg_line_length": 31.080645161290324, "alnum_prop": 0.7114686040477426, "repo_name": "gangadharkadam/office_frappe", "id": "e73d6aae1a0615a241ab80f6bc405b26c2c0262b", ...
import os from paste import urlmap from paste import fileapp from webob.exc import HTTPNotFound from minreal.client import MinrealClient from minreal.csp import CSPApp class EchoClient(MinrealClient): """ A plugin that echos back any data sent it. This plugin also provides a simple HTML UI that allows...
{ "content_hash": "ffec90f7e26542a9e3f24bf89ae33a09", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 79, "avg_line_length": 33, "alnum_prop": 0.6247933884297521, "repo_name": "desmaj/minreal", "id": "0d68b023148242f92294be81e2f1e41787b05dc7", "size": "1815", "binary": fa...
""" models imports app, but app does not import models so we haven't created any loops. """ import datetime from flask_peewee.auth import BaseUser # provides password helpers.. from peewee import * from .app import db class User(db.Model, BaseUser): username = CharField() password = CharField() email ...
{ "content_hash": "ecb88c31a5442ea540c206b3433b4413", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 72, "avg_line_length": 23.130434782608695, "alnum_prop": 0.706766917293233, "repo_name": "sloria/flask-template", "id": "2b8e8e403b59137ee96ed701120c5ce1d73c2db4", "size": ...
""" OVERALL CREDIT TO: t0mm0, Eldorado, VOINAGE, BSTRDMKR, tknorris, smokdpi, TheHighway urlresolver XBMC Addon Copyright (C) 2011 t0mm0 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free So...
{ "content_hash": "f893b85d9f3912dcc56b2f2c95a8896d", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 87, "avg_line_length": 37.58, "alnum_prop": 0.6397019691325173, "repo_name": "dbiesecke/dbiesecke.github.io", "id": "7cb4a808074ed3047178dfd65e1d8ad93bb64cc5", "size": "187...
import flax.linen.activation import numpy as np import jax import jax.numpy as jnp from jax import jit, grad, vmap, random, device_put, device_get from jax.tree_util import tree_map, tree_leaves, tree_multimap, tree_structure from flax.linen.activation import relu, sigmoid from functools import reduce, partial def in...
{ "content_hash": "042b806b410b9e5660700c4e81307775", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 82, "avg_line_length": 29.166666666666668, "alnum_prop": 0.6354285714285715, "repo_name": "mattmcd/PyBayes", "id": "3d778b09112dd6cad3d0a450cbae9ebada584a91", "size": "875"...
from confiture import Confiture, ConfigFileError from src.shell.data.data import Data class ScatTest(object): def __init__(self, *args, **kwargs): self.__config = kwargs["clang"] self.__accuracy = {"arity": list(), "type": list()} def display(self): print "Average on ({}):".forma...
{ "content_hash": "e5bc5dedec078d629e56f90e07dc28ea", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 114, "avg_line_length": 44.450980392156865, "alnum_prop": 0.5147772386413763, "repo_name": "Frky/scat", "id": "23388f6e36ef0e02507480903cc139689fcfd758", "size": "2268", ...
from flask import Flask, render_template from videoonline import models from videoonline.models import db from videoonline.extensions import bcrypt, login_manager, principals from flask_principal import identity_loaded, UserNeed, RoleNeed from flask_login import current_user def Create_App(Config = 'videoonline...
{ "content_hash": "a5d073bac2d2bb203bd46565de21f787", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 78, "avg_line_length": 36.540983606557376, "alnum_prop": 0.6155226558995065, "repo_name": "zgoo/OVSS-I", "id": "35e9e9d073d040d30a00bf561e53a9a1ebedc2d2", "size": "2417", ...
import sys SCRIPT_NAME = __name__ #@TODO replace with logger... ERR_STREAM = sys.stderr #@TODO replace with logger... from nexson_validator import NexSON, NexSONError, ValidationLogger, FilteringLogger, WarningCodes def error(msg): global SCRIPT_NAME, ERR_STREAM ERR_STREAM.write('{n}: ERROR: {m}'.format(n=SCR...
{ "content_hash": "e040c479eab2f3fa0c825b314df3b585", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 127, "avg_line_length": 35.114285714285714, "alnum_prop": 0.5850284784377543, "repo_name": "leto/new_opentree_api", "id": "785ab74f98424df54041f3914d6a9b9f2e39730a", "size"...
""" Support for the Fitbit API. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.fitbit/ """ import os import logging import datetime import time import voluptuous as vol from homeassistant.core import callback from homeassistant.components.http i...
{ "content_hash": "e1d380eefbe191d624299ca33f7292e5", "timestamp": "", "source": "github", "line_count": 490, "max_line_length": 79, "avg_line_length": 38.8734693877551, "alnum_prop": 0.5831058378832423, "repo_name": "ewandor/home-assistant", "id": "35748b30ecf4bb65c2e89c8c1ee5130616a35d18", "size":...
default_app_config = 'django_pph.apps.DjangoPPHAppConfig'
{ "content_hash": "31ecef20a677e640eb9e142637bce9e1", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 57, "avg_line_length": 58, "alnum_prop": 0.8103448275862069, "repo_name": "PolyPasswordHasher/PolyPasswordHasher-Django", "id": "16f2f887b4a2805faf09f321ee506c847bed6937", "...
import django.db.models.deletion import modelcluster.contrib.taggit import modelcluster.fields import taggit.managers from django.conf import settings from django.db import migrations, models import wagtail.core.blocks import wagtail.core.fields import wagtail.images.blocks import wagtail.images.models import wagtail....
{ "content_hash": "6b4736973d53cba2c7e9f2ef6bec066a", "timestamp": "", "source": "github", "line_count": 584, "max_line_length": 385, "avg_line_length": 51.87328767123287, "alnum_prop": 0.5730177592922691, "repo_name": "nealtodd/wagtail", "id": "032928e6ea38ee6079770a63ba64fc6f498b7f4f", "size": "30...
""" WSGI config for MyProject 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.10/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application {% if cookiecutter.heroku_deployme...
{ "content_hash": "3ac04c08d5058d8186c3612d417480c3", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 113, "avg_line_length": 36.294117647058826, "alnum_prop": 0.766612641815235, "repo_name": "tamj0rd2/cookiecutter-drfreact", "id": "20d9a9d2ebedd34ab61b1799848f0362261e0174", ...
import json import logging import os # Requests import requests from requests.structures import CaseInsensitiveDict __all__ = [] logger = logging.getLogger('lmiapi.public') class LogMeInPublicAPIBase(object): API_ROOT = None def __init__(self, creds): assert self.API_ROOT self.creds = sel...
{ "content_hash": "16f57295e2b6f5a3dea3b36f010cb036", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 81, "avg_line_length": 38.71304347826087, "alnum_prop": 0.5559299191374663, "repo_name": "ninemoreminutes/lmiapi", "id": "98488dd33bda6937fcebfe11bb87da45f40b2eda", "size"...
import uuid from django.db.models import Case from django.db.models import When from django_filters.rest_framework import DjangoFilterBackend from rest_framework import viewsets from rest_framework.exceptions import ParseError from rest_framework.response import Response from rest_framework.serializers import Validati...
{ "content_hash": "a8dd435bfb759a39b227ec6b3f89a5b5", "timestamp": "", "source": "github", "line_count": 191, "max_line_length": 121, "avg_line_length": 40.973821989528794, "alnum_prop": 0.6055456171735242, "repo_name": "learningequality/kolibri", "id": "e7aa42c077b6b0ecd3ddd8de31936c651e6bd21d", "s...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('scheduler', '0007_scheduler_num_message_handlers'), ] operations = [ migrations.AlterField( model_name='scheduler', name='nu...
{ "content_hash": "be2ea75eaa99a297c91f45efdaa9ab56", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 61, "avg_line_length": 22.666666666666668, "alnum_prop": 0.6151960784313726, "repo_name": "ngageoint/scale", "id": "3f16ffcf7fe017e892f2e434b3f71c81746900af", "size": "481"...
from __future__ import print_function import os import sys import pkg_resources import time import datetime BUILD_DATE = datetime.datetime.utcfromtimestamp(int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))) # If extensions (or modules to document with autodoc) are in another directory, # add these directories to ...
{ "content_hash": "e6d2f3a7379e88fbacee10459424e4cc", "timestamp": "", "source": "github", "line_count": 290, "max_line_length": 102, "avg_line_length": 32.179310344827584, "alnum_prop": 0.6899914273467638, "repo_name": "auready/flask", "id": "81106a3ac744c007d095081a47d20aff06ee7172", "size": "9747...
""" mfoc module. Contains the ModflowOc class. Note that the user can access the ModflowOc class as `flopy.modflow.ModflowOc`. Additional information for this MODFLOW package can be found at the `Online MODFLOW Guide <http://water.usgs.gov/ogw/modflow/MODFLOW-2005-Guide/index.html?oc.htm>`_. """ import sy...
{ "content_hash": "e7718aa7f27cfe0c0af208522554018a", "timestamp": "", "source": "github", "line_count": 484, "max_line_length": 149, "avg_line_length": 40.28719008264463, "alnum_prop": 0.477152674496128, "repo_name": "mrustl/flopy", "id": "669b3fd07cf0b1222523d8ce8732afbb93897e6c", "size": "19499",...
from setuptools import setup, find_packages setup(name = "pylein", version = "0.1", description = "Setup python projects painlessly", url = "https://github.com/harshadss/pylein", author = "Harshad Saykhedkar", license = "BSD 3-Clause License", packages = find_packages(), test_...
{ "content_hash": "b67ee33766c269d4aebfe808ea63766c", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 64, "avg_line_length": 34.07142857142857, "alnum_prop": 0.59958071278826, "repo_name": "harshadss/pylein", "id": "d40fa96bce100c6fced9bb3e02c67a8fea5021b1", "size": "477", ...
import tornado.ioloop import tornado.web import optparse import os import sys import binascii import struct import strus import collections import strusMessage # [1] Globals: # Term df map: termDfMap = {} # Collection size (number of documents): collectionSize = 0 # Strus statistics message processor: strusctx = strus...
{ "content_hash": "204d3896980c09b8b42244f81b73026c", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 113, "avg_line_length": 33.89795918367347, "alnum_prop": 0.543046357615894, "repo_name": "patrickfrey/strusTutorials", "id": "3ae9629df88db8e7256e347480d355490fb94320", "si...
from django.conf.urls import patterns, include, url from django.contrib import admin from django.conf import settings from django.conf.urls.static import static from . import views import profiles.urls import accounts.urls urlpatterns = patterns( '', url(r'^$', views.HomePage.as_view(), name='home'), url...
{ "content_hash": "24859d3bf7435216d8e7dacf82127f37", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 80, "avg_line_length": 34, "alnum_prop": 0.6995798319327731, "repo_name": "adrwhong/csc309-startit", "id": "cb0924726c993e473b5a25153cc8c892f5a1ab42", "size": "952", "bin...
""" Directory server testing """ from email.mime.text import MIMEText from unittest import SkipTest from django.conf import settings from django.test import TestCase import ldap import time from disclaimr.query_cache import QueryCache from disclaimrwebadmin import models, constants from disclaimr.configuration_helper ...
{ "content_hash": "28ba571386bf2803511f5be85ba10b89", "timestamp": "", "source": "github", "line_count": 419, "max_line_length": 79, "avg_line_length": 28.176610978520287, "alnum_prop": 0.5957140437065899, "repo_name": "dploeger/disclaimr", "id": "72eeaf13507f0c87a6ec2ea70cf213de20c82958", "size": "...
"""Beam DoFns and PTransforms to provide validation of improvements models.""" from __future__ import annotations from core.jobs import job_utils from core.jobs.decorators import validation_decorators from core.jobs.types import improvements_validation_errors from core.platform import models import apache_beam as be...
{ "content_hash": "c7ed4d798c615c474e3773631a19b5fb", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 78, "avg_line_length": 38.02, "alnum_prop": 0.7185691741188848, "repo_name": "oppia/oppia", "id": "f37da54aec4f62cd58f45430e97e4276bc950304", "size": "2524", "binary": fa...
import subprocess class AudioProcessor(object): def __init__(self, decoder='ffmpeg', encoder='ffmpeg', stretcher='wavstretch', encoderOpts=None, stretcherOpts=None): self.decoder = decoder self.encoder = encoder...
{ "content_hash": "f6b1f0bd952bc27bd52557df174e3d0c", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 68, "avg_line_length": 29.02127659574468, "alnum_prop": 0.5909090909090909, "repo_name": "rumblesan/dronr", "id": "e2e9d6a07caf4508abcc319570f1f4f28f7e5f42", "size": "1387"...
from abc import abstractclassmethod import tensorflow as tf from tensorflow.contrib.rnn import LSTMCell, LSTMStateTuple from constant import WORD2VEC_EMB_DIMENSION, WORD2VEC_PATH from data_loader import build_vocab, get_embedding_weights, get_word2vec_model, prepare_data, start_threads LOGGER = None class SimpleDisa...
{ "content_hash": "bb42fc8d2e0bb2db099970c31d561242", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 120, "avg_line_length": 43.942622950819676, "alnum_prop": 0.6282409998134676, "repo_name": "osmanbaskaya/coarse-wsd", "id": "a79279e900ccecbbcdef3f4625852968b82f8842", "si...
import arrow from betterapis import db class Review(db.Model, SimpleSerializing): id = db.Column(db.Integer, primary_key=True) talk_id = db.Column(db.Integer) details = db.Column(db.String) def __init__(self, **kwargs): self.talk_id = kwargs.get('talk_id') self.details = kwargs.get('de...
{ "content_hash": "3c05fa1c5535f8c92f6ad0f46f3b88aa", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 66, "avg_line_length": 28.529411764705884, "alnum_prop": 0.6164948453608248, "repo_name": "tylerdave/OpenAPI-Tutorial", "id": "50c420bd261223ce358c2e19e2f2549d1edd1f28", "s...
import time import os import getopt import sys class Log: """规范日志类""" fn = '' au = '' dt = '' con = '' def __init__(self): current_date = self.fetch_current_date() self.fn = current_date + '.md' self.au = 'Lu Hao' self.dt = current_date self.con = self....
{ "content_hash": "4a909ad450469f58665569f93ffcd682", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 83, "avg_line_length": 25.446428571428573, "alnum_prop": 0.5417543859649123, "repo_name": "lhzbxx/QiLe2", "id": "9b4b3ed20b81d0605e8c875e27ea840cfcd34f4e", "size": "1622", ...
"""Deprecation utilities :author: Logilab :copyright: 2006-2008 LOGILAB S.A. (Paris, FRANCE) :contact: http://www.logilab.fr/ -- mailto:python-projects@logilab.org """ __docformat__ = "restructuredtext en" import sys from warnings import warn from clonedigger.logilab.common.modutils import LazyObject, load_modu...
{ "content_hash": "892f3538cccf63faea1a71bfad40a15f", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 81, "avg_line_length": 34.833333333333336, "alnum_prop": 0.6346237494562853, "repo_name": "h2oloopan/easymerge", "id": "7045e260cd168fc708bad81248bc4893830dac9f", "size": ...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('visit', '0050_auto_20150810_2027'), ] operations = [ migrations.AlterField( model_name='staff', name='is_visit_1_trained', ...
{ "content_hash": "a406ac07b9c219981ece98e8b4e491b1", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 58, "avg_line_length": 24.652173913043477, "alnum_prop": 0.5731922398589065, "repo_name": "koebbe/homeworks", "id": "413238285ad98fa0290b295ae3ca229a94679e92", "size": "591...
from setuptools import setup, find_packages from mimiron import __version__ setup( name='mimiron', version=__version__, description="Easily manage your tfvars config via Mimiron", url='https://github.com/ImageIntelligence/mimiron', author='David Vuong', author_email='david@imageintelligence.c...
{ "content_hash": "f84c4dd42c483a64dd3d981d3d0e1eb0", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 65, "avg_line_length": 24.954545454545453, "alnum_prop": 0.569216757741348, "repo_name": "ImageIntelligence/mimiron", "id": "8a6be46e0a0d16460dcba2bad3b6a2ec05d2e986", "siz...
"""Volume drivers for libvirt.""" import os from os_brick.initiator import connector from oslo_concurrency import processutils from oslo_config import cfg from oslo_log import log as logging import six from nova import exception from nova.i18n import _ from nova.i18n import _LE from nova.i18n import _LW from nova im...
{ "content_hash": "fd82a0917fe9ba2e46232e1433ccdea7", "timestamp": "", "source": "github", "line_count": 392, "max_line_length": 79, "avg_line_length": 41.109693877551024, "alnum_prop": 0.5851690971144896, "repo_name": "ruslanloman/nova", "id": "192f4b3be9acd5799db55bccc6aeabbab3c1665c", "size": "16...
"""Interface to Azure object proposals.""" from __future__ import absolute_import, division, print_function import requests import utool as ut import numpy as np from six.moves import zip from os.path import abspath, dirname, expanduser, join, exists # NOQA (print, rrr, profile) = ut.inject2(__name__, '[azure]') VER...
{ "content_hash": "9a1c3fed419ba405589c23818aa49d3b", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 129, "avg_line_length": 36.33582089552239, "alnum_prop": 0.6553707126720065, "repo_name": "Erotemic/ibeis", "id": "9afd9abcdce88352a5f11c4e6e50546f3617f1ec", "size": "4893...
from collections import defaultdict import numpy as np class DataLoader: def __init__(self): self.chars = set() lines = [] for l in open('./kaomojis'): self.chars |= set(l[:-1]) lines.append(l[:-1]) self.char_to_idx = { c:i for i,c in enumerate(self.chars) }...
{ "content_hash": "69ab43a58cef054b3985557db89954f0", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 93, "avg_line_length": 33.241379310344826, "alnum_prop": 0.5186721991701245, "repo_name": "yustoris/kaomoji_with_rnn", "id": "860cce21771cf34a0031fa6c291a7a958fe137aa", "si...
import sys import os import shlex import subprocess # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.a...
{ "content_hash": "c10c9f194f2a47dcb8c6cf2a47099bfb", "timestamp": "", "source": "github", "line_count": 317, "max_line_length": 79, "avg_line_length": 32.22397476340694, "alnum_prop": 0.6926089084679393, "repo_name": "BYVoid/OpenCC", "id": "fa6332de5209efc6b75c65ae42877f798850da77", "size": "10659"...
""" Functions for converting python distributions to rez packages. """ from __future__ import print_function from rez.exceptions import RezSystemError import pkg_resources import shutil import sys import os import os.path import textwrap def _mkdirs(*dirs): path = os.path.join(*dirs) if not os.path.exists(pa...
{ "content_hash": "7d41d8c03f5aa817c1599c6ed56a7ac3", "timestamp": "", "source": "github", "line_count": 248, "max_line_length": 84, "avg_line_length": 33.068548387096776, "alnum_prop": 0.5511522985001829, "repo_name": "nerdvegas/rez", "id": "904a378709da5d232e9fd26fc1c763030f0d9d16", "size": "8285"...
""" This is the utils module that collects convenience functions and code that are useful for charts ecosystem. """ #----------------------------------------------------------------------------- # Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # Th...
{ "content_hash": "5298d89ade63ddb5e8ad69864059e52b", "timestamp": "", "source": "github", "line_count": 225, "max_line_length": 87, "avg_line_length": 33.71111111111111, "alnum_prop": 0.5774555042847725, "repo_name": "gpfreitas/bokeh", "id": "52637502dfcb537d2783b6e1b6f229e1a972c260", "size": "7585...
from django.db import migrations def clear_results_with_u_prefix(apps, schema_editor): Scenario = apps.get_model('modeling', 'Scenario') for scenario in Scenario.objects.filter(results__contains="[{u'"): scenario.results = "[]" scenario.save() class Migration(migrations.Migration): depe...
{ "content_hash": "407ab93c0f610579ef7f39c0fc35df2a", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 78, "avg_line_length": 27.4, "alnum_prop": 0.666058394160584, "repo_name": "WikiWatershed/model-my-watershed", "id": "44cd30aca7bbd8afb5d115e3acfa1522b7748c87", "size": "57...