text stringlengths 4 1.02M | meta dict |
|---|---|
class Formatter(object):
"""
Base class for all formatter classes.
A formatter is an extension point (variation point) for the runner logic.
A formatter is called while processing model elements.
Processing Logic (simplified, without ScenarioOutline and skip logic)::
for feature in runner.... | {
"content_hash": "fb7eae72e1e3803b0d25aa89a5f23948",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 79,
"avg_line_length": 28.19090909090909,
"alnum_prop": 0.5524024508223154,
"repo_name": "tokunbo/behave-parallel",
"id": "d7c61cfc1e0e6a480427fadfcdae3e9e697df8b1",
"size... |
from __future__ import unicode_literals
from django.db import migrations, models
import wagtail.wagtailcore.fields
import wagtail.wagtailadmin.taggable
import modelcluster.fields
import modelcluster.contrib.taggit
class Migration(migrations.Migration):
dependencies = [
('taggit', '0002_auto_20150616_212... | {
"content_hash": "bf4fb4d0a1336499c9c4a3f7219f46e5",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 357,
"avg_line_length": 47.903225806451616,
"alnum_prop": 0.5892255892255892,
"repo_name": "makhadzi/nds",
"id": "ef108373eccf11713dfa7153f0d62b6e5c361515",
"size": "2994",... |
"""
film.py: a simple tool to manage your movies review
Simon Rozet, http://atonie.org/
@@ :
- manage directors and writers
- manage actors
- handle non IMDB uri
- markdown support in comment
Requires download and import of Python imdb library from
http://imdbpy.sourceforge.net/ - (warning: installation
will trigger... | {
"content_hash": "f1c06d1f1da3ff698f7c6897260b65cb",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 121,
"avg_line_length": 35.67424242424242,
"alnum_prop": 0.6211509874708006,
"repo_name": "GMDSP-Linked-Data/RDF-work-in-progress",
"id": "578f4b6e75ea8f21249f76ca425fe67719... |
try:
from lxml import etree
from lxml.etree import ETCompatXMLParser as parser
def xml_fromstring(argument):
return etree.fromstring(argument, parser=parser())
def xml_frompath(path):
return etree.parse(path, parser=parser()).getroot()
except ImportError:
try:
import xml.et... | {
"content_hash": "410acb03d747b08ccd25e2a9d4c63ecd",
"timestamp": "",
"source": "github",
"line_count": 331,
"max_line_length": 88,
"avg_line_length": 28.930513595166165,
"alnum_prop": 0.5546157059314955,
"repo_name": "valeriog-crytek/glad",
"id": "35cba2b2b819fecfb5ed2f50888b2fb6de108e32",
"size":... |
"""
Copyright 2015 Josh Conant
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, software
di... | {
"content_hash": "ce5354fd117f15c8a21d2d98cd264f20",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 74,
"avg_line_length": 32.62222222222222,
"alnum_prop": 0.6791553133514986,
"repo_name": "insequent/fibserv",
"id": "2f4767ef33de5afb54412e3444d60ec104bc3d0b",
"size": "151... |
import json
from datetime import datetime
from opentreewebapputil import (get_opentree_services_method_urls,
fetch_current_TNRS_context_names,
get_data_deposit_message,)
import bleach
from bleach.sanitizer import Cleaner
# Define a consistent cleaner to ... | {
"content_hash": "e9117917c433987050dadd0ed24bdad5",
"timestamp": "",
"source": "github",
"line_count": 521,
"max_line_length": 140,
"avg_line_length": 45.46257197696737,
"alnum_prop": 0.6258549354048806,
"repo_name": "OpenTreeOfLife/opentree",
"id": "7f82feae10291384237d51559718dbabf2640abe",
"siz... |
"""
Test the OOb sensor command Plugin.
"""
from .. import OobSensorGetCommand
from .test_oob_sensor_command import TestOobSensorCommand
class TestOobSensorGetCommand(TestOobSensorCommand):
def setUp(self):
super(TestOobSensorGetCommand, self).setUp()
self.oob_sensor_get = OobSensorGetCommand(self... | {
"content_hash": "560caa39a72b99e52e5da97264d9e6cd",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 103,
"avg_line_length": 54.625,
"alnum_prop": 0.6149885583524027,
"repo_name": "intel-ctrlsys/actsys",
"id": "54ee9c45190428df03bcd153bbb6020168146772",
"size": "1810",
"... |
from build_template import *
from optparse import OptionParser
import json
import os
def generate_enum_classfile(json_file, model):
filename = os.path.basename(json_file)
p = os.path.dirname(os.path.dirname(json_file))
enum_name = filename[:-5]
enum_file = os.path.join(p, enum_name + '.php')
print(... | {
"content_hash": "8d1825a2ef09c3b7e7f02c1a6500f9c9",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 88,
"avg_line_length": 27.18918918918919,
"alnum_prop": 0.6043737574552683,
"repo_name": "healerkx/AdminBuildr",
"id": "3933957b8fee2dfec2b9e2de3d4b23a597402e4c",
"size": "... |
from .imputer import Imputer
| {
"content_hash": "416cbfc60cf92832a8d890bccc6e896d",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 28,
"avg_line_length": 29,
"alnum_prop": 0.8275862068965517,
"repo_name": "robinsonkwame/Imputer.py",
"id": "783c449359c8a6133fae459cc099f9196274b16a",
"size": "29",
"bina... |
"""
The MIT License (MIT)
Copyright (c) 2015-2017 Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, ... | {
"content_hash": "528f417ffeeaf9ceb443257412964be8",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 95,
"avg_line_length": 35.44525547445255,
"alnum_prop": 0.6904859967051071,
"repo_name": "mgardne8/discord.py",
"id": "555bfd99403a964ca76377c5f1a2b835d93fbbf6",
"size": "... |
class AutoApiMissingAdminConfig(Exception):
pass
class Message(Exception):
def __init__(self, message):
super(Message, self).__init__()
self.message = message
| {
"content_hash": "e270f2e4ca707fbb487a97d59fa8f329",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 43,
"avg_line_length": 20.666666666666668,
"alnum_prop": 0.6451612903225806,
"repo_name": "fvalverd/AutoApi",
"id": "fe7c17e841b3fce44846743c95f3b0c93df7b586",
"size": "212"... |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Gradient(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scattersmith.marker"
_path_str = "scattersmith.marker.gradient"
_valid_props = {"color", "... | {
"content_hash": "8993ee6bc5579fbda6b375e91662f2ea",
"timestamp": "",
"source": "github",
"line_count": 236,
"max_line_length": 84,
"avg_line_length": 33.42372881355932,
"alnum_prop": 0.5463995943204868,
"repo_name": "plotly/plotly.py",
"id": "e1e91ba222fcb53f7bebfb9d1da9010102fbf460",
"size": "788... |
import bee
from bee.segments import *
import libcontext
from libcontext.pluginclasses import *
from libcontext.socketclasses import *
from .. import chessboard as comp_chessboard
class pandachessboard(comp_chessboard.chessboard):
def __init__(self, boardparent):
self.boardparent = boardparent
com... | {
"content_hash": "e4f87b07ceffddb16526f37f0c7f061a",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 86,
"avg_line_length": 29.84285714285714,
"alnum_prop": 0.6203925323121111,
"repo_name": "agoose77/hivesystem",
"id": "ca7c7286a8597f35f3246db42dddb8a2aad101d1",
"size": "2... |
from __future__ import absolute_import, unicode_literals
from .compat import reduce
def build_pipe(*args):
'''builds a pipe (a processing function) of the list of functions'''
return reduce(lambda g, f: (lambda elem: f(g(elem))), args)
def compose(*args):
'''composes the list of function into one'''
... | {
"content_hash": "f5d33ef35f56b77ea46dc30eb7ac256d",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 72,
"avg_line_length": 24.764705882352942,
"alnum_prop": 0.6817102137767221,
"repo_name": "szopu/git-jira-worklog",
"id": "d576025a3a8dd2ddc429e9385e4f755977b4c77c",
"size"... |
__author__ = 'jdaniel'
from math import sqrt
from GaiaSolve.model import Model
class ZDT1(Model):
def __init__(self):
super(ZDT1, self).__init__()
def evaluate(self):
g = 1.0 + 9.0*sum(self.x[1:])/(len(self.x) - 1)
f1 = self.x[0]
f2 = g * (1.0 - sqrt(f1/g))
self.obj... | {
"content_hash": "b7486fb6e4ba8969f3fdd0e5aeeddff2",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 55,
"avg_line_length": 20.266666666666666,
"alnum_prop": 0.5600328947368421,
"repo_name": "jldaniel/Gaia",
"id": "5d25095dbfeee98ba5e69747acc1dc911d92254a",
"size": "1216",... |
from datetime import datetime
from typing import Dict, Sequence, Union
import humanreadable as hr
TimeArg = Union[hr.Time, int, str, None]
IcmpReplies = Sequence[Dict[str, Union[str, bool, float, int, datetime]]]
PingAddOpts = Union[str, Sequence[str]]
| {
"content_hash": "a72a6122bec0ce1e33097bcb073f5103",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 73,
"avg_line_length": 28.444444444444443,
"alnum_prop": 0.7578125,
"repo_name": "thombashi/pingparsing",
"id": "dfe8d7a7127270da49a374972a845e3d07749815",
"size": "256",
... |
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
eraser = orm.Brush.objects.get(canonical_name='paintbrush')
eraser.ordinal = 999
eraser.save()
paintbrush = orm.Brush.ob... | {
"content_hash": "4a94056e393158ac6066de04033a122e",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 187,
"avg_line_length": 57.108108108108105,
"alnum_prop": 0.549297996529421,
"repo_name": "drawquest/drawquest-web",
"id": "f302485351be4ec2a33dbd8b16b3f05454af0573",
"siz... |
"""
Copyright 2012 Ali Ok (aliokATapacheDOTorg)
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 wr... | {
"content_hash": "3db73afd2e76bc938fde52ae1f9d0a30",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 118,
"avg_line_length": 39.60377358490566,
"alnum_prop": 0.753692234397332,
"repo_name": "aliok/trnltk",
"id": "8c723987e5bb0af2b8bb0a85d6ef60100ecd839a",
"size": "2099",
... |
from openerp import fields, models
class Partner(models.Model):
_inherit = 'res.partner'
instructor = fields.Boolean("Instructor", default=False)
session_ids = fields.Many2many('openacademy.session', string="Session as attendee",
readonly=True)
| {
"content_hash": "1216dfa37518b9152acdedd9df83efc3",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 87,
"avg_line_length": 33.22222222222222,
"alnum_prop": 0.6421404682274248,
"repo_name": "ITTANNER/openacademy-project",
"id": "97ef600094fed7ee4edd5bf0fd54cd6fcf31035b",
"s... |
from base import *
try:
from local_settings import *
except ImportError:
raise ImportError('Add settings/local_settings.py to hold secret info ')
| {
"content_hash": "6657ab5b73fca87ac31bcbed7491858b",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 76,
"avg_line_length": 25.833333333333332,
"alnum_prop": 0.7419354838709677,
"repo_name": "rmwdeveloper/webhack",
"id": "95f8651d1aa427f22a73d448f0e7572b7c6291a1",
"size": "... |
"""This module includes classes used for annotating trace information.
This includes the base StateAnnotation class, as well as an adaption,
which will not be copied on every new state.
"""
class StateAnnotation:
"""The StateAnnotation class is used to persist information over traces.
This allows modules to... | {
"content_hash": "d8e9aab7af0f17006476a92321d17066",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 101,
"avg_line_length": 31.904761904761905,
"alnum_prop": 0.7029850746268657,
"repo_name": "b-mueller/mythril",
"id": "0f25a31118791ef787c5ea0bb9c8b8c6792d0ec5",
"size": "1... |
"""Example differentially private trainer and evaluator for MNIST.
"""
from __future__ import division
import json
import os
import sys
import time
import numpy as np
from six.moves import xrange
import tensorflow as tf
from differential_privacy.dp_sgd.dp_optimizer import dp_optimizer
from differential_privacy.dp_sg... | {
"content_hash": "ff8d31ce5afc37c4eb322e4f0723254c",
"timestamp": "",
"source": "github",
"line_count": 493,
"max_line_length": 80,
"avg_line_length": 41.488843813387426,
"alnum_prop": 0.6301456927740295,
"repo_name": "jiaphuan/models",
"id": "d9343974dab6cc1c519672ff2fbb932e546d1db0",
"size": "211... |
from __future__ import absolute_import
from . import lexer, parser
from . import type_equation_solver
from .coretypes import *
from .typesets import *
from .type_symbol_table import *
from .util import *
from .coercion import coercion_cost
from .error import (DataShapeSyntaxError, OverloadError, UnificationError,
... | {
"content_hash": "66c79e2f29f17ce602bc8ffc727e0ef0",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 74,
"avg_line_length": 34.92982456140351,
"alnum_prop": 0.6534404821697639,
"repo_name": "FrancescAlted/datashape",
"id": "316dce7c8163937d4362ad9c4ffb923608a43eb5",
"size"... |
from rest_framework import permissions
class IsOwnerOrReadOnly(permissions.BasePermission):
"""
Custom permission to only allow owners of an object to edit it.
"""
def has_object_permission(self, request, view, obj):
# Read permissions are allowed to any request,
# so we'll always allo... | {
"content_hash": "a87ce7eae84022ec5e51caa253f19ce7",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 73,
"avg_line_length": 36.53333333333333,
"alnum_prop": 0.6843065693430657,
"repo_name": "perryhook/django-rest-tutorial",
"id": "6af03476b030609a074069c2f83c0e8dc7fd8ba9",
... |
import csv
import sys
from collections import defaultdict
fieldnames = ['Position', 'Ref', 'Alt', 'Variation', 'Zygosity', 'Refseq_change', 'Gene', 'Conserved_in_20_mammals', 'Sift_score', 'Polyphen_score', 'Cadd_score', 'Gnomad_af']
#Frequency','Samples']
frequencies = defaultdict(list)
samples = defaultdict(list)
a... | {
"content_hash": "ac5de52b4f42205f94fa0183382ab9dc",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 175,
"avg_line_length": 30.42105263157895,
"alnum_prop": 0.6375432525951558,
"repo_name": "naumenko-sa/cre",
"id": "aeb9cdda28f98a29ef55cedc93705fc4acc4ffa5",
"size": "1226... |
import logging
from django.core.urlresolvers import reverse
from django.db import transaction
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from peavy_demo.forms import QuoteForm
from peavy_demo.models import Quote
@transaction... | {
"content_hash": "f3754fd57eb05239cc89a4e3878fc447",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 118,
"avg_line_length": 30.096774193548388,
"alnum_prop": 0.6934619506966774,
"repo_name": "fairview/django-peavy",
"id": "ea5048dfbc2ee72365f4af5c9487e5fdc0cca6bc",
"size"... |
import requests
from requests.auth import HTTPBasicAuth
import json
import uuid
url = "http://127.0.0.1:8000"
auth = HTTPBasicAuth('admin', 'admin001')
def call_api(entity, verb='GET', params=None):
headers = {"Content-Type": "application/json"}
# TODO complete with all verbs
if verb == 'POST':
... | {
"content_hash": "8f6322bb91a67b5ade000b4063e8b236",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 78,
"avg_line_length": 24.333333333333332,
"alnum_prop": 0.6602739726027397,
"repo_name": "dcaravana/interview_restapi",
"id": "ef0536496f4fe40ab306e9fa2985f7b7219356db",
"... |
import json
import requests
def main(query):
#get the data
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko)'
'Chrome/53.0.2785.116 Safari/537.36'}
raw_data = requests.get("https://www.musixmatch.com/search/%s/lyrics" % query, headers=... | {
"content_hash": "651c0e00bf4c9231ed3c4ab344239725",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 123,
"avg_line_length": 40,
"alnum_prop": 0.6557692307692308,
"repo_name": "anshuman73/lyric-matcher",
"id": "0c0da528c729a66ca822a5899c09d1e7643aad9d",
"size": "1163",
"... |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Tickfont(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "mesh3d.colorbar"
_path_str = "mesh3d.colorbar.tickfont"
_valid_props = {"color", "family",... | {
"content_hash": "a100e49ac4ca74dea0e391803f52964d",
"timestamp": "",
"source": "github",
"line_count": 227,
"max_line_length": 82,
"avg_line_length": 37.29955947136564,
"alnum_prop": 0.5588756348175269,
"repo_name": "plotly/python-api",
"id": "e700b3d9adbf9c236069d2303a29658f4dc6e9f4",
"size": "84... |
import pytest
import sitchlib
import os
this_file_dirpath = os.path.dirname(os.path.abspath(__file__))
project_basepath = os.path.join(this_file_dirpath, "../../")
fixtures_path = os.path.join(this_file_dirpath, "../fixtures/")
csv_fixture_file = os.path.join(fixtures_path, "testdata.csv.gz")
class TestIntegrationCo... | {
"content_hash": "ac815a3f601b8bc7bc0646776182e9db",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 65,
"avg_line_length": 36.708333333333336,
"alnum_prop": 0.6674233825198638,
"repo_name": "sitch-io/feed_builder",
"id": "f5ba01598dd49eba3508077f6bdab5097023e442",
"size":... |
"""Test various net timeouts.
- Create three iond nodes:
no_verack_node - we never send a verack in response to their version
no_version_node - we never send a version (only a ping)
no_send_node - we never send any P2P message.
- Start all three nodes
- Wait 1 second
- Assert that we're connected
- Send ... | {
"content_hash": "b08c3772527f1f57a9f034ec0736bcdd",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 119,
"avg_line_length": 33.851851851851855,
"alnum_prop": 0.6684901531728665,
"repo_name": "aspaas/ion",
"id": "34d0a7272ef5cd08ab65b78407faa16056e979bb",
"size": "2951",
... |
import RPi.GPIO as GPIO
import logging
import Adafruit_PCA9685
import time
# Logging config
logging.basicConfig(filename='servo.log', level=logging.WARNING)
# System variables
pi = 3.14159
servo = 0
arm_angle = 0 # degrees
zero_motion_pl = 410
compensation_factor = 1.027
ccw_full_rot_time = 1.1 # s / 360 deg
base_an... | {
"content_hash": "d939e80aa97f5d6891e1d8b68c78bf64",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 98,
"avg_line_length": 29.3206106870229,
"alnum_prop": 0.614162978391044,
"repo_name": "MANSEDS/Lunar-Rover-2017-Robotics",
"id": "783f0632d27d49fdd04835995017d55ebe5a25ab",... |
class BinaryTree(object):
def __init__(self, rootid=None):
self.left = None
self.right = None
self.rootid = rootid
self.parents = [rootid]
def getLeftChild(self):
return self.left
def getRightChild(self):
return self.right
def setNodeValu... | {
"content_hash": "711af24e522bd628ecce1124b464a9d2",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 48,
"avg_line_length": 23.51851851851852,
"alnum_prop": 0.5464566929133858,
"repo_name": "Faraaz54/python_training_problems",
"id": "381eb0b5476a4a804b9db23c3781a7ae024bce0f"... |
from src.settings import Colors
def league_color(league: str) -> Colors:
if league in [
'1 HNL (Croatia)',
'A-League (Australia)',
'Bundesliga 2 (Germany)',
'Coppa Italia (Italy)',
'First Division (Cyprus)',
'Jupiler League (Belgium)',
'League Two (England)'... | {
"content_hash": "cf17c8fbe5ddbba98be91f25061a4692",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 46,
"avg_line_length": 30.579545454545453,
"alnum_prop": 0.5247120029728726,
"repo_name": "vapkarian/soccer-analyzer",
"id": "0bf5dd99ab9fed207e6cc05787f89ad27322b3ca",
"si... |
import collections
import copy
import uuid
from keystoneauth1.fixture import V2Token
from keystoneauth1 import loading as ks_loading
import mock
from mox3 import mox
import netaddr
from neutronclient.common import exceptions
from neutronclient.v2_0 import client
from oslo_config import cfg
from oslo_config import fixt... | {
"content_hash": "c40a83621cf765b2f357f495b5485d5e",
"timestamp": "",
"source": "github",
"line_count": 6015,
"max_line_length": 79,
"avg_line_length": 47.54596841230258,
"alnum_prop": 0.5595250166964464,
"repo_name": "hanlind/nova",
"id": "6275e1d593814ac714fee107c9493accb8c010a4",
"size": "286626... |
import os
import re
import cPickle as pickle
import copy
from PyQt4.QtCore import Qt, SIGNAL, QAbstractTableModel, QString, QVariant, QModelIndex
from PyQt4.QtGui import QColor
import WordClass
import WordContainerClass
import WordTesterExceptions as wtexception
WORD, MEANINGS, CONTEXT, DIFFICULTY = range(4)
MAGIC_... | {
"content_hash": "a924950fdc6f9bac2a4d3f36b0ce1aae",
"timestamp": "",
"source": "github",
"line_count": 530,
"max_line_length": 129,
"avg_line_length": 36.79056603773585,
"alnum_prop": 0.5461305707985025,
"repo_name": "michaupl/wordtester",
"id": "2057eafd79fb85f681b7f3b4b62c4c10062c2761",
"size": ... |
from marshmallow_jsonapi import Schema, fields
from marshmallow import validate, ValidationError
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy.exc import SQLAlchemyError
import datetime
from config import APP_ROOT, DEBUG
import hashlib
import os
import subprocess
db = SQLAlchemy(session_options={"autoflu... | {
"content_hash": "0591403cb926d0cf6024f8b17c01883e",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 141,
"avg_line_length": 36.24096385542169,
"alnum_prop": 0.5598404255319149,
"repo_name": "konstantinKim/vd-backend",
"id": "ee538402fec6769e8c1305d7e848dbe8356e028b",
"siz... |
import webapp2
import logging
import fix_path
from routes import route_list
from config import app_config
app = webapp2.WSGIApplication(route_list,
config = app_config,
debug = app_config.get('debug', True))
| {
"content_hash": "a98421984eb30a3470c43142d6d41216",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 70,
"avg_line_length": 25,
"alnum_prop": 0.5963636363636363,
"repo_name": "adrian/feed2me",
"id": "551a17e8e148a386d1865dcd5831d275ee0df0ff",
"size": "291",
"binary": fal... |
from django.test import TestCase
from django.urls import reverse
from portal.models import Student, Hobby
from portal.tests.constants import VALID_USERNAME
from portal.utils import get_invalid_id_popup, create_families_from_parents, assign_children_to_families
def create_student_and_return(username, child=False, mag... | {
"content_hash": "4b8d78c5f8f26d509f6a0bf4d5cb5173",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 118,
"avg_line_length": 45.72558139534884,
"alnum_prop": 0.6562913233648663,
"repo_name": "martinzlocha/mad",
"id": "302ed926d5ede4b8926e312b9a32334a453e976b",
"size": "98... |
"""Drop ``user`` and ``chart`` table
Revision ID: cf5dc11e79ad
Revises: 03afc6b6f902
Create Date: 2019-01-24 15:30:35.834740
"""
from __future__ import annotations
import sqlalchemy as sa
from alembic import op
from sqlalchemy import inspect
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alem... | {
"content_hash": "6e5ee1c5554c937509a5ca4a27c97371",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 107,
"avg_line_length": 34.63917525773196,
"alnum_prop": 0.6199404761904762,
"repo_name": "nathanielvarona/airflow",
"id": "78b3ca28f0b8eaea148ee9de828df447909fa6e0",
"size... |
__revision__ = "test/QT/reentrant.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
"""
Test creation from a copied environment that already has QT variables.
This makes sure the tool initialization is re-entrant.
"""
import TestSCons
test = TestSCons.TestSCons()
test.Qt_dummy_installation('qt')
test.wr... | {
"content_hash": "6b3deddf731f4afabec0d59de64ed9e3",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 94,
"avg_line_length": 19.6734693877551,
"alnum_prop": 0.6628630705394191,
"repo_name": "EmanueleCannizzaro/scons",
"id": "cbe2512cabdabad5f122b1b74d7a1e39610b3345",
"size"... |
import os, chardet
import unittest
from transifex.txcommon.tests.base import BaseTestCase
from transifex.languages.models import Language
from transifex.resources.models import *
from transifex.resources.formats.mozillaproperties import MozillaPropertiesHandler
from transifex.addons.suggestions.models import Suggesti... | {
"content_hash": "413a45019e67bc79a97b2c7188c7e9a6",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 93,
"avg_line_length": 35.76774193548387,
"alnum_prop": 0.6204906204906205,
"repo_name": "rvanlaar/easy-transifex",
"id": "7d571b937a13ecd6e4c3f8f508527ff40d332dd2",
"size... |
import random
import numpy as np
from scipy.optimize import minimize
from sklearn.linear_model import LinearRegression
from copy import deepcopy
def random_id():
return ''.join([random.choice('abcdefghijklmnopqrstuvwxyz123456789') for i in range(10)])
### VARIABLES
class AbstractVariable():
def __init__(self... | {
"content_hash": "ad855874a5800473589a5e864d4e9510",
"timestamp": "",
"source": "github",
"line_count": 572,
"max_line_length": 127,
"avg_line_length": 28.613636363636363,
"alnum_prop": 0.5646117187022668,
"repo_name": "iaroslav-ai/global-optimization",
"id": "78e8322fca9325ec7f4ac850e3cb9c70e033be2d... |
class HundredPush(object):
def __init__(self):
self.count = 0
def push(self, line):
if (self.count % 100 == 9):
print("Lチカ!!: {0}".format(line.strip()))
self.count = self.count + 1
return True
print("{0}".format(self.count))
self.count = self... | {
"content_hash": "5814353217d1016263f7062f6fbedc61",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 52,
"avg_line_length": 23.58823529411765,
"alnum_prop": 0.5062344139650873,
"repo_name": "youkidearitai/Arduino_LED_on_Python",
"id": "edfbbda293903e9cd0e67762015e714e16e5899... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Proyectos'
db.create_table('registros_proyectos', (
('id', self.gf('django.db.models.fields.AutoField')(... | {
"content_hash": "bb3a91d5a2cf38383e164d3989c9a85e",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 168,
"avg_line_length": 66.63392857142857,
"alnum_prop": 0.5763097949886105,
"repo_name": "pattyreinoso/voluntariadoHOI",
"id": "c9498f83c6849772daa9d15f3196df2d01ed28b6",
... |
"""Convenience module providing common shader entry points
The point of this module is to allow client code to use
OpenGL Core names to reference shader-related operations
even if the local hardware only supports ARB extension-based
shader rendering.
There are also two utility methods compileProgram and compileShader... | {
"content_hash": "23a68f3607e446c1674ee7be87e9890a",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 102,
"avg_line_length": 34.701219512195124,
"alnum_prop": 0.6355649270778422,
"repo_name": "alexus37/AugmentedRealityChess",
"id": "d8d88688e6bcf41604d8662f85de4ee370a22455"... |
from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HM2_then1_ConnectedLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HM2_then1_ConnectedLHS.
"""
# F... | {
"content_hash": "ee5889afc8885cbf1d9a961c68f26608",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 125,
"avg_line_length": 43.36065573770492,
"alnum_prop": 0.47334593572778827,
"repo_name": "levilucio/SyVOLT",
"id": "2da4c5460e4eb62ec1e03794eb70e830023527df",
"size": "26... |
"""Tests application-provided metadata, status code, and details."""
import threading
import unittest
import grpc
import grpc_gcp
from grpc_gcp_test.unit import test_common
from grpc_gcp_test.unit.framework.common import test_constants
from grpc_gcp_test.unit.framework.common import test_control
_SERIALIZED_REQUEST... | {
"content_hash": "9756e576593db6b60845a1f9f2134e01",
"timestamp": "",
"source": "github",
"line_count": 652,
"max_line_length": 80,
"avg_line_length": 42.38343558282209,
"alnum_prop": 0.5979590359701816,
"repo_name": "GoogleCloudPlatform/grpc-gcp-python",
"id": "d3fb74196c5cbee4133df6852ca12c70b7a3d5... |
import yaml
import sys
import random
import string
class Config():
def __init__(self, fileName):
global cfg
try:
with open(fileName, 'r') as ymlfile:
cfg = yaml.load(ymlfile)
except Exception as e:
print(e)
input("Press ... | {
"content_hash": "fb702c961b1387bdd53e32a30201c2be",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 118,
"avg_line_length": 29.925,
"alnum_prop": 0.5580618212197159,
"repo_name": "anti0/Discord-YouTube-Feed-BOT",
"id": "269e4448184e1eec7d87130766f474327988985d",
"size": "... |
import os
import time
import socket
from resource import getrusage, RUSAGE_SELF
from twisted.application.service import Service
from twisted.internet.task import LoopingCall
from carbon.conf import settings
stats = {}
prior_stats = {}
HOSTNAME = socket.gethostname().replace('.', '_')
PAGESIZE = os.sysconf('SC_PAGESI... | {
"content_hash": "7eed79d6428239af877b83affde906f2",
"timestamp": "",
"source": "github",
"line_count": 210,
"max_line_length": 98,
"avg_line_length": 31.976190476190474,
"alnum_prop": 0.7048399106478034,
"repo_name": "johnseekins/carbon",
"id": "c4d50e1ac9484424c5586f1d94cf58b6fc235375",
"size": "... |
'common functions to classify c++ files'
from __future__ import absolute_import, print_function, unicode_literals
import os
import re
from unilint.unilint_plugin import UnilintPlugin
CPP_SOURCE = 'cpp_source'
CPP_EXTENSIONS = ['c', 'cc', 'c\+\+', 'cxx', 'cpp',
'h', 'hh', 'h\+\+', 'hxx', 'hpp']
CPP... | {
"content_hash": "af125e801cb58f71de9551cd3e425a7b",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 76,
"avg_line_length": 28.586206896551722,
"alnum_prop": 0.6133896260554885,
"repo_name": "tkruse/unilint",
"id": "3c45c23cbb66622401481f5377d6eaa40ade77ab",
"size": "3056"... |
"""Base configurations to standardize experiments."""
from __future__ import absolute_import
from __future__ import division
# from __future__ import google_type_annotations
from __future__ import print_function
import copy
from typing import Any, List, Mapping, Optional
import dataclasses
import tensorflow as tf
im... | {
"content_hash": "a062471c3a8c37c59f023e7e6765d5c5",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 80,
"avg_line_length": 30.958333333333332,
"alnum_prop": 0.6527590847913862,
"repo_name": "alexgorban/models",
"id": "65fab425843892c244e0e524d41c4173af8d8a29",
"size": "29... |
from webassets import Bundle, register
webclientjs = Bundle('static/js/01_Item.js', 'static/js/02.Control.js', 'static/js/03.Util.js', 'static/js/04.Time.js',
'static/js/Event.js', 'static/js/Tag.js',
filters='jsmin', output='webclient.js')
register('webclientjs', js) | {
"content_hash": "3b7ea59586268afdd6f5b65bdd8745d6",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 119,
"avg_line_length": 48.833333333333336,
"alnum_prop": 0.6655290102389079,
"repo_name": "Lapeth/timeline",
"id": "9de1f7ae394844bf31897228c1a4ae648e2b2e4e",
"size": "293"... |
"""
Tests functionality of commerce API for version 2
"""
import inspect
import functools
import json
import os
import pathlib
import pytest
import requests_mock
from gw2api import GuildWars2Client
def test_coins_to_gems(gw2_client, mock_adapter):
"""Tests conversion of coins to gems
Args:
gw2_cli... | {
"content_hash": "872a8a6ea25ff83ae3c81fc3eb82b3ca",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 81,
"avg_line_length": 30.597014925373134,
"alnum_prop": 0.6588617886178861,
"repo_name": "JuxhinDB/gw2-api-interface",
"id": "660f2a3167c096488fb16778e3ac849b1346a2ce",
"... |
from panda3d.core import *
from panda3d.direct import *
from direct.interval.IntervalGlobal import *
from otp.avatar import Avatar
from otp.nametag.NametagConstants import *
from toontown.char import CharDNA
from toontown.char import DistributedChar
from direct.directnotify import DirectNotifyGlobal
from direct.fsm imp... | {
"content_hash": "418f409a5ce6f3ec56458752bbfa7222",
"timestamp": "",
"source": "github",
"line_count": 294,
"max_line_length": 135,
"avg_line_length": 43.642857142857146,
"alnum_prop": 0.6475722858701582,
"repo_name": "silly-wacky-3-town-toon/SOURCE-COD",
"id": "00e3802e083778084e4100608274eb4d56250... |
from olliebennett.tweets import tweet_cpu_temp
__author__ = 'Ollie Bennett | http://olliebennett.co.uk/'
if __name__ == '__main__':
# If calling as a script, update the status
tweet_cpu_temp()
| {
"content_hash": "f2112018567bd529881d2555903e6411",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 57,
"avg_line_length": 29,
"alnum_prop": 0.6551724137931034,
"repo_name": "olliebennett/raspberry-pi-scripts",
"id": "a1cd0f18031e3f84f3bda1bfbae8cbba150c0cd7",
"size": "245... |
"""InternetSemLimites URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home'... | {
"content_hash": "29392986f2e0b234d4e69bb24f7543bd",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 79,
"avg_line_length": 35.333333333333336,
"alnum_prop": 0.6921097770154374,
"repo_name": "InternetSemLimites/PublicAPI",
"id": "144d56533bd555895ef88b2726763e0434d4ea6b",
... |
from .workspace_structure import WorkspaceStructure
class Replacement(WorkspaceStructure):
def __init__(self, object_from_initial, object_from_modified, relation):
WorkspaceStructure.__init__(self)
self.object_from_initial = object_from_initial
self.object_from_modified = object_from_modif... | {
"content_hash": "b6448e2143561b1f174b3dd54116a005",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 76,
"avg_line_length": 39.666666666666664,
"alnum_prop": 0.7226890756302521,
"repo_name": "jalanb/co.py.cat",
"id": "4f4942fe401ad76ece784f9dfb81369e0b919af5",
"size": "357"... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('walletone', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='walletonesuccesspayment',
name='WMI_MERCHAN... | {
"content_hash": "39b495f4560a7c18658c1bc006153253",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 63,
"avg_line_length": 25.52173913043478,
"alnum_prop": 0.5945485519591142,
"repo_name": "otov4its/django-walletone",
"id": "cc5267c6b3547628520a6377fcb1f39de5cf3922",
"siz... |
import httplib
import re
import os
import requests
import json
from datetime import datetime
from distutils.version import LooseVersion
from cumulusci.core.exceptions import GithubApiNotFoundError
from cumulusci.core.utils import import_class
from cumulusci.tasks.release_notes.exceptions import CumulusCIException
fr... | {
"content_hash": "f2300644e4e44c7400dec5ecb7f4c1a6",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 93,
"avg_line_length": 33.523148148148145,
"alnum_prop": 0.5945311421074437,
"repo_name": "e02d96ec16/CumulusCI",
"id": "4b81bd0380cd6abc0aeff917061ec826c9ff485b",
"size":... |
""" This file contains email sending functions for Flask-User.
It uses Jinja2 to render email subject and email message. It uses Flask-Mail to send email.
:copyright: (c) 2013 by Ling Thio
:author: Ling Thio (ling.thio@gmail.com)
:license: Simplified BSD License, see LICENSE.txt for more details."""
i... | {
"content_hash": "ae100b5ba9f856bd48f482638b672dbc",
"timestamp": "",
"source": "github",
"line_count": 179,
"max_line_length": 199,
"avg_line_length": 39.201117318435756,
"alnum_prop": 0.6943138093202224,
"repo_name": "ashwini0529/Oreo",
"id": "1bf066e6a513b838227dd99ff225f09abfa7f9ff",
"size": "7... |
"""Exceptions used with SQLAlchemy.
The base exception class is :exc:`.SQLAlchemyError`. Exceptions which are
raised as a result of DBAPI exceptions are all subclasses of
:exc:`.DBAPIError`.
"""
from .util import compat
class SQLAlchemyError(Exception):
"""Generic error class."""
code = None
def __i... | {
"content_hash": "4639ea6a2e32e311ebc753b9cd0d6ade",
"timestamp": "",
"source": "github",
"line_count": 541,
"max_line_length": 79,
"avg_line_length": 29.297597042513864,
"alnum_prop": 0.6111671924290221,
"repo_name": "wujuguang/sqlalchemy",
"id": "1e575626a5061b9e41ec285beef581242dd05c0c",
"size":... |
"""
Module for importing remote and local files into CARTO
.. module:: carto.field_import
:platform: Unix, Windows
:synopsis: Module for importing remote and local files into CARTO
.. moduleauthor:: Daniel Carrion <daniel@carto.com>
.. moduleauthor:: Alberto Romeu <alrocar@carto.com>
"""
from pyrestcli.field... | {
"content_hash": "21772aaccbd4cfbb0d9d4cf019b8b037",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 312,
"avg_line_length": 32.94082840236686,
"alnum_prop": 0.6103826118196515,
"repo_name": "CartoDB/carto-python",
"id": "76e7217280c730822374460125ba6629292011be",
"size":... |
import unittest
"""
Given an array of length n, where each value lies between 1 to n inclusive. Some values can be
repeated multiple times and some other values can be absent. Count frequency of all elements that are
present and print the missing elements. Expected time complexity is O(n) and expected space complexity ... | {
"content_hash": "414ec17711554cb2646e252ed9e73c2d",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 111,
"avg_line_length": 31.170731707317074,
"alnum_prop": 0.6471048513302035,
"repo_name": "prathamtandon/g4gproblems",
"id": "bd8abcc1707d2a1c4de0d04d6b3d8f43f3de2c82",
"s... |
"""
@package mi.dataset.driver
@file mi/dataset/driver/flort_dj/cspp/flort_dj_cspp_telemetered_driver.py
@author Jeff Roy
@brief Driver for the flort_dj_cspp instrument
Release notes:
Initial Release
"""
from mi.dataset.dataset_parser import DataSetDriverConfigKeys
from mi.dataset.dataset_driver import SimpleDataset... | {
"content_hash": "9acba8c927c2787bf9e9b53406a5ebbb",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 101,
"avg_line_length": 31.560606060606062,
"alnum_prop": 0.7268362938070091,
"repo_name": "JeffRoy/mi-dataset",
"id": "22635bd0b7b18008984ac3cefd3558a7d826668c",
"size": "... |
"""Factories to help in tests."""
from factory import PostGenerationMethodCall, Sequence
from factory.alchemy import SQLAlchemyModelFactory
from hamcwebc.database import db
from hamcwebc.user.models import User
class BaseFactory(SQLAlchemyModelFactory):
"""Base factory."""
class Meta:
"""Factory con... | {
"content_hash": "a7c1f6de0a631a23aa658478d61ebe0d",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 66,
"avg_line_length": 24.633333333333333,
"alnum_prop": 0.6847090663058186,
"repo_name": "gurkslask/hamcwebc",
"id": "37c49a03eb605cf9d65152b6153c17d899e03d63",
"size": "7... |
"""
Client load generator
2016 samules (c)
"""
import os
import random
import zmq
import sys
import socket
import redis
from datetime import datetime
from config.redis_config import redis_config
from locking import FLock
sys.path.append(os.path.join(os.path.expanduser('~'), 'qa', 'dynamo'))
from logger import pubsub... | {
"content_hash": "f9501282abbb849f778d2e9eae573786",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 115,
"avg_line_length": 45.110344827586204,
"alnum_prop": 0.5638281608316771,
"repo_name": "samuelsh/pyFstress",
"id": "7b8827d03f5f045c84b63bd6a6f6f82d6a698e64",
"size": ... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('forum', '0009_topic_post_it'),
]
operations = [
migrations.AddField(
model_name='profile',
name='banned',
field=... | {
"content_hash": "70b34c2b9cc81594d761adab9e6c34c5",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 79,
"avg_line_length": 22.166666666666668,
"alnum_prop": 0.5964912280701754,
"repo_name": "rdujardin/icforum",
"id": "b22ee2ac96f448fc4c0d7724d6335c7a398b5039",
"size": "10... |
import json
import os
import codecs
import sys
ESC_CHAR = 27
ERASE_LINE_CTRL_CODE = '[2K'
CURSOR_UP_CTRL_CODE = '[%dA'
CURSOR_DOWN_CTRL_CODE = '[%dB'
class StreamOutputError(Exception):
pass
def stream_output(output, stream):
is_terminal = hasattr(stream, 'fileno') and os.isatty(stream.fileno())
if sys.... | {
"content_hash": "8197c85c41dc2e0d3a1f38e6219bf82d",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 80,
"avg_line_length": 27.93548387096774,
"alnum_prop": 0.554657428791378,
"repo_name": "pralexa/awsebcli",
"id": "31419f9c8c74ebb4aca17cc5055fef83015aa60e",
"size": "2598"... |
def length_of_code(code):
"""
Centralize the character counting to one place
"""
return len(code.replace('\r\n', '\n'))
| {
"content_hash": "bf7080796744da734cf9d8f7e778988a",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 50,
"avg_line_length": 27.2,
"alnum_prop": 0.6029411764705882,
"repo_name": "lionleaf/dwitter",
"id": "7872b56ecfbcb35427ec39122d4829234f84bf47",
"size": "137",
"binary": ... |
import unittest
from handledata import remove_hashtag, get_hashtag
from handledata import split_record
class DataTestCase(unittest.TestCase):
"""
Unittest for tools.py
"""
##################################################
# Unittest for preprocessing data
def test_get_hashtag(self):
... | {
"content_hash": "9fbef165cb9fa25dc8508393b0f69503",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 72,
"avg_line_length": 29.76,
"alnum_prop": 0.5114247311827957,
"repo_name": "Shitaibin/tweets-spam-clustering",
"id": "0d4dcbce546ac6bdcac1d15aa6305d42e06225b0",
"size": "... |
import os
import shutil
import string
import subprocess
import sys
from os.path import sep
outBase = '..' + sep + '..' + sep + 'output' + sep + 'calcPhifBenchmark'
def findAveragePotentTime(dataPath):
avgTime = 0
f = open(dataPath + sep + 'performance.csv', 'r')
potentTimeSum = 0
numValues = 0
for... | {
"content_hash": "e16dd28642e1c2be14a2e7312a121f57",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 79,
"avg_line_length": 26.522935779816514,
"alnum_prop": 0.5804219993081978,
"repo_name": "CacheMiss/pic",
"id": "ff0019735ce23d8ce46fceef3a65f37e60f844e2",
"size": "2910"... |
from SceneViewTest import SceneViewTest
from ShaderAssignmentUITest import ShaderAssignmentUITest
from StandardGraphLayoutTest import StandardGraphLayoutTest
from SceneGadgetTest import SceneGadgetTest
from SceneInspectorTest import SceneInspectorTest
from SceneHierarchyTest import SceneHierarchyTest
from Documentation... | {
"content_hash": "289d0b389becd0bad4210acb00cff697",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 59,
"avg_line_length": 39.5,
"alnum_prop": 0.8708860759493671,
"repo_name": "goddardl/gaffer",
"id": "0c7aceac4bc4b18dd8175cf24d4d2a75123c4682",
"size": "2198",
"binary":... |
"""
-------------------------------------------------------------------------
AIOpening - __init__.py
Defines the Spaces (action/state space) base class
created: 2017/09/01 in PyCharm
(c) 2017 Sven - ducandu GmbH
-------------------------------------------------------------------------
"""
from .tuple import T... | {
"content_hash": "57b512d917976265cdb52182fc387ea2",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 74,
"avg_line_length": 25.055555555555557,
"alnum_prop": 0.45454545454545453,
"repo_name": "ducandu/aiopening",
"id": "d67a73842802e7b7f30f12d6fb76e3f95c488967",
"size": "4... |
import pandas as pd
cluster = './c319p70+0p56'
photoz = pd.read_csv(cluster + '_photoz.csv')
specz = pd.read_csv(cluster + '_specz.csv')
photo = pd.read_csv(cluster + '_photo.csv')
c = pd.merge(photo, photoz, left_on='objID', right_on='objID', how='outer')
try:
sc = pd.merge(c, specz, left_on='objID', right_on='obj... | {
"content_hash": "442008f6136e672d86fe2e914ab0b583",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 79,
"avg_line_length": 39.26086956521739,
"alnum_prop": 0.6190476190476191,
"repo_name": "boada/vpCluster",
"id": "5a7593a97dce0913cfe8195f7b10c5a97f0cdb83",
"size": "903",... |
import pickle
import secfs.store
import secfs.fs
from secfs.types import I, Principal, User, Group
# current_itables represents the current view of the file system's itables
current_itables = {}
# a server connection handle is passed to us at mount time by secfs-fuse
server = None
def register(_server):
global se... | {
"content_hash": "cadba330643209fed6675bd7d813a2a9",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 96,
"avg_line_length": 34.7909604519774,
"alnum_prop": 0.611075024358558,
"repo_name": "mit-pdos/secfs-skeleton",
"id": "ee087bb79838e82853cfd04bd279e55eb22720f4",
"size":... |
"""Handles database requests from other nova services."""
import copy
import itertools
from oslo import messaging
from oslo.serialization import jsonutils
from oslo.utils import excutils
from oslo.utils import timeutils
import six
from nova.api.ec2 import ec2utils
from nova import block_device
from nova.cells import... | {
"content_hash": "cadc10c7ec10c9f30e936c0a49c14cf8",
"timestamp": "",
"source": "github",
"line_count": 818,
"max_line_length": 79,
"avg_line_length": 49.06845965770171,
"alnum_prop": 0.5579749862972744,
"repo_name": "mgagne/nova",
"id": "88ee72c154f887bcb4780e9dd6b5ffa128ce6fe7",
"size": "40743",
... |
class Solution(object):
def numberToWords(self, num):
"""
:type num: int
:rtype: str
"""
if num==0:
return 'Zero'
mapping=["","Thousand","Million", "Billion"]
resstr=''
for i in range(len(mapping)):
if num%1000 != ... | {
"content_hash": "b4959f709f7dbf8bf606c6c903874f41",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 184,
"avg_line_length": 33.26470588235294,
"alnum_prop": 0.4916003536693192,
"repo_name": "Tanych/CodeTracking",
"id": "8688a919696ed9c344a5ef1cdcfa0e4425c6bf93",
"size": "... |
usage = '''
Write extra flags to outfile for DM based on the bot name:
$ python dm_flags.py outfile Test-Mac10.9-MacMini6.2-HD4000-x86_64-Release
Or run self-tests:
$ python dm_flags.py test
'''
import inspect
import json
import os
import sys
def lineno():
caller = inspect.stack()[1] # Up one level to our cal... | {
"content_hash": "323b49c1967c4946b943a3d8e0486f7a",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 78,
"avg_line_length": 30.162790697674417,
"alnum_prop": 0.6448213826779748,
"repo_name": "Igalia/skia",
"id": "a7ed8ca7afaf804f93bd63633fea4c74f68c631c",
"size": "3914",
... |
r"""
models
~~~~~~~
Data model of blog.
:copyright: (c) 2013 by Harvey Wang.
"""
import re
from datetime import datetime
from werkzeug import security
from ._base import db, SessionMixin
__all__ = [
'Category', 'Tag',
'Article', 'Comment',
'User', 'Link',
'BlackList... | {
"content_hash": "fac1a73f2f6b2ff79a69063ff8a1eb83",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 105,
"avg_line_length": 32.31188118811881,
"alnum_prop": 0.6151371227210051,
"repo_name": "harveyqing/Qingblog",
"id": "99b759ceea78cc300cd3b239211543715d3dc492",
"size": ... |
import argparse
import subprocess
import textwrap
import portslicer
import fieldslicer
import combiner
import bro
#Create the command-line capability
parser = argparse.ArgumentParser(prog="Bro Log Utility Script",
description=textwrap.dedent('''\
This program will slice conn.log's based off of a given port ... | {
"content_hash": "7149f7535816ed2005da4973723760a1",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 119,
"avg_line_length": 48.92727272727273,
"alnum_prop": 0.6882199925678186,
"repo_name": "jacobdshimer/Bro-Log-Utility-Script",
"id": "1e9e9bff6d96081a380c7d198607f044578f3e... |
from __future__ import division
import math
class SakaCalendar(object):
JULIAN_EPOCH = 1721425.5
SAKA_MONTH_NAMES= [u"Chaitra", u"Vaisakha", u"Jyaishta", u"Asadha", u"Sravana", u"Bhadra",u"Aswina", u"Kartiak", u"Agrahayana",u"Pausa",u"Magha",u"Phalguna"]
SAKA_WEEK_NAMES= [u"Ravivar", u"Somavar", u"Ma... | {
"content_hash": "456075bcd279c4e830986deb92a8b84b",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 161,
"avg_line_length": 44.42857142857143,
"alnum_prop": 0.5828272001905442,
"repo_name": "sternshus/arelle2.7",
"id": "70a39aefdec6708c7a4f82e8ff2a778072bb2948",
"size": ... |
from __future__ import division, absolute_import, print_function
"""Provides the basic, interface-agnostic workflow for importing and
autotagging music files.
"""
import os
import re
import pickle
import itertools
from collections import defaultdict
from tempfile import mkdtemp
from bisect import insort, bisect_left
... | {
"content_hash": "494269e947350696c5f392e0dd68e028",
"timestamp": "",
"source": "github",
"line_count": 1690,
"max_line_length": 79,
"avg_line_length": 35.598224852071006,
"alnum_prop": 0.5880720067818022,
"repo_name": "jackwilsdon/beets",
"id": "68d5f3d5dd05f21bc4b62365bd424b99be6cbf87",
"size": "... |
import abc
import logging
from itertools import izip
from datetime import datetime
import tornado.gen
from tormon.api import utils
from tormon.models import Response, RequestError
DEFAULT_TIMESTAMP = 0.0
DEFAULT_STATUS_CODE = None
DEFAULT_HEADER_SET = {}
class IBaseWriter(object):
__metaclass__ = abc.ABCMeta
... | {
"content_hash": "ffae8ee8655509e71b14da30308ad4bc",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 76,
"avg_line_length": 27.15730337078652,
"alnum_prop": 0.5887463798096815,
"repo_name": "jnosal/tormon",
"id": "8593fb653b8375fd6326c2285d035771b0b24de8",
"size": "4834",... |
from django import template
register = template.Library()
def paginator(context, adjacent_pages=2):
"""
To be used in conjunction with the object_list generic view.
Adds pagination context variables for use in displaying first, adjacent and
last page links in addition to those created by the object_l... | {
"content_hash": "7813a972ae00cb4562198c9c2ebde86e",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 80,
"avg_line_length": 35.23076923076923,
"alnum_prop": 0.6200873362445415,
"repo_name": "wtrevino/django-listings",
"id": "4980a6cd14d3e2149162056ce8ea8a02e5647e4d",
"size... |
__author__ = 'Yves Bonjour'
from Tokenizer import create_tokenizer
import redis
import uuid
def create_indexer(redis_host, redis_port):
tokenizer = create_tokenizer()
redis_db = redis.Redis(redis_host, redis_port)
store = RedisIndexStore(redis_db)
return Indexer(store, tokenizer)
class Indexer:
... | {
"content_hash": "9126c89cc179ca64b8b232452d459d67",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 93,
"avg_line_length": 30.097560975609756,
"alnum_prop": 0.6428957320367369,
"repo_name": "ybonjour/nuus",
"id": "ac4d53bbfd933384fc1fa8fad08d02ca8184b0e8",
"size": "3702"... |
'''
Copyright (c) 2017 Vanessa Sochat
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute... | {
"content_hash": "a7336a43a08773e0083cb9bb8fcbcb9e",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 107,
"avg_line_length": 44.84848484848485,
"alnum_prop": 0.7648648648648648,
"repo_name": "vsoch/docfish",
"id": "1f6be3263f4f9887a1a35f4fc667ea9962e4945d",
"size": "1480",... |
"""Classes supporting creation and editing of questions."""
__author__ = 'Mike Gainer (mgainer@google.com)'
from common import schema_fields
from models import models
from models import roles
from modules.dashboard import dto_editor
from google.appengine.api import users
class AdminPreferencesEditor(dto_editor.Bas... | {
"content_hash": "1298433889e12066caced4cb5b7822ab",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 76,
"avg_line_length": 39.25974025974026,
"alnum_prop": 0.6493549454184585,
"repo_name": "wavemind/mlgcb",
"id": "45647c8fe3ea2f2d20137637ad180cea824c3450",
"size": "3621",... |
import datetime
import sys
from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union
from ... import _serialization
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
... | {
"content_hash": "cf2ae5614b26cd3cb91744cc7dc929b3",
"timestamp": "",
"source": "github",
"line_count": 1948,
"max_line_length": 165,
"avg_line_length": 43.65092402464066,
"alnum_prop": 0.6520486405118073,
"repo_name": "Azure/azure-sdk-for-python",
"id": "9d9565b0d7a662ab0daf5fcd82e702eaf6381fe7",
... |
"""Implementation of tenant API."""
from __future__ import absolute_import
from .. import admin
from .. import authz
from .. import context
from .. import schema
class API(object):
"""Treadmill Tenant REST api."""
def __init__(self):
def _admin_tnt():
"""Lazily return admin object."""
... | {
"content_hash": "e5e8ec113047e2a52052e5092596abf5",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 62,
"avg_line_length": 29.12121212121212,
"alnum_prop": 0.5098855359001041,
"repo_name": "toenuff/treadmill",
"id": "c54245ee1a5e72efa7b34880a24d749298911de8",
"size": "192... |
from .models import Note
from rest_framework import serializers, viewsets, routers
class NoteSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Note
fields = ('id', 'content', 'time', 'update_time')
class NoteViewSet(viewsets.ReadOnlyModelViewSet):
queryset = Note.object... | {
"content_hash": "b99a4dcb2842d3edc5fb36a58ef438ef",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 61,
"avg_line_length": 25.823529411764707,
"alnum_prop": 0.7380410022779044,
"repo_name": "kyunooh/JellyBlog",
"id": "78f725f957c395bba5aeda5d3502d8d87c37a56a",
"size": "43... |
"""
This module defines various classes of supported actions. All actions are
implemented as static methods, but are defined using classes (as opposed to
modules) so that a set of well-defined actions can be namespaced easily.
"""
import os
import shutil
def get_nested_dict(input_dict, key):
"""
Helper funct... | {
"content_hash": "3b8037d3b20eb2b506482ea09fc15d65",
"timestamp": "",
"source": "github",
"line_count": 292,
"max_line_length": 90,
"avg_line_length": 31.89041095890411,
"alnum_prop": 0.5343642611683849,
"repo_name": "materialsproject/custodian",
"id": "3e833ce38d4c4b7d08b67a1f42ab51e3588c6bd0",
"s... |
from __future__ import unicode_literals
import re
from .amp import AMPIE
from .common import InfoExtractor
from ..utils import (
parse_duration,
parse_iso8601,
try_get,
)
class AbcNewsVideoIE(AMPIE):
IE_NAME = 'abcnews:video'
_VALID_URL = r'''(?x)
https?://
... | {
"content_hash": "8e75545bd0a8a1b3042859905728cd4a",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 134,
"avg_line_length": 40.66242038216561,
"alnum_prop": 0.5007832080200502,
"repo_name": "yasoob/youtube-dl-GUI",
"id": "908c833770038840f6b073ef7a5f8f5bf61278fc",
"size"... |
from cogent.app.parameters import FlagParameter, ValuedParameter
from cogent.app.util import CommandLineApplication, ResultPath
"""Application controller for sfffile"""
__author__ = "Kyle Bittinger"
__copyright__ = "Copyright 2007-2012, The Cogent Project"
__credits__ = ["Kyle Bittinger"]
__license__ = "GPL"
__vers... | {
"content_hash": "be09a82e01e8a2f04acf36b92eb960f8",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 70,
"avg_line_length": 35.92424242424242,
"alnum_prop": 0.5963728384647828,
"repo_name": "sauloal/cnidaria",
"id": "95e84099c1fe0b85383ea3a6865a7e983162704e",
"size": "2394... |
import os
import sys
import socket
import subprocess
import datetime
import signal
import StringIO
import math
import geopm_context
import geopmpy.launcher
from geopmpy.launcher import resource_manager
class TestLauncher(object):
def __init__(self, app_conf, ctl_conf, report_path,
trace_path=None... | {
"content_hash": "69f61707a89523ee7f7c6ffaea179134",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 120,
"avg_line_length": 39.30578512396694,
"alnum_prop": 0.5578216989066442,
"repo_name": "sssylvester/geopm",
"id": "5ba19a21422da209ef4a4174f82bccc5769e5d85",
"size": "6... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('distances', '0024_remove_exercise_testtime'),
]
operations = [
migrations.AlterField(
model_name='exercise',
name='sport',
... | {
"content_hash": "316f32d486cc97a286ad37f17b9692db",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 241,
"avg_line_length": 32.111111111111114,
"alnum_prop": 0.596885813148789,
"repo_name": "tkettu/rokego",
"id": "fbf4b7c4b69a58f3ccff272569e8e435d6fd1935",
"size": "649",
... |
"""Helpful routines for regression testing."""
from base64 import b64encode
from binascii import hexlify, unhexlify
from decimal import Decimal, ROUND_DOWN
import hashlib
import json
import logging
import os
import random
import re
from subprocess import CalledProcessError
import time
from . import coverage
from .aut... | {
"content_hash": "cadf7711c4a79bc3de84f6bb444a7352",
"timestamp": "",
"source": "github",
"line_count": 567,
"max_line_length": 119,
"avg_line_length": 38.045855379188716,
"alnum_prop": 0.6341553866122752,
"repo_name": "MazaCoin/maza",
"id": "2dbc60f88b266f89b2f3d733291c48e50a565e85",
"size": "2178... |
"""
Tests for stuff in django.utils.datastructures.
"""
import copy
import pickle
from django.test import SimpleTestCase
from django.utils.datastructures import *
class SortedDictTests(SimpleTestCase):
def setUp(self):
self.d1 = SortedDict()
self.d1[7] = 'seven'
self.d1[1] = 'one'
... | {
"content_hash": "cb8b9a537edb3c7510db0a122ef9959c",
"timestamp": "",
"source": "github",
"line_count": 282,
"max_line_length": 82,
"avg_line_length": 34.709219858156025,
"alnum_prop": 0.530036779730282,
"repo_name": "disqus/django-old",
"id": "d86a3c8fb8bf63bd97ba34a8f6fed7785eead50e",
"size": "97... |
import sys
import warnings
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from airflow.utils.context import Context
if sys.version_info >= (3, 8):
from functools import cached_property
else:
from cached_property import cached_property
from airflow.models import BaseOperator
from airflow.providers.am... | {
"content_hash": "88ebae410659aa45f7eeb40cc73d41c7",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 107,
"avg_line_length": 31.55952380952381,
"alnum_prop": 0.6593738211995473,
"repo_name": "mistercrunch/airflow",
"id": "b35e3d034231d54480b0e9866d19bc4624d31dfe",
"size": ... |
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('product', '0003_sale_amount'),
('activity', '0005_conclusion'),
]
operations = [
migrations... | {
"content_hash": "9d215fec53a7521d4ed3d898d4022f30",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 114,
"avg_line_length": 37.02777777777778,
"alnum_prop": 0.5693923480870218,
"repo_name": "boyombo/pharmrep",
"id": "1ee7e027db7fd1a961723612651bcae676f9371d",
"size": "140... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.