text
stringlengths
4
1.02M
meta
dict
"""Tests for the :mod:`campy.util.timer` module."""
{ "content_hash": "eb66a42b5fc82cf04f7f901def0bdff6", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 51, "avg_line_length": 52, "alnum_prop": 0.6538461538461539, "repo_name": "sredmond/acmpy", "id": "b8378c96715873de3c6a62d32fa1d13a91fe8d38", "size": "52", "binary": false...
from __future__ import absolute_import, print_function, unicode_literals, division import os import argparse import sc2reader from sc2reader import utils from sc2reader.exceptions import ReadError def printReplay(filepath, arguments): """ Prints summary information about SC2 replay file """ try: rep...
{ "content_hash": "80eb460f625162770b58035007745617", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 122, "avg_line_length": 44.225806451612904, "alnum_prop": 0.5931801604668125, "repo_name": "BlackVegetable/starcraft-oracle", "id": "52b39c1ed462dc700402df567b9606d003f1b363...
from django.contrib.auth import logout, login from django.contrib.auth.forms import UserCreationForm from django.http import HttpResponseRedirect from django.shortcuts import render, get_object_or_404 from django.urls import reverse from django.views.generic import View from django.db.models import Count from courses....
{ "content_hash": "5f8cd4a9735fb0d49809ff7da050d066", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 102, "avg_line_length": 35.17796610169491, "alnum_prop": 0.6646591182847507, "repo_name": "RubenSchmidt/giscademy", "id": "f86edbbfbc9a94130cbff0d3c01ccc0922c785c4", "size...
DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', '[email protected]'), ) MANAGERS = ADMINS TIME_ZONE = 'America/Chicago' LANGUAGE_CODE = 'en-us' INTERNAL_IPS = ('127.0.0.1', ) SITE_ID = 1 # If you set this to False, Django will make some optimizations so as not # to load th...
{ "content_hash": "8aab8a544020e904f064369dc1ed941a", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 79, "avg_line_length": 28.78481012658228, "alnum_prop": 0.693051890941073, "repo_name": "boldprogressives/akcode", "id": "df5b8c6cc10f5dbf25b00d87ac75749fcbfa0014", "size"...
import sys # 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.append('..') sys.path.append('../..') sys.path.append('../../...
{ "content_hash": "5a5201418eccee4e37dc34f079123cd3", "timestamp": "", "source": "github", "line_count": 238, "max_line_length": 94, "avg_line_length": 32.84873949579832, "alnum_prop": 0.7031210028140189, "repo_name": "kpdyer/libfte", "id": "5e507b09b4b8fbf03775fa662a0f9e6f8fab4993", "size": "8265",...
''' Build the pipeline workflow by plumbing the stages together. ''' from ruffus import Pipeline, output_from, regex, suffix from stages import Stages def make_pipeline(state): '''Build the pipeline by constructing stages and connecting them together''' # Build an empty pipeline pipeline = Pipeline(name=...
{ "content_hash": "5654a463749bf33d71ee1afbc2f73bcd", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 80, "avg_line_length": 30.885714285714286, "alnum_prop": 0.6799259944495837, "repo_name": "bjpop/md5_pipeline", "id": "6d97e1ec2d0ba760bcd5797e00198d21c67edfc1", "size": "1...
import lxml.html import lxml.etree import models import urllib2 import json import httplib import unicodedata """ Abstract base class for fetchers """ class Fetcher(object): """ Base URL for fetching Artists' details """ __BASE_URL = '' """ Unique name for fetcher, used in models.Band.origin ...
{ "content_hash": "fdc4cdbd7a050dc4a92e79445e6e86b0", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 115, "avg_line_length": 31.038709677419355, "alnum_prop": 0.5743088754936604, "repo_name": "dgraziotin/iProtal", "id": "749127637de19d7882a6817911a429ebd5c81771", "size": ...
from __future__ import print_function import os,sys,inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) sys.path.insert(0,parentdir) import bibtexparser import re from datetime import datetime import django from django.utils import t...
{ "content_hash": "fc6e580a2e1b20282973632a4be5f449", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 112, "avg_line_length": 31.174418604651162, "alnum_prop": 0.6299888101454681, "repo_name": "fzenke/morla", "id": "cd1bb1f4dfb62c3b0da5aa48d8119a298d0f3982", "size": "2700",...
"""Training helper that checkpoints models and creates session.""" import time import numpy as np from tensorflow.python.client import session from tensorflow.python.distribute import distribution_strategy_context from tensorflow.python.framework import errors from tensorflow.python.framework import ops from tensorfl...
{ "content_hash": "6768cf03595b70877fc9b7e6bd31fc6e", "timestamp": "", "source": "github", "line_count": 572, "max_line_length": 93, "avg_line_length": 39.56468531468531, "alnum_prop": 0.6578586894083337, "repo_name": "Intel-Corporation/tensorflow", "id": "5cc36141f3bc65d9b84aa9b876a441e29db3c3d2", ...
""" Factory functions to prepare useful data. """ import pytz import pandas as pd import numpy as np from datetime import timedelta from zipline.protocol import Event, DATASOURCE_TYPE from zipline.sources import (SpecificEquityTrades, DataFrameSource, DataPane...
{ "content_hash": "2bacbbb4b337a5fbe3b6b87df4d621a0", "timestamp": "", "source": "github", "line_count": 327, "max_line_length": 79, "avg_line_length": 29.972477064220183, "alnum_prop": 0.5855524946434038, "repo_name": "umuzungu/zipline", "id": "9adb4dcb5e3b697151ab21e6aabd68436d9507c7", "size": "10...
""" ... """ import argparse import sys import os from fontTools.ttLib import TTFont from fontTools.ttLib.tables import otTables as ot from fontTools.otlLib.builder import buildStatTable, _addName from fontTools.varLib.instancer import ( instantiateVariableFont, sanityCheckVariableTables ) def split_slnt(ttfon...
{ "content_hash": "4bad9d767f1823a3893344752018f8bb", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 104, "avg_line_length": 30.517241379310345, "alnum_prop": 0.6508474576271186, "repo_name": "googlefonts/roboto-classic", "id": "536adf08c556da719fa9b4772b8b98cb46ddb5e1", ...
from django.conf.urls.defaults import * urlpatterns = patterns('', url('^$','django.views.generic.simple.direct_to_template',{'template':'bueda_flickr_mashup/templates/bueda_flickr_mashup/demo.html'},name='demo'), url('^run','views.demo',name='run'), )
{ "content_hash": "10d77af0121b595be8745a161d8ebf2b", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 150, "avg_line_length": 43.666666666666664, "alnum_prop": 0.6984732824427481, "repo_name": "bueda/bueda-flickr-mashup", "id": "cfb74eedde8b1813d42458b98fd6deec3e4b6acb", "si...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): # Flag to indicate if this migration is too risky # to run online and needs to be coordinated for offline is_dangerous = True ...
{ "content_hash": "a60b2379e8bc97c77c56f919dc4a252d", "timestamp": "", "source": "github", "line_count": 234, "max_line_length": 222, "avg_line_length": 66.02136752136752, "alnum_prop": 0.6083241633762703, "repo_name": "ifduyue/sentry", "id": "6315e23a9cfe5c1882afddf6db236289e5bcf590", "size": "1547...
''' Created on May 17, 2012 @author: h87966 ''' import unittest from google.appengine.ext import testbed from unit5.blog_entry import BlogData from unit5.blog_datastore_factory import BlogDataStoreFactory from unit5.blog_service import BlogService class Test(unittest.TestCase): def setUp(self): # First...
{ "content_hash": "5398185ab90e828c199ec6f2b4446570", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 112, "avg_line_length": 35.50877192982456, "alnum_prop": 0.6403162055335968, "repo_name": "cdoremus/udacity-python_web_development-cs253", "id": "22a9a75bf9e5244e21a92a6b1f3e...
import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." for coll in orm.CollectionRecord.objects.all(): for qdc in orm['dublincore.qualifieddubli...
{ "content_hash": "cbcc6207002410060ac5f31229aae965", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 188, "avg_line_length": 79.52054794520548, "alnum_prop": 0.5509043927648579, "repo_name": "cdlib/RecordExpress", "id": "ed7c8296301624d555da615f047d601c43868a16", "size": ...
import ctypes import ctypes.wintypes import datetime import os import wx try: import winsound except ImportError: winsound = None import ChatKosLookup DIVIDER = '-' * 40 PLUS_TAG = '[+]' MINUS_TAG = u'[\u2212]' # Unicode MINUS SIGN # Cargo-culted from: # http://stackoverflow.com/questions/3927259/how-do-you...
{ "content_hash": "5d46cef48cb781298fe71d2ef4e29726", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 90, "avg_line_length": 29.427586206896553, "alnum_prop": 0.62034216076869, "repo_name": "Mightymod/nrds-tools-tnnt", "id": "cd6ad768cde94e70f0d87bc347b3757b7687c9aa", "siz...
from typing import TYPE_CHECKING from ...utils import ( OptionalDependencyNotAvailable, _LazyModule, is_flax_available, is_tf_available, is_tokenizers_available, is_torch_available, ) _import_structure = { "configuration_electra": ["ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP", "ElectraConfig",...
{ "content_hash": "22c5f17be5e481628134a3a4c0a6bf95", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 113, "avg_line_length": 30.194805194805195, "alnum_prop": 0.6653763440860215, "repo_name": "huggingface/transformers", "id": "59e3ca47794173fd8b8721d57d1e3f60c03cf0b1", "s...
""" To change the version of entire package, just edit this one location. """ __title__ = 'newspaper' __author__ = 'Lucas Ou-Yang' __license__ = 'MIT' __copyright__ = 'Copyright 2014, Lucas Ou-Yang' version_info = (0, 0, 6) __version__ = ".".join(map(str, version_info))
{ "content_hash": "e93109ba8b4f4af859a88f931caae8bc", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 69, "avg_line_length": 27.2, "alnum_prop": 0.6323529411764706, "repo_name": "cantino/newspaper", "id": "b452fa57e888f630721b5bc3b5e78f60aa2a2547", "size": "296", "binary"...
from pathlib import Path def all_tracefiles(input_dirs, tracepoint) -> tuple: for dir in input_dirs: for router in (dir / 'routers').iterdir(): tracefile = router / 'trace' / tracepoint yield router.name, tracefile def extract_messages(tracefile: Path) -> list: messages = [] ...
{ "content_hash": "b4799b050921df60bf6162c25ba448c3", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 53, "avg_line_length": 28, "alnum_prop": 0.5595238095238095, "repo_name": "reisub-de/dmpr-simulator", "id": "57783b1a4d1e6732b14239b8c6f2407974a85073", "size": "588", "bi...
from functools import wraps from smartbotsol.singleton import Singleton class Cache(object): """Cache interface""" __metaclass__ = Singleton STORE = None def get(self, parameter): raise NotImplementedError def add(self, key, value): raise NotImplementedError def to_dict...
{ "content_hash": "0a40c2fe28a98f702f42a7cbbec6d012", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 47, "avg_line_length": 22.060606060606062, "alnum_prop": 0.6167582417582418, "repo_name": "dqunbp/smartbotsol", "id": "a864aa11dcd8443f75d91447c552c7ff86b5228f", "size": "7...
def process_qq_history(path, skip_system=True, encoding="utf-8", strip=None, output_path=None): """ Process QQ chat history export text file to sentences. :param path: Path to QQ history txt file. :param skip_system: Skip system message if set. :param encoding: Encoding of the txt file. :pa...
{ "content_hash": "0cdd2623573f541becf57dc2fecebf23", "timestamp": "", "source": "github", "line_count": 224, "max_line_length": 111, "avg_line_length": 33.410714285714285, "alnum_prop": 0.5376803848209514, "repo_name": "dickrd/cla_tool", "id": "a388dcea02e644660272923ca94e03c70454069d", "size": "75...
from airflow.contrib.hooks.aws_hook import AwsHook class RedshiftHook(AwsHook): """ Interact with AWS Redshift, using the boto3 library """ def get_conn(self): return self.get_client_type('redshift') # TODO: Wrap create_cluster_snapshot def cluster_status(self, cluster_identifier): ...
{ "content_hash": "6ff1c71b4310099c92028447d222fe47", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 121, "avg_line_length": 43.44186046511628, "alnum_prop": 0.673982869379015, "repo_name": "jfantom/incubator-airflow", "id": "071caf2610c01199589fca851d3a03cc18ae5c6a", "siz...
from __future__ import absolute_import import theano import theano.tensor as T import numpy as np class Constraint(object): def __call__(self, p): return p class MaxNorm(Constraint): def __init__(self, m=2): self.m = m def __call__(self, p): norms = T.sqrt(T.sum(T.sqr(p), axis=0))...
{ "content_hash": "84d08b21a28d86eb520abd8e34e0b9de", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 62, "avg_line_length": 22.34375, "alnum_prop": 0.5846153846153846, "repo_name": "kfoss/keras", "id": "a1164126ff79060cacda13c5a21e4f66ef5d09d9", "size": "715", "binary": ...
import socket, select # from SocketServer import (TCPServer as TCP, # StreamRequestHandler as SRH) from time import ctime import os HOST = '' PORT = 21567 BUFSIZ = 1024 ADDR = (HOST, PORT) tcpSerSock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) tcpSerSock.bind(ADDR) tcpSerSock....
{ "content_hash": "dc3ac2bca6ecd79aed19a0a1a580c0af", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 55, "avg_line_length": 23.857142857142858, "alnum_prop": 0.5662959794696322, "repo_name": "WillSkywalker/core-python-programming", "id": "2ee311ce05707a97ca25deb8f2f04301df9f...
""" AncestryDNA genotyping data extraction. Copyright (C) 2016 PersonalGenomes.org This software is shared under the "MIT License" license (aka "Expat License"), see LICENSE.TXT for full license text. """ import bz2 from cStringIO import StringIO from datetime import date, datetime import logging import os import re...
{ "content_hash": "c5a8f3e5c57d1fe343379cc521821236", "timestamp": "", "source": "github", "line_count": 442, "max_line_length": 105, "avg_line_length": 39.31221719457014, "alnum_prop": 0.5843116942909761, "repo_name": "OpenHumans/open-humans-data-processing", "id": "90b01820bdc7688ce0cfc89e6c35ff28eb...
""" Tests for attachments Api. """ import ddt import mock import webob from cinder.api import microversions as mv from cinder.api.v3 import attachments as v3_attachments from cinder import context from cinder import exception from cinder import objects from cinder import test from cinder.tests.unit.api import fakes f...
{ "content_hash": "0fc11e2c975c1d15b27102e8d4e1bd96", "timestamp": "", "source": "github", "line_count": 273, "max_line_length": 78, "avg_line_length": 43.53113553113553, "alnum_prop": 0.547542914843487, "repo_name": "eharney/cinder", "id": "f780f9d5b8f3d8faf8ba55f2afb9171e6dba5470", "size": "12523"...
"""Unit tests for core.domain.rte_component_registry.""" import inspect import os import pkgutil import re import string import struct from core.domain import obj_services from core.domain import rte_component_registry from core.tests import test_utils import feconf import schema_utils import schema_utils_test import...
{ "content_hash": "639d7fe5e08f1317273ad8ad55845b06", "timestamp": "", "source": "github", "line_count": 339, "max_line_length": 153, "avg_line_length": 44.666666666666664, "alnum_prop": 0.6134592524105138, "repo_name": "souravbadami/oppia", "id": "e2b54a9c7bc94e09fbf2560b353c90fcfebb363f", "size": ...
from __future__ import absolute_import, division, print_function __author__ = "{{ cookiecutter.full_name }}" __version__ = "{{ cookiecutter.version }}" __license__ = "MIT" __email__ = "{{ cookiecutter.email }}" __uri__ = "https://{{ cookiecutter.project_name }}.readthedocs.org" __description__ = "{{ cookiecutter.shor...
{ "content_hash": "83bd3041e92ef668197f2f517a8a3c66", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 67, "avg_line_length": 36.77777777777778, "alnum_prop": 0.6404833836858006, "repo_name": "econchick/cookiecutter-roguelynn", "id": "a6c7ba8d52c05fe70af3769bc9ff4d8c90573dfb", ...
import sys import os import time from optparse import OptionParser try: import simplejson as json except ImportError: import json sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "oeqa"))) from oeqa.oetest import runTests from oeqa.utils.sshcontrol import SSHControl # this isn't prett...
{ "content_hash": "143c8540aece639b895fbe0157ad00dc", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 131, "avg_line_length": 34.666666666666664, "alnum_prop": 0.6305288461538462, "repo_name": "wwright2/dcim3-angstrom1", "id": "e1b6642ec2a441577ecce62e7ecec03e3e6ad2df", "s...
number1 = int(input("digite um número que servirá de base:")) number2 = int(input("digite um número que servirá de expoente: ")) counter = 1 number = number1 while counter < number2: number = number * number1 counter += 1 print("o número",number1,"elevado ao número",number2,"é:",number)
{ "content_hash": "194ff7082c8a2c40015078e2af3727b2", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 66, "avg_line_length": 29.8, "alnum_prop": 0.7013422818791947, "repo_name": "jucimarjr/IPC_2017-1", "id": "97a20f5f702458d169b677a795840cb85d5630ca", "size": "1097", "bin...
""" LLDB AppKit formatters part of The LLVM Compiler Infrastructure This file is distributed under the University of Illinois Open Source License. See LICENSE.TXT for details. """ # example summary provider for CFBinaryHeap # the real summary is now C++ code built into LLDB import lldb import ctypes import lldb.runtim...
{ "content_hash": "91f04c3068cc0809bd465fd5f083055b", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 97, "avg_line_length": 34.86335403726708, "alnum_prop": 0.6468911455549617, "repo_name": "youtube/cobalt", "id": "b22f2c5d4f7c504c929cbfb398ce5fa1295cff12", "size": "5613"...
import hashlib import logging import os import random import signal import socket import string import subprocess import sys import time from twisted.internet import reactor from twisted.internet.protocol import DatagramProtocol from twisted.internet.error import MulticastJoinError from twisted.web import resource, se...
{ "content_hash": "cf6d1f5c959f44074746a9a738d12470", "timestamp": "", "source": "github", "line_count": 355, "max_line_length": 81, "avg_line_length": 32.76619718309859, "alnum_prop": 0.5880330123796423, "repo_name": "fmichea/flocon", "id": "78eabc4ec3eaef2690a2b2c748fda39ca635f7a8", "size": "11762...
import os from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy # from flask.ext.script import Manager, Shell, Server from flask.ext.login import LoginManager from flask.ext.openid import OpenID from flask.ext.mail import Mail, Message from config import basedir app = Flask(__name__) app.config.from_obje...
{ "content_hash": "7c6d697575a2982b3fc9b142d450341e", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 70, "avg_line_length": 27.06896551724138, "alnum_prop": 0.729936305732484, "repo_name": "gretahuang/calhacks2015", "id": "ae2cb0bc3f28415dbd6443ff00f1d80fbea0f18f", "size":...
from __future__ import unicode_literals from django.db import models from TCA.administration.models import Grade from TCA.utils.models.mixins import TimeStamped class Stream(TimeStamped): grade = models.OneToOneField( Grade, db_index=True ) url = models.CharField( 'URL', ...
{ "content_hash": "1eec697bc81ed53a35a4482bb4911c2d", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 49, "avg_line_length": 20.954545454545453, "alnum_prop": 0.6399132321041214, "repo_name": "JosmanPS/tsebaoth-christian-academy", "id": "34f8529e9da600dffd68aebd038d426a79c643...
import os import sqlite3 import csv def build(table_name, csv_file): print 'Creating for %s.' % table_name # Database Connect con = sqlite3.connect(DATABASE_FILE) con.text_factory = str # Load File data = [] with open(csv_file,'r') as f: next(f) # skip headings rea...
{ "content_hash": "4f3b5d4934a68090d6a662045f9e7781", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 208, "avg_line_length": 28.50943396226415, "alnum_prop": 0.6108537392455328, "repo_name": "Atrac613/KanjiReading-iOS", "id": "66853438c27fd2bb8c50f6a03c90c349d85d79b4", "si...
"""Tests for TFGAN's head.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.gan.python import namedtuples as tfgan_tuples from tensorflow.contrib.gan.python.estimator.python import head from tensorflow.python.estimator import m...
{ "content_hash": "73f52e0985746f726e816a383f503ee9", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 80, "avg_line_length": 36.32098765432099, "alnum_prop": 0.7127804214819851, "repo_name": "drpngx/tensorflow", "id": "5309d87765694fa476dae006105e842420a7c437", "size": "363...
from rest_framework import routers, serializers, viewsets # Lazy from assays.models import( AssayStudy, AssayDataPoint, AssayMatrixItem, AssayGroup, AssayGroupCompound, AssayGroupCell, AssayGroupSetting, AssayStudyAssay, AssaySampleLocation, AssayTarget, AssayMethod, Phys...
{ "content_hash": "e54d3eac608fac4d68a9c7e4fa0b6b72", "timestamp": "", "source": "github", "line_count": 470, "max_line_length": 104, "avg_line_length": 32.51276595744681, "alnum_prop": 0.638374451933774, "repo_name": "UPDDI/mps-database-server", "id": "a7c246883ffafcc0c6596816cc97411e082edecf", "si...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 30, transform = "Integration", sigma = 0.0, exog_count = 20, ar_order = 12);
{ "content_hash": "f4f7d9b560fc908a7c5ba9b2e90555b7", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 169, "avg_line_length": 38.42857142857143, "alnum_prop": 0.7100371747211895, "repo_name": "antoinecarme/pyaf", "id": "9a66c51e0e1e350f36a771bd1b9473bf9167e47a", "size": "269...
from __future__ import absolute_import, division, print_function import matplotlib import numpy as np import os import subprocess import sys import tempfile matplotlib.use('pdf') import matplotlib.pyplot as plt from dragonn.metrics import ClassificationResult from keras.layers.core import (Activation, Dense, Dropout, F...
{ "content_hash": "19f9438ac31647708739f699ec28f68d", "timestamp": "", "source": "github", "line_count": 427, "max_line_length": 89, "avg_line_length": 38.096018735362996, "alnum_prop": 0.596606626913383, "repo_name": "ktaneishi/deepchem", "id": "2930b28edd70f873d8dcec5930982df541408d8b", "size": "1...
from __future__ import print_function from __future__ import absolute_import from __future__ import division import math from compas.geometry import quaternion_multiply from compas.geometry import quaternion_conjugate from compas.geometry import quaternion_unitize from compas.geometry import quaternion_canonize from ...
{ "content_hash": "aa14fdc4ed656c5bd0bbf2897947e835", "timestamp": "", "source": "github", "line_count": 509, "max_line_length": 118, "avg_line_length": 26.18860510805501, "alnum_prop": 0.4855213803450863, "repo_name": "compas-dev/compas", "id": "d9b14e5dbcc6ddc2ff6e1149e8ab1697862aeaa1", "size": "1...
from accurate_bg_check.mixin.crud import BaseCrud class Order(BaseCrud): resource = 'order' client = None def __init__(self, client=None): if not client: raise Exception('accurate_bg_check client instance required') self.client = client
{ "content_hash": "7ec594279a7db7e0e4d2c39aaca5e868", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 73, "avg_line_length": 25.454545454545453, "alnum_prop": 0.65, "repo_name": "kaushal235/accurate_bg_check", "id": "8f5e28778ca83cbc149174745b0e772d4ead8f90", "size": "280",...
import json from datetime import datetime import argparse import apache_beam as beam from apache_beam.io import WriteToBigQuery from apache_beam.options.pipeline_options import PipelineOptions from apache_beam.io.gcp.internal.clients import bigquery import logging from apache_beam.io import ReadFromText import random ...
{ "content_hash": "665b5835d814be542adee625adf20289", "timestamp": "", "source": "github", "line_count": 386, "max_line_length": 179, "avg_line_length": 42.898963730569946, "alnum_prop": 0.4093846246754031, "repo_name": "GoogleCloudPlatform/training-data-analyst", "id": "9a5fed7c7b1081c9f5278cb5767d82...
from proteus import * from proteus import (StepControl, TimeIntegration, NonlinearSolvers, LinearSolvers, LinearAlgebraTools) from threep_navier_stokes_sed_p import * from tank import * if timeDiscretization=='vbdf': timeIntegratio...
{ "content_hash": "7a1696e317fe40bbba57241238954a87", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 116, "avg_line_length": 30.625, "alnum_prop": 0.7356009070294784, "repo_name": "erdc-cm/air-water-vv", "id": "3966270554157d8f092553b03fdb001e6fca9b36", "size": "2205", "...
from dynamodb_wrapper.client import Client from dynamodb_wrapper.fields import Field, FieldType from dynamodb_wrapper.models import DynamoDBModel
{ "content_hash": "294169fa4986f3db0807f4cafa0ece79", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 52, "avg_line_length": 48.666666666666664, "alnum_prop": 0.863013698630137, "repo_name": "vicenteneto/dynamodb-wrapper", "id": "972128980ae7dff70ce1f53542a164d9f19c68c4", "s...
import datetime from flask import g from ..._compat import as_unicode from mongoengine import Document from mongoengine import DateTimeField, StringField, ReferenceField, ListField, BooleanField, IntField def get_user_id(): try: return g.user.id except Exception as e: return No...
{ "content_hash": "f9f5382339f5f7614d98c39f8b50034b", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 101, "avg_line_length": 29.198019801980198, "alnum_prop": 0.6700576466598847, "repo_name": "qpxu007/Flask-AppBuilder", "id": "ba943972b14e68df09f34a5fd03bfccedc9b7912", "s...
import os import sys import pygame from common import mvc import textrect import math from common.constants import * from client.constants import * from common.util.rect import Rect class Model(mvc.Model): def __init__(self, theMap, isHost): super(Model, self).__init__() self.theMap = theMap ...
{ "content_hash": "206d53a8cb2e8b3a3c0689caf82a75f2", "timestamp": "", "source": "github", "line_count": 421, "max_line_length": 80, "avg_line_length": 35.111638954869356, "alnum_prop": 0.5305100798268164, "repo_name": "Wopple/fimbulvetr", "id": "a00f98e6b3dc77966962a214ec2f7049ff1e54f8", "size": "1...
BASE_LANGUAGE = 'fr' TARGET_LANGUAGE = 'de' FILENAME = 'algorea.json' TARGET_FILENAME = 'algorea.json.new' NEW_TRANSLATIONS_FILE = 'translations_german.json' import json, re # Read target language translations try: available_translations = json.load(open('%s/%s' % (TARGET_LANGUAGE, FILENAME))) except: print("...
{ "content_hash": "9a59afa1b20016b80e6be9e873c9fe62", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 104, "avg_line_length": 35.15714285714286, "alnum_prop": 0.5900040633888664, "repo_name": "France-ioi/commonFramework", "id": "4751aaefd71dc91e6dc4f566593d664271722ca7", "s...
""" module containing command line interface implementation and utilities. """ import argparse from subprocess import call import os import json from clamm import config, get_config_path, config_template from clamm import util def create_library_parsers(subps): """creates library sub-parsers """ lib_p =...
{ "content_hash": "51456a2f85c4f3b474194fa3f48b9703", "timestamp": "", "source": "github", "line_count": 383, "max_line_length": 80, "avg_line_length": 28.825065274151434, "alnum_prop": 0.5782608695652174, "repo_name": "p5a0u9l/clamm", "id": "42d100345c0554827c9bf585b7fffc63e7a58c4d", "size": "11040...
import re import copy from collections.abc import Iterable import zipfile import numpy as np import skrf def debug_counter(n=-1): count = 0 while count != n: count += 1 yield count def is_numeric(val): try: float(val) return True except ValueError: return Fal...
{ "content_hash": "438dc6b7cba4edab0c663e3043a1a42e", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 112, "avg_line_length": 24.278350515463917, "alnum_prop": 0.5605095541401274, "repo_name": "scikit-rf/scikit-rf", "id": "3f70fca65d659b1fcfefe69bdb4e04833d9d759f", "size":...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("feedback", "0002_auto_20150913_1904"), ] operations = [ migrations.AlterField( model_name="scheduleitemchoicefeedback", name...
{ "content_hash": "a3c0520573ae7f1345ea4207ffdd7982", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 73, "avg_line_length": 26.36, "alnum_prop": 0.575113808801214, "repo_name": "pythonindia/junction", "id": "7d7cbbebf001425df4c9a192cf338947af06b8c7", "size": "683", "bina...
from django.contrib.gis.gdal import SpatialReference, CoordTransform, SRSException from django.contrib.gis.geos import Point, GEOSGeometry import math class MapTools(): def __init__(self, mapTileSize=256): EARTH_RADIUS = 6378137 # as in WGS84 # resolution at zoom 0 (?) # 2r pi = u...
{ "content_hash": "59887d3c698c292c1bbf3c7f6cd7c500", "timestamp": "", "source": "github", "line_count": 315, "max_line_length": 123, "avg_line_length": 33.733333333333334, "alnum_prop": 0.5653115000941088, "repo_name": "biodiv/anycluster", "id": "3e2f99c7567921604af5219994a7b5892295c349", "size": "...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.framework import dtypes from tensorflow.python.ops import array_ops from tensorflow.python.ops.linalg import linalg as linalg_lib from tensorflow.python.ops.linalg imp...
{ "content_hash": "5d55afa7fa7a9c4b7ac7e1a693a8d7a3", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 93, "avg_line_length": 35.40096618357488, "alnum_prop": 0.6615720524017468, "repo_name": "hehongliang/tensorflow", "id": "f0cc5d709f9bfec2e3dcfadecc8f949bb6ce6e6d", "size"...
"""Run doctests for tensorflow.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import re import sys import textwrap import tensorflow as tf import numpy as np from absl import flags from absl.testing import absltest import tensorflow_estimat...
{ "content_hash": "1060d44ef4f8bc6e2fca034ad8c23f93", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 78, "avg_line_length": 29.039772727272727, "alnum_prop": 0.6325572295049893, "repo_name": "tensorflow/estimator", "id": "a3cecab84cdd0822b117abb022679a3ddf615ce7", "size":...
try: from urllib.parse import urlparse # Py3 except ImportError: from urlparse import urlparse from holmes.utils import is_valid, _ from holmes.validators.base import Validator class LinkWithRelCanonicalValidator(Validator): @classmethod def get_violation_definitions(cls): return { ...
{ "content_hash": "978142d7abc6f63bb4ff9ee0e3cd5c05", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 81, "avg_line_length": 33.95652173913044, "alnum_prop": 0.5121638924455826, "repo_name": "holmes-app/holmes-api", "id": "437eff4e0c924617949e1f397c3da6537877ed06", "size": ...
import logging import os from django.core.management import BaseCommand from django.utils.text import slugify from emgapi import models as emg_models from ..lib.genome_util import sanity_check_genome_output, \ sanity_check_catalogue_dir, find_genome_results, \ get_genome_result_path, \ read_tsv_w_headers...
{ "content_hash": "a7762b5b5161fe1cf72eb532d4f333ed", "timestamp": "", "source": "github", "line_count": 376, "max_line_length": 116, "avg_line_length": 43.630319148936174, "alnum_prop": 0.5869551965864066, "repo_name": "EBI-Metagenomics/emgapi", "id": "09c8babb87de845302b37bd7a356fc8b4544f605", "si...
import csv # remove later import json import urllib import urllib2 import requests from operator import itemgetter from collections import OrderedDict def get_server_csm_stats(server): good = 0 bad = 0 indeterminate = 0 # may not exist, use try/except to fail through try: deadvar = server.issu...
{ "content_hash": "c61569b469cffd3297393119dc445e08", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 113, "avg_line_length": 36.0958904109589, "alnum_prop": 0.5827324478178368, "repo_name": "david-sackmary/whack-a-mole", "id": "2faa1a1d4253a444eded8dba1e04fe5f953f1008", "...
from sklearn.datasets import make_circles from sklearn.cluster import KMeans, AgglomerativeClustering, DBSCAN X, y = make_circles(n_samples=1500, factor=.4, noise=.05) km = KMeans(n_clusters=2) plt.figure() plt.scatter(X[:, 0], X[:, 1], c=km.fit_predict(X)) ac = Agglomerativ...
{ "content_hash": "26359f5d968d1c545c00688dd493ae90", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 84, "avg_line_length": 29.944444444444443, "alnum_prop": 0.6363636363636364, "repo_name": "RTHMaK/RPGOne", "id": "0ed7269ef64d68dcfadf14039c9d68c2ad3d6eb9", "size": "539", ...
import os import sys # Exported functions class mzb_atom(str): pass def notify(metric, value): _mzbench_pipe.write("M {{{0}, {1}}}.\n".format(_encode_metric(metric), value)) def get_metric_value(name): return _call(mzb_atom('mzb_metrics'), mzb_atom('get_value'), [name]) def _call(module, function, a...
{ "content_hash": "15209550458e990d63d99f91afea57e6", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 110, "avg_line_length": 26.184466019417474, "alnum_prop": 0.6091954022988506, "repo_name": "ethercrow/mzbench", "id": "ee984afd44009716527cb30bedf645fffd1daaa0", "size": "...
import warnings import tensorflow as tf from tensorflow.python import debug as tf_debug import numpy as np import pickle import getopt import time import sys import os import csv import spacy import re import math import random from dnc.dnc import * from recurrent_controller import * from post_controller import * from...
{ "content_hash": "660f1db23a9ee1900b660ded992ea0e1", "timestamp": "", "source": "github", "line_count": 464, "max_line_length": 160, "avg_line_length": 41.82327586206897, "alnum_prop": 0.48613830773987426, "repo_name": "HimariO/VideoSum", "id": "c0a65d1e7f157c046f32ada34aa134cb0ce885e8", "size": "1...
import sys #print('Number of arguments:', len(sys.argv), 'arguments.') #print('Argument List:', str(sys.argv)) #students = sys.argv students = {"Tom":[100,90,88,95,55], "John":[70,78,60,89], "Amy":[50,66,20,88,30], "Bob":[99,64,80,72,90], "Tony":[100,83,92] } #print(students) #print(type(students)) #students.pop(0) ...
{ "content_hash": "d774d67cdc91cb98a77ff2298605ca4c", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 127, "avg_line_length": 28.363636363636363, "alnum_prop": 0.6826923076923077, "repo_name": "yuzheng/fbPOIMapping", "id": "630a16b2bb4b738da76315769589938bc1b88982", "size":...
''' Created on Nov 26, 2011 @author: Mirna Lerotic, 2nd Look Consulting http://www.2ndlookconsulting.com/ Copyright (c) 2013, Stefan Vogt, Argonne National Laboratory All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the...
{ "content_hash": "a75f0a3434e734e1b8a6e707bc25d848", "timestamp": "", "source": "github", "line_count": 1140, "max_line_length": 151, "avg_line_length": 37.16140350877193, "alnum_prop": 0.6533141346426211, "repo_name": "MapsPy/MapsPy", "id": "681fa7977d28f45f2f8d51a9dbbe608e227e38c6", "size": "4236...
""" Featurizers for complex. """ # flake8: noqa from deepchem.feat.complex_featurizers.rdkit_grid_featurizer import RdkitGridFeaturizer from deepchem.feat.complex_featurizers.complex_atomic_coordinates import NeighborListAtomicCoordinates from deepchem.feat.complex_featurizers.complex_atomic_coordinates import Neighbor...
{ "content_hash": "c25c1ef46f0f1ea3b8d1ee17558bd8c4", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 117, "avg_line_length": 72.55555555555556, "alnum_prop": 0.8874425727411945, "repo_name": "lilleswing/deepchem", "id": "fb9ea61f04492878434261f9b9ddddb2b5ca4ada", "size": "...
import pytest import math from cntestcase import cnapp from cadnano.part.nucleicacidpart import NucleicAcidPart def create3Helix(doc, direction, length): part = doc.createNucleicAcidPart(is_lattice=True) assert len(part.getidNums()) == 0 radius = part.radius() origin_pt00 = (0, 0, 0) origin_pt90...
{ "content_hash": "5699107f4a7dc9217d6700747bf3d825", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 75, "avg_line_length": 31.76923076923077, "alnum_prop": 0.6828087167070218, "repo_name": "scholer/cadnano2.5", "id": "c22c3a717e344b4ef2d007c7443a56572e93cef9", "size": "16...
import django_filters from tour.models import Tour class TourFilter(django_filters.FilterSet): class Meta: model = Tour fields = ('name',)
{ "content_hash": "8d42d7bc15aff07e7b70c95556b41e00", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 43, "avg_line_length": 16.3, "alnum_prop": 0.6625766871165644, "repo_name": "micahhausler/django-tour", "id": "37662e04a7e5bc65e68fa83ec850906370221572", "size": "163", "...
"""Implementations of learning abstract base class managers.""" # pylint: disable=invalid-name # Method names comply with OSID specification. # pylint: disable=no-init # Abstract classes do not define __init__. # pylint: disable=too-few-public-methods # Some interfaces are specified as 'markers' and include...
{ "content_hash": "b1f24083027fc73be5b963b14a7a2620", "timestamp": "", "source": "github", "line_count": 3287, "max_line_length": 137, "avg_line_length": 42.69729236385762, "alnum_prop": 0.6502215952004332, "repo_name": "mitsei/dlkit", "id": "2c4f70602902167e338bc27b8f871a2a41614905", "size": "14034...
import Utils import os from collections import defaultdict import matplotlib.pyplot as plt import pandas as pd from random import Random from Simulation import Simulation import pylab, numpy, math, csv def run_sim(params, exp_prefix, rng, sim=True): """ Run multiple initialisations of a single set of experime...
{ "content_hash": "36edcdca6bc6cf8b3ca171261bed6efa", "timestamp": "", "source": "github", "line_count": 1219, "max_line_length": 301, "avg_line_length": 47.67842493847416, "alnum_prop": 0.5924810736407433, "repo_name": "thorsilver/Modelling-academic-job-security", "id": "390f39a35a7f3eaf44db1441af29e...
from tempest.api.identity import base from tempest import test class TestApiDiscovery(base.BaseIdentityV2Test): """Tests for API discovery features.""" @test.attr(type='smoke') @test.idempotent_id('ea889a68-a15f-4166-bfb1-c12456eae853') def test_api_version_resources(self): descr = self.non_a...
{ "content_hash": "4c4b2b1022c5a564fd229a9e2182dcb7", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 76, "avg_line_length": 40.38095238095238, "alnum_prop": 0.6191037735849056, "repo_name": "rakeshmi/tempest", "id": "57c78ef76666a688e7c0e37d4c060f4f52e15de4", "size": "2342...
import json import urllib2 url="https://ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=10&q=https://news.google.com/news/feeds?output=rss" response = urllib2.urlopen(url) html = response.read() obj=json.loads(html) n = len(obj["responseData"]["feed"]["entries"]) for i in range(0, n): pub=obj["responseData"...
{ "content_hash": "2f0a410b08a611cb46ee5361c7d33c7a", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 118, "avg_line_length": 26.681818181818183, "alnum_prop": 0.6916524701873935, "repo_name": "dr-slump/bajawa", "id": "47e45d3b6ddddf368ed1fa8439b8eac6306fe964", "size": "974...
""" Passes that massage expression graphs into execution kernels. """ from __future__ import absolute_import, division, print_function from .frontend import (translate, coercions, jit, ckernel_impls, ckernel_lift, allocation, assemblage) #--------------------------------------------------------...
{ "content_hash": "4f30ecac23d22c871c635b0943def088", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 73, "avg_line_length": 27.16, "alnum_prop": 0.5139911634756995, "repo_name": "XinSong/blaze", "id": "a348043419e0e911bdd3b24d68591ef5ebe59a87", "size": "704", "binary": f...
"""Application base, containing global templates.""" default_app_config = 'pontoon.base.apps.BaseConfig' MOZILLA_REPOS = ( 'ssh://hg.mozilla.org/users/m_owca.info/firefox-beta/', 'ssh://hg.mozilla.org/users/m_owca.info/firefox-for-android-beta/', 'ssh://hg.mozilla.org/users/m_owca.info/thunderbird-beta/',...
{ "content_hash": "0d5f75ff433025f83562f3fcb9f84e2d", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 73, "avg_line_length": 44.05, "alnum_prop": 0.6980703745743473, "repo_name": "m8ttyB/pontoon", "id": "7fda5d5c2e4dbb85acd962f9a497ea564585888d", "size": "881", "binary": ...
r""" clang-format git integration ============================ This file provides a clang-format integration for git. Put it somewhere in your path and ensure that it is executable. Then, "git clang-format" will invoke clang-format on the changes in current files or a specific commit. For further details, run: git cl...
{ "content_hash": "897c2d7ef563ee2b5db513a61145f379", "timestamp": "", "source": "github", "line_count": 473, "max_line_length": 93, "avg_line_length": 36.35940803382664, "alnum_prop": 0.6414699383649262, "repo_name": "runt18/osquery", "id": "dfc84962edac04caecd508ebb0af8cc831669680", "size": "17563...
'''Runner for debugging with xt-gdb.''' from os import path from runners.core import ZephyrBinaryRunner, RunnerCaps class XtensaBinaryRunner(ZephyrBinaryRunner): '''Runner front-end for xt-gdb.''' def __init__(self, cfg): super(XtensaBinaryRunner, self).__init__(cfg) @classmethod def name(...
{ "content_hash": "4bda1ccc6281684304d19b3a97a971cb", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 69, "avg_line_length": 26.666666666666668, "alnum_prop": 0.6260416666666667, "repo_name": "punitvara/zephyr", "id": "2aeb42d8f69cae7e399b4957bc66e2f78dd25f79", "size": "103...
import ujson
{ "content_hash": "4dcec4fec048a72de29dc3426ddae51d", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 12, "avg_line_length": 12, "alnum_prop": 0.9166666666666666, "repo_name": "Fluorescing/PyPSFGen", "id": "5138a7547bdd4296e6f14b485783d1dbefa95204", "size": "12", "binary":...
from django.db import models from django.template.defaultfilters import slugify from django.utils import timezone from acquisition.models import Acquisition import calendar import datetime import json def to_timestamp(dt): stamp = calendar.timegm(dt.timetuple()) * 1000 return stamp class Series(models.Mod...
{ "content_hash": "e7606a4c46d886b5dec5ae0f4554b3c8", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 77, "avg_line_length": 24.479674796747968, "alnum_prop": 0.5914978412487546, "repo_name": "tomaszpiotro/Tracker", "id": "e685febd7e8fb07777406aa97ac2e394b91356f8", "size":...
import logging l = logging.getLogger(__name__) from mox3 import mox from datetime import date, datetime, time, timedelta from django_lean.experiments.models import (Experiment, DailyEngagementReport, DailyConversionReport, DailyC...
{ "content_hash": "d931fbde2b427af57393cd5a8fb4ffbf", "timestamp": "", "source": "github", "line_count": 559, "max_line_length": 144, "avg_line_length": 50.78354203935599, "alnum_prop": 0.5702057207270678, "repo_name": "MontmereLimited/django-lean", "id": "79ad32aa2a40d7ca4cb6c43f5d16e08c87846796", ...
from temboo.core.choreography import Choreography from temboo.core.choreography import InputSet from temboo.core.choreography import ResultSet from temboo.core.choreography import ChoreographyExecution import json class GetLegislator(Choreography): def __init__(self, temboo_session): """ Create a...
{ "content_hash": "b5f27ca71d62e157b2a706f5775db622", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 197, "avg_line_length": 47.939655172413794, "alnum_prop": 0.6809926272253192, "repo_name": "jordanemedlock/psychtruths", "id": "580cd911ed0a26b3bc14205320d3f94e107489a9", ...
from django.db import models from django.utils.translation import ugettext_lazy as _ from filer.models.imagemodels import Image from fractions import Fraction import exifread class ExifData(models.Model): class Meta: verbose_name = _('EXIF Data') verbose_name_plural = _('EXIF data') image = m...
{ "content_hash": "664c8c3197be6c7b737be86a8e3da2e8", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 83, "avg_line_length": 30.647058823529413, "alnum_prop": 0.5108765195137556, "repo_name": "svenhertle/django_image_exif", "id": "791a2571752233e30c50ea57ca75c3745c428991", ...
import os import re from base64 import b64decode from dataclasses import dataclass from enum import Enum from typing import Any, Dict, List, Mapping, Optional import pkg_resources from flask import Response as FlaskResponse from saml2 import BINDING_HTTP_POST, BINDING_HTTP_REDIRECT from saml2.client import Saml2Client...
{ "content_hash": "9a620ef1214a59440572c6ba769918a0", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 120, "avg_line_length": 41.634020618556704, "alnum_prop": 0.6305558994676241, "repo_name": "SUNET/eduid-webapp", "id": "d37869c13e61a883a693027902da3c00e769b306", "size": ...
from oslo.serialization import jsonutils from webob import exc from nova.api.openstack.compute.plugins.v3 import pci from nova.api.openstack import wsgi from nova import context from nova import db from nova import exception from nova import objects from nova.pci import device from nova import test from nova.tests.uni...
{ "content_hash": "6f743eeb2376802d9c0731bba7d99361", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 77, "avg_line_length": 43.276018099547514, "alnum_prop": 0.5193433709744877, "repo_name": "luzheqi1987/nova-annotation", "id": "6ac6269195d738667597ef292b656f7e39c753fa", ...
from __future__ import absolute_import from contextlib import contextmanager from django.test.utils import modify_settings from corsheaders.signals import check_request_enabled def add_middleware(action, path): return modify_settings(**{ 'MIDDLEWARE': { action: path, } }) def ...
{ "content_hash": "8eda90c639e632504de9a87a640d8be1", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 53, "avg_line_length": 20.4375, "alnum_prop": 0.6987767584097859, "repo_name": "kawamon/hue", "id": "1347cabee362c3ca6af81c706a315f6b9c063dd3", "size": "654", "binary": f...
from django.urls import reverse from django.test import TestCase from model_mommy import mommy from orcamentos.crm.models import Occupation class OccupationTest(TestCase): def setUp(self): self.obj = Occupation.objects.create(occupation='Gerente') self.obj2 = Occupation.objects.create(occupation=...
{ "content_hash": "637e722df965f4eddc61df767cd8226a", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 104, "avg_line_length": 31.545454545454547, "alnum_prop": 0.6983669548511047, "repo_name": "rg3915/orcamentos", "id": "fd6fbbc26bf58e1c9b2c1fc58b149a8fd6915e46", "size": "1...
""" Slightly modified variant of the original script. Author of the original: Aishwarya Agrawal """ import sys dataDir = '/BS/databases/vqa_1.0/VQA' sys.path.insert(0, '../vqaTools') from vqa import VQA from vqaClassNormalizedEval import VQAClassNormalizedEval as VQAEval import matplotlib.pyplot as plt import skimage...
{ "content_hash": "98ead905aa44cfdc744673a4db4e83eb", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 134, "avg_line_length": 39.630630630630634, "alnum_prop": 0.6912934757899523, "repo_name": "mateuszmalinowski/visual_turing_test-tutorial", "id": "fa33f135e09db918f2ff1265fd...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('osbs', '0001_initial'), ] operations = [ migrations.AlterField( model_name='osbsrecord', name='component', field...
{ "content_hash": "a069fc2dda44310b3f15f091c2c5aba0", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 93, "avg_line_length": 23, "alnum_prop": 0.6111111111111112, "repo_name": "xychu/product-definition-center", "id": "b490c73f7c4207fd0ce5b39e04818d0afc15858d", "size": "438"...
from subprocess import Popen, PIPE, STDOUT import os, sys import xmlrpclib import cPickle class _Method(object): def __init__(self, proxy, name): self.proxy = proxy self.name = name def __call__(self, *args): #print "CALL", self.name, args z = getattr( self.proxy, self.name, ...
{ "content_hash": "b1ec27023015919e3ecb269a8e648b6e", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 124, "avg_line_length": 30.8659793814433, "alnum_prop": 0.541750167000668, "repo_name": "yang-guangliang/android_guard", "id": "6ad2c24fc47a6a462e28541326586b55cc67f3fb", ...
from __future__ import division from weight.weight_vector import WeightVector from learner.perceptron_base import PerceptronLearnerBase from learner import logger from feature.feature_vector import FeatureVector __version__ = '1.0.0' class Learner(PerceptronLearnerBase): name = "AveragePerceptronLearner" ...
{ "content_hash": "60777437c2163f0ff0716b00de4fdf6f", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 98, "avg_line_length": 37.927083333333336, "alnum_prop": 0.5432573468827245, "repo_name": "sfu-natlang/glm-parser", "id": "39b9963290127a2b42fec441a2b008fddefc1c0d", "size"...
from helpers import get_allowed import web class IndexR: """ This endpoint is just a quick way to ensure that the vcontrol API is up and running properly """ allow_origin, rest_url = get_allowed.get_allowed() def GET(self): """ GET HTTP Request """ web.header("Content-Type","te...
{ "content_hash": "58a24f51cfebc20d8b9306d6a8d419e4", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 79, "avg_line_length": 28.4, "alnum_prop": 0.6455399061032864, "repo_name": "CyberReboot/vcontrol", "id": "de3d32b0928eb71577148827bc9af05a0c75332b", "size": "426", "bina...
from __future__ import unicode_literals import datetime import os import re import sys import types from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.http import (HttpResponse, HttpResponseServerError, HttpResponseNotFound, HttpRequest, build_request_repr) from d...
{ "content_hash": "3381131d5741be017a2c347caf5fba6f", "timestamp": "", "source": "github", "line_count": 1112, "max_line_length": 251, "avg_line_length": 38.37769784172662, "alnum_prop": 0.5799746930358984, "repo_name": "Proggie02/TestRepo", "id": "aaa7e40efe58e1d453a2e4c137c3436fb3327c8d", "size": ...
""" DICT server """ from __future__ import (absolute_import, division, print_function, unicode_literals) import argparse import os import sys import logging try: # Python 2 import SocketServer as socketserver except ImportError: # Python 3 import socketserver log = logging.getLogger...
{ "content_hash": "9a079e7825ec4b5bd6a5f752004ef73c", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 78, "avg_line_length": 29.666666666666668, "alnum_prop": 0.6117113223854796, "repo_name": "kimjinyong/i2nsf-framework", "id": "a41a8a0d67d1cf8375971ad61fb49ba5bf3f86cb", "...
#!/usr/bin/env python # # Copyright (c) 2009 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
{ "content_hash": "b21c13a712e6f8e9e86a27f1d79ce979", "timestamp": "", "source": "github", "line_count": 5017, "max_line_length": 97, "avg_line_length": 39.90711580625872, "alnum_prop": 0.6366138232091662, "repo_name": "zuyu/incubator-quickstep", "id": "431c112cccceb4dfbfedc24435c9aea029ff956b", "si...
import logging import os import sys import warnings from django.utils.translation import ugettext_lazy as _ import xstatic.main import xstatic.pkg.angular import xstatic.pkg.angular_cookies import xstatic.pkg.angular_mock import xstatic.pkg.bootstrap_datepicker import xstatic.pkg.bootstrap_scss import xstatic.pkg.d3 i...
{ "content_hash": "b2801c301d72da9e50b1e11a10c25699", "timestamp": "", "source": "github", "line_count": 345, "max_line_length": 79, "avg_line_length": 33.571014492753626, "alnum_prop": 0.6831289932654119, "repo_name": "mrunge/openstack_horizon", "id": "fb273b52e09936b1d532512008dec5da19f0a8f0", "si...
__author__ = 'dengzhihong' from numpy import * import numpy as np from sklearn.decomposition import * from sklearn.linear_model import LogisticRegression from sklearn.svm import SVC from sklearn.cluster import KMeans from sklearn.neighbors import KNeighborsClassifier import pylab import matplotlib.cm as cm import matp...
{ "content_hash": "505cffe852ae687bd865c4dd3fbc0d5a", "timestamp": "", "source": "github", "line_count": 602, "max_line_length": 140, "avg_line_length": 39.308970099667775, "alnum_prop": 0.5346940500338067, "repo_name": "dzh123xt/DigitRecognition", "id": "5b269f437faaba3f3caf9b5db8b5cd41bbbb01f2", "...
from ee.utils import test from ee.cli.main import get_test_app class CliTestCaseSite(test.EETestCase): def test_ee_cli(self): self.app.setup() self.app.run() self.app.close() def test_ee_cli_site_enable(self): self.app = get_test_app(argv=['site', 'enable', 'example2.com']) ...
{ "content_hash": "0acad812d09285a1693e0a45e72c5aef", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 72, "avg_line_length": 24.5, "alnum_prop": 0.6020408163265306, "repo_name": "Jurisdesk/freedoms", "id": "87cc4f856d119103579dbc157cc7184187f0dc49", "size": "392", "binary...
import base64 from django.http import HttpResponse from django.middleware.common import CommonMiddleware from django.conf import settings import os class AuthMiddleware(CommonMiddleware): """ Add this to middleware: 'utils.basic_auth_middleware.AuthMiddleware', Add these settings: USE_BASIC_AUTH = True # This s...
{ "content_hash": "977ccd364fe0def4b2b6793237481c21", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 165, "avg_line_length": 38.8125, "alnum_prop": 0.644122383252818, "repo_name": "blitzagency/django-chatterbox", "id": "21f98cf67197924a9dab7426af42ec2f6bd2ad1e", "size": "1...
""" Techies' landmines :copyright: (c) 2014 Runzhou Li (Leo) :license: The MIT License (MIT), see LICENSE for details. """ from __future__ import unicode_literals from techies.compat import ( unicode, nativestr, unicode_data ) import time import redis try: import simplejson as json except: import json ...
{ "content_hash": "cf1210a3eb641447112c44d365689e58", "timestamp": "", "source": "github", "line_count": 293, "max_line_length": 78, "avg_line_length": 24.351535836177476, "alnum_prop": 0.6023826208829712, "repo_name": "woozyking/techies", "id": "f0a8abed6b86d4ffaef26adf0de59afb63f31102", "size": "7...
import base64 import datetime import hashlib import json import logging import urllib import urllib2 import urlparse import webapp2 from google.appengine.api import memcache from webapp2_extras import jinja2 import credentials class SinkHandler(webapp2.RequestHandler): @webapp2.cached_property def _jinja2(se...
{ "content_hash": "b3c3f80446525092a339bafe1a932aef", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 77, "avg_line_length": 34.049180327868854, "alnum_prop": 0.5793612582250041, "repo_name": "caseymrm/drivesink", "id": "6da07df5c30dd4dfe2d59331529a365402673277", "size": "...
import collections import datetime from merc import errors from merc import feature from merc import message from merc import util class KLineFeature(feature.Feature): NAME = __name__ install = KLineFeature.install KLineDetail = collections.namedtuple("KLineDetail", ["reason", "expiry"]) @KLineFeature.regist...
{ "content_hash": "ea4f4e5d7eebeab6ba72f07dc500e552", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 73, "avg_line_length": 25.297619047619047, "alnum_prop": 0.6672941176470588, "repo_name": "merc-devel/merc", "id": "538f41ce7e389535d0fa49d4f139a956287139fc", "size": "2125...
""" Functions for exiting scripts in a standard way. """ import json import os import sys def fail(*args): """ Exit with failure with optional commentary to stderr. """ message = '' for arg in args: message += arg if message != '': sys.stderr.write(message.strip() + '\n') ...
{ "content_hash": "172a075355bf3bdc93d55e98de75266d", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 79, "avg_line_length": 21.80821917808219, "alnum_prop": 0.5646984924623115, "repo_name": "perfsonar/pscheduler", "id": "10356b2d3d0590141d4d2275683aef1b3e14861c", "size": "...
from django.test import TestCase from mainapp.functions.search import ( search_string_to_params, params_to_search_string, MainappSearch, MULTI_MATCH_FIELDS, ) expected_params = { "query": { "bool": { "should": [ { "multi_match": { ...
{ "content_hash": "eccb8b46aaf7e4e548943384e55dd377", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 100, "avg_line_length": 33.52325581395349, "alnum_prop": 0.4890738813735692, "repo_name": "meine-stadt-transparent/meine-stadt-transparent", "id": "9592062f37878a42c1d8136483...
__author__ = 'luckydonald' from . import encoding from .utils import escape # validate_input from .exceptions import ArgumentParseError from os import path # file checking. import logging logger = logging.getLogger(__name__) class Argument(object): def __init__(self, name, optional=False, multible=False): self.n...
{ "content_hash": "57085d37b59ba90cebf97486be17228a", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 223, "avg_line_length": 25.410596026490065, "alnum_prop": 0.7159238988793328, "repo_name": "luckydonald/pytg2", "id": "115811718c0bc553ea8e90c193a94d36c1ee2e1c", "size": "...
from heat.common.i18n import _ from heat.engine import constraints from heat.engine import properties from heat.engine import resource from heat.engine import support class GlanceImage(resource.Resource): ''' A resource managing for image in Glance. ''' support_status = support.SupportStatus(version=...
{ "content_hash": "fb996bce2d4c1b2f06024c834c5eb79c", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 76, "avg_line_length": 34.19130434782609, "alnum_prop": 0.5363682604272635, "repo_name": "rdo-management/heat", "id": "66c5d4653389862c3555fb38450a851a24ce997c", "size": "...