text stringlengths 4 1.02M | meta dict |
|---|---|
from openinghours.models import OpeningHours, WEEKDAYS
from openinghours.forms import Slot, time_to_str, str_to_time
from openinghours.utils import get_premises_model
from django.shortcuts import render, redirect, get_object_or_404
from django.views.generic import DetailView
from collections import OrderedDict
class ... | {
"content_hash": "2d1fdd97ed31001713f098d1765616d4",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 80,
"avg_line_length": 41.95918367346939,
"alnum_prop": 0.5634727626459144,
"repo_name": "arteria/django-openinghours",
"id": "0622bf5c9ad99acf6f1f69e57f3539c1088b9420",
"s... |
from JumpScale import j
import JumpScale.baselib.serializers
import JumpScale.grid.serverbase
from JumpScale.grid.serverbase.DaemonClient import Transport
import time
def retry(func):
def wrapper(self, *args, **kwargs):
try:
if j.system.net.tcpPortConnectionTest(*self._connection[:2]):
... | {
"content_hash": "3cfb5c357a679cc0126ca173d36b8fe9",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 88,
"avg_line_length": 38.09090909090909,
"alnum_prop": 0.5389817024661894,
"repo_name": "Jumpscale/jumpscale6_core",
"id": "79dd58bf84f4c4a48b089e39a946773abda45308",
"siz... |
from jobsched.watchdog import watchdog
import os
import subprocess
import sys
class RunScript(object):
def __init__(self, script=None):
self.script = os.path.abspath(script)
@watchdog()
def __call__(self, info):
if os.path.exists(self.script):
script = os.path.abspath(self.sc... | {
"content_hash": "7c88b4bfa88b4237d3a921d4751bcef2",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 92,
"avg_line_length": 33.416666666666664,
"alnum_prop": 0.5810473815461347,
"repo_name": "frenzykryger/jobsched",
"id": "478c8732d6bcbbb32c83f86c2b2ed5a655d89686",
"size":... |
from datetime import datetime
from decimal import Decimal
import pytz
import random
import time
from django.conf import settings as django_settings
from django.utils.datastructures import SortedDict
from dolphin import settings
from dolphin.middleware import LocalStoreMiddleware
from dolphin.utils import get_ip, get_... | {
"content_hash": "7e569af62c7c26c7f8b8863ffb278104",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 97,
"avg_line_length": 34.935483870967744,
"alnum_prop": 0.5851470782218705,
"repo_name": "coxmediagroup/dolphin",
"id": "e4c3a2b5ba5fa6ddbf04b161689943806da4e1b7",
"size"... |
import _plotly_utils.basevalidators
class UniformtextValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="uniformtext", parent_name="layout", **kwargs):
super(UniformtextValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_nam... | {
"content_hash": "814d4f7c762d4179ab4604ea8814de1b",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 82,
"avg_line_length": 41.266666666666666,
"alnum_prop": 0.5605815831987075,
"repo_name": "plotly/plotly.py",
"id": "e768a0c7a0cea06639ae9dab0bcf094a186a0f64",
"size": "123... |
"""
PlexAPI Play PlayQueues
"""
import plexapi, requests
from plexapi import video
from plexapi import utils
class PlayQueue(object):
def __init__(self, server, data, initpath):
self.server = server
self.initpath = initpath
self.identifier = data.attrib.get('identifier')
self.medi... | {
"content_hash": "2cae52a9d6be3d28fcaa16954a767e22",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 90,
"avg_line_length": 42.270270270270274,
"alnum_prop": 0.6547314578005116,
"repo_name": "ayerlock/python-plexcontrol",
"id": "96261c4d1c4819e9bcedc866673df1eda4ada2a4",
"... |
'''
Classes to solve and simulate consumption-savings model with a discrete, exogenous,
stochastic Markov state. The only solver here extends ConsIndShockModel to
include a Markov state; the interest factor, permanent growth factor, and income
distribution can vary with the discrete state.
'''
import sys
sys.path.ins... | {
"content_hash": "6f9db1cb974d936eb0a5d9afc73b1599",
"timestamp": "",
"source": "github",
"line_count": 1122,
"max_line_length": 171,
"avg_line_length": 47.889483065953655,
"alnum_prop": 0.6216779572694111,
"repo_name": "bolmez/Class-HARK",
"id": "9b8de5cf83b089a96399657f2e804e13962a4b43",
"size": ... |
import ast
import csv
import logging
import math
import os
from nose_parameterized import parameterized
import numpy
import SimpleITK as sitk
import six
from radiomics import featureextractor, getTestCase, imageoperations
# Get the logger. This is done outside the class, as it is needed by both the class and the cus... | {
"content_hash": "984cb917a3e9a7bde9bc8fe2c82bd511",
"timestamp": "",
"source": "github",
"line_count": 439,
"max_line_length": 119,
"avg_line_length": 36.78132118451025,
"alnum_prop": 0.6734997213104601,
"repo_name": "Radiomics/pyradiomics",
"id": "3b8857822b4e2a3d50de624bf9b9d801b19ee9d3",
"size"... |
import vx
from vx.window import window
from .undo import undo_tree, addition, removal
import vx.movement as move
import vx.text as text
from .keybindings import ctrl, keys
from vx.copystack import CopyStack
import re
from contextlib import contextmanager
class buffer(window):
def __init__(self, *args, **kwargs):
... | {
"content_hash": "205c02e071351e26e04de3958e65c093",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 113,
"avg_line_length": 34.967592592592595,
"alnum_prop": 0.5180722891566265,
"repo_name": "philipdexter/vx",
"id": "9e844a4b6d3e0e124f16feb04e69f550b621b64d",
"size": "75... |
from openerp import models, fields, api
class Wizard(models.TransientModel):
_name = 'openacademy.wizard'
def _default_sessions(self):
return self.env['openacademy.session'].browse(
self._context.get('active_ids'))
session_ids = fields.Many2many(
'openacademy.session',
... | {
"content_hash": "4a7afbdfb01ede9ee7a433885878b079",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 70,
"avg_line_length": 28.363636363636363,
"alnum_prop": 0.6362179487179487,
"repo_name": "umiphos/vauxooTechnical",
"id": "f97a76918409112673efaf8de98123cba4891aba",
"size... |
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key us... | {
"content_hash": "daf6abf9a7d3363348715ffc4f9f4533",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 89,
"avg_line_length": 29.333333333333332,
"alnum_prop": 0.6945592286501377,
"repo_name": "ionelmc/django-redisboard",
"id": "d4c852b7de80f8bda1328f4c57c643ebf581e137",
"si... |
import os
def _recursive_update(d, u):
"""
Yanked from ``http://stackoverflow.com/questions/3232943/``
Recursively update dictionary ``d`` with ``u``
"""
for k, v in u.iteritems():
if isinstance(v, dict):
r = _recursive_update(d.get(k, {}), v)
d[k] = r
else:... | {
"content_hash": "1258bfc31f1debe9dfca0acfd7c49b58",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 69,
"avg_line_length": 26.78787878787879,
"alnum_prop": 0.5769230769230769,
"repo_name": "jcmcken/pallium",
"id": "b390ba2b214d24a99b925bbacdb448d361459464",
"size": "884",... |
"""Implementations of different data feeders to provide data for TF trainer."""
# Copyright 2015-present Scikit Flow Authors. All Rights Reserved.
#
# 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 Li... | {
"content_hash": "eab75bf8018db90ba48c8f79e3e2e048",
"timestamp": "",
"source": "github",
"line_count": 413,
"max_line_length": 100,
"avg_line_length": 38.64164648910412,
"alnum_prop": 0.6046744783507738,
"repo_name": "panmari/tensorflow",
"id": "3a33dd7a70b456a756cf46f4de2c604dd95f8358",
"size": "... |
exec(open('functional/tests/_standalone_rst_defaults.py').read())
# Source and destination file names.
test_source = "standalone_rst_latex.txt"
test_destination = "standalone_rst_latex.tex"
# Keyword parameters passed to publish_file.
writer_name = "latex"
# Settings
# use "smartquotes" transition:
settings_override... | {
"content_hash": "8b8430eb380060d6ce7a3cc7f151867f",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 65,
"avg_line_length": 28.75,
"alnum_prop": 0.7565217391304347,
"repo_name": "kawamon/hue",
"id": "0809fcc939566ddfeba6e96da8eee72e955cad50",
"size": "345",
"binary": fal... |
from collections import defaultdict
from datetime import datetime
import logging
import pytz
from website.settings import KEEN as keen_settings
from keen.client import KeenClient
logger = logging.getLogger(__name__)
class DailyReporter:
def report(self, report_date):
"""build reports for the given date... | {
"content_hash": "93ac65658222c33219c666b50054a9f6",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 103,
"avg_line_length": 36.015151515151516,
"alnum_prop": 0.6243163651661758,
"repo_name": "cslzchen/osf.io",
"id": "e37a1ee1ac9b972c1f8e0769d412547c34da3e9c",
"size": "237... |
import six
import yaml
from django import template
from django.template import loader
from django.test.utils import override_settings
from django.urls import reverse
from openstack_dashboard import api
from openstack_dashboard.test import helpers as test
INDEX_URL = reverse('horizon:project:api_access:index')
API_U... | {
"content_hash": "561f852f362cb8c4c49012ed91fcc50c",
"timestamp": "",
"source": "github",
"line_count": 351,
"max_line_length": 82,
"avg_line_length": 39.37321937321937,
"alnum_prop": 0.597684515195369,
"repo_name": "noironetworks/horizon",
"id": "982e5aac949ccdba2a0c421dc1ed3185cfe64430",
"size": ... |
#!/usr/bin/env python3
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Tests for enum_preprocess.py.
This test suite contains various tests for the C++ -> Java enum generator.
"""
import collections
from datetime import da... | {
"content_hash": "0c93905f93d26f277164570b3fbbf8e8",
"timestamp": "",
"source": "github",
"line_count": 783,
"max_line_length": 80,
"avg_line_length": 34.33588761174968,
"alnum_prop": 0.5858285289194718,
"repo_name": "nwjs/chromium.src",
"id": "c14f2a085edbce9037b6a2453b3d687119baae48",
"size": "26... |
from __future__ import absolute_import, division, print_function, unicode_literals
import app
from splunklib.searchcommands import app_root, execute
from os import environ, path
import sys
pypy_argv = ['pypy', path.join(app_root, 'bin', 'generatetext.py')] + sys.argv[1:]
pypy_environ = dict(environ)
pypy_environ.pop... | {
"content_hash": "a26791b7343c6e58d6780c4b26a25aed",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 117,
"avg_line_length": 40.857142857142854,
"alnum_prop": 0.7517482517482518,
"repo_name": "sullivanmatt/splunk-sdk-python",
"id": "aec19e2f912b6509c0eded1a0be8d33c62f1a62a",... |
n, k = map(int, input().split())
str = input()
dictionary = dict((letter, str.count(letter)) for letter in set(str))
for item in range(26):
if k == 0:
break
key = chr((item + ord('a')))
if key in dictionary:
if dictionary[key] >= k:
dictionary[key] -= k
k = 0
... | {
"content_hash": "0dbc32fb9563dafcc116e2aa2866d80a",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 69,
"avg_line_length": 23.178571428571427,
"alnum_prop": 0.5069337442218799,
"repo_name": "AHJenin/acm-type-problems",
"id": "0b2a279024ca7a383259f1daf049a7eb153c9d08",
"si... |
"""
==================
Default Resolvers
==================
This module holds all the default resolvers used by "BaseSettings".
Normally you don't have to import something form this module, Resolver
are found automatic based on the default type or the name of the key.
based on the following steps we try to find... | {
"content_hash": "b11201367cd3775b4eafe66cbf432cae",
"timestamp": "",
"source": "github",
"line_count": 1349,
"max_line_length": 148,
"avg_line_length": 37.415122312824316,
"alnum_prop": 0.5424088126324966,
"repo_name": "loek17/settingslib",
"id": "62ad42c2c5d7d36e3495946654802ef82f77ac3a",
"size":... |
from django.conf.urls import url
from services import views
urlpatterns = [
# service configurations
url(r'^(?P<id>\d+)/$', views.profile, name='profile'),
url(r'^create/', views.create, name='create'),
url(r'^(?P<id>\d+)/delete/$', views.delete, name='delete'),
url(r'^(?P<id>\d+)/edit/$', views.update, name='upd... | {
"content_hash": "4e7762092a78b9172559cfc47716f779",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 60,
"avg_line_length": 33.81818181818182,
"alnum_prop": 0.6370967741935484,
"repo_name": "omwomotieno/tunza_v3",
"id": "25ef6301aff431999cf4d51ed37f936327f1f325",
"size": "... |
import os
import json
import sys
import pydoc
import textwrap
import typing
from datetime import datetime
from coupling import fs
from fnmatch import fnmatch
try:
from os.path import samefile
except ImportError:
from shutil import _samefile as samefile
import logging
logger = logging.getLogger(__name__)
de... | {
"content_hash": "f2c41ffaa34eeeaa71ac323ec84e322e",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 116,
"avg_line_length": 27.936363636363637,
"alnum_prop": 0.6384640416531077,
"repo_name": "yyang179/ngta",
"id": "148ec17928cf427411fc5b12a1c76b074f629653",
"size": "3098... |
import json
from django.http import HttpResponse
def render_json(view_func):
""" render http response to json decorator
"""
def wrap(request, *args, **kwargs):
retval = view_func(request, *args, **kwargs)
if isinstance(retval, HttpResponse):
retval.mimetype = 'application/json;... | {
"content_hash": "657663374df1153649c8beef42fdf3c3",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 83,
"avg_line_length": 32,
"alnum_prop": 0.626953125,
"repo_name": "zym1115718204/xspider",
"id": "e7d927c0b25d5296ddd4a10011c01b1afdda32c6",
"size": "603",
"binary": fal... |
import argparse
import logging
from neutronclient.common import utils
from neutronclient.neutron import v2_0 as neutronV20
def _format_fixed_ips(port):
try:
return '\n'.join([utils.dumps(ip) for ip in port['fixed_ips']])
except Exception:
return ''
class ListPort(neutronV20.ListCommand):
... | {
"content_hash": "d16de6888df96c25bd709a62ba45842d",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 74,
"avg_line_length": 34.64670658682635,
"alnum_prop": 0.5732803318354649,
"repo_name": "CiscoSystems/python-neutronclient",
"id": "f8ac9a9f49fe093df67e7ec58a0e59bcc42a3c1c... |
class Fail(Exception):
pass
class InvalidArgument(Fail):
pass
| {
"content_hash": "b6533deb596b34ccfbc50ac236a1fb44",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 28,
"avg_line_length": 14.2,
"alnum_prop": 0.704225352112676,
"repo_name": "samuel/kokki",
"id": "1fa8779f78d90051967d0f28441bba24beda1854",
"size": "72",
"binary": false,... |
import os
import re
import sys
from setuptools import setup, find_packages
needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
pytest_runner = ['pytest-runner'] if needs_pytest else []
def find_version(*paths):
fname = os.path.join(*paths)
with open(fname) as fhandler:
version_file = fhan... | {
"content_hash": "0bdca4f1acb9b8454f2dda77a21a8e85",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 79,
"avg_line_length": 28.764705882352942,
"alnum_prop": 0.6080436264485344,
"repo_name": "yuyang0/pymesos",
"id": "792f7c0f9bfc49a2566523fd13c2b0bbc1fc0956",
"size": "1467... |
import numpy as np
# import py.cat
import re
def drop_brackets(cat):
if cat.startswith('(') and \
cat.endswith(')') and \
find_closing_bracket(cat, 0) == len(cat)-1:
return cat[1:-1]
else:
return cat
def find_closing_bracket(source, start):
open_brackets = 0
for i, c i... | {
"content_hash": "8260827ce0971bc91c80bd763efc6b68",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 70,
"avg_line_length": 25.938053097345133,
"alnum_prop": 0.5110883657454793,
"repo_name": "masashi-y/myccg",
"id": "efae7fb952a2e822a282b5d00b5f6087f91b376c",
"size": "293... |
"""
Defines clients for connecting to different services.
"""
import gmusicapi
import playcl.util
class GooglePlayClient(object):
"""
A client for connecting to Google Play for music.
"""
def __init__(self, email, password):
"""
Creates a client that is logged in using the given credentials.
"""
if not... | {
"content_hash": "46a364d1ba7d08658f23655a88c8c64a",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 87,
"avg_line_length": 22.126582278481013,
"alnum_prop": 0.6584668192219679,
"repo_name": "cadyyan/Play-Cl",
"id": "a4eb53db709ce3af343f355e3b0ddad664faf8ed",
"size": "1748... |
from __future__ import absolute_import, division, print_function
"""
Build a ply lexer, but without the implicit magic and global
state, just load prebuilt ply parser and lexers at roughly the
same cost of loading a Python module.
"""
import functools
from ply.lex import Lexer, LexerReflect
from ply.yacc import Parser... | {
"content_hash": "71cb0a3c4ae5f5b83d172fe56cc59f6c",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 64,
"avg_line_length": 26.77777777777778,
"alnum_prop": 0.6894882434301521,
"repo_name": "zeeshanali/blaze",
"id": "56e33ae5f8f210aa306f4a1189337197bfbe8194",
"size": "1446... |
import os
import shlex
import sys
from pathlib import Path
from subprocess import PIPE, STDOUT, run
ACTION_PATH = Path(os.environ["GITHUB_ACTION_PATH"])
ENV_PATH = ACTION_PATH / ".black-env"
ENV_BIN = ENV_PATH / ("Scripts" if sys.platform == "win32" else "bin")
OPTIONS = os.getenv("INPUT_OPTIONS", default="")
SRC = os... | {
"content_hash": "85133f0c750e8d3908415bc74e690993",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 85,
"avg_line_length": 30.822222222222223,
"alnum_prop": 0.6705118961788031,
"repo_name": "psf/black",
"id": "ff9d4112aed7f19f14930284ef38ee6134a8bc05",
"size": "1387",
"... |
import json
import os
import time
import traceback
import math
from swift import gettext_ as _
from eventlet import Timeout
import six
from six.moves.urllib.parse import quote
import swift.common.db
from swift.container.sync_store import ContainerSyncStore
from swift.container.backend import ContainerBroker, DATADIR... | {
"content_hash": "d4b154c2467b9aaf07cbbd470a4edda1",
"timestamp": "",
"source": "github",
"line_count": 898,
"max_line_length": 79,
"avg_line_length": 47.17817371937639,
"alnum_prop": 0.5893641127319077,
"repo_name": "swiftstack/swift",
"id": "0292320fbec899e0599751aed0b993ca063f17a3",
"size": "429... |
import zlib
import base64
def decode_base64_and_inflate( b64string ):
decoded_data = base64.b64decode( b64string )
return zlib.decompress( decoded_data , -15)
def deflate_and_base64_encode( string_val ):
zlibbed_str = zlib.compress( string_val )
compressed_string = zlibbed_str[2:-4]
return base6... | {
"content_hash": "675e6dd272739e6d3d7c88ecf5cd0b83",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 70,
"avg_line_length": 35.702127659574465,
"alnum_prop": 0.5214541120381406,
"repo_name": "yv84/pyph",
"id": "031e562d4c0f36c5b9bdf8af4ac422bfa5617a60",
"size": "2309",
"... |
from __future__ import print_function
import paddle.fluid as fluid
import paddle.fluid.layers as layers
from paddle.fluid.layers import detection
from paddle.fluid.framework import Program, program_guard
import unittest
class TestDetection(unittest.TestCase):
def test_detection_output(self):
program = Pr... | {
"content_hash": "6b34058d35eb344fa0692849fac76673",
"timestamp": "",
"source": "github",
"line_count": 578,
"max_line_length": 80,
"avg_line_length": 36.97923875432526,
"alnum_prop": 0.4956021334331431,
"repo_name": "tensor-tang/Paddle",
"id": "d4151428c8a61e976fb593c8cf9363d6cfccdebf",
"size": "2... |
"Core classes and exceptions for lacrm"
from __future__ import print_function
import logging
import requests
import json
from lacrm.utils import LacrmArgumentError, BaseLacrmError
from os.path import expanduser
LOGGER = logging.getLogger(__name__)
class Lacrm(object):
"""Less Annoying CRM Instance
An insta... | {
"content_hash": "aa45e3a6819b4e1bc14830b24e3ba23a",
"timestamp": "",
"source": "github",
"line_count": 361,
"max_line_length": 130,
"avg_line_length": 34.33240997229917,
"alnum_prop": 0.469985476843634,
"repo_name": "HighMileage/lacrm",
"id": "f13eb056eaa301db1388887bb89ea73174e2dc4a",
"size": "12... |
from __future__ import print_function
import pika, uuid
SERVER = 'gose.fiehnlab.ucdavis.edu'
FOUT = open(str(uuid.uuid1()) +'.csv', 'wb')
def callback(ch, method, properties, body):
FOUT.write(body)
FOUT.write(b'\n')
FOUT.flush()
if __name__ == '__main__':
credentials = pika.PlainCredentials('sajjan'... | {
"content_hash": "40df1c7528ae11b9288f068304321bd2",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 81,
"avg_line_length": 27.541666666666668,
"alnum_prop": 0.7155824508320726,
"repo_name": "berlinguyinca/spectra-hash",
"id": "6840a6e9cd1b6e44f71d3b7eac6219256538295d",
"s... |
""" Contains the base classes for mechanical EM-style score reels."""
# score_reel.py
# Mission Pinball Framework
# Written by Brian Madden & Gabe Knuth
# Released under the MIT License. (See license info at the end of this file.)
# Documentation and more info at http://missionpinball.com/mpf
import logging
import ti... | {
"content_hash": "f47708b3ee47a8edba375faaf5b5c24e",
"timestamp": "",
"source": "github",
"line_count": 1267,
"max_line_length": 83,
"avg_line_length": 42.42620363062352,
"alnum_prop": 0.6001599880939092,
"repo_name": "spierepf/mpf",
"id": "d071bcc72ecb3cb327a8b3df2dc88f9946568bd6",
"size": "53754"... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('topics', '0022_auto_20170306_0242'),
]
operations = [
migrations.AddField(
model_name='programmingexerciselanguage',
name='s... | {
"content_hash": "9a69269531ab27c08165c3b43a7fcc14",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 53,
"avg_line_length": 22.473684210526315,
"alnum_prop": 0.5971896955503513,
"repo_name": "uccser/cs-unplugged",
"id": "acf88f1882b36425727dcd71150192796178178a",
"size": "... |
from oslo.config import cfg
import six
from solum.common import exception
from solum.tests import base
class ExceptionTestCase(base.BaseTestCase):
"""Test cases for exception code."""
def test_with_kwargs(self):
exc = exception.ResourceNotFound(name='application', id='green_paint')
self.asse... | {
"content_hash": "8aff2a21ebe56ad829d5d310f39c47f6",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 78,
"avg_line_length": 37.86274509803921,
"alnum_prop": 0.6240290005178664,
"repo_name": "jamesyli/solum",
"id": "e7e31d97599667eb51ef14ee0b9f01b7d8dd677b",
"size": "2567",... |
import mock
from oslo_utils import importutils
import six
from heat.common import exception
from heat.common.i18n import _
from heat.common import template_format
from heat.engine import resource
from heat.engine import rsrc_defn
from heat.engine import scheduler
from heat.tests import common
from heat.tests import ut... | {
"content_hash": "b51e53fb2753b3d836281d9874ff1633",
"timestamp": "",
"source": "github",
"line_count": 441,
"max_line_length": 79,
"avg_line_length": 46.48299319727891,
"alnum_prop": 0.6263720181472267,
"repo_name": "gonzolino/heat",
"id": "5b3bd9ee7e7d5794e115e563c57cebb65f1cf6fe",
"size": "21133... |
from __future__ import print_function
# Copyright 2019 Google LLC
#
# 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 app... | {
"content_hash": "e0ed50c52d7c2804b2851e3164b140d7",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 74,
"avg_line_length": 29.225806451612904,
"alnum_prop": 0.7141280353200883,
"repo_name": "google/myelin-acorn-electron-hardware",
"id": "87e74e90aef954236ae9389fe4c28d6e9984... |
"""
sentry.utils.data_filters.py
~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import fnmatch
import ipaddress
import six
from django.utils.encoding import force_text
from sentry i... | {
"content_hash": "92cba4bb4489c72b94e8ac8d47af6e13",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 92,
"avg_line_length": 29.758928571428573,
"alnum_prop": 0.675967596759676,
"repo_name": "gencer/sentry",
"id": "2b675273597a7a1263d43a963bddbccc6c38f333",
"size": "3333",... |
"""
A linked list is said to contain a cycle if any node is visited more than once while traversing the list.
Complete the function provided for you in your editor. It has one parameter: a pointer to a Node object named that points to the head of a linked list. Your function must return a boolean denoting whether ... | {
"content_hash": "5df06a695946d738c6a2698c5f6a14f6",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 301,
"avg_line_length": 25.05426356589147,
"alnum_prop": 0.6036509900990099,
"repo_name": "lemming52/white_pawn",
"id": "369160fe1e7c8d308c7cf0c7935eab5e8733570c",
"size":... |
"""
couchbasekit.fields
~~~~~~~~~~~~~~~~~~~
:website: http://github.com/kirpit/couchbasekit
:copyright: Copyright 2012, Roy Enjoy <kirpit *at* gmail.com>, see AUTHORS.txt.
:license: MIT, see LICENSE.txt for details.
* :class:`couchbasekit.fields.CustomField`
* :class:`couchbasekit.fields.ChoiceField`
* :class:`couchb... | {
"content_hash": "cd18ef724decfbbd4dea764a01ccb5aa",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 80,
"avg_line_length": 32.963157894736845,
"alnum_prop": 0.617276065783171,
"repo_name": "rbin/Django-Unchained",
"id": "bc5a8f88041137bd78670c790de9914d7bcace3a",
"size":... |
import os, sys
from identifiers import Identifiers
# add python module logger to path
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'logger'))
from logger import Logger
# add python module device files to path
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'device_files'))
from device_i... | {
"content_hash": "d2d71939232b6f329b9693355a659b7e",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 96,
"avg_line_length": 27.059322033898304,
"alnum_prop": 0.6617601002192296,
"repo_name": "chrism333/xpcc",
"id": "ddcf99f15c32f7b9d82c9c7de3684076080245a2",
"size": "3524... |
__author__ = 'darshanhegde'
"""
Reads in all the chunks of paragraph vectors generated and puts them in a single
numpy aray. Finds the nearest neighbour sentences to given sentences.
"""
import os
import sys
import numpy as np
import pickle
def pickle_load(in_file_path):
in_file = open(in_file_path, "rU")
d... | {
"content_hash": "a35cca0709abf21bd1296ab9cb9879f0",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 125,
"avg_line_length": 36.58163265306123,
"alnum_prop": 0.6178521617852162,
"repo_name": "darshanhegde/ParagraphVec",
"id": "ef254600bb4fed318ead4c85411a8fe3af4f9324",
"si... |
import base64
import copy
import datetime
import functools
import os
import string
import tempfile
import fixtures
import iso8601
import mock
from oslo.config import cfg
from nova.api.ec2 import cloud
from nova.api.ec2 import ec2utils
from nova.api.ec2 import inst_state
from nova.api.metadata import password
from nov... | {
"content_hash": "83f4b9f94e8108a8e592cd11bcb80c78",
"timestamp": "",
"source": "github",
"line_count": 3182,
"max_line_length": 79,
"avg_line_length": 44.83689503456945,
"alnum_prop": 0.5196430949527234,
"repo_name": "srajag/nova",
"id": "d9ff15e2826fd85986f53e668173a10c76aaf583",
"size": "143496"... |
from toee import *
import char_editor
def CheckPrereq(attachee, classLevelled, abilityScoreRaised):
#Many Shot, Point Blank Shot and Rapid Shot are required either standard feats or from the ranger class
if char_editor.has_feat(feat_manyshot) or char_editor.has_feat(feat_ranger_manyshot):
if char_editor.has_feat... | {
"content_hash": "2d54af71ba3a5bb92d3e5deab0a9115f",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 104,
"avg_line_length": 38.666666666666664,
"alnum_prop": 0.7672413793103449,
"repo_name": "GrognardsFromHell/TemplePlus",
"id": "223da01cc55aaa5786d5fb71a971e99e8920c4e2",
... |
import sys
import binascii
from twisted.internet.defer import inlineCallbacks
from autobahn.twisted.component import Component, run
from autobahn.twisted.util import sleep
from autobahn.wamp.types import SubscribeOptions
AUTHMETHOD, TRANSPORT, SERIALIZER = sys.argv[1].split('-')
if AUTHMETHOD not in ['anonymous', 'tic... | {
"content_hash": "4ad56c4a04e83b74835f65695bce1c7e",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 92,
"avg_line_length": 30.694117647058825,
"alnum_prop": 0.5415868148715983,
"repo_name": "crossbario/crossbar-examples",
"id": "15004e6c3f116867206b24e3179622362784216a",
... |
from __future__ import print_function
from twisted.trial import unittest
from twisted.python.failure import Failure
from twisted.internet import reactor
from twisted.internet.defer import Deferred, inlineCallbacks
from twisted.python import log as txlog
from scrapy.http import Request, Response
from scrapy.spider impo... | {
"content_hash": "93a1f2f5441ad934985016c03aada2c4",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 92,
"avg_line_length": 41.66015625,
"alnum_prop": 0.6470698546647914,
"repo_name": "nett55/scrapy",
"id": "443894feb828ae8417b7026ba00afd5b02564f9f",
"size": "10665",
"b... |
from .dev_settings import * # noqa
# These endpoints will throw an error on the django debug panel
EXCLUDED_DEBUG_URLS = [
"/content/storage",
]
DEBUG_PANEL_ACTIVE = True
def custom_show_toolbar(request):
return not any(
request.path.startswith(url) for url in EXCLUDED_DEBUG_URLS
) # noqa F405... | {
"content_hash": "eeb01c10842a39ff1d312f1e16f5b0b5",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 74,
"avg_line_length": 26.125,
"alnum_prop": 0.7049441786283892,
"repo_name": "DXCanas/content-curation",
"id": "79f9ddac6ee9fef94e49fc7b9c72703b2f4da237",
"size": "627",
... |
"""
Low-level LAPACK functions (:mod:`scipy.linalg.lapack`)
=======================================================
This module contains low-level functions from the LAPACK library.
.. versionadded:: 0.12.0
.. note::
The common ``overwrite_<>`` option in many routines, allows the
input arrays to be overwrit... | {
"content_hash": "f0e5a1c58ec9048a3019e25606708b97",
"timestamp": "",
"source": "github",
"line_count": 1036,
"max_line_length": 77,
"avg_line_length": 15.083011583011583,
"alnum_prop": 0.6147446563419942,
"repo_name": "anntzer/scipy",
"id": "3da8a03ce5a675bc40015f888eee44bbc6d55d9b",
"size": "1562... |
from __future__ import absolute_import
from __future__ import with_statement
from mock import Mock
from celery.concurrency.threads import NullDict, TaskPool, apply_target
from celery.tests.utils import Case, mask_modules, mock_module
class test_NullDict(Case):
def test_setitem(self):
x = NullDict()
... | {
"content_hash": "07c7de5d1cf856b4a0b5a5141bf60b85",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 76,
"avg_line_length": 30.55,
"alnum_prop": 0.5777414075286416,
"repo_name": "ask/celery",
"id": "2b12e18aff2a29ff252a768ca2952212db116ad9",
"size": "1833",
"binary": fal... |
import datetime
import uuid
from django.utils import datetime_safe
from keystoneauth1.access import access
from keystoneauth1.access import service_catalog
from keystoneclient.v3 import domains
from keystoneclient.v3 import projects
from keystoneclient.v3 import roles
from keystoneclient.v3 import users
import request... | {
"content_hash": "4f93ad76315aacd04653c3def70e31d7",
"timestamp": "",
"source": "github",
"line_count": 341,
"max_line_length": 75,
"avg_line_length": 32.03225806451613,
"alnum_prop": 0.43916506454270804,
"repo_name": "NeCTAR-RC/horizon",
"id": "81429efbf84f486b9a4363a94600fb0d8519ba7c",
"size": "1... |
'''This module exposes the post bug that Eric Moritz is experiences
where smisk segfaults
:See: Fixed in 77188bce80d5 <http://hg.hunch.se/smisk/diff/77188bce80d5/src/Stream.c>
'''
from smisk import wsgi
import smisk.core
from StringIO import StringIO
def safe_copyfileobj(fsrc, fdst, length=16*1024, size=0):
'''
... | {
"content_hash": "84b87377e7393c5dacbe3e20e93c21d4",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 87,
"avg_line_length": 30.896551724137932,
"alnum_prop": 0.6389508928571429,
"repo_name": "rsms/smisk",
"id": "1ba89b2f9f519b2d9532789da1dc007acd51829e",
"size": "1792",
... |
from string import Template
from datetime import date
bitcoinDir = "./";
inFile = bitcoinDir+"/share/qt/Info.plist"
outFile = "Sharecoin-Qt.app/Contents/Info.plist"
version = "unknown";
fileForGrabbingVersion = bitcoinDir+"bitcoin-qt.pro"
for line in open(fileForGrabbingVersion):
lineArr = line.replace(" ... | {
"content_hash": "000877d9f3a73edc98449b658efead6b",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 69,
"avg_line_length": 27.291666666666668,
"alnum_prop": 0.7099236641221374,
"repo_name": "FrancoisJ/ShareCoin",
"id": "92d89ade32b192def287488025236695489a06a8",
"size": "... |
import ConfigParser
import var
import irc
# Reading from ini files.
# Return dictionary of option:data.
def fill_dict (filename, section, raw_path = False):
if filename.startswith("ini/") or raw_path:
filepath = filename
else:
filepath = "ini/{}/{}".format(irc.server, filename)
c... | {
"content_hash": "08c273242e0e0da5aa5484c1f389af5e",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 87,
"avg_line_length": 28.84552845528455,
"alnum_prop": 0.5997745208568207,
"repo_name": "mikotohe2/deskbot",
"id": "cbdb6792a97207041d4de29278a74f2ce5d7c78d",
"size": "35... |
import unittest
import re
import os
from urllib.request import urlopen
import ssl
from themis.modules.general import regex_base_url, get_looker_instance, format_output
class GeneralTestCase(unittest.TestCase):
base_url = os.environ.get('LOOKERSDK_BASE_URL')
def test_legacy_instance_url(self):
self.as... | {
"content_hash": "3056afa4a4380d297dcfa8b94aa5f5ee",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 140,
"avg_line_length": 53.28846153846154,
"alnum_prop": 0.6726813424756406,
"repo_name": "looker-open-source/themis",
"id": "58ccc113a7287588334b1a2aa8e7ec66191e3d0a",
"si... |
"""
Google Web App gateway tests.
@since: 0.3.1
"""
import unittest
from StringIO import StringIO
from google.appengine.ext import webapp
import pyamf
from pyamf import remoting
from pyamf.remoting.gateway import google as _google
class WebAppGatewayTestCase(unittest.TestCase):
def setUp(self):
unitt... | {
"content_hash": "4f3f56e9521e729f6aee5c5a20749b1a",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 78,
"avg_line_length": 26.56,
"alnum_prop": 0.6147590361445783,
"repo_name": "cardmagic/PyAMF",
"id": "e7f9cff448412baa1c1f85df0f6a1394a6a9209f",
"size": "3423",
"binary... |
"""Tests for haiku._src.nets.vqvae."""
import functools
from absl.testing import absltest
from absl.testing import parameterized
from haiku._src import stateful
from haiku._src import test_utils
from haiku._src import transform
from haiku._src.nets import vqvae
import jax
import jax.numpy as jnp
import numpy as np
... | {
"content_hash": "cfb306702292b6eae84b6f6a68557713",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 80,
"avg_line_length": 37.738461538461536,
"alnum_prop": 0.6506318793314309,
"repo_name": "deepmind/dm-haiku",
"id": "d8279a581a195929eca68c9c4e7a5b0f52a05fa8",
"size": "8... |
import logging
from time import monotonic as monotonic_clock
class _LogRateLimit(logging.Filter):
def __init__(self, burst, interval, except_level=None):
logging.Filter.__init__(self)
self.burst = burst
self.interval = interval
self.except_level = except_level
self.logger =... | {
"content_hash": "9005c64f3621d80fdf598dad1f43c436",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 77,
"avg_line_length": 29.93525179856115,
"alnum_prop": 0.6327805815909637,
"repo_name": "openstack/oslo.log",
"id": "05ad581f28a141dfd910847be2055b3c7f50c756",
"size": "4... |
"""Utils for the booking app."""
from django.contrib.sessions.models import Session
from .models import Booking
def get_booking(request):
"""
Returns the booking that is in progress for the current user or None
We assume that a user can only have one booking that is in-progress.
TODO: This implemen... | {
"content_hash": "0a5a4cc6270b8923df1904efd344e7c2",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 79,
"avg_line_length": 34.35294117647059,
"alnum_prop": 0.6639554794520548,
"repo_name": "zcqHub/django-booking",
"id": "c2d754b14137c0ecf7cf0383c5cfbb06babaaa0d",
"size": ... |
import logging
import json
import multiprocessing
import os
import signal
from threading import Lock
import time
import tornado.httpserver
import tornado.netutil
import tornado.web
from zmq.eventloop import ioloop
from threading import Thread
from twisted.internet import reactor
from db_store import Obdb
from market ... | {
"content_hash": "7ae78156a071bf4b4c39242c6aae81c3",
"timestamp": "",
"source": "github",
"line_count": 373,
"max_line_length": 91,
"avg_line_length": 33.6970509383378,
"alnum_prop": 0.5586761078844776,
"repo_name": "STRML/OpenBazaar",
"id": "c39ef54b1e43240ff11bcb30f81056e597be0908",
"size": "1256... |
import _plotly_utils.basevalidators
class IdsValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="ids", parent_name="contourcarpet", **kwargs):
super(IdsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
e... | {
"content_hash": "b231620e615f5d34d2c8d9eb1e721f1d",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 81,
"avg_line_length": 35.81818181818182,
"alnum_prop": 0.6192893401015228,
"repo_name": "plotly/plotly.py",
"id": "b9e45d342c9059f57f596295e16377e809bbd772",
"size": "394"... |
import numpy as np
import pandas as pd
import grizzly_impl
from lazy_op import LazyOpResult, to_weld_type
from weld.weldobject import *
from utils import *
from groupbyweld import GroupByWeld
from seriesweld import SeriesWeld
class DataFrameWeld:
"""Summary
Attributes:
df (TYPE): Description
... | {
"content_hash": "dcef529c0c1fb90409f1875a89001e5b",
"timestamp": "",
"source": "github",
"line_count": 508,
"max_line_length": 95,
"avg_line_length": 33.960629921259844,
"alnum_prop": 0.5103756086250869,
"repo_name": "weld-project/weld",
"id": "ea4b17d01417416220f2317bdf110a78f6b6de34",
"size": "1... |
from nose.tools import assert_raises
from libsheep.protocol import Message, MessagePart, Context, Command
def test_message_args_set_message_parts():
m = Message('H', 'SUP')
assert isinstance(m.context, MessagePart)
assert isinstance(m.command, MessagePart)
def test_message_parts_have_arg_codes():
m = ... | {
"content_hash": "d6099338986c1978e12c0275b1ba985d",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 68,
"avg_line_length": 31.6,
"alnum_prop": 0.7075949367088608,
"repo_name": "exogen/80sheep",
"id": "bffa255d1dbcd6c2c304297a12bf26a8019fc2b6",
"size": "790",
"binary": f... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/mission/quest_item/shared_rovim_minnoni_q1_needed.iff"
result.attribute_template_id = -1
result.stfName("loot_nboo_n","rovim_minnoni_q1_needed")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
... | {
"content_hash": "ee3144c242e25a5e1ae3f0c00d9bc93e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 90,
"avg_line_length": 25.846153846153847,
"alnum_prop": 0.7053571428571429,
"repo_name": "anhstudios/swganh",
"id": "a2d1340d04a399d0393d4978d95e43d209645d51",
"size": "48... |
"""
https://leetcode.com/problems/median-of-two-sorted-arrays/
"""
import sys
import random
class Solution:
"""
Wrapper class for Leetcode solution
"""
def findMedianSortedArrays(self, nums1: [int], nums2: [int]) -> float:
"""
Parameters
----------
nums1: [int]
... | {
"content_hash": "cf53832012056903f365d2f6d7bd96f9",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 128,
"avg_line_length": 34.62686567164179,
"alnum_prop": 0.5695402298850575,
"repo_name": "paulness/paulness.github.io",
"id": "1292dd778885668050efde10fa65d342d8df72cd",
... |
"""
WSGI config for horseapi project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETT... | {
"content_hash": "f84d0da7ff1ad07490b10d10d5399cfe",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 24.5625,
"alnum_prop": 0.7709923664122137,
"repo_name": "deforestg/Air-Horse-One",
"id": "965b2f77225654f6f21f48c2e794a65314092e83",
"size": "393",
... |
from base import BaseBot
from scraping import general, defense, scraper
import sys
class DefenderBot(BaseBot):
def __init__(self, browser, config, planets):
self.defense_client = defense.Defense(browser, config)
self.general_client = general.General(browser, config)
self.planets = planets... | {
"content_hash": "fd4643fbb2f02b52732b188138049856",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 129,
"avg_line_length": 50.72727272727273,
"alnum_prop": 0.6158474142345111,
"repo_name": "winiciuscota/OG-Bot",
"id": "2ca6bd8fb97e2c4d3c2b71b5cec9676fac7a45c5",
"size": ... |
#!/usr/bin/env python
#
# Copyright 2013, Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
import struct
import threading
import time
import logging
import unittest
from vtproto import topodata_pb2
from vtdb import keyrange_consta... | {
"content_hash": "6ec42b02a02c08a5bdc4ba5a56a39423",
"timestamp": "",
"source": "github",
"line_count": 857,
"max_line_length": 80,
"avg_line_length": 43.47024504084014,
"alnum_prop": 0.6091963279110968,
"repo_name": "guokeno0/vitess",
"id": "32d43b286a6e91ac21c930236d0f13ef53df2512",
"size": "3725... |
"""
WSGI config for proyecto_eees project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANG... | {
"content_hash": "8f3591fbb2b31db69f5196d31cb2aee0",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 25.25,
"alnum_prop": 0.7722772277227723,
"repo_name": "cgutierr3z/proyecto-eees",
"id": "5562cff12b94a05938520ecbd2597498089537cd",
"size": "404",
... |
from flask import current_app
from manager_rest import constants
from manager_rest.storage import models
from manager_rest.security.authorization import authorize
from manager_rest.security import MissingPremiumFeatureResource
from manager_rest.manager_exceptions import (
BadParametersError,
MethodNotAllowedEr... | {
"content_hash": "b7e98455df35920b6f0432b9a7ff79d9",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 78,
"avg_line_length": 36.63157894736842,
"alnum_prop": 0.6258210180623974,
"repo_name": "cloudify-cosmo/cloudify-manager",
"id": "3f2f0b4e6751b815cd7bf4e0a0a2113666770b46",... |
"""Basic tests for gradients."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.eager import backprop
from tensorflow.python.eager import context
from tensorflow.python.eager import custom_gradient
from tensorflow.python.eager impor... | {
"content_hash": "b7a0e3ed1a39f73e0a5013acb2c1a8ac",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 80,
"avg_line_length": 31.141361256544503,
"alnum_prop": 0.5946536650975117,
"repo_name": "ychfan/tensorflow",
"id": "c97cb62125741ccdec495d925651a3559bd5fb9c",
"size": "6... |
import socket
from multiprocessing.pool import ThreadPool
from time import sleep
import six
from kombu import Connection, Consumer, Queue
from kombu.exceptions import MessageStateError
from kombu.utils import nested
from microservices.helpers.logs import InstanceLogger
from microservices.utils import get_logger
_log... | {
"content_hash": "721aa05e90d8f54a376b21c0528198af",
"timestamp": "",
"source": "github",
"line_count": 404,
"max_line_length": 92,
"avg_line_length": 34.31683168316832,
"alnum_prop": 0.5401759953837276,
"repo_name": "viatoriche/microservices",
"id": "2f72b02463230e304247fd07ade57af06a258a1a",
"siz... |
"""
Creates all the various image sizes and file structure
for a cordova project.
`python generate.py`
"""
import os
import sys
import logging
import subprocess
import optparse
from config import PLATFORMS
class Converter(object):
"""
Takes an icon image and splash image and generates a folder that includ... | {
"content_hash": "f595e6950265ca97e8f707084944bbe1",
"timestamp": "",
"source": "github",
"line_count": 239,
"max_line_length": 150,
"avg_line_length": 35.17573221757322,
"alnum_prop": 0.5582252884501011,
"repo_name": "collingreen/cordova-icon-splash-generator",
"id": "873afd47531098941db617e9a0b4c62... |
import unittest
from .simple import Base
class CrashTest(Base):
config = 'test/crash1.yaml'
def testBadRequest(self):
conn = self.http()
conn.request('GET', '/')
resp = conn.getresponse()
self.assertTrue(b'Not Found' in resp.read())
conn.close()
def testGoodReques... | {
"content_hash": "966b8ce5c6e3416219e676e426c8c09c",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 60,
"avg_line_length": 26.93877551020408,
"alnum_prop": 0.5522727272727272,
"repo_name": "tailhook/zerogw",
"id": "cedc9dc3d933b1551f7cf7a65a4aaeb6f7cc2c95",
"size": "1320"... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('spanish_content', '0010_auto_20170304_1848'),
]
operations = [
migrations.AddField(
model_name='eduprogram',
name='video',
... | {
"content_hash": "5541f9b04d7b526c079fdc8055eb951e",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 55,
"avg_line_length": 21.666666666666668,
"alnum_prop": 0.6025641025641025,
"repo_name": "DjangoGirlsSeoul/lightandleadership",
"id": "7950c0eeb49041ab8b71decbeb240076f498a5... |
import logging
from django.conf import settings
from django.test import TestCase
from django.test.client import Client
log = logging.getLogger(__name__)
class URLTests(TestCase):
def setUp(self):
self.client = Client()
self.client.login(
username=settings.TEST_USERNAME,
pa... | {
"content_hash": "0dd874487dc6140a63170360bf5e99c0",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 60,
"avg_line_length": 29.916666666666668,
"alnum_prop": 0.5459610027855153,
"repo_name": "MattAgile/django-spa-crm",
"id": "5b7ec670d7fac97286d064891606262d9b3f957c",
"siz... |
first = input('write the price of the first product: R$ ')
first = int(first)
second = input('write de price of the second product: R$ ')
second = int(second)
third = input('write the price of the third product: R$ ')
third = int(third)
if first < second < third or first < third < second and first:
pr... | {
"content_hash": "13a37e35de657ff6c1e1ab63a57d7697",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 63,
"avg_line_length": 34.8421052631579,
"alnum_prop": 0.6676737160120846,
"repo_name": "jucimarjr/IPC_2017-1",
"id": "debacba9b1a87f9cc747c9d94fd1023b2577af73",
"size": "9... |
""" Example file submission script
Requires the `aws` command line utility: http://aws.amazon.com/cli/
"""
import hashlib
import json
import os
import requests
import subprocess
import sys
import time
host = 'REPLACEME/'
encoded_access_key = 'UISQC32B'
encoded_secret_access_key = 'ikc2wbs27minvwo4'
path = 'test.fast... | {
"content_hash": "b27c803f3ecfd84a7556ba142bb366b4",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 94,
"avg_line_length": 28.186046511627907,
"alnum_prop": 0.6206683168316832,
"repo_name": "ENCODE-DCC/pyencoded-tools",
"id": "888ac405b5f9e5bce873bb9b0aa05a3f0c2e9560",
"... |
from dns.resolver import Resolver
import socket
import ipaddress
import os
DEBUG = os.environ.get("EEHDEBUG_SPF")
__version__ = "0.0.1"
PASS = "pass"
FAIL = "fail"
SOFTFAIL = "softfail"
NEUTRAL = "neutral"
PERMERROR = "permerror"
TEMPERROR = "temperror"
NONE = "none"
SMTP_PERM_FAIL = 550
statusmap = {
PASS: (2... | {
"content_hash": "4b7e7d0fb434f64023349a36f55e4d73",
"timestamp": "",
"source": "github",
"line_count": 212,
"max_line_length": 87,
"avg_line_length": 22.31132075471698,
"alnum_prop": 0.5317124735729387,
"repo_name": "Varbin/EEH",
"id": "be265ac2319e4c2406a07ec4162963ae837401f4",
"size": "4730",
... |
def main():
sum = 0.0
count = 0
print ("Press [Enter] to exit.")
temp = input("What's the temperature? ")
while temp != "":
sum += float(temp)
count += 1
temp = input("What's the temperature? ")
print("The average temperature is:", sum / count)
if __name__ == '__main... | {
"content_hash": "4c2aaf284b0bae99a1b9a91e1e02da12",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 53,
"avg_line_length": 21.055555555555557,
"alnum_prop": 0.5303430079155673,
"repo_name": "SeattleCentral/ITC110",
"id": "6f6607c5a692f9a3c7362078465c6f237016bd87",
"size":... |
'''
Copyright 2014-2015 Teppo Perä
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 i... | {
"content_hash": "e25237b4de9cf8dcc3203f49ce4ff8e1",
"timestamp": "",
"source": "github",
"line_count": 298,
"max_line_length": 116,
"avg_line_length": 33.81879194630873,
"alnum_prop": 0.5906925977376464,
"repo_name": "justanr/py3traits",
"id": "3451d3716d54e18f20805a9c0aba0303b9831d37",
"size": "1... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('invoices', '0005_auto_20160109_1041'),
]
operations = [
migrations.AddField(
model_name='invoiceposition',
... | {
"content_hash": "8abf8003ee1d8544be834757c2c9db8a",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 174,
"avg_line_length": 40.64912280701754,
"alnum_prop": 0.6098403107466551,
"repo_name": "samupl/simpleERP",
"id": "56d87c9f69108c8ef28a9e3f8ead6995edae39ac",
"size": "238... |
import random
class Guid:
def __innit__(self):
| {
"content_hash": "d8182b17894cd285fbfc804d727b18f3",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 21,
"avg_line_length": 8.833333333333334,
"alnum_prop": 0.6226415094339622,
"repo_name": "SeVenOPS/DevChat",
"id": "7a3f5c35cfbc72686e9c780687c6235ce35c9e9a",
"size": "54",
... |
import pytest
from {{ cookiecutter.project_slug }}.users.models import User
from {{ cookiecutter.project_slug }}.users.tests.factories import UserFactory
@pytest.fixture(autouse=True)
def media_storage(settings, tmpdir):
settings.MEDIA_ROOT = tmpdir.strpath
@pytest.fixture
def user(db) -> User:
return User... | {
"content_hash": "d624a69b6bff429e984fedd698e9345e",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 77,
"avg_line_length": 23.571428571428573,
"alnum_prop": 0.7545454545454545,
"repo_name": "trungdong/cookiecutter-django",
"id": "7095a4714b216ee3cc67248eeff51da72db96d06",
... |
import _plotly_utils.basevalidators
class UValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="u", parent_name="cone", **kwargs):
super(UValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwargs... | {
"content_hash": "554785f3c99980725761c72b94d1242d",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 70,
"avg_line_length": 35.25,
"alnum_prop": 0.5910165484633569,
"repo_name": "plotly/python-api",
"id": "9d58adf8ef8e67ec6d0256641ee4222597f49538",
"size": "423",
"binary... |
from django import forms
from cropimg.widgets import CIImgWidget, CIThumbnailWidget
class CIImageField(forms.ImageField):
widget = CIImgWidget
class CIThumbnailField(forms.CharField):
widget = CIThumbnailWidget
def __init__(self, image_field, size, *args, **kwargs):
"""
:param image_f... | {
"content_hash": "704f36c94813ad87ccca475102ac748e",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 96,
"avg_line_length": 32.026315789473685,
"alnum_prop": 0.6055875102711585,
"repo_name": "rewardz/cropimg-django",
"id": "9bbdfcdf26c19c26b24b35a2fd90d910f59b654b",
"size"... |
from tkinter import *
#Ventana
#se le asigna a la variable ventana dicho sea de paso la ventana
ventana = Tk()
#se le asigna el nombre que va a tener la ventana
ventana.title("Computadores CE")
#definimos el tamaño minimo que va a tener nuestra ventana especificamente corresponden al ancho x alto
ventana.mi... | {
"content_hash": "859364eca34dbeda00c83556e9756f0f",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 103,
"avg_line_length": 34.625,
"alnum_prop": 0.7460890493381468,
"repo_name": "baiper06/tutorial-tkinter",
"id": "db3a81e1ce42321cb130ca5a161e02e3f2a3b140",
"size": "887",... |
import os
import sys
from stat import ST_SIZE
from logging import debug, info, warning, error
from Utils import getTextFromXml, getTreeFromXml, formatSize, unicodise, calculateChecksum, parseNodes
from Exceptions import S3UploadError
from collections import defaultdict
class MultiPartUpload(object):
MIN_CHUNK_SIZ... | {
"content_hash": "7ac244df7a18ef6ac1f75342bfa1e3af",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 227,
"avg_line_length": 45.58673469387755,
"alnum_prop": 0.5647453833240067,
"repo_name": "sharethis-github/OpenSource",
"id": "ed671301369d4762ccc117950a40fb46861caae9",
... |
"""private module containing functions used to emit INSERT, UPDATE
and DELETE statements on behalf of a :class:`.Mapper` and its descending
mappers.
The functions here are called only by the unit of work functions
in unitofwork.py.
"""
import operator
from itertools import groupby
from .. import sql, util, exc as sa... | {
"content_hash": "cb41d059f040459daab4fd0106112977",
"timestamp": "",
"source": "github",
"line_count": 1079,
"max_line_length": 78,
"avg_line_length": 37.77386468952734,
"alnum_prop": 0.5300309141763581,
"repo_name": "FRC-Team-3140/north-american-happiness",
"id": "35631988bba6dfd9736c0d3e129cdbcf41... |
class Solution:
def minMeetingRooms(self, intervals: 'List[Interval]') -> 'int':
START = 1
END = 0 # Sort by placing end first
points = []
for i in intervals:
points.append((i.start,START))
points.append((i.end,END))
points = sorted(points)
ma... | {
"content_hash": "be1905d82ccc2d48cd95d171379183f5",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 68,
"avg_line_length": 30.94736842105263,
"alnum_prop": 0.4846938775510204,
"repo_name": "akras14/cs-101",
"id": "5e1c91ece48ad899339fbe0fae768a8c11c9925b",
"size": "721",
... |
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SITE_ROOT = os.path.dirname(BASE_DIR)
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.9/howto/deployment/che... | {
"content_hash": "89671cebabde57b0e27dd610e6b2a2c6",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 91,
"avg_line_length": 28.508196721311474,
"alnum_prop": 0.6760590377611654,
"repo_name": "letsmeet-click/letsmeet.click",
"id": "469f19724d0a2527f5ea212fa490c7c18b6895bc",
... |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | {
"content_hash": "9ce4baa8578ec32bad8820e25e3da0d2",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 112,
"avg_line_length": 38.111111111111114,
"alnum_prop": 0.7478134110787172,
"repo_name": "alexus37/AugmentedRealityChess",
"id": "d7162d34e2a614a4745fdd8621b7fb270ec6e3ec",... |
import time
import array
import itertools
import math
import platform
import json
import collections
import argparse
import arrayfunc
##############################################################################
########################################################
def InitOptionData(arraycode, arraysize, f... | {
"content_hash": "0058319aa842b1cc4c45b5daa4ba20c4",
"timestamp": "",
"source": "github",
"line_count": 686,
"max_line_length": 134,
"avg_line_length": 30.113702623906704,
"alnum_prop": 0.6804143673153258,
"repo_name": "m1griffin/arrayfunc",
"id": "f4f91dd688834ad43787412df8b32bb0093b9ef0",
"size":... |
"""
Driver for Linux servers running LVM.
"""
import math
import os
import socket
from oslo.config import cfg
from cinder.brick import exception as brick_exception
from cinder.brick.local_dev import lvm as lvm
from cinder import exception
from cinder.image import image_utils
from cinder.openstack.common import file... | {
"content_hash": "ccc9f58aeb4f7731f009ed082f377327",
"timestamp": "",
"source": "github",
"line_count": 619,
"max_line_length": 79,
"avg_line_length": 40.701130856219706,
"alnum_prop": 0.5619591966341192,
"repo_name": "github-borat/cinder",
"id": "f984a506c4786b0fc0b5afd95292facca00bd15d",
"size": ... |
def break_words(stuff):
"""This function breaks stuff into words"""
words = stuff.split(' ')
return words
def sort_words(words):
"""Sorts list of words alphabetically"""
return sorted(words)
def print_first_word(words):
"""removed and prints first word in a list"""
first = words.pop(0)
print first
def print_... | {
"content_hash": "2e03f2b3aab4bf2f14545fecf66a0241",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 63,
"avg_line_length": 24.53125,
"alnum_prop": 0.7197452229299363,
"repo_name": "cohadar/learn-python-the-hard-way",
"id": "15891d32ef19ef111324c88f8b73201ae742efde",
"size... |
"""Unit tests for classroom_domain.py"""
from __future__ import annotations
from core.domain import classroom_domain
from core.tests import test_utils
class ClassroomDomainTests(test_utils.GenericTestBase):
def test_that_domain_object_is_created_correctly(self) -> None:
classroom_data = classroom_domai... | {
"content_hash": "32aeb94e046635bb300d809171afe220",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 74,
"avg_line_length": 40,
"alnum_prop": 0.7055555555555556,
"repo_name": "oppia/oppia",
"id": "ba6624c21e1b89dfc3521b8ed154e0a90606eddb",
"size": "1343",
"binary": false... |
"""Routines related to PyPI, indexes"""
import sys
import os
import re
import mimetypes
import posixpath
from pip.log import logger
from pip.util import Inf, normalize_name, splitext, is_prerelease
from pip.exceptions import (
DistributionNotFound, BestVersionAlreadyInstalled, InvalidWheelFilename,
Unsupporte... | {
"content_hash": "1c6dfad3b1f4ce2454d2619668e0a9ef",
"timestamp": "",
"source": "github",
"line_count": 1107,
"max_line_length": 79,
"avg_line_length": 37.15356820234869,
"alnum_prop": 0.5148921685428773,
"repo_name": "blueyed/pip",
"id": "295246a7d56111b5ce0dd04e6f995dbb702f0c14",
"size": "41129",... |
from json import JSONEncoder
import random
import os
import uuid
import json
from .config import Config
# for function serialization
class HCEncoder(JSONEncoder):
def default(self, o):
if(hasattr(o, '__call__')): # is function
return "function:" +o.__module__+"."+o.__name__
else:
try:
... | {
"content_hash": "7ee8e91333e2f6ccdaa5538b500ceab1",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 148,
"avg_line_length": 29.992481203007518,
"alnum_prop": 0.5632990724492354,
"repo_name": "255BITS/hyperchamber",
"id": "129e36f21bd86dea89e8963756759dd433df4a06",
"size"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.