text stringlengths 4 1.02M | meta dict |
|---|---|
import json
import logging
import re
from django.utils.translation import ugettext_lazy as _ # noqa
from django.views.decorators.debug import sensitive_variables # noqa
from horizon import exceptions
from horizon import forms
from horizon import messages
from openstack_dashboard import api
LOG = logging.getLogger... | {
"content_hash": "1c3756056f242bf2441b89cf3e99d0d3",
"timestamp": "",
"source": "github",
"line_count": 255,
"max_line_length": 79,
"avg_line_length": 39.68627450980392,
"alnum_prop": 0.5425889328063241,
"repo_name": "ikargis/horizon_fod",
"id": "23cc7cda77ce9b2fedf1555aa4d59c910094baac",
"size": "... |
""" Skill definition from a YAML config. """
# pylint: disable=too-few-public-methods
class SkillDef:
""" Skill definition from a YAML config. """
# pylint: disable=too-many-arguments
def __init__(self, name, package_name, class_name, url, params, intent_defs, dialogue_events_defs, notification_defs, requ... | {
"content_hash": "8b682212fc25ab7e25694cf9f700fcf6",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 144,
"avg_line_length": 38.19047619047619,
"alnum_prop": 0.6119077306733167,
"repo_name": "snipsco/snipsskills",
"id": "ec4e47c4116f3b21e58a18e13035c2d6d5131b57",
"size": "... |
import catkin_sphinx
import os
import sys
import subprocess
from xml.etree.ElementTree import ElementTree
# -- General configuration -----------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or you... | {
"content_hash": "e6c33c81fa3fbcb6035fd7fc062adf38",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 104,
"avg_line_length": 33.18807339449541,
"alnum_prop": 0.6939875604699378,
"repo_name": "shyamalschandra/catkin",
"id": "471d70dd9ddb08f13c4443a0bdc1cf4bc0064694",
"size... |
import sys
import os
sys.path.append(
os.path.join(os.path.dirname(__file__), "../")
)
import yaml
import unittest
from pymongo import MongoClient
from bson.json_util import loads as json_loads
from utils import load_test_info
from utils import print_desc
from utils import print_msg
from utils import setu... | {
"content_hash": "6a50cadfb5e945da9506142c79c4817f",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 78,
"avg_line_length": 29.365853658536587,
"alnum_prop": 0.5743355481727574,
"repo_name": "cmpitg/mongob",
"id": "8150621765f6879ec7ff8446d20c534585e4d5b5",
"size": "2564",... |
import Renascence
def main():
Renascence.setStreamPath("./")
Renascence.setLibPath("./")
producer = Renascence.init(["func.xml"])
print producer.listAllFunctions()
print producer.listAllTypes()
x0 = producer.load('TrBmp', "input.jpg")
x1 = producer.load('TrBmp', "input_sharp.jpg")
x2 = ... | {
"content_hash": "621f399ddd6affd934bdd4f9bfe22b6c",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 162,
"avg_line_length": 36.72,
"alnum_prop": 0.6699346405228758,
"repo_name": "jxt1234/Genetic-Program-Frame",
"id": "06edaedf5460cc384414260e8e396d747e92dbd6",
"size": "93... |
import subprocess
ESCAPE_CHARS = {"'", ' ', '(', ')', '&', ',', ';'}
class Shell(object):
def __init__(self, aliases=None):
self.aliases = aliases
def apply_aliases(self, command):
if self.aliases is not None:
for key, val in self.aliases.iteritems():
command = com... | {
"content_hash": "9e01bf6351724976fc85d901fa54986b",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 78,
"avg_line_length": 27.964285714285715,
"alnum_prop": 0.5389527458492975,
"repo_name": "bluquar/itunes_android_nofluff",
"id": "0d30e890565fbcd72acbec32104535b083d4c9d3",
... |
import psutil
from pkg_resources import get_distribution
from django.conf import settings
from django.db import connections
from django.utils.module_loading import import_string
import logging
import os
import six
import socket
import sys
import tempfile
import time
from collections import OrderedDict
from datetime i... | {
"content_hash": "6f4bfe860f509ab6fd3af075c03b4917",
"timestamp": "",
"source": "github",
"line_count": 334,
"max_line_length": 111,
"avg_line_length": 31.32934131736527,
"alnum_prop": 0.5822821100917431,
"repo_name": "saxix/django-sysinfo",
"id": "1f692943b2855b53422d410e33123d553b5af644",
"size":... |
def test_sdkmanager_can_run_without_problem(host):
assert host.run_expect([0], ". ~/profile.d/android.sh && sdkmanager --list")
def test_cmdline_tools_installed_and_available(host):
cmd = host.run(". ~/profile.d/android.sh && env")
assert "cmdline-tools" in cmd.stdout
def test_installed_sdkmanager_packages(host... | {
"content_hash": "df3c4fdd28d22ce1c70a017da83f6fcb",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 118,
"avg_line_length": 48.42857142857143,
"alnum_prop": 0.700589970501475,
"repo_name": "bitrise-io/osx-box-bootstrap",
"id": "e1aea0a43c25defe47f745d69f56befdd8054fd2",
"... |
"""
Django settings for proj project in development.
For more information on this file, see
https://docs.djangoproject.com/en/2.2.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(B... | {
"content_hash": "374d35da51a6499d90eb75ed16ad8435",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 73,
"avg_line_length": 31.42105263157895,
"alnum_prop": 0.7370184254606366,
"repo_name": "ElofssonLab/web_common_backend",
"id": "21f461f9a8f37c71a8883529a266879f2aebbd80",
... |
"""scons.Node.FS
File system nodes.
These Nodes represent the canonical external objects that people think
of when they think of building software: files and directories.
This holds a "default_fs" variable that should be initialized with an FS
that can be used by scripts or modules looking for the canonical default.... | {
"content_hash": "ae4d6f7966da80e2224a389d1cd7e11b",
"timestamp": "",
"source": "github",
"line_count": 3302,
"max_line_length": 120,
"avg_line_length": 35.42761962447002,
"alnum_prop": 0.5665999897420116,
"repo_name": "renhaoqi/gem5-stable",
"id": "3f3cf2870c1fcebc94e8728202a1e80b355a474f",
"size"... |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from .. import models
class Operations(object):
"""Operations operations.
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An ob... | {
"content_hash": "a7748a6b8b08f0b29cb4022308a3c2e4",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 142,
"avg_line_length": 39.475,
"alnum_prop": 0.6652944901836605,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "4103715cdf91f542667cfc5918ed978194b98df6",
"size": ... |
import cPickle as pickle
import nose
import angr
import ana
import os
import tempfile
internaltest_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries/tests'))
internaltest_files = [ 'argc_decide', 'argc_symbol', 'argv_test', 'counter', 'fauxware', 'fauxware.idb', 'manysum', 'pw', ... | {
"content_hash": "c2d12eb99a6b03fff5092b8e28c34a98",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 178,
"avg_line_length": 30.928571428571427,
"alnum_prop": 0.6678214010777521,
"repo_name": "f-prettyland/angr",
"id": "9db288fbc3585bfd9c2035f66fcb18af550f4aa9",
"size": "2... |
from __future__ import print_function
import sys
import os
import netCDF4 as nc
import numpy as np
import shlex
import subprocess as sp
class TestGridGeneration():
def __init__(self):
self.test_dir = os.path.dirname(os.path.realpath(__file__))
self.input_dir = os.path.join(self.test_dir, 'inputs... | {
"content_hash": "4e85cc1afdfee373e2f371021f12784f",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 80,
"avg_line_length": 34.682291666666664,
"alnum_prop": 0.5066826850878511,
"repo_name": "CWSL/access-cm-tools",
"id": "8633424ef77084c8e3921242b73180776bdea489",
"size":... |
from __future__ import unicode_literals
import json
import uuid
from StringIO import StringIO
from mock import patch, Mock, call
from tests import TestCase, logged_in
from nose.tools import eq_
from catsnap import Client
from catsnap.table.image import Image, ImageContents
from catsnap.table.album import Album
from ca... | {
"content_hash": "09e78d520e035b53bcd682d3ec486955",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 73,
"avg_line_length": 34.10362694300518,
"alnum_prop": 0.5597082953509571,
"repo_name": "ErinCall/catsnap",
"id": "92b04b336a11c5681688d85dfc6075e96f04f970",
"size": "658... |
extensions = [
'sphinx.ext.autodoc',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The encoding of... | {
"content_hash": "effc9ba16026b5723dbc4e06f2560ed0",
"timestamp": "",
"source": "github",
"line_count": 310,
"max_line_length": 80,
"avg_line_length": 28.545161290322582,
"alnum_prop": 0.691264549666629,
"repo_name": "aldebaran/strong_typing",
"id": "1e2021afd947811880e94d3760302c44c011b368",
"size... |
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 'UserScore'
db.create_table(u'leaderboards_userscore', (
(u'id', self.gf('django.db.models.fields.AutoFie... | {
"content_hash": "14780dc053fb999db4d19dd1d7c98b68",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 187,
"avg_line_length": 70.5229357798165,
"alnum_prop": 0.5573045401326916,
"repo_name": "mingot/detectme_server",
"id": "46f5e90df547b9ef2ec1fde0cc3874258efc4d33",
"size"... |
try:
# for Python2
from Tkinter import *
import Tkinter as tk
from DiffWord import * # added by Samad
import time
except ImportError:
# for Python3
from tkinter import *
import tkinter as tk
import time
# speech api
import speech_recognition as sr
from oauth2client.client import Goo... | {
"content_hash": "c14786e65836e74146fd984b398a80ac",
"timestamp": "",
"source": "github",
"line_count": 420,
"max_line_length": 118,
"avg_line_length": 35.326190476190476,
"alnum_prop": 0.5405405405405406,
"repo_name": "faroos3/QuoteR",
"id": "212143cf7693e45ab970a2eff025aceadde06c28",
"size": "148... |
from ggrc import db
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import validates
from .associationproxy import association_proxy
from .category import CategoryBase
from .categorization import Categorizable
from .mixins import (
deferred, BusinessObject, Hierarchical, Timeboxed, CustomAt... | {
"content_hash": "81c6238639e863fe471c1cde75fd5c09",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 91,
"avg_line_length": 33.84234234234234,
"alnum_prop": 0.6813523226407561,
"repo_name": "vladan-m/ggrc-core",
"id": "792bc1837351973d88443a1e7610001071ab52a0",
"size": "7... |
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.utils.decorators import method_decorator
from django.utils.translation import ugettext_noop, ugettext as _
from corehq.apps.domain.decorators import login_required
from corehq.apps.h... | {
"content_hash": "0b5295a25d6d9664f72729143be65970",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 94,
"avg_line_length": 38.01538461538462,
"alnum_prop": 0.7138810198300283,
"repo_name": "qedsoftware/commcare-hq",
"id": "48e465c38554687360d73d8f89659322d5070332",
"size"... |
from ....testing import assert_equal
from ..preprocess import ApplyDeformations
def test_ApplyDeformations_inputs():
input_map = dict(deformation_field=dict(field='comp{1}.def',
mandatory=True,
),
ignore_exception=dict(nohash=True,
usedefault=True,
),
in_files=dict(field='fnames',
mand... | {
"content_hash": "a8771ef890fe19761a2b09dc593a72a1",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 78,
"avg_line_length": 27.209302325581394,
"alnum_prop": 0.6410256410256411,
"repo_name": "carolFrohlich/nipype",
"id": "a84d6e82467a16dc07cd20a74ac6421f02acb0da",
"size": ... |
"""Materialized Path Trees"""
import sys
import operator
if sys.version_info >= (3, 0):
from functools import reduce
from django.core import serializers
from django.db import models, transaction, connection
from django.db.models import F, Q
from django.utils.translation import ugettext_noop as _
from treebeard.... | {
"content_hash": "ac01ebbec3791d469be389df3e20f483",
"timestamp": "",
"source": "github",
"line_count": 1094,
"max_line_length": 94,
"avg_line_length": 37.73126142595978,
"alnum_prop": 0.5469257231455013,
"repo_name": "velfimov/django-treebeard",
"id": "d1756782e2a7a0860185555146ca4583316fe4de",
"s... |
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
# from sqlalchemy import Column, Integer, String
# from app import db
engine = create_engine('sqlite:///database.db', echo=True)
db_session = scoped_session(sessionmaker(... | {
"content_hash": "26410edf22f2b17436d4749b9ba21bf4",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 58,
"avg_line_length": 30.806451612903224,
"alnum_prop": 0.6544502617801047,
"repo_name": "andycasey/original-oracle",
"id": "e438d665203bc0c90c6304140ed9def0983cd84f",
"si... |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'MapView'
db.create_table(u'annotations_mapview', (
(u'id', self.gf('d... | {
"content_hash": "504361b33c40e23bf5e6585514f42992",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 86,
"avg_line_length": 38,
"alnum_prop": 0.5903271692745377,
"repo_name": "douglay/map_annotator",
"id": "57946cbde2d1b6a1d8febb4e238b89b5630e61bf",
"size": "1430",
"bina... |
import argparse
import io
import os
import platform
import re
import subprocess
import sys
class TestFailedError(Exception):
pass
def escapeCmdArg(arg):
if '"' in arg or ' ' in arg:
return '"%s"' % arg.replace('"', '\\"')
else:
return arg
def run_command(cmd):
if sys.version_info[0... | {
"content_hash": "b7447cb0a7fa052d8157756276ba6688",
"timestamp": "",
"source": "github",
"line_count": 312,
"max_line_length": 86,
"avg_line_length": 40.41025641025641,
"alnum_prop": 0.5398159898477157,
"repo_name": "gregomni/swift",
"id": "654887b12efde541787933c20e7cbe4edcc8ca6c",
"size": "12632... |
"""Tests for Building Blocks of the TensorFlow Debugger CLI."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import stat
import tempfile
import numpy as np
from tensorflow.python.client import pywrap_tf_session
from tensorflow.python.debug.cli... | {
"content_hash": "7a6ad2511b666d67a4bc8bf7164d9e50",
"timestamp": "",
"source": "github",
"line_count": 1160,
"max_line_length": 80,
"avg_line_length": 39.43189655172414,
"alnum_prop": 0.6346385081218163,
"repo_name": "jhseu/tensorflow",
"id": "774f49f65d12e132d01f72738c7911883437e3b7",
"size": "46... |
"""Tests for tensorflow.ops.test_util."""
import collections
import copy
import random
import threading
import unittest
import weakref
from absl.testing import parameterized
import numpy as np
from google.protobuf import text_format
from tensorflow.core.framework import graph_pb2
from tensorflow.core.protobuf impor... | {
"content_hash": "9cee4e8e16e30f6b79582aaca7ef6581",
"timestamp": "",
"source": "github",
"line_count": 1097,
"max_line_length": 98,
"avg_line_length": 35.16043755697356,
"alnum_prop": 0.6566591480646081,
"repo_name": "gautam1858/tensorflow",
"id": "5d51ab7a1b0161ee98632bc506c44e6d780ae57e",
"size"... |
from __future__ import print_function
VERSION = "0.4"
import glob, sys
# drivers
from PIL import BdfFontFile
from PIL import PcfFontFile
if len(sys.argv) <= 1:
print("PILFONT", VERSION, "-- PIL font compiler.")
print()
print("Usage: pilfont fontfiles...")
print()
print("Convert given font files ... | {
"content_hash": "91557edc0253fd62a8b3e4f52bbeefd5",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 68,
"avg_line_length": 19.386363636363637,
"alnum_prop": 0.5791324736225087,
"repo_name": "kitanata/resume",
"id": "f18310f79771a22bb015533d56ae9f58f29f403b",
"size": "1053... |
__author__ = 'kajal'
from crowdsourcing.serializers.template import *
from rest_framework import viewsets
class TemplateViewSet(viewsets.ModelViewSet):
from crowdsourcing.models import Template
queryset = Template.objects.all()
serializer_class = TemplateSerializer
class TemplateItemViewSet(viewsets.ModelView... | {
"content_hash": "b9ad1d7b02fb0fd1df4dc89cb82ccd86",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 59,
"avg_line_length": 35.68421052631579,
"alnum_prop": 0.831858407079646,
"repo_name": "radhikabhanu/crowdsource-platform",
"id": "9e6194cd08c9788a813e242d99c0114af7347e97",... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/ship/components/shield_generator/shared_shd_incom_techscreen_1.iff"
result.attribute_template_id = 8
result.stfName("space/space_item","shd_incom_techscreen_1_n")
#### BEGIN MODIFICATIONS ####
#### END MO... | {
"content_hash": "fbc2c79bd18eff732188ac3c73bca808",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 103,
"avg_line_length": 27.23076923076923,
"alnum_prop": 0.7175141242937854,
"repo_name": "anhstudios/swganh",
"id": "866ec48d7cd7436abf38b234a56a7ffe2127f8eb",
"size": "49... |
from os.path import dirname, join
import pkgutil
import unittest
class TestOpenCVContrib(unittest.TestCase):
def test_haarcascade_jpg(self):
self.check_haarcascade("jpg")
def test_haarcascade_png(self):
self.check_haarcascade("png")
# Adapted from https://realpython.com/face-recognition... | {
"content_hash": "a461ae6dc6a85a1c4962f283d92eef7c",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 92,
"avg_line_length": 38.81967213114754,
"alnum_prop": 0.5418074324324325,
"repo_name": "chaquo/chaquopy",
"id": "3c7b38762eb434182eed500bbd478a824d03e5b9",
"size": "2368"... |
from django.db import models
from datetime import date
## TODO: replace this with something that doesn't hit the db. At this point the traffic should be low and it's not much of a concern.
## also we're not pushing the stats anywhere...
class logreport(models.Model):
date = models.DateField()
apikey = mod... | {
"content_hash": "f45ceb0632ff8573f870eacdba96074b",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 134,
"avg_line_length": 32.48148148148148,
"alnum_prop": 0.6818700114025086,
"repo_name": "sunlightlabs/read_FEC",
"id": "8f1f8d26e98efaa1ce09bc4a802b502377df9f12",
"size":... |
"""
scripts for build constraint files and models and for optimizing models
"""
import os.path as osp
import h5py
import sys
from string import lower
from features import BatchRCFeats, MulFeats, QuadSimpleMulFeats, QuadSimpleMulIndFeats, QuadSimpleMulMapIndFeats, QuadSimpleMulBendIndFeats, SimpleMulFeats, SimpleMulGr... | {
"content_hash": "3d97dae81ea8be6370b8eb1843f34832",
"timestamp": "",
"source": "github",
"line_count": 208,
"max_line_length": 239,
"avg_line_length": 42.75480769230769,
"alnum_prop": 0.662768469582818,
"repo_name": "rll/lfd",
"id": "d1703456256b16ac20520895c6c94fa5e9466194",
"size": "8893",
"bi... |
import re
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect
from django.http import HttpResponse, Http404
from django.core.urlresolvers import reverse, resolve
from django.contrib import messages
from teacher.apps.accounts.authorization import is_teacher
from teacher.apps.... | {
"content_hash": "f5275f10c8efad5142ba6f6ccdecf60d",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 95,
"avg_line_length": 39.56521739130435,
"alnum_prop": 0.6142857142857143,
"repo_name": "houssemFat/MeeM-Dev",
"id": "6d2610c22149f5c0dda57ce83842b7c6e25dc369",
"size": "2... |
from pig_util import outputSchema
@outputSchema('value:int')
def return_one():
"""
Return the integer value 1
"""
return 1 | {
"content_hash": "ffa120276ed8569b1b1573448cead7a4",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 33,
"avg_line_length": 16.875,
"alnum_prop": 0.6666666666666666,
"repo_name": "MinerKasch/HadoopWithPython",
"id": "0cd7fe2fdba42d3fc378b188562e076e873a5416",
"size": "135",... |
import getpass
import requests
import os
import sys
import json
STRIKETRACKER_URL = os.environ['STRIKETRACKER_URL'] if 'STRIKETRACKER_URL' in os.environ else 'https://striketracker.highwinds.com'
if len(sys.argv) != 3:
print "Usage: python add_permission.py [account hash] [userId]"
sys.exit()
PARENT_ACCOUNT = ... | {
"content_hash": "1d277a5e78757b1c3d46aec6a6fa3cf1",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 131,
"avg_line_length": 36.67307692307692,
"alnum_prop": 0.5967488201363398,
"repo_name": "Highwinds/CDNWS-examples",
"id": "63b5a7a806635d4994586cf32a82a17c0d63bbd6",
"siz... |
import codesters
import math
def go_to(x,y):
sprite = codesters.Sprite()
sprite.go_to(x,y)
return [sprite.get_x(),sprite.get_y()]
def test_go_to():
coords = go_to(200,300)
x = coords[0]
y = coords[1]
assert x == 200 and y == 300
def glide_to(x,y):
sprite = codesters.Sprite()
sprit... | {
"content_hash": "907b483d7c98186fc38183c7d53489de",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 70,
"avg_line_length": 25.514084507042252,
"alnum_prop": 0.6538780016560861,
"repo_name": "codestersnyc/codesters-graphics",
"id": "fe6db5e1dd24e84aa9d5656eace9b3787e850766"... |
from collections import namedtuple
Add = namedtuple('Add', 'location left right')
Sub = namedtuple('Sub', 'location left right')
Mul = namedtuple('Mul', 'location left right')
Div = namedtuple('Div', 'location left right')
Pow = namedtuple('Pow', 'location left right')
UnaryMin = namedtuple('UnaryMin', 'location opera... | {
"content_hash": "545870e11a4bcbeea46bf2a511b0d551",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 53,
"avg_line_length": 38.90909090909091,
"alnum_prop": 0.7313084112149533,
"repo_name": "TomiBelan/multiparser",
"id": "b50adf38095e1731962c2d19596e2f4d93d42afe",
"size": ... |
""" smashlib.util.ipy
import shortcuts for ipython. this also might help to keep
smashlib in sync with changing ipython target versions?
"""
import re
import keyword
from IPython.utils.coloransi import TermColors
from goulash.cache import MWT
from peak.util.imports import lazyModule
logging = lazyModule('smas... | {
"content_hash": "41a55c260cde9f044cfc3daa799646e6",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 76,
"avg_line_length": 31.31764705882353,
"alnum_prop": 0.6562734785875282,
"repo_name": "mattvonrocketstein/smash",
"id": "9ee8de3d61fe4173dfcfbfd9866c9f1775c3e71e",
"size... |
from universe.envs.vnc_core_env.vnc_core_env import GymCoreEnv, GymCoreSyncEnv
from universe.envs.vnc_core_env.translator import AtariTranslator, CartPoleTranslator
| {
"content_hash": "dc09e5c751af7e8f5496b84c4902dae4",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 85,
"avg_line_length": 82.5,
"alnum_prop": 0.8545454545454545,
"repo_name": "rht/universe",
"id": "83b202752c478a1f4ca0d7fd00337378c80ba159",
"size": "165",
"binary": fals... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class RetrieveStatistics(Choreography):
def __init__(self, temboo_session):
"""
Cre... | {
"content_hash": "77685a9e3c9170f868f4f2a4b38bf369",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 250,
"avg_line_length": 46.1219512195122,
"alnum_prop": 0.7017451084082496,
"repo_name": "jordanemedlock/psychtruths",
"id": "3ecdab0de352ec87e2442e7189c4e55c6ca6dafb",
"si... |
"""
Tests - Deuce Client - Auth - OpenStack Authentication
"""
import datetime
import time
import uuid
from unittest import TestCase
import contextlib
import keystoneclient.exceptions
import mock
import deuceclient.auth
import deuceclient.auth.openstackauth as openstackauth
import deuceclient.tests.test_auth
from deu... | {
"content_hash": "4886da6a905a5c2966a014969a3a2cc3",
"timestamp": "",
"source": "github",
"line_count": 993,
"max_line_length": 79,
"avg_line_length": 39.863041289023165,
"alnum_prop": 0.5319573565076798,
"repo_name": "rackerlabs/deuce-client",
"id": "039f7a86bc489c125b18d644a86be2c2e391c558",
"siz... |
import inspect
import itertools
import warnings
from markupsafe import escape
from markupsafe import Markup
from wtforms import widgets
from wtforms.i18n import DummyTranslations
from wtforms.utils import unset_value
from wtforms.validators import StopValidation
from wtforms.validators import ValidationError
class ... | {
"content_hash": "c3809439bce8e8baacc7bed601bb4cbd",
"timestamp": "",
"source": "github",
"line_count": 449,
"max_line_length": 80,
"avg_line_length": 32.4097995545657,
"alnum_prop": 0.5785459043430456,
"repo_name": "wtforms/wtforms",
"id": "59c4e955220ecfee5fdea2f016cfefd902d24bb8",
"size": "14552... |
import _plotly_utils.basevalidators
class FillValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="fill", parent_name="table.cells", **kwargs):
super(FillValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
d... | {
"content_hash": "e31eb969d553858e869c9ae3a3a9ce91",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 80,
"avg_line_length": 34.56521739130435,
"alnum_prop": 0.529559748427673,
"repo_name": "plotly/plotly.py",
"id": "a920b6da1e57f05883a67e578e8c7042b31265bd",
"size": "795",... |
"""Class for interacting with the Skia Gold image diffing service."""
# pylint: disable=useless-object-inheritance
import logging
import os
import platform
import shutil
import sys
import tempfile
import time
CHROMIUM_SRC = os.path.realpath(
os.path.join(os.path.dirname(__file__), '..', '..'))
GOLDCTL_BINARY = ... | {
"content_hash": "36de94a2fbadfdaa7a00a92ee4bccbdc",
"timestamp": "",
"source": "github",
"line_count": 556,
"max_line_length": 80,
"avg_line_length": 38.47122302158273,
"alnum_prop": 0.6513791491351099,
"repo_name": "scheib/chromium",
"id": "9ec065e4c98e41b525ad6675d9363727a5db2b2f",
"size": "2155... |
from django import forms
from django.conf import settings
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from django.contrib.admin.widgets import ForeignKeyRawIdWidget
generic_script = """
<script type="text/javascript">
function showGenericRelatedObjectLookupPop... | {
"content_hash": "5999f8c3afd17eee6b4e3ec6e43c844f",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 98,
"avg_line_length": 33.44047619047619,
"alnum_prop": 0.5165539337842648,
"repo_name": "jazzband/django-authority",
"id": "fb5821b0a39e7bfd8616d437cf0e333b969332e2",
"siz... |
import logging
import pymongo
from django.conf import settings
from django.core.management.base import BaseCommand
from crits.config.config import CRITsConfig
from crits.core.mongo_tools import mongo_update, mongo_remove, mongo_connector
from create_sectors import add_sector_objects
logger = logging.getLogger(__n... | {
"content_hash": "02a81059c132090a55fad0bbbbbfe990",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 78,
"avg_line_length": 18.03921568627451,
"alnum_prop": 0.5733695652173914,
"repo_name": "davidhdz/crits",
"id": "bf1383e5e644439cf20135e9aae0c4ca60d51e48",
"size": "3680"... |
from __future__ import unicode_literals
from rest_framework import generics
from rest_framework import permissions
from api.base.views import JSONAPIBaseView
from api.base import permissions as base_permissions
from api.base.utils import get_object_or_error
from api.requests.permissions import NodeRequestPermission
f... | {
"content_hash": "22542515a1e7293aa6dde1f87b5a58b4",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 85,
"avg_line_length": 30.753846153846155,
"alnum_prop": 0.6953476738369184,
"repo_name": "binoculars/osf.io",
"id": "859972d8bf1cd4150b537dd8414bd7153615de00",
"size": "19... |
"""
A driver for Bare-metal platform.
"""
import os
from nova.compute import power_state
from nova import context as nova_context
from nova import db
from nova import exception
from nova import flags
from nova.openstack.common import cfg
from nova.openstack.common import importutils
from nova.openstack.common import lo... | {
"content_hash": "44b7da83468804e9194e4e34cdf55b76",
"timestamp": "",
"source": "github",
"line_count": 497,
"max_line_length": 81,
"avg_line_length": 38.503018108651915,
"alnum_prop": 0.581364966555184,
"repo_name": "NoBodyCam/TftpPxeBootBareMetal",
"id": "abe383575f6f6f454c62694f3e311479ef9fc305",
... |
from distutils.core import setup
from setuptools import find_packages
setup(
name='snactor',
version='0.2',
packages=find_packages(exclude=['contrib', 'docs', 'tests']),
url='https://github.com/leapp-to/snactor',
license='ASL 2.0',
author="Vinzenz 'evilissimo' Feenstra",
author_email='evili... | {
"content_hash": "79ad85a81d98315326b20500ed790f66",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 65,
"avg_line_length": 30.11764705882353,
"alnum_prop": 0.681640625,
"repo_name": "leapp-to/snactor",
"id": "7c4a74f9ed137ca08c5502617a5028ee9ac79e0d",
"size": "512",
"bi... |
policy_data = """
{
"context_is_admin": "role:admin or role:administrator",
"os_compute_api:servers:show:host_status": "",
"os_compute_api:servers:migrations:force_complete": "",
"os_compute_api:os-admin-actions:inject_network_info": "",
"os_compute_api:os-admin-actions:reset_network": "",
"os_... | {
"content_hash": "f722b905b4ad0917febc118d187b421f",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 63,
"avg_line_length": 45.401709401709404,
"alnum_prop": 0.6297063253012049,
"repo_name": "cloudbase/nova",
"id": "951df19d3fea08deca3cedcfeba242cd1ac25071",
"size": "5903... |
"""Provides utility functions"""
import random
import string
def random_string(length, pool=4):
"""Generates a random string of length length
containing a variety of characters as specified by pool"""
char_pool = string.letters
if pool >= 2:
char_pool += string.digits
if pool >= 3:
... | {
"content_hash": "3001716d1c1ac660178c6202e5c57094",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 85,
"avg_line_length": 25.333333333333332,
"alnum_prop": 0.6578947368421053,
"repo_name": "FreakJoe/cryptolockpy",
"id": "2ee89ea632fbebddd699374de6bb6117483b69c5",
"size":... |
from openerp.addons.mail.tests.common import TestMail
from openerp.exceptions import AccessError
from openerp.osv.orm import except_orm
from openerp.tools import mute_logger
class TestMailGroup(TestMail):
@mute_logger('openerp.addons.base.ir.ir_model', 'openerp.models')
def test_00_mail_group_access_rights(s... | {
"content_hash": "1d821c2739b3875747faaa3438ce1a86",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 126,
"avg_line_length": 58.3921568627451,
"alnum_prop": 0.6474143720617864,
"repo_name": "diogocs1/comps",
"id": "c131ce0bd0b309b4a06c0258517dabed119d9ec2",
"size": "3964",... |
import unittest
from ctypes import *
class StructFieldsTestCase(unittest.TestCase):
# Structure/Union classes must get 'finalized' sooner or
# later, when one of these things happen:
#
# 1. _fields_ is set.
# 2. An instance is created.
# 3. The type is used as field of another Structur... | {
"content_hash": "95be5104e6ad67c0e198453132111502",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 71,
"avg_line_length": 31.06,
"alnum_prop": 0.5486155827430779,
"repo_name": "Jeff-Tian/mybnb",
"id": "12827e2f51b324a1728dd154257131ceda18b07e",
"size": "1553",
"binary"... |
import os,sys
from lxml import etree
#the em-dash before the word even was replaced with — in this constant:
default_xslt = """<?xml version="1.0" encoding="UTF-8"?>
<!-- #############################################################
# Name: UpdateMetaData-1.2.xsl
# Purpose: Update th... | {
"content_hash": "52ff9d6df36af32efe9146bcd7e02832",
"timestamp": "",
"source": "github",
"line_count": 563,
"max_line_length": 446,
"avg_line_length": 45.83658969804618,
"alnum_prop": 0.492404867085174,
"repo_name": "sillsdev/DblMetaData",
"id": "bbc16e54b1ac09204a454e470137199466f5bcd3",
"size": ... |
"""For using the Beancount shell from Fava."""
# mypy: ignore-errors
import contextlib
import io
import textwrap
from typing import List
from typing import TYPE_CHECKING
from beancount.core.data import Entries
from beancount.core.data import Query
from beancount.parser.options import OPTIONS_DEFAULTS
from beancount.qu... | {
"content_hash": "5c38fac813bb9d32986f60b3f4a1b737",
"timestamp": "",
"source": "github",
"line_count": 205,
"max_line_length": 78,
"avg_line_length": 33.204878048780486,
"alnum_prop": 0.5939474070809461,
"repo_name": "aumayr/beancount-web",
"id": "13bf7c41808ddc18ee652dbcb6a7ee952eeb8abf",
"size":... |
import testtools
from tempest.api.compute import base
from tempest import config
from tempest.lib import decorators
from tempest import test
CONF = config.CONF
class ServersOnMultiNodesTest(base.BaseV2ComputeAdminTest):
@classmethod
def resource_setup(cls):
super(ServersOnMultiNodesTest, cls).resou... | {
"content_hash": "b9db502e25d48da9dc64d5ca9a8ab6db",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 74,
"avg_line_length": 40.140625,
"alnum_prop": 0.6516154145581938,
"repo_name": "vedujoshi/tempest",
"id": "858998af987f3b30593a800d23ef02554c592f3b",
"size": "3200",
"b... |
from django.test import TestCase
from backend.models import Concert
from backend.tests.helpers import login, create_user, create_festival, create_concert
from backend.tests.helpers import create_client
class UpdateConcertInfoTests(TestCase):
def test_no_client_name_provided(self):
"""
update_conc... | {
"content_hash": "bf9a5f7a4b6892f0cc4a1a98c2c7e005",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 118,
"avg_line_length": 38.043795620437955,
"alnum_prop": 0.5823100537221796,
"repo_name": "amentis/FestPal-Server",
"id": "619d5376d61d15c6279a1a37b851148ba575d7dc",
"siz... |
from challenges.challenge import Challenge
from challenges.conf import Conf
from challenges.scaffold import Scaffold
from challenges.runner import Runner
from challenges.main import main
| {
"content_hash": "0a57e0cad7ccb524bd6e2dcdbf382bf8",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 42,
"avg_line_length": 31.333333333333332,
"alnum_prop": 0.8617021276595744,
"repo_name": "elmar-hinz/Python.Challenges",
"id": "0b37234a74f1aee8e5fc68ab2a365a434912030f",
"... |
import json
from typing import Optional
import zipcodes
from great_expectations.core.expectation_configuration import ExpectationConfiguration
from great_expectations.exceptions import InvalidExpectationConfigurationError
from great_expectations.execution_engine import (
PandasExecutionEngine,
SparkD... | {
"content_hash": "1e9eb6b0d13e5241aa1feb507ee1712a",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 115,
"avg_line_length": 39.76027397260274,
"alnum_prop": 0.6296296296296297,
"repo_name": "great-expectations/great_expectations",
"id": "607c18645a76d3d60f23dc362b4024ee6c7... |
from __future__ import division
from sklearn.neighbors import NearestNeighbors
import numpy as np
from sets import Set
import os
import os.path
import bson
import sys
import csv
import json
import math
import string
import random
import names
import operator
from collections import defaultdict
from scipy.sparse impor... | {
"content_hash": "fea27e629d4b460f97770d7d05df084e",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 155,
"avg_line_length": 30.58267716535433,
"alnum_prop": 0.5131307929969104,
"repo_name": "valentin7/shazam-datascience",
"id": "1fae28dc289f520e055d3cd97e7bfa9365f66c9a",
... |
from flask import Flask
import base64
from flask_jwt import JWT
app = Flask(__name__)
app.config.from_object('metaflask.config')
app.url_map.strict_slashes = False
jwt = JWT(app)
@app.after_request
def after_request(response):
response.headers.add('Access-Control-Allow-Origin', '*')
return response
import m... | {
"content_hash": "d9f896fbd74ea2d26c3f2b49dfa93efc",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 60,
"avg_line_length": 22.294117647058822,
"alnum_prop": 0.7546174142480211,
"repo_name": "harmon25/metaflask",
"id": "30aa0243e1f2d4d43165bdd95060dae000fa77c9",
"size": "4... |
from django.test import TestCase
from .. import forms, managers, models
class ManagerTest(TestCase):
manager = managers.FormManager
fixtures = [
'wizard_builder_data',
]
def _change_form_text(self, form):
question = models.FormQuestion.objects.filter(pk=form['id'])
question.u... | {
"content_hash": "48e81b98d2946379e10bd464cb50a5e6",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 69,
"avg_line_length": 32.229166666666664,
"alnum_prop": 0.6192630898513252,
"repo_name": "SexualHealthInnovations/django-wizard-builder",
"id": "6411743d55641437168e31775a07... |
"""
Command-line interface to the GBP APIs
"""
from __future__ import print_function
import argparse
import logging
import os
import sys
from keystoneclient.auth.identity import v2 as v2_auth
from keystoneclient.auth.identity import v3 as v3_auth
from keystoneclient import discover
from keystoneclient.openstack.comm... | {
"content_hash": "b7ffdbd3b9ed7351d0ea74d5dfea731e",
"timestamp": "",
"source": "github",
"line_count": 831,
"max_line_length": 79,
"avg_line_length": 40.312876052948255,
"alnum_prop": 0.5800298507462687,
"repo_name": "tbachman/python-group-based-policy-client",
"id": "ba84f7c3c5d1428614a41a6b7922d56... |
from django.conf.urls import url
from . import views, views_admin
urlpatterns = [
# views
# views_admin
url(r'^delete_possible_twitter_handles/(?P<candidate_campaign_we_vote_id>wv[\w]{2}cand[\w]+)/$',
views_admin.delete_possible_twitter_handles_view, name='delete_possible_twitter_handles',),
... | {
"content_hash": "84561e2c88f364be9b2dfcdbce50ff2f",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 113,
"avg_line_length": 46.2,
"alnum_prop": 0.7070707070707071,
"repo_name": "jainanisha90/WeVoteServer",
"id": "18e1a31300d2a8cc05a3c6d7df54b0bd30d96219",
"size": "815",
... |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('auth', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('hs_core', '0004_auto_20150721_1... | {
"content_hash": "0632f9894f500283dd678cbdf3f0ad32",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 239,
"avg_line_length": 57.31547619047619,
"alnum_prop": 0.615432547512722,
"repo_name": "RENCI/xDCIShare",
"id": "7ab4b90b57d9e1077f286ec41e50d10bbafbc76a",
"size": "9653... |
"""
NIMH Data Archive Data Structure Client
Example:
nimh_data_archive -d demof01 child_dem01
"""
__author__ = 'Nolan Nichols <https://orcid.org/0000-0003-1099-3328>'
import os
import sys
import json
import logging
import requests
class DataDictionary(object):
"""Creates an object to retrieve NDA data dic... | {
"content_hash": "742d32628a5de3254f1e4b989c02989b",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 78,
"avg_line_length": 34.79545454545455,
"alnum_prop": 0.5878510777269759,
"repo_name": "sibis-platform/nimh_datadict",
"id": "2ea3c4dd3721827cb4ba6756b41c8999d7dc5187",
... |
import sys
import logging
import csv
from django.core.management.base import BaseCommand, CommandError
from django.db.utils import IntegrityError
from django.db import transaction
from django.conf import settings
from mpr import models
logger = logging.getLogger(__name__)
class Command(BaseCommand):
args = '<f... | {
"content_hash": "48493d15cca6d49268a03d4709cf012f",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 137,
"avg_line_length": 42.698113207547166,
"alnum_prop": 0.6301369863013698,
"repo_name": "Code4SA/medicine-price-registry",
"id": "58c5dece5f66d30a2af8ba9528d33860c113c6e8"... |
from oslo_config import cfg
CONF = cfg.CONF
rest_server_ops = [
cfg.StrOpt('bind_host',
default='0.0.0.0',
help='Address to bind the API server to'),
cfg.IntOpt('bind_port',
default=8801,
help='Port the bind the API server to'),
cfg.StrOpt('user... | {
"content_hash": "1d141db92b133bf260f903a26aea26b0",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 72,
"avg_line_length": 24.17241379310345,
"alnum_prop": 0.5249643366619116,
"repo_name": "smartbgp/yabgp",
"id": "5b476d72ceba065a2431a042195104a50f6e9457",
"size": "1336",... |
import datetime
from StringIO import StringIO
try: # pragma: no cover
import Image
except ImportError: # pragma: no cover
from Pillow import Image
import colander
from kotti.views.edit import ContentSchema
from kotti.views.edit import generic_edit
from kotti.views.edit import generic_add
from kotti.views.vie... | {
"content_hash": "bd7e28983a6fb96d5c285cba0073a649",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 74,
"avg_line_length": 27.647773279352226,
"alnum_prop": 0.6282032508419974,
"repo_name": "chrneumann/kotti_events",
"id": "ff81d3022c58e9c0afcd954256a78ba3ecada378",
"siz... |
"""Gluon EventHandlers for Estimators"""
import logging
import os
import time
import warnings
import numpy as np
from ....metric import EvalMetric
from ....metric import Loss as metric_loss
__all__ = ['TrainBegin', 'TrainEnd', 'EpochBegin', 'EpochEnd', 'BatchBegin', 'BatchEnd',
'StoppingHandler', 'Metric... | {
"content_hash": "21e164c787fd1d414b8e3f4ae3790fb4",
"timestamp": "",
"source": "github",
"line_count": 691,
"max_line_length": 117,
"avg_line_length": 44.68162083936324,
"alnum_prop": 0.5789473684210527,
"repo_name": "reminisce/mxnet",
"id": "da2c84455e3517e8b45d92dcf08d12b7ade44c40",
"size": "317... |
import unittest
from unittest import mock
import gitmagic
class TestBlameParser(unittest.TestCase):
def setUp(self):
self.commit1 = ['commit1',['line 1', 'line 2', 'line 3']]
self.commit2 = ['commit2',['line 4', 'line 5', 'line 6']]
self.repo = mock.Mock()
self.repo.blame.return_va... | {
"content_hash": "9e62715fa5523756aabe2fb099254831",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 97,
"avg_line_length": 41.78,
"alnum_prop": 0.6280516993776927,
"repo_name": "balabit/git-magic",
"id": "18298e4890f3878a7f23b952668b65179e896b9e",
"size": "2089",
"binar... |
import six
import webob.dec
import webob.exc
from oslo_log import log as logging
from conveyor.api.wsgi import wsgi
from conveyor import exception
from conveyor.i18n import _, _LE, _LI
from conveyor import utils
from conveyor import wsgi as base_wsgi
LOG = logging.getLogger(__name__)
class FaultWrapper(base_wsgi.... | {
"content_hash": "1e7f3aaceacb15b8fb527a35a397aefc",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 76,
"avg_line_length": 36.34375,
"alnum_prop": 0.6272570937231299,
"repo_name": "Hybrid-Cloud/conveyor",
"id": "a39f88c63281c4fbe24b334611f7718c13a9ec12",
"size": "3059",
... |
import os, csv
datadir = "/Users/titlis/cogsci/projects/stanford/projects/overinformativeness/experiments/24_interactive_color_reference_game/experiment/data/"
csv_messagenames = [o for o in os.listdir("/Users/titlis/cogsci/projects/stanford/projects/overinformativeness/experiments/24_interactive_color_reference_gam... | {
"content_hash": "d0e12c1c5d4cd764c4ec4fb9f257b1b4",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 241,
"avg_line_length": 31.415384615384614,
"alnum_prop": 0.7196376101860921,
"repo_name": "thegricean/overinformativeness",
"id": "1b82e99af006877018d81a8d938f1653473c6372"... |
from setuptools import setup, find_packages
import os
import screwjack
setup(
name="screwjack",
version=screwjack.__version__,
description="ScrewJack is a tiny command line tool for manipulating modules.",
long_description="",
author="Xiaolin Zhang",
author_email="leoncamel@gmail.com",
url=... | {
"content_hash": "e0e366409b7da8f89f4aa454cbf80cf5",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 119,
"avg_line_length": 33.354838709677416,
"alnum_prop": 0.6112185686653772,
"repo_name": "DataCanvasIO/screwjack",
"id": "084020afe8782f0ce11df797a9377705bf0c2bd7",
"size... |
"""Test the CDA method in cclib"""
import sys
import logging
import unittest
sys.path.insert(1, "..")
from ..test_data import getdatafile
from cclib.method import CDA
from cclib.parser import Gaussian
def main(log=True):
data1, logfile1 = getdatafile(Gaussian, "CDA", ["BH3CO-sp.log"])
data... | {
"content_hash": "d569936fa5169693fccf4683745f030b",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 115,
"avg_line_length": 26,
"alnum_prop": 0.5594951923076923,
"repo_name": "cclib/cclib",
"id": "49ee47c4c4a6b0e5081454b1fc415a5590c25523",
"size": "1867",
"binary": fals... |
from google.cloud import aiplatform_v1
async def sample_delete_context():
# Create a client
client = aiplatform_v1.MetadataServiceAsyncClient()
# Initialize request argument(s)
request = aiplatform_v1.DeleteContextRequest(
name="name_value",
)
# Make the request
operation = clien... | {
"content_hash": "8a5ab49e59c970a2b79cc4f1f3267de2",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 78,
"avg_line_length": 24.91304347826087,
"alnum_prop": 0.7155322862129145,
"repo_name": "googleapis/python-aiplatform",
"id": "23c94c67caacde77960dbb9c28fd4d347fc9181e",
"... |
import base64
import collections
import itertools
import logging
import os, lzma
import pickle
import shutil
import zipfile
from sqlalchemy import func
from sqlalchemy.sql.expression import delete, bindparam
from terroroftinytown.format import registry
from terroroftinytown.format.projectsettings import ProjectSettin... | {
"content_hash": "cb3438ca7ea19e62a11ae387b2e5d977",
"timestamp": "",
"source": "github",
"line_count": 415,
"max_line_length": 104,
"avg_line_length": 35.81927710843374,
"alnum_prop": 0.5332660612176253,
"repo_name": "hugovk/terroroftinytown",
"id": "241f7597bf878e42eced8b798e9d9513d804646a",
"siz... |
def get_key(data, keys, default=None):
keys = keys.split('.')
try:
for k in keys:
data = data[k]
return data
except KeyError:
return default
def delete_key(data, keys):
keys = keys.split('.')
for k in keys[:-1]:
data = data[k]
del data[keys[-1]]
def ... | {
"content_hash": "28740025e22e8c52b14fb162db9eb448",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 54,
"avg_line_length": 25.90909090909091,
"alnum_prop": 0.5403508771929825,
"repo_name": "Deepomatic/dmake",
"id": "814d51272d87e02455d78a6b6a9aeab31748fb6a",
"size": "570"... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('sites', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='sites',
old_name='site_id',
new_name='name... | {
"content_hash": "844a20945ba39d9ad15fb9b01e33eb7c",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 39,
"avg_line_length": 22.08823529411765,
"alnum_prop": 0.49134487350199735,
"repo_name": "ZhibinCH/my3MW",
"id": "d8b6e94dae376e28c4200e61be677d360ea41861",
"size": "824",... |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from ironicclient import client
import six
from congress.datasources import constants
from congress.datasources import datasource_driver
from congress.datasources import datasource_utils as ds_utils
class Ir... | {
"content_hash": "c6703fa189bcd29378d5219670b27791",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 79,
"avg_line_length": 41.907766990291265,
"alnum_prop": 0.532607436580563,
"repo_name": "openstack/congress",
"id": "866b2a04273fe5f8139ac1550f083474a7198138",
"size": "9... |
import os
import sys
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy import and_
from sqlalchemy.orm import load_only
from models import Advertisement, Municipality
import numpy as np
from osgeo import gdal
class GeoData():
def __init__(self, filename):
driver... | {
"content_hash": "c2f6302f25713de4ade463e2c6909191",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 201,
"avg_line_length": 33.73571428571429,
"alnum_prop": 0.5763286047004023,
"repo_name": "bhzunami/Immo",
"id": "3cf07771c8711705c2182270f2f2557b1542cad0",
"size": "4723"... |
class YarhBase:
def __init__(self, parent):
self.parent = parent
def html(self):
raise NotImplementedError()
def yarh(self):
raise NotImplementedError()
def findparent(self, **kwargs):
keys = ["type"]
findable = False
for kwarg in kwargs:
i... | {
"content_hash": "4e02ce551291cb4a494dede52769c25b",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 51,
"avg_line_length": 24.925925925925927,
"alnum_prop": 0.5289747399702823,
"repo_name": "minacle/yarh",
"id": "621a34615835ede211e3f56d2be53bfd970231a9",
"size": "673",
... |
import warnings
from unittest import skipUnless
from django.conf import settings as django_settings
from django.utils.encoding import force_str
from mezzanine.conf import register_setting, registry, settings
from mezzanine.conf.context_processors import TemplateSettings
from mezzanine.conf.models import Setting
from ... | {
"content_hash": "61b2103ee3fc3b03c563de98f95b0af1",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 86,
"avg_line_length": 38.58461538461538,
"alnum_prop": 0.6218102073365231,
"repo_name": "jerivas/mezzanine",
"id": "177ebe5eb503079eaf0f01a150c891e72a8028d3",
"size": "10... |
from cloudkitty import transformer
class GnocchiTransformer(transformer.BaseTransformer):
def __init__(self):
pass
def _generic_strip(self, data):
res_data = {
'resource_id': data['id'],
'project_id': data['project_id'],
'user_id': data['user_id'],
... | {
"content_hash": "d19234f0f5668c9bfe2269f5cffb3f7b",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 67,
"avg_line_length": 32.6140350877193,
"alnum_prop": 0.5416890801506186,
"repo_name": "muraliselva10/cloudkitty",
"id": "3445db52581c69a237ee7e4be53ba60af1e76aef",
"size"... |
from django.apps import AppConfig
class ArticlesAppConfig(AppConfig):
name = 'articles'
label = 'articles'
verbose_name = "Articles"
| {
"content_hash": "e3a9e4848eb9413730cd24b7eaee4395",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 35,
"avg_line_length": 21,
"alnum_prop": 0.7074829931972789,
"repo_name": "albertoconnor/website",
"id": "c851ece3758574f6feb837c44557091f8ef4823d",
"size": "147",
"binary... |
"""Policy Engine For Heat"""
from oslo.config import cfg
from heat.common import exception
from heat.openstack.common import policy
CONF = cfg.CONF
DEFAULT_RULES = {
'default': policy.FalseCheck(),
}
class Enforcer(object):
"""Responsible for loading and enforcing rules."""
def __init__(self, scope=... | {
"content_hash": "55d98c65ee878ff04072105b635de946",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 79,
"avg_line_length": 39.13235294117647,
"alnum_prop": 0.6388575723412251,
"repo_name": "redhat-openstack/heat",
"id": "01a4338c76707245b2bef02fb32a8a9aaab523e1",
"size": ... |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.contenttypes import generic
from taggit.models import ItemBase as TaggitItemBase
from autoslug import AutoSlugField
from openbudget.settings.base import AUTH_USER_MODEL
from openbudget.apps.sheets.models import Temp... | {
"content_hash": "f8955dc50862f823d3b02eaeeed2acc5",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 78,
"avg_line_length": 24.66891891891892,
"alnum_prop": 0.6020268419611066,
"repo_name": "zbyufei/open-budgets",
"id": "3f8d10db23042c935db90f0a28087e51b6a5fae7",
"size": ... |
from py4j.java_gateway import get_method
from typing import Union
from pyflink.java_gateway import get_gateway
from pyflink.table import ExplainDetail
from pyflink.table.expression import Expression, _get_java_expression
from pyflink.table.expressions import col, with_columns, without_columns
from pyflink.table.serial... | {
"content_hash": "c36401210d2db7f9dc0ff053fd592a08",
"timestamp": "",
"source": "github",
"line_count": 1499,
"max_line_length": 100,
"avg_line_length": 41.19546364242829,
"alnum_prop": 0.5659411840912035,
"repo_name": "twalthr/flink",
"id": "484d7583a72f6f6cf5e3f08565d8e851abb74e1d",
"size": "6271... |
from flask import Flask, redirect, url_for, request, jsonify, abort
import sqlite3
import nmap
import time
import storage
app = Flask(__name__)
@app.route('/')
def index():
return redirect(url_for('static', filename='index.html'))
@app.route('/getActiveNames')
def getActiveNames():
activeUsers = storage.getActiveU... | {
"content_hash": "1a2f87fc12560e74c8629a32b1cdd193",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 67,
"avg_line_length": 20.127659574468087,
"alnum_prop": 0.6775898520084567,
"repo_name": "m-philipp/mac-disco",
"id": "ec60964ce31fe789174f6e7b2a8fce8571762677",
"size": "... |
from __future__ import unicode_literals
from datetime import timedelta
from sqlalchemy import DDL
from sqlalchemy.event import listens_for
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.orm.base import NEVER_SET, NO_VALUE
from indico.core.db imp... | {
"content_hash": "562daf073836c8b54341286c43d48245",
"timestamp": "",
"source": "github",
"line_count": 373,
"max_line_length": 110,
"avg_line_length": 34.5656836461126,
"alnum_prop": 0.6107189948033817,
"repo_name": "mvidalgarcia/indico",
"id": "2bfb49f12ac04b0c6f7e8225d49943f6e8ddd21f",
"size": "... |
"""Support for mounting images with qemu-nbd."""
import os
import random
import re
import time
from oslo.config import cfg
from nova.i18n import _, _LE
from nova.openstack.common import log as logging
from nova import utils
from nova.virt.disk.mount import api
LOG = logging.getLogger(__name__)
nbd_opts = [
cfg... | {
"content_hash": "a2aa9211c1096b23776e8c96c68abbdd",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 78,
"avg_line_length": 33.096774193548384,
"alnum_prop": 0.5450779727095516,
"repo_name": "badock/nova",
"id": "2bc3b3e57e3416becd29b873efd48dbbfef5015a",
"size": "4677",
... |
import pyb, pwm
FORWARDS = 255
BACKWARDS = -FORWARDS
STOP = 0
#possible dcmotor configurations, depends on skin orientation
Y1 = {'enable_pin':pyb.Pin.board.Y8, 'enable_timer':12, 'enable_channel':2, 'control0':pyb.Pin.board.Y6,'control1':pyb.Pin.board.Y7}
Y2 = {'enable_pin':pyb.Pin.board.Y3, 'enable_t... | {
"content_hash": "36819b83a8266d860425255912270df9",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 132,
"avg_line_length": 36.943661971830984,
"alnum_prop": 0.6504003049942814,
"repo_name": "PinkInk/upylib",
"id": "11554709d806e630b5173d1d12b09d8649cd634e",
"size": "2623... |
import numpy
import colorsys
from scipy.ndimage.filters import gaussian_filter
from scipy.ndimage.morphology import distance_transform_edt
def rgb2hls(img):
copy = img.reshape(img.shape[0] * img.shape[1], img.shape[2])
converted = numpy.array([colorsys.rgb_to_hls(v[0]/255.0,v[1]/255.0,v[2]/255.0) for v in co... | {
"content_hash": "bafb6ebea9b079dee89b6b3dae305ae6",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 119,
"avg_line_length": 29.59090909090909,
"alnum_prop": 0.6612903225806451,
"repo_name": "alexjc/imgscaper",
"id": "968590010d8df45e2ede8a0df2999a75bf4f86c5",
"size": "130... |
import os.path
import re
# We need to ensure a local settings file is defined,
# thus no-one changes the settings file unless its a
# global change. Or at least changes the settings.tmpl file instead
try:
from .local_settings import *
except ImportError:
raise AssertionError("Local settings file not defined")... | {
"content_hash": "6dc74830ee6c624d86e42633bf417c3e",
"timestamp": "",
"source": "github",
"line_count": 332,
"max_line_length": 128,
"avg_line_length": 28.07831325301205,
"alnum_prop": 0.6042694700708002,
"repo_name": "Saevon/webdnd",
"id": "888f6c5b4b501b64e7237ec50952e8ae05217f25",
"size": "9322"... |
"""
Run a single species simulation and plot each time step separately.
"""
import time
import numpy
import pylab
import model.grid
from model.grid import Species, Grid
import habitat
# The size of the simulation grid
height, width = 128, 128
# Simulation time
time_steps = 10
# Random number generator seed for the... | {
"content_hash": "474e97658c2b2e3effdab37a282dafc4",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 70,
"avg_line_length": 25.973684210526315,
"alnum_prop": 0.7375886524822695,
"repo_name": "rybicki/corridor-spom",
"id": "ee4df74da86f0f2948b17f69bb76fe62f089bad5",
"size":... |
import argparse
import sys
import os
import subprocess
import signal
import getpass
import simplejson
from termcolor import colored
import ConfigParser
import StringIO
import functools
import time
import random
import string
from configobj import ConfigObj
import tempfile
import pwd, grp
import traceback
import uuid
im... | {
"content_hash": "d36ab004eab2dd35f35a5e7c959de62b",
"timestamp": "",
"source": "github",
"line_count": 3361,
"max_line_length": 893,
"avg_line_length": 42.66319547753645,
"alnum_prop": 0.6053727221373726,
"repo_name": "ghxandsky/zstack-utility",
"id": "fd2918e631979ff5719991132d9b644cd0810554",
"s... |
from .model_tests import *
from .form_tests import *
from .tags_tests import *
from .managers_tests import *
| {
"content_hash": "607a2726c2d82661f9bc02b503cc7bc1",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 29,
"avg_line_length": 27.25,
"alnum_prop": 0.7431192660550459,
"repo_name": "tsouvarev/django-money",
"id": "cca1f4101adffd98a4ed257960b00512bf431686",
"size": "109",
"bi... |
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='DashboardWidget',
fields=[
... | {
"content_hash": "811438ad80fb9cefdab99cb54e6bf839",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 433,
"avg_line_length": 52.95652173913044,
"alnum_prop": 0.6149425287356322,
"repo_name": "vIiRuS/Lagerregal",
"id": "acd96c1f73115a032487d0495ff7b2042369194c",
"size": "12... |
"""
The implementations of the hdfs clients.
"""
import logging
import threading
from luigi.contrib.hdfs import config as hdfs_config
from luigi.contrib.hdfs import webhdfs_client as hdfs_webhdfs_client
from luigi.contrib.hdfs import hadoopcli_clients as hdfs_hadoopcli_clients
logger = logging.getLogger('luigi-interf... | {
"content_hash": "fd7980fb453de7bc03b524a951e6748a",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 82,
"avg_line_length": 30.651162790697676,
"alnum_prop": 0.6949924127465857,
"repo_name": "dlstadther/luigi",
"id": "d3c113a9b98b4a3ef65cbf0f1030d3d7f5baecff",
"size": "192... |
import tensorflow as tf
import train
import numpy as np
import pprint
flags = tf.app.flags
flags.DEFINE_string("dataset", "cosmo", "")
flags.DEFINE_string("datafile", "data/cosmo_primary_64_1k_train.npy", "Input data file for cosmo")
flags.DEFINE_integer("epoch", 1, "Epochs to train [1]")
flags.DEFINE_float("learning_... | {
"content_hash": "3410152a2fd563d884612992ab25246f",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 121,
"avg_line_length": 49.229166666666664,
"alnum_prop": 0.6961489631823953,
"repo_name": "MustafaMustafa/dcgan-tf-benchmark",
"id": "4e901d6dc4b731fa0a426b3dde59522f4bd0121... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.