text stringlengths 4 1.02M | meta dict |
|---|---|
from .core import db
class Project(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String, nullable=False)
sprints = db.relationship('Sprint', backref='project')
class Sprint(db.Model):
id = db.Column(db.Integer, primary_key=True)
number = db.Column(db.Integer, nullab... | {
"content_hash": "4c2f518060d284a4a1861bf56a862a51",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 67,
"avg_line_length": 34.17391304347826,
"alnum_prop": 0.688295165394402,
"repo_name": "victorneo/enkindle",
"id": "4b2265f353121f7fbaa22a895a0a82b873e88998",
"size": "786... |
"""External libraries"""
| {
"content_hash": "f54c41ef9a460e071213a9ce1e280ae8",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 24,
"avg_line_length": 25,
"alnum_prop": 0.68,
"repo_name": "toros-astro/corral",
"id": "b8ab5a3ff9e4f405dcb31bfe0c69a8f964981633",
"size": "1806",
"binary": false,
"cop... |
from __future__ import print_function
from u2flib_host import u2f, exc, __version__
from u2flib_host.constants import APDU_USE_NOT_SATISFIED
from u2flib_host.utils import u2str
from u2flib_host.yubicommon.compat import text_type
import time
import json
import argparse
import sys
def authenticate(devices, params, fa... | {
"content_hash": "dbfbd4d58a39816e372d64358481fbcc",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 84,
"avg_line_length": 34.29245283018868,
"alnum_prop": 0.5587345254470426,
"repo_name": "Yubico/python-u2flib-host",
"id": "19fbd3dc3b19b168ec4c970b8c94354613f79d74",
"si... |
from django.test import TestCase
from .models import Course, CourseModule
# Variables for use in unit tests
LTI_CONTEXT_ID = 'some_context_id'
LTI_TOOL_CONSUMER_INSTANCE_GUID = 'some_guid'
API_COURSE_ID = 1
LTI_RESOURCE_LINK_ID = 'some_resource_link_id'
LTI_RESOURCE_LINK_TITLE = 'some_resource_link_title'
API_COLLECT... | {
"content_hash": "9c5543e457245066824c247b64b3cc97",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 97,
"avg_line_length": 32.411764705882355,
"alnum_prop": 0.6429219600725953,
"repo_name": "Harvard-ATG/media_management_lti",
"id": "eb8b0a951e7738b8a30280313b4f05db53127434"... |
"""
Copyright 2015 Logvinenko Maksim
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softw... | {
"content_hash": "cdef01dbf95f7b01bf47425a6e995400",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 120,
"avg_line_length": 33.988571428571426,
"alnum_prop": 0.6267652992602556,
"repo_name": "logarithm/photon-python",
"id": "79a8d119dafa6cc58ba2c8c6c24d4ca6b8c8ca23",
"si... |
"""
query.py
Utility functions to query vcf explorer from the command line.
Needs refactoring -> delly hardcoded code.
"""
import re
import pymongo
from . import connection, db
def create_sample_query( query_command ):
match = re.match(r"^SAMPLE(=|\!=|\?=)\[?(.+)\]?",query_command)
query = {... | {
"content_hash": "3c06766042a94cea2c0db2577cdb7da3",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 108,
"avg_line_length": 32.2,
"alnum_prop": 0.5729813664596274,
"repo_name": "CuppenResearch/vcf-explorer",
"id": "7669d9f0321c11ce135b685272cff4043740c082",
"size": "1288"... |
"""Functions to create chemical series data sets."""
from __future__ import absolute_import
import numpy
from fermilib.utils._molecular_data import (MolecularData,
periodic_hash_table,
periodic_polarization)
# Define error objec... | {
"content_hash": "8f220f2a8468f90fae36b424f51552ae",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 77,
"avg_line_length": 35.852112676056336,
"alnum_prop": 0.5833824395992929,
"repo_name": "ProjectQ-Framework/FermiLib",
"id": "4cc6c3d3b0cb46dd028b0768abca22f039af87cd",
... |
"""
:class:`Teleport` geocoder.
"""
from geopy.compat import urlencode
from geopy.exc import GeocoderServiceError
from geopy.geocoders.base import (
Geocoder,
DEFAULT_TIMEOUT,
DEFAULT_FORMAT_STRING,
)
from geopy.location import Location
from geopy.util import logger
try:
from urllib.parse import quote ... | {
"content_hash": "4ea80bd8e8cf4812b9bc2a0b817d534f",
"timestamp": "",
"source": "github",
"line_count": 283,
"max_line_length": 100,
"avg_line_length": 34.66077738515901,
"alnum_prop": 0.5793658884697727,
"repo_name": "magnushiie/geopy",
"id": "525017f96a5d8ed1dbcb1e4a5ef7a1ef86c70a55",
"size": "98... |
from enumfields import Enum
class Operation(Enum):
CREATE = 'CREATE'
READ = 'READ'
UPDATE = 'UPDATE'
DELETE = 'DELETE'
| {
"content_hash": "4ee18fb01bda3ab4bcfcd5153e867cd1",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 27,
"avg_line_length": 17.125,
"alnum_prop": 0.6277372262773723,
"repo_name": "seebass/drf-tools",
"id": "6da0f80ea23f4784706b863c90709e528b579069",
"size": "137",
"binary... |
server = 'examples.hello_server.HelloServer'
# The module path of the worker class
worker = 'examples.hello_worker.HelloWorker'
# The base name of the server that will be combined with host and pid
# and used when requesting tasks from AWS.
name = 'HelloExample'
# Set the ARN for the activity that this server will w... | {
"content_hash": "9d4e9acde9c691cda14d4ffc691e1899",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 81,
"avg_line_length": 36.53333333333333,
"alnum_prop": 0.7541058394160584,
"repo_name": "irothschild/stefuna",
"id": "f9ab34b60c3a2e2263cabde72380b9f8316b0638",
"size": "2... |
import wx
from wx.lib.floatcanvas import FloatCanvas as FC
from modder import MOD_REGISTRY
from modder.gui.graph.models import Block, ConnectorLine, CanvasMixin
class ModManagerFrame(wx.Frame, CanvasMixin):
def __init__(self):
wx.Frame.__init__(
self, None, -1, "FloatCanvas Graph Test", wx.D... | {
"content_hash": "c47f15e63fc5e54f025cc851c87fa312",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 85,
"avg_line_length": 34.951219512195124,
"alnum_prop": 0.5617585484996511,
"repo_name": "JokerQyou/Modder2",
"id": "85a303d3f7ed94a3bb715b564760240666664052",
"size": "28... |
from __future__ import unicode_literals
from collections import defaultdict
import datetime
import decimal
import json
import re
from moto.compat import OrderedDict
from moto.core import BaseBackend, BaseModel
from moto.core.utils import unix_time
from .comparisons import get_comparison_func
class DynamoJsonEncoder(... | {
"content_hash": "64a2b98f5bd1ab842f9d88a02474114d",
"timestamp": "",
"source": "github",
"line_count": 719,
"max_line_length": 122,
"avg_line_length": 38.378303198887345,
"alnum_prop": 0.5430890773356527,
"repo_name": "kefo/moto",
"id": "7590ee1e1bc75cebe7946cc2f12a367d21f550a9",
"size": "27594",
... |
import os, logging
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
# SECURITY WARNING... | {
"content_hash": "e08d54650f81c41f698423edb5e097c1",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 91,
"avg_line_length": 26.78048780487805,
"alnum_prop": 0.6530054644808743,
"repo_name": "jroeland/teapot",
"id": "57ec30d45b9d0b3c8e190902d50a61a93f5f31a9",
"size": "3294... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import wagtail.wagtailcore.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
('wagtailcore', '0023_alter_page_revision_on_delete_behaviour'),
('wagta... | {
"content_hash": "e98df07a0c1a52e93ca7efc8ff9b055c",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 191,
"avg_line_length": 36.483870967741936,
"alnum_prop": 0.6162687886825818,
"repo_name": "samuelleeuwenburg/Samplate",
"id": "2e340c670717f0b9c4fed27427c1a6179dee2a0c",
"... |
from django.shortcuts import render
from django.views.generic.base import TemplateView
from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
import core.models as coremodels
from django.views.generic.edit import CreateView, UpdateView
from sitegate.decorators import redirect_... | {
"content_hash": "f997fb57af16f810bad525f11a98745d",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 194,
"avg_line_length": 37.142857142857146,
"alnum_prop": 0.7181818181818181,
"repo_name": "georgebcservices/coffeedapp",
"id": "5a8012f84aad798e7a665af1cdbc85d209b68fb5",
... |
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
f... | {
"content_hash": "9b4877d3495e471bb7e44dec4d0ea1db",
"timestamp": "",
"source": "github",
"line_count": 311,
"max_line_length": 201,
"avg_line_length": 45.09003215434084,
"alnum_prop": 0.6014404906225487,
"repo_name": "Azure/azure-sdk-for-python",
"id": "2aa39a2edb04854fe413f9b6d523691280236343",
"... |
from django.test import TestCase, Client
from django.core.urlresolvers import resolve
from django.contrib.auth.models import User
from allaccess.views import OAuthRedirect, OAuthCallback
from authentication.views import ForgotPasswordView, ResetPasswordView,\
ActivateAccountView
from authentication.emails import ... | {
"content_hash": "a95b32c53c45689851117aeda0bd7f56",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 73,
"avg_line_length": 30.932642487046632,
"alnum_prop": 0.5884422110552764,
"repo_name": "andela/troupon",
"id": "c00082a6a998fe05f31707388c57b77db08078c2",
"size": "5994... |
import os
import caffe
import yaml
from fast_rcnn.config import cfg
import numpy as np
import numpy.random as npr
from rpn.generate_anchors import generate_anchors
from utils.cython_bbox import bbox_overlaps
from fast_rcnn.bbox_transform import bbox_transform
DEBUG = False
class AnchorTargetLayer(caffe.Layer):
""... | {
"content_hash": "f69c88685ba20a9cceed6894af8c413b",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 95,
"avg_line_length": 40.54744525547445,
"alnum_prop": 0.5650765076507651,
"repo_name": "AtsushiHashimoto/fujino_mthesis",
"id": "b90aa5546ebc5d5111e2f2282d67caa2d607a2e9",... |
"""HTTP API connector implementation."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import collections
import json
import logging
from future.moves.urllib import parse as urlparse
from future.utils import iterkeys
import requests
from werkzeug impo... | {
"content_hash": "f2b31fc280dee9b296bebd58d6b311fb",
"timestamp": "",
"source": "github",
"line_count": 296,
"max_line_length": 80,
"avg_line_length": 30.344594594594593,
"alnum_prop": 0.6505232687597418,
"repo_name": "dunkhong/grr",
"id": "976b6307e432c753376afe3a635c409bdeb5ed49",
"size": "9004",... |
import azure.mgmt.resource.resources as resources
from azure.common.credentials import ServicePrincipalCredentials
from azure.mgmt.rdbms import postgresql
from msrestazure.azure_exceptions import CloudError
from common.methods import set_progress
from resourcehandlers.azure_arm.models import AzureARMHandler
RESOURCE_... | {
"content_hash": "d735e357163425f6e0dac950d05d9262",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 103,
"avg_line_length": 36.69117647058823,
"alnum_prop": 0.5346693386773547,
"repo_name": "CloudBoltSoftware/cloudbolt-forge",
"id": "3708a718c62cba309e70d694c028dea38aab2085... |
"""Compute NeighborRank for nodes in a graph."""
from citenet import util
def neighborrank(graph, amount=100, neighborhood_depth=2):
"""Compute the NeighborRank of the top ``amount`` nodes in graph,
using the specified neighborhood_depth."""
# Get top n nodes with highest outdegree (most often cited).
... | {
"content_hash": "a4bb0deb853413efc5dc46bfc507465a",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 72,
"avg_line_length": 36.5,
"alnum_prop": 0.6449771689497716,
"repo_name": "Pringley/citenet",
"id": "f26b08220ccc852687563af163fbd20fe506c9bb",
"size": "876",
"binary":... |
'''
@author: [email protected]
@copyright: 2017 Englesh.org. All rights reserved.
@license: https://github.com/Fyzel/weather-data-flaskapi/blob/master/LICENSE
@contact: [email protected]
@deffield updated: 2017-06-14
'''
import json
import logging
import random
import sys
imp... | {
"content_hash": "19e08c69911ff5e1d24da20592ee02c1",
"timestamp": "",
"source": "github",
"line_count": 1110,
"max_line_length": 119,
"avg_line_length": 40.31171171171171,
"alnum_prop": 0.5480042908863362,
"repo_name": "Fyzel/weather-data-flaskapi",
"id": "dcbe1cf0ff90a097995569aeb7da4ff8e7eb4bb1",
... |
from .utils import InputExample, InputFeatures, DataProcessor
from .glue import glue_output_modes, glue_processors, glue_tasks_num_labels, glue_convert_examples_to_features
from .squad import squad_convert_examples_to_features, SquadFeatures, SquadExample, SquadV1Processor, SquadV2Processor
from .xnli import xnli_outpu... | {
"content_hash": "bd07a9b27c8ab58c3f371c5e2e339df2",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 118,
"avg_line_length": 91.75,
"alnum_prop": 0.8337874659400545,
"repo_name": "HLTCHKUST/Xpersona",
"id": "0f1b24893ae961a7c286c882c1dd50a84b76a35c",
"size": "367",
"binar... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('profiles', '0008_auto_20150801_1847'),
('messaging', '0002_auto_20150801_1852'),
]
operations = [
migrations.AddField(
model_nam... | {
"content_hash": "447743875479259e61e5377285f026c0",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 112,
"avg_line_length": 27.6,
"alnum_prop": 0.6231884057971014,
"repo_name": "lancekrogers/music-network",
"id": "b31a9687402ccc34e0c49b6dbff9875cf46cce25",
"size": "576",
... |
import datetime as dt
import numpy as np
from numpy.linalg import eigh
def parse_range(daterange):
if 'd' in daterange:
return dt.timedelta(days=int(daterange.replace('d', '')))
elif 'w' in daterange:
return dt.timedelta(weeks=int(daterange.replace('w', '')))
elif 'm' in daterange:
... | {
"content_hash": "018700da05bccc8ed70c7036f08b5206",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 69,
"avg_line_length": 33.03703703703704,
"alnum_prop": 0.6446188340807175,
"repo_name": "ldkge/visfx",
"id": "8be65e46489edecae85590b95e2a25e495a9da2c",
"size": "892",
"... |
"""
Variation on the "promise" design pattern.
Promises make it easier to handle asynchronous operations correctly.
"""
import time
import logging
LOGGER = logging.getLogger(__name__)
class BrokenPromise(Exception):
"""
The promise was not satisfied within the time constraints.
"""
def __init__(se... | {
"content_hash": "be2adb92522a8ba6a0eac47b1a013cf6",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 117,
"avg_line_length": 33.31666666666667,
"alnum_prop": 0.6074704018676005,
"repo_name": "edx/bok-choy",
"id": "7ef66711f0bd064c8892888a3893f77ea5940136",
"size": "5997",... |
from ..cw_model import CWModel
class ExpenseEntry(CWModel):
def __init__(self, json_dict=None):
self.id = None # (Integer)
self.company = None # **(CompanyReference)
self.chargeToId = None # (Integer)
self.chargeToType = None # **(Enum)
self.type = None # *(... | {
"content_hash": "66782f4c71ac660931892db89878f86f",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 63,
"avg_line_length": 39.357142857142854,
"alnum_prop": 0.5762250453720508,
"repo_name": "joshuamsmith/ConnectPyse",
"id": "8058352e8e1025b9c39b593adc41b94758599897",
"siz... |
from .threading_decorators import Threaded_Function, as_thread, check_stop
del(threading_decorators)
try:
import IPython
if IPython.get_ipython() is not None: # We are in an IPython session
try:
from .matplotlib_qt_signals import Main_Loop_Caller
gui_safe = Main_Loop_Caller
... | {
"content_hash": "c48b70b970d514064cba04b1d15e63d2",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 74,
"avg_line_length": 24.666666666666668,
"alnum_prop": 0.6261261261261262,
"repo_name": "Vrekrer/threading_decorators",
"id": "4539ebe3499dfda815675689ad0e85f7c9c127a4",
... |
import pymongo
import bottle
import sys
@bottle.get("/hw1/<n>")
def get_hw1(n):
connection = pymongo.MongoClient("mongodb://localhost")
n = int(n)
db = connection.m101
collection = db.funnynumbers
magic = 0
try:
iter = collection.find({},limit=1, skip=n).sort('value', direction=1)
... | {
"content_hash": "e8335899daf07f882427662dc4ef8833",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 77,
"avg_line_length": 19.62962962962963,
"alnum_prop": 0.6264150943396226,
"repo_name": "MaximAbramchuck/mongodb-university-homeworks",
"id": "027b821a860de4cd9ab88f6374eed3... |
"""
Django settings for django_content_toolkit project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BA... | {
"content_hash": "f4ac515c462ece5754e3e558a31db3a5",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 71,
"avg_line_length": 24.454545454545453,
"alnum_prop": 0.7221189591078067,
"repo_name": "esistgut/django-content-toolkit",
"id": "08902eadd2e556f2d5564994562516d89f82a404",... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'OtherName.type'
db.add_column('portal_othername', 'type', self.gf('django.db.models.fields.CharField')(defau... | {
"content_hash": "ad079eaf7453d31701381a09558349c8",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 174,
"avg_line_length": 83.24615384615385,
"alnum_prop": 0.5414895583071521,
"repo_name": "mikesname/ehri-collections",
"id": "0c280ffa677d01b78182fdc78bea17d914ede564",
"... |
import datetime
import os
import re
import unittest
import uuid
from decimal import Decimal
import pytest
from django.http import QueryDict
from django.test import TestCase, override_settings
from django.utils import six, timezone
import rest_framework
from rest_framework import serializers
from rest_framework.fields... | {
"content_hash": "f4d599988d81f0247637427e63fce70e",
"timestamp": "",
"source": "github",
"line_count": 1860,
"max_line_length": 163,
"avg_line_length": 31.144086021505377,
"alnum_prop": 0.5831376881646182,
"repo_name": "uploadcare/django-rest-framework",
"id": "069ba879d4b5c4687f08e5852263e30cc9dd88... |
from tartist.data.rflow import control, InputPipe
import time
q = InputPipe('tart.pipe.test')
with control(pipes=[q]):
for i in range(10):
print(q.get()['current'])
time.sleep(1)
| {
"content_hash": "ceb026088b15a1910cde61d23ef45c6e",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 49,
"avg_line_length": 25,
"alnum_prop": 0.65,
"repo_name": "vacancy/TensorArtist",
"id": "4295f7ccbd9b1156c52b8ee34e77d7f1f758451f",
"size": "354",
"binary": false,
"co... |
from flask import Blueprint, render_template, current_app, redirect, g, get_template_attribute
from flask_application.controllers import TemplateView
from flask_application.profiles.models import Profile
from flask_application.users.models import User
from flask.ext.mobility.decorators import mobilized
import re
use... | {
"content_hash": "083a1ae4c0a3b14b6fe129d06a829a11",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 94,
"avg_line_length": 35.63503649635037,
"alnum_prop": 0.6188037689471528,
"repo_name": "dbdeadbeat/refurence",
"id": "0da361c826a605a10b0b782d0797dffa9e6d7922",
"size": ... |
'''
Created on Oct 1, 2016
@author: rtorres
'''
import datetime
from flaskiwsapp.database import SurrogatePK, Model, db, reference_col, relationship, Column
class Ticket(SurrogatePK, Model):
"""A ticket of the app."""
__tablename__ = 'tickets'
request_id = reference_col('requests', nullable=False, uniq... | {
"content_hash": "b4e28787aa315128d257227fac542794",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 92,
"avg_line_length": 30.193548387096776,
"alnum_prop": 0.6442307692307693,
"repo_name": "rafasis1986/EngineeringMidLevel",
"id": "06b1003d6d79e60c09e2a6a77a4ac335dada28cb",... |
import sys
import os
from optparse import OptionParser
from _version import __version__
from platypus.frontend import get_ast
from platypus.cfg import get_cfg
from platypus.simulator import get_ir
class Shell:
def __init__(self, source_filename):
try:
source_file = open(source_filename, 'r') ... | {
"content_hash": "951e4532d41070f1361663b0378be320",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 87,
"avg_line_length": 31.021505376344088,
"alnum_prop": 0.5237435008665511,
"repo_name": "anayjoshi/platypus",
"id": "8c4793e30a727fa5b0925a04b7f32c509eb35f35",
"size": "2... |
import os
import shutil
from tests import add, TestCase
from mutagen.easymp4 import EasyMP4, error as MP4Error
from tempfile import mkstemp
class TEasyMP4(TestCase):
def setUp(self):
fd, self.filename = mkstemp('.mp4')
os.close(fd)
empty = os.path.join('tests', 'data', 'has-tags.m4a')
... | {
"content_hash": "4d3c48a07b596f198db9d1efa611d733",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 75,
"avg_line_length": 33.61744966442953,
"alnum_prop": 0.5546017169095628,
"repo_name": "hanvo/MusicCloud",
"id": "8c9d7801dff071fee5d6e2b5e93d73ec221c8106",
"size": "500... |
from django.core.urlresolvers import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from demo_app.models import Post
class PostTests(APITestCase):
def test_post_list(self):
url = reverse('post_list')
response = self.client.get(url, format='json')
self... | {
"content_hash": "944006c2c6a86e086f46da977021024c",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 116,
"avg_line_length": 48.05128205128205,
"alnum_prop": 0.6392742796157951,
"repo_name": "chris-ramon/django_angularjs_demo_fbv",
"id": "d6ff54131307742146cf7825cebeeeeaf676... |
from django.db import models
from helpers import create_uid,roll
class Author(models.Model):
access_token = models.CharField(max_length=18,null=True)
last_access = models.DateTimeField(auto_now=True)
username = models.CharField(max_length=50,primary_key=True)
password = models.CharField(max_le... | {
"content_hash": "73454918a60229b08f47b20ebae42170",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 121,
"avg_line_length": 41.89156626506024,
"alnum_prop": 0.6804716709807305,
"repo_name": "hgeg/nightblade-prelude",
"id": "0c5a5455fe221db91cae2dbbed7831b7282f7f8b",
"size... |
from __future__ import print_function
import time
from raiden.settings import (
DEFAULT_SETTLE_TIMEOUT,
DEFAULT_POLL_TIMEOUT,
DEFAULT_REVEAL_TIMEOUT,
)
from raiden.tests.utils.tester_client import (
BlockChainServiceTesterMock,
)
from raiden.tests.fixtures.tester import (
tester_blockgas_limit,
... | {
"content_hash": "35e534af5b62a019493a79e2a3a029fb",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 89,
"avg_line_length": 27.304347826086957,
"alnum_prop": 0.6392174704276615,
"repo_name": "charles-cooper/raiden",
"id": "9fedfa511374106ff010992663152b4377b276d9",
"size"... |
import re
from collections import deque
from collections import defaultdict
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.remote.webdriver import WebDriver
def analyze(url=None, driver=None, mode="all", unique=False):
"""
Analyze... | {
"content_hash": "a359eafd55fdb66522c224af54434dbf",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 184,
"avg_line_length": 35.80859375,
"alnum_prop": 0.5669248390967602,
"repo_name": "perfidia/selesame",
"id": "c9fdc57034f0edec1edf694ce808395917f89803",
"size": "9215",
... |
import unittest
from pathlib import Path
from striprtf.striprtf import rtf_to_text
RTF_DIR = Path.cwd() / "tests" / "rtf"
TEXT_DIR = Path.cwd() / "tests" / "text"
class TestUnicodeJapanese(unittest.TestCase):
def test_empty(self):
example_rtf = RTF_DIR / "issue_15.rtf"
example_txt = TEXT_DIR / "... | {
"content_hash": "b3af056d0d4ad4c271c70115897208ff",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 64,
"avg_line_length": 31.333333333333332,
"alnum_prop": 0.6471631205673759,
"repo_name": "joshy/striprtf",
"id": "4d41be63919fda930c9ec57886bf8d48af0b805c",
"size": "564",... |
import os
import sys
import tempfile
import unittest
# Mutates sys.path.
import test_env
from utils import file_path
from utils import fs
def write_content(path, content):
with fs.open(path, 'wb') as f:
f.write(content)
class FSTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
if not file_p... | {
"content_hash": "554bd5145384ae61294521c200adfcad",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 77,
"avg_line_length": 29.674285714285713,
"alnum_prop": 0.6323897554400154,
"repo_name": "luci/luci-py",
"id": "897436ce8fa55a3a5a7fcb8893fb7e737cf2cb02",
"size": "5406",... |
"""(Re)installs pyxb compiling the opengis bundle in order to access OGC
binding classes.
"""
import argparse
import logging
import os
import shlex
import shutil
import subprocess
import tarfile
import tempfile
import pathlib2
try:
from pyxb.bundles import opengis
PYXB_AVAILABLE = True
except ImportError as... | {
"content_hash": "c284d1a643d81669a5af2fb422b6ce5b",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 78,
"avg_line_length": 31.25,
"alnum_prop": 0.6229565217391304,
"repo_name": "pyoseo/django-oseoserver",
"id": "f564eafd95c80e60e9e21e1a18c02de58e83b44f",
"size": "2875",
... |
import os
import click
import logging
import pandas as pd
import glob
from dotenv import find_dotenv, load_dotenv
@click.command()
@click.argument('input_filepath', type=click.Path(exists=True))
@click.argument('fine_csv_filepath', type=click.Path(exists=True))
@click.argument('output_filepath', type=click.Path())
def... | {
"content_hash": "68b049a3f656ca4aa187f4abca63809f",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 79,
"avg_line_length": 36.62222222222222,
"alnum_prop": 0.683252427184466,
"repo_name": "ndanielsen/dc_parking_violations_data",
"id": "c5eed6c1ed96b547e8936ff9a1a545c77bdeaf... |
from tests.helpers import BaseTestCase
class TestCommitCommand(BaseTestCase):
def test_can_commit(self):
"""
Default use case where user invokes `et commit` with minimal parameters
"""
self.fail('Not Implemented')
def test_does_not_work_outside_of_a_linked_project(self):
... | {
"content_hash": "dd8f2ee8ec48e703fd2ca79abeff7104",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 79,
"avg_line_length": 28.4,
"alnum_prop": 0.6314553990610329,
"repo_name": "pnw/env-tracker",
"id": "fbdb37b353126186339d87a080afd86c9c67da44",
"size": "426",
"binary": ... |
""" Cisco_IOS_XR_Ethernet_SPAN_cfg
This module contains a collection of YANG definitions
for Cisco IOS\-XR Ethernet\-SPAN package configuration.
This module contains definitions
for the following management objects\:
span\-monitor\-session\: none
This YANG module augments the
Cisco\-IOS\-XR\-ifmgr\-cfg,
Cisco... | {
"content_hash": "54d8bbdb132c611872e9757caaccc0a6",
"timestamp": "",
"source": "github",
"line_count": 377,
"max_line_length": 297,
"avg_line_length": 28.453580901856764,
"alnum_prop": 0.5314626643050248,
"repo_name": "111pontes/ydk-py",
"id": "1ee832945e1e0d4373b8c57240d37a1a8a1b7d9d",
"size": "1... |
import csv
import re
from encoding import safe_encode, safe_decode
newline_regex = re.compile('\r\n|\r|\n')
csv.register_dialect('tsv_no_quote', delimiter='\t', quoting=csv.QUOTE_NONE, quotechar='')
def tsv_string(s):
return safe_encode(newline_regex.sub(u', ', safe_decode(s).strip()).replace(u'\t', u' '))
de... | {
"content_hash": "4f2358b0fd37b6377c240cd1397bd7c9",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 93,
"avg_line_length": 28.25,
"alnum_prop": 0.665929203539823,
"repo_name": "openvenues/libpostal",
"id": "783d77925924b979629eab8aa4badef84ecaaf9a",
"size": "452",
"bina... |
from __future__ import unicode_literals
AUTHOR = u'Nithesh Mittapally'
SITENAME = u'Code Opinions by Nithesh Mittapally'
SITEURL = ''
PATH = 'content'
THEME = 'opinions'
TIMEZONE = 'America/New_York'
DEFAULT_LANG = u'en'
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_AT... | {
"content_hash": "acd5b58b3ea351113d4e176cec8a0f03",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 77,
"avg_line_length": 25.833333333333332,
"alnum_prop": 0.6870967741935484,
"repo_name": "nithesh/blog",
"id": "6df311ae25c566c8e311233fd416b87998b61367",
"size": "978",
... |
""" twitter related helper functions .. uses tweepy. """
## jsb imports
from jsb.utils.exception import handle_exception
from jsb.utils.pdol import Pdol
from jsb.utils.textutils import html_unescape
from jsb.utils.generic import waitforqueue, strippedtxt, splittxt
from jsb.lib.persist import PlugPersist
from jsb.lib.... | {
"content_hash": "7fd6e4e47b0fc7de25bd19a965e6a377",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 131,
"avg_line_length": 31.727272727272727,
"alnum_prop": 0.6537359488648887,
"repo_name": "Petraea/jsonbot",
"id": "a0a3ebe05db68896f1786ed5cadba37dc9f0550f",
"size": "45... |
import numpy as np
def bellman_ford(n, edges):
op = [0, 0, 0]
distance = np.empty(n)
distance[:] = np.infty
predecessor = np.empty(n, dtype='int')
predecessor[:] = -1
op[2] += 4
while True:
# start from random vertice as we don't care about actual path
distance[edges[0][0... | {
"content_hash": "1a6a7a150acbfcbdfe013828ea7dfe52",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 114,
"avg_line_length": 27.75595238095238,
"alnum_prop": 0.4625777396525842,
"repo_name": "rudnitskih/ucu-adc-coursework",
"id": "cf161cfce5a3b77d172ccb7aeeae4d634d7bb031",
... |
from google.cloud import monitoring_v3
def sample_list_notification_channel_descriptors():
# Create a client
client = monitoring_v3.NotificationChannelServiceClient()
# Initialize request argument(s)
request = monitoring_v3.ListNotificationChannelDescriptorsRequest(
name="name_value",
)
... | {
"content_hash": "7e3a2881eafabaad5575fc38ce8fcca4",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 98,
"avg_line_length": 30.35,
"alnum_prop": 0.7528830313014827,
"repo_name": "googleapis/python-monitoring",
"id": "e3dc263cddfc4e4ec26307dba414daad6ea9ba2e",
"size": "2053... |
"""
Class for spherical harmonic coefficients of the gravitational potential.
"""
import numpy as _np
import matplotlib as _mpl
import matplotlib.pyplot as _plt
from mpl_toolkits.axes_grid1 import make_axes_locatable as _make_axes_locatable
import copy as _copy
import warnings as _warnings
import xarray as _xr
from... | {
"content_hash": "73a9aa2f84e178dbd937f53722c4c7fb",
"timestamp": "",
"source": "github",
"line_count": 3893,
"max_line_length": 79,
"avg_line_length": 44.69303878756743,
"alnum_prop": 0.5383585263520893,
"repo_name": "SHTOOLS/SHTOOLS",
"id": "72d07e082369fab83b56e38febb7582c7a719233",
"size": "173... |
"""Base class for linear operators."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import abc
import contextlib
import numpy as np
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_util
from tensorflow.python.o... | {
"content_hash": "f04e271e27290909fdbc38a2df6a67cc",
"timestamp": "",
"source": "github",
"line_count": 898,
"max_line_length": 80,
"avg_line_length": 34.724944320712694,
"alnum_prop": 0.6460250777667319,
"repo_name": "Xeralux/tensorflow",
"id": "c7513d5b40c5a4bb11501c90e08a9dc3a38c2e09",
"size": "... |
from copy import deepcopy
from item import Item
from types import METHOD_TO_TYPE_MAPPING
from url import URL
## Represents a request for API data.
#
# The Request object provides a standard interface for creating requests for API
# data. An instance of this class is never directly initialized, but instead
#... | {
"content_hash": "15b476c0a48672046704cde0e4a6494f",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 99,
"avg_line_length": 41.13939393939394,
"alnum_prop": 0.5490571596935769,
"repo_name": "josephdunn/stackpy",
"id": "44e80b48115bc3c68e63e34c9a5e13796467bc18",
"size": "6... |
import operator
from urllib import urlencode
from django.http import HttpResponseRedirect
from django.template import Context, loader, RequestContext
from django.template.response import TemplateResponse
from django.shortcuts import get_object_or_404
from django.core.urlresolvers import reverse
from django.core.pagina... | {
"content_hash": "b39ecc1f5ecd03f6f02b1f5f56d7eaac",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 124,
"avg_line_length": 47.07751937984496,
"alnum_prop": 0.6199571875514572,
"repo_name": "aykut/django-oscar",
"id": "0ed18fd2ad9e3467172bb5e3d3cf0632dfe70317",
"size": "... |
import json
from lib.base import BaseRedisAction
__all__ = [
'MultiSRemAction'
]
class MultiSRemAction(BaseRedisAction):
def run(self, key, values):
values = json.loads(values)
for value in values:
self._client.srem(key, value)
return True
| {
"content_hash": "0d6a078739029c5ab52706c6ca663b88",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 41,
"avg_line_length": 18.0625,
"alnum_prop": 0.6332179930795848,
"repo_name": "ryandub/st2redis",
"id": "f3b52dde186ee59385d12eeb03d963b8f3b5b3d3",
"size": "289",
"binar... |
from south.db import db
from django.db import models
from mypage.pages.models import *
class Migration:
def forwards(self, orm):
# Adding field 'Page.layout_migrated'
db.add_column('pages_page', 'layout_migrated', models.BooleanField(default=False))
def backward... | {
"content_hash": "4ff667bf8374b10168a3d706aa465810",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 115,
"avg_line_length": 44.51851851851852,
"alnum_prop": 0.5029118136439268,
"repo_name": "ella/mypage",
"id": "5dcd0d5a49af7eb4cf7cc71e0530122373b53f1c",
"size": "2405",
... |
from .EntityFactory import EntityFactory | {
"content_hash": "dd1aa5f6c6d99b7736763f303a856923",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 40,
"avg_line_length": 40,
"alnum_prop": 0.9,
"repo_name": "GMadorell/larv",
"id": "1691eedf490f30ae26609570defc6bf1a9f240f5",
"size": "54",
"binary": false,
"copies": "... |
import glob
import pkg_resources
def data_file(basename):
datadir = pkg_resources.resource_filename('kevlar', 'tests/data')
return datadir + '/' + basename
def data_glob(globstr):
datadir = pkg_resources.resource_filename('kevlar', 'tests/data')
return sorted(glob.glob(datadir + '/' + globstr))
| {
"content_hash": "55f42bb21ba220708c15d9de510cf6ff",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 69,
"avg_line_length": 26.333333333333332,
"alnum_prop": 0.6962025316455697,
"repo_name": "dib-lab/kevlar",
"id": "c160d42875b63de0285cdba981fb781b30ebc825",
"size": "687",... |
from functools import wraps
from pyramid.request import call_app_with_subpath_as_path_info
def wsgiapp(wrapped):
""" Decorator to turn a WSGI application into a :app:`Pyramid`
:term:`view callable`. This decorator differs from the
:func:`pyramid.wsgi.wsgiapp2` decorator inasmuch as fixups of
``PATH_IN... | {
"content_hash": "d231c9058db4cd2fd8bb1d23ebefb345",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 77,
"avg_line_length": 40.94871794871795,
"alnum_prop": 0.6552911709455228,
"repo_name": "danielpronych/pyramid-doxygen",
"id": "d176e4ce5d265789e231f61eece0c08b577ca3d3",
... |
from apysignature import __version__
from setuptools import setup, find_packages
setup(
name='apysignature',
version=__version__,
install_requires=[
'ordereddict>=1.1'
],
url='https://github.com/erickponce/apysignature',
description='Python implementation of the Ruby Signature library ... | {
"content_hash": "7cc2e37f8c041b0c03768268642217ac",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 111,
"avg_line_length": 33.42857142857143,
"alnum_prop": 0.6527777777777778,
"repo_name": "erickponce/apysignature",
"id": "b5d61d51ff58ce089d0d53932d4f82b5215ebc3b",
"size... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('forum', '0005_auto_20161009_1758'),
]
operations = [
migrations.RemoveField(
model_name='thread',
name='content',
),... | {
"content_hash": "dc548bbaa7f9848a28c009ec730cf2ea",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 53,
"avg_line_length": 23.75,
"alnum_prop": 0.5413533834586466,
"repo_name": "WarwickAnimeSoc/aniMango",
"id": "15e8eff20fd35b7274215f5161d84bc99aa25ee4",
"size": "738",
... |
from fabric.api import *
from fabric.contrib.files import exists
env.user = 'vagrant'
env.hosts = '192.168.33.10'
vagrant_ssh = local('vagrant ssh-config | grep IdentityFile', capture=True)
env.key_filename = vagrant_ssh.split()[1].strip('"')
env.project_dir = 'duoclub'
env.project_name = 'duoclub'
env.project_confi... | {
"content_hash": "0d61ff0e72d074b5cc12cde60182653d",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 132,
"avg_line_length": 32.462765957446805,
"alnum_prop": 0.5739800098312305,
"repo_name": "mittya/duoclub",
"id": "ca0f45cdf757e90be04795f26dae25b454f6f282",
"size": "641... |
"""Benchmarks on Keras layers."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import numpy as np
import six
import tensorflow as tf
from tensorflow.python.keras.benchmarks.layer_benchmarks import layer_benchmarks_test_base
from tensorf... | {
"content_hash": "500e3038be34b1c784882fd53acbf836",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 90,
"avg_line_length": 36.134408602150536,
"alnum_prop": 0.6384466597232554,
"repo_name": "freedomtan/tensorflow",
"id": "a8a0031046583ed13a6e8d4a5c1e07f6f416d38c",
"size"... |
from __future__ import print_function
import argparse
import json
import os
import re
import sys
"""Simple superficial API doc generator for .cmake files"""
def crawl_for_cmake(path, excluded_files=None):
"""Crawls over path, looking for files named *.cmake, returns tuple of full and relative path."""
cmake... | {
"content_hash": "f1fc43c2129eaceca72cccc05037dccf",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 186,
"avg_line_length": 40.026315789473685,
"alnum_prop": 0.5208744247205785,
"repo_name": "ros/catkin",
"id": "12ef0335c68845e13acefb388c7e1e18a0c11fe5",
"size": "7713",
... |
from distutils.core import setup
setup(name='PyBIND',
version='0.1.0',
description='Python package for writing ISC BIND files',
author='Brian L. Brush',
author_email='[email protected]',
classifiers=['Development Status :: 4 - Beta',
'Intended Audience :: Information... | {
"content_hash": "1d212962d87a216192d3c378e33c7e04",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 65,
"avg_line_length": 40.2,
"alnum_prop": 0.5887230514096186,
"repo_name": "RhubarbSin/PyBIND",
"id": "b8404f8860ba3aa472eaf3d72cd8cc3ed29b1030",
"size": "603",
"binary"... |
from pysmt.shortcuts import Symbol, LE, GE, Int, And, Equals, Plus, Solver
from pysmt.typing import INT
hello = [Symbol(s, INT) for s in "hello"]
world = [Symbol(s, INT) for s in "world"]
letters = set(hello+world)
domains = And(And(LE(Int(1), l),
GE(Int(10), l)) for l in letters)
sum_hello = Plus... | {
"content_hash": "b0c86df4955c0a1967d6194b3ae0b427",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 74,
"avg_line_length": 26.181818181818183,
"alnum_prop": 0.6180555555555556,
"repo_name": "agriggio/pysmt",
"id": "e2eded27723be122f5b40f8e5f9d5c4155bac6ab",
"size": "864",... |
from django.db import models
from django.conf import settings
from django.contrib.auth.models import User
from django.utils.encoding import python_2_unicode_compatible
from django.db.models.signals import post_save
from django.dispatch import receiver
@python_2_unicode_compatible
class SecuredpiProfile(models.Model):... | {
"content_hash": "328857b82844c7cc48e434d1d09fcb7c",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 68,
"avg_line_length": 31.333333333333332,
"alnum_prop": 0.7004909983633388,
"repo_name": "Secured-Pi/Secured-Pi",
"id": "665d85a9409258751668f0cadeef3da6d6506078",
"size":... |
import logging
import struct
import zlib
from kafka.codec import (
gzip_encode, gzip_decode, snappy_encode, snappy_decode
)
from kafka.common import (
BrokerMetadata, PartitionMetadata, Message, OffsetAndMessage,
ProduceResponse, FetchResponse, OffsetResponse,
OffsetCommitResponse, OffsetFetchResponse
... | {
"content_hash": "aee892b39af079af79f3f153a9dd29f2",
"timestamp": "",
"source": "github",
"line_count": 560,
"max_line_length": 89,
"avg_line_length": 35.683928571428574,
"alnum_prop": 0.5543712155332032,
"repo_name": "spicavigo/kafka-python",
"id": "f98547909e95c0c1aeddcce6236b302abda76511",
"size... |
from collections import OrderedDict
from operator import attrgetter
from django.db import connections, transaction, IntegrityError
from django.db.models import signals, sql
from django.utils import six
class ProtectedError(IntegrityError):
def __init__(self, msg, protected_objects):
self.protected_object... | {
"content_hash": "cfb34114536100ebf9faf5e06d702294",
"timestamp": "",
"source": "github",
"line_count": 628,
"max_line_length": 91,
"avg_line_length": 43.04936305732484,
"alnum_prop": 0.577510634362863,
"repo_name": "atruberg/django-custom",
"id": "9d08786cf3a75f91004b19f3667ca938352bb53b",
"size":... |
import gc
import webrepl
import my_network
my_network.connect()
webrepl.start()
gc.collect()
| {
"content_hash": "fb8bba418d5bc70abb185f996a26d580",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 20,
"avg_line_length": 10.666666666666666,
"alnum_prop": 0.7604166666666666,
"repo_name": "NSE-labs/ESP8266-wifi-devices",
"id": "f2f8f84999db031ba424b29abef32ee4ff1c9520",
... |
"""
py2exe conversion script
"""
from distutils.core import setup
import py2exe
setup(windows=[{"script":"main.py"}], options={"py2exe":{"includes":["sip"]}}) | {
"content_hash": "918cc51e97ca3d4efe23a99fa00004d1",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 78,
"avg_line_length": 20,
"alnum_prop": 0.6875,
"repo_name": "AeroNotix/pdftotif",
"id": "2ec2437802b5f0fa1c206616bcb670c87dced382",
"size": "160",
"binary": false,
"co... |
"""A module that implements the "theanolm decode" command.
"""
import gc
import sys
import os
import logging
import numpy
import theano
from theanolm import Network
from theanolm.backend import TextFileType
from theanolm.backend import get_default_device, log_free_mem
from theanolm.scoring import LatticeBatch, Latti... | {
"content_hash": "9caee970a425d5674306ea398d9018a4",
"timestamp": "",
"source": "github",
"line_count": 310,
"max_line_length": 82,
"avg_line_length": 45.60967741935484,
"alnum_prop": 0.6134097178018247,
"repo_name": "senarvi/theanolm",
"id": "b2a3ee1a654e8c7ec2e167366b4ab6414e3e73f5",
"size": "141... |
import logging
import random
from google.appengine.ext import webapp
from common import const, framework
class Index(framework.BaseRequestHandler):
def get(self):
msg = self.request.get('msg')
msg_type = self.request.get('msg_type', 'info')
self.render(['index', 'indexAbout'], locals())
class AboutProfile(f... | {
"content_hash": "cfa35c598a0b21ba3dc5d7228f17ed67",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 50,
"avg_line_length": 24.4390243902439,
"alnum_prop": 0.6786427145708582,
"repo_name": "PatrickKennedy/Sybil",
"id": "544d34863e0252d57fc5e1140ed3bc996a0b0354",
"size": "2... |
from __future__ import unicode_literals
from django.utils.encoding import python_2_unicode_compatible
from django.db import models
from .validators import has_valid_date
@python_2_unicode_compatible
class MaintenanceMessage(models.Model):
planned_date = models.DateTimeField(validators=[has_valid_date])
reas... | {
"content_hash": "025a35782981e4c7327a2d68a0b1ed09",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 68,
"avg_line_length": 29.4375,
"alnum_prop": 0.721868365180467,
"repo_name": "MattBlack85/django-about",
"id": "68e9b9a9e6218259b8cb4a41af1bac4d47c6c05a",
"size": "471",
... |
from logging import debug
from typing import Dict, List
from gitlabform.gitlab import GitLab
from gitlabform.processors.abstract_processor import AbstractProcessor
class SchedulesProcessor(AbstractProcessor):
def __init__(self, gitlab: GitLab):
super().__init__("schedules", gitlab)
def _process_conf... | {
"content_hash": "9087f707e4f6f37b98868ba78dc8bd56",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 88,
"avg_line_length": 41.57377049180328,
"alnum_prop": 0.5264195583596214,
"repo_name": "egnyte/gitlabform",
"id": "cd3e5e6a23d8efa6700bd4461f740e5e339bea7c",
"size": "50... |
from app.configuration import get_value
from app.helper import output_start, php, output_error
def execute():
output_start('phpmetrics')
metric_dir = get_value('metric-dir')
scan_dir = get_value('project-dir')+get_value('scan-dir')
excludes = '|'.join(get_value('exclude-dirs'))
if excludes != ''... | {
"content_hash": "05751fe32639d55a4fd0bd1b8bcc1a94",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 162,
"avg_line_length": 34.095238095238095,
"alnum_prop": 0.6508379888268156,
"repo_name": "mi-schi/php-code-checker",
"id": "71b690ce2a57d0238e47aa8bf069c4890f702443",
"si... |
import matplotlib.pyplot as plt
import numpy as np
import os
from numpy import r_
from math import ceil
from viz_utils import saveCurrentPlot, colorForLabel, nameFromDir
from ..utils import sequence as seq
# from ..utils.arrays import meanNormalizeCols, stdNormalizeCols, zNormalizeCols
from ..transforms import *
from ... | {
"content_hash": "b5440bf769c1504bc6268ebd928113bf",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 94,
"avg_line_length": 31.22421524663677,
"alnum_prop": 0.700847335918426,
"repo_name": "dblalock/flock",
"id": "a5ef4a9d5793cb179e1843e81fabf2f3f12c7ece",
"size": "6982",... |
import sys
args = sys.argv
arg_len = len(args)
if arg_len <3:
print("\n**** Written by DJP, 23/11/15 in Python 3.4 ****\n")
print("This program takes a wrapped fasta file as input.")
print("It outputs an unwrapped fasta file.")
print("\n**** USAGE **** \n")
print("unwrap_fasta.py [name of fasta file... | {
"content_hash": "0f90bcbf71843e551720b220106fe9bc",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 70,
"avg_line_length": 24.774193548387096,
"alnum_prop": 0.6015625,
"repo_name": "DarrenJParker/fasta_tools",
"id": "7927404b3451f90cb40dd249595cdfc06cd976a3",
"size": "793... |
'''Taken from URL:
https://gist.githubusercontent.com/xively-gists/5565335/raw/RaspberryPiTutorial.py
Referred by tutorial:
https://xively.com/dev/tutorials/pi/
'''
import os
import xively
import subprocess
import time
import datetime
import requests
# extract feed_id and api_key from environment variables
... | {
"content_hash": "d7afbd17b62709655aa4ad5dcf5ef344",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 85,
"avg_line_length": 25.884057971014492,
"alnum_prop": 0.7127659574468085,
"repo_name": "medovarsky/sms-tx",
"id": "7f318f888d3d3c43884ff80e42f2dffb3f242ca2",
"size": "18... |
import unittest
import pydoop
pp = pydoop.import_version_specific_module('_pipes')
from pydoop.pipes import Factory, RecordReader
class test_record_reader(RecordReader):
DEFAULT_VALUE = 'The quick red fox jumped on the lazy brown dog'
KEY_FORMAT = 'key-%d'
NUMBER_RECORDS = 10
def __init__(self, ctx):
R... | {
"content_hash": "2e4b7813b42765c7d67dfc4c267c2769",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 74,
"avg_line_length": 31.231884057971016,
"alnum_prop": 0.6556844547563805,
"repo_name": "jkahn/pydoop-code",
"id": "d629146feb94192dea53adc366e88296fcfc4b4a",
"size": "27... |
import collections
import contextlib
import mock
import netaddr
from oslo.config import cfg
import testtools
from neutron.agent.linux import ip_lib
from neutron.agent.linux import utils
from neutron.common import constants as n_const
from neutron.openstack.common import importutils
from neutron.plugins.common import ... | {
"content_hash": "abaa11423934135e1668f0d8ec9c4f9a",
"timestamp": "",
"source": "github",
"line_count": 1154,
"max_line_length": 79,
"avg_line_length": 45.25649913344888,
"alnum_prop": 0.5616934094129361,
"repo_name": "shakamunyi/neutron-dvr",
"id": "aaec36c9d62b614ac686478c3874d4d87a6d6f8c",
"size... |
import _plotly_utils.basevalidators
class XValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="x", parent_name="mesh3d.lightposition", **kwargs):
super(XValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edi... | {
"content_hash": "1808f4efaed4c9c90511a4cb77143282",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 86,
"avg_line_length": 37.42857142857143,
"alnum_prop": 0.5820610687022901,
"repo_name": "plotly/python-api",
"id": "607535cd1109df831170f626465f91660dac77f1",
"size": "524... |
from setuptools import setup
setup(
name = 'pyscale',
version = '0.1.1',
platforms = 'linux',
license = 'GPLv3',
url = 'https://github.com/alexcepoi/pyscale',
download_url = 'https://github.com/alexcepoi/pyscale/zipball/master',
description = 'General purpose Python framework for writing highly scalable appl... | {
"content_hash": "680e97c9d9dde664b33f3446e8151c36",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 119,
"avg_line_length": 29.77777777777778,
"alnum_prop": 0.695273631840796,
"repo_name": "alexcepoi/pyscale",
"id": "8d56b5e93267dce4358138c854faed718dc95979",
"size": "848... |
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.datetime_safe
class Migration(migrations.Migration):
dependencies = [
('resources', '0002_auto_20141213_1454'),
]
operations = [
migrations.AddField(
model_name='film',
... | {
"content_hash": "7886486703c34ba8fa3b456d58cc23c6",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 82,
"avg_line_length": 24.2,
"alnum_prop": 0.6260330578512396,
"repo_name": "phalt/swapi",
"id": "a521b369de1383f9051126082f128a370ac767bd",
"size": "508",
"binary": fals... |
from __future__ import division
from phoneclassification.phoneclassification.confusion_matrix import confusion_matrix
import numpy as np
import argparse,collections
from phoneclassification.phoneclassification._fast_EM import EM, e_step, m_step
"""
Extract the set of data associated with a set of phones
and give a la... | {
"content_hash": "b22a147935301860cd5ec9e354aabb24",
"timestamp": "",
"source": "github",
"line_count": 264,
"max_line_length": 236,
"avg_line_length": 40.61363636363637,
"alnum_prop": 0.6197537772803582,
"repo_name": "markstoehr/acoustic_cues",
"id": "07d7e24966c479b28ffdbd73bac4a205774c5368",
"si... |
from .cfg_fast import CFGFast
from .cfg_accurate import CFGAccurate
from .cfg import CFG
from .cfb import CFBlanket
# things to make your life easier
from .cfg_arch_options import CFGArchOptions
from .cfg_utils import CFGUtils
from .cfg_node import CFGNode
| {
"content_hash": "cc25dd26feb633bdebe9effa226789d6",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 44,
"avg_line_length": 28.666666666666668,
"alnum_prop": 0.8062015503875969,
"repo_name": "tyb0807/angr",
"id": "706dda88c2f9ad60cebb4abd009ded18bec9e874",
"size": "270",
... |
from __future__ import absolute_import
import logging
from keras.layers import Lambda, Dense, Concatenate
from keras.models import Model, Input
from .architectures import get_network_by_name
from .generic_layer_utils import slice_vector
logger = logging.getLogger(__name__)
class BaseDecoder(object):
def __ini... | {
"content_hash": "bade64b3970268fd8fcf75ebd211fd72",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 119,
"avg_line_length": 49.036458333333336,
"alnum_prop": 0.582793414763675,
"repo_name": "gdikov/vae-playground",
"id": "99e36724d0a14259cfc7782e26c6b7244b764732",
"size"... |
"""One-line documentation for from_to_tests module.
A detailed description of from_to_tests.
"""
__author__ = '[email protected] (Scott Kirkwood)'
import sys
sys.path.append('..')
import mm2notes
import unittest
import codecs
import glob
import difflib
class FromToTests(unittest.TestCase):
def RunOne(self,... | {
"content_hash": "19deea6fb8426f0ed66ee1c701616706",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 65,
"avg_line_length": 26.354166666666668,
"alnum_prop": 0.6490118577075099,
"repo_name": "scottkirkwood/mm2notes",
"id": "49685cfa37e0531a105cdc0dcfaf283a4304a90a",
"size"... |
"""
WSGI config for ligo project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ligo.settings")
from django.core.wsgi im... | {
"content_hash": "27523457a924df4e3341c9f90e282509",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 78,
"avg_line_length": 27.357142857142858,
"alnum_prop": 0.7702349869451697,
"repo_name": "hikaMaeng/bsShortURL",
"id": "39b106373b244342f5acd0d26dd5b0fcf3e1cbed",
"size": ... |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import tempfile
from django.core.management import call_command
from django.core.management.base import CommandError
from django.test import TestCase
from ..management.commands.importusers import crea... | {
"content_hash": "54061ffd341dde5f10d7b04a3d8cbde9",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 124,
"avg_line_length": 36.42045454545455,
"alnum_prop": 0.646801872074883,
"repo_name": "DXCanas/kolibri",
"id": "bc5bc258df28ea08cf5caf36208645b421af2df2",
"size": "6410... |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
settings = {
'name': 'ipaddress',
'version': '1.0.6',
'description': 'IPv4/IPv6 manipulation library',
'long_description': 'Port of the 3.3+ ipaddress module to 2.6 and 2.7',
'author': 'Philipp Hagemeiste... | {
"content_hash": "f2dc0dc495a9c171fa8c42490fdc70a5",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 75,
"avg_line_length": 33.785714285714285,
"alnum_prop": 0.6236786469344608,
"repo_name": "NikolayDachev/jadm",
"id": "af9268cb86db2da39e2c2a526b71c4bc9b8fba9c",
"size": "9... |
from datetime import datetime, timedelta
import json
from django import template
from django.conf import settings
from django.core.urlresolvers import reverse
from django.template.loader import render_to_string
from django.utils.datastructures import SortedDict
from django.utils.safestring import mark_safe
from django.... | {
"content_hash": "1bd0125ef0c3ef67aceed24beb4456dd",
"timestamp": "",
"source": "github",
"line_count": 229,
"max_line_length": 119,
"avg_line_length": 27.633187772925766,
"alnum_prop": 0.6494943109987358,
"repo_name": "SEL-Columbia/commcare-hq",
"id": "50314180fd2de97e50da6c0359234aee42818999",
"s... |
import sys, re, os, shutil, bisect, textwrap, shlex
import svntest
from svntest import main, actions, tree
from svntest import Failure
if sys.version_info[0] >= 3:
# Python >=3.0
from io import StringIO
else:
# Python <3.0
from cStringIO import StringIO
def make(wc_dir, commands, prev_status=None, prev_disk=... | {
"content_hash": "5a4871c4954685a63d8b86c20b7b37e8",
"timestamp": "",
"source": "github",
"line_count": 1654,
"max_line_length": 79,
"avg_line_length": 31.081620314389358,
"alnum_prop": 0.5660098426345581,
"repo_name": "jmckaskill/subversion",
"id": "cb387e83e241cc3b8a03a0f15b4522bbb69c9e94",
"size... |
from datetime import datetime
import types
import mongoengine as me
import cow.server as server
import cow.plugins.mongoengine_plugin as mongoengine_plugin
from preggy import expect
import derpconf.config as config
import tornado.web
import bzz
import bzz.signals as signals
import bzz.utils as utils
import tests.base... | {
"content_hash": "f7d6c49cc4ec6d2ab0ebd6c173913edf",
"timestamp": "",
"source": "github",
"line_count": 265,
"max_line_length": 127,
"avg_line_length": 36.16603773584906,
"alnum_prop": 0.5623956594323873,
"repo_name": "bzz-framework/bzz",
"id": "dc523a42ff68954838e846bc10ffdc57292931a3",
"size": "9... |
import lief
import sys
import time
# Do not parse dyld info
config = lief.MachO.ParserConfig()
config.parse_dyld_bindings = False
config.parse_dyld_exports = False
config.parse_dyld_rebases = False
t1 = time.time()
lief.MachO.parse(sys.argv[1], config)
t2 = time.time()
print(f"Done in {t2 - t1}s")
# Parse the dyl... | {
"content_hash": "cb3c356624e956dda02a11701582d941",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 37,
"avg_line_length": 20.130434782608695,
"alnum_prop": 0.714902807775378,
"repo_name": "lief-project/LIEF",
"id": "7d6f483bf7be72079e3b07766c6bf1c793f13af6",
"size": "463... |
from django.db import models
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from tinymce import models as tinymce_models
from econordeste.current_user import get_current_user
class Calendar(models.Model):
date_pub ... | {
"content_hash": "80ee654ec1ff747a23887feffb9b4c44",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 76,
"avg_line_length": 41.146341463414636,
"alnum_prop": 0.5939537640782454,
"repo_name": "klebercode/econordeste",
"id": "e10300e05796661868acb5352f6a2ff2868083ab",
"size"... |
from lamp_ivideon.settings import LOGGER
class Lamp:
def __init__(self):
self._on = False
self._color = (None, None, None)
self._actions = []
@property
def on(self):
return self._on
@on.setter
def on(self, value):
self._on = value
@property
def ac... | {
"content_hash": "e6dca1b11709f173bc32062db6f5a6b0",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 80,
"avg_line_length": 21.782608695652176,
"alnum_prop": 0.5419161676646707,
"repo_name": "mvshalamov/ivideon_test",
"id": "36a5f87e13179a439b274202ea68b6eba99575fd",
"size... |
from random import randrange, choice
description = '''
Monopoly odds
Problem 84
In the game, Monopoly, the standard board is set up in the following way:
GO A1 2=CC1 A2 T1 R1 B1 7=CH1 B2 B3 JAIL
H2 C1
T2 U1
H1 C2
36=CH3 C3
R4 R2
G3 D1
33=CC3 CC2=17
G2 D2
G1 D3
G2J F3 U2 F2 F1 R3 E3 E2 22=CH2 E1 FP
A... | {
"content_hash": "f0f4f595ca42e655bb6e640e0e3752b0",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 673,
"avg_line_length": 40.791666666666664,
"alnum_prop": 0.7211440245148111,
"repo_name": "mbuhot/mbuhot-euler-solutions",
"id": "ef4a5e4c18a6a4ba75925d6d243c38f409cd8ea5",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.