text stringlengths 4 1.02M | meta dict |
|---|---|
import ddapp.objectmodel as om
from ddapp.asynctaskqueue import AsyncTaskQueue
class GraspSearchPlanner(object):
def __init__(self, ikPlanner, robotModel, jointController, sensorJointController, planPlaybackFunction, showPoseFunction, playbackRobotModel):
self.ikPlanner = ikServer
self.robotMode... | {
"content_hash": "f015f007fc73b8e870bd109881a7056c",
"timestamp": "",
"source": "github",
"line_count": 923,
"max_line_length": 175,
"avg_line_length": 35.070422535211264,
"alnum_prop": 0.6647513129440841,
"repo_name": "gizatt/director",
"id": "31003390b18a2e5ed73f53bc6b4ed1b60fe47cb1",
"size": "32... |
"""Serializers for channels_fields"""
import copy
import logging
from typing import List
from django.contrib.auth import get_user_model
from django.db import transaction
from rest_framework import serializers
from rest_framework.exceptions import ValidationError
from channels.serializers.channels import ChannelAppear... | {
"content_hash": "136f3979d19eaab832b53643a6f0a4f0",
"timestamp": "",
"source": "github",
"line_count": 319,
"max_line_length": 88,
"avg_line_length": 35.08150470219436,
"alnum_prop": 0.5983379501385041,
"repo_name": "mitodl/open-discussions",
"id": "a0312313a991219c760cce2c8559e32cd13ddb99",
"size... |
from pyzabbix import ZabbixAPI
import sys
username="wentian"
password="65107318"
zapi = ZabbixAPI("http://zabbix.ustack.com")
zapi.login(username, password)
print "Connected To Zabbix API Version %s" % zapi.api_version()
hostgroup_id = sys.argv[1]
status = int(sys.argv[2])
def get_hostgroup_id(hostgroup_name):
... | {
"content_hash": "e6abf85719366631f4a0ed55f179ebb2",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 64,
"avg_line_length": 27.96969696969697,
"alnum_prop": 0.6890574214517876,
"repo_name": "zhaozhilong1993/demon",
"id": "caa79dbfed081a807510debd41511326ef86661b",
"size": ... |
from django.test import TestCase
from nose.tools import ok_, eq_
from ..forms import ReportForm
from ..models import Report
class ReportFormTest(TestCase):
def tearDown(self):
Report.objects.all().delete()
def test_invalid_data(self):
data = {'url': 'random', 'description': 'Invalid'}
... | {
"content_hash": "4be261509cd0770213543137876516a4",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 74,
"avg_line_length": 28.82758620689655,
"alnum_prop": 0.6088516746411483,
"repo_name": "mozilla/popcorn_maker",
"id": "b37f772e294d11ab14dd77b621bc8e5a7bce6683",
"size": ... |
from __future__ import (unicode_literals, division, absolute_import, print_function)
REMOVE_THIS_KEY = object()
def mergeargs(argvalue, remove=False):
if not argvalue:
return None
r = {}
for subval in argvalue:
mergedicts(r, dict([subval]), remove=remove)
return r
def _clear_special_values(d):
'''Remove ... | {
"content_hash": "818aa6de04f0a99d2fb9b9f683f6fdd9",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 84,
"avg_line_length": 21.988505747126435,
"alnum_prop": 0.6576058546785154,
"repo_name": "S0lll0s/powerline",
"id": "c06ab30ccd24b16b2daec45ed08aaa0a97ef2a59",
"size": "19... |
from __future__ import (absolute_import, division)
__metaclass__ = type
import pwd
import os
import pytest
from ansible import constants
from ansible.module_utils.six import StringIO
from ansible.module_utils.six.moves import configparser
from ansible.module_utils._text import to_text
@pytest.fixture
def cfgparser... | {
"content_hash": "7f66e979750e8760824d103d387c0412",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 61,
"avg_line_length": 23.70873786407767,
"alnum_prop": 0.6601146601146601,
"repo_name": "thaim/ansible",
"id": "fa9902e77539aed51cc54307c89e89b00662608d",
"size": "3203",... |
from django.test.client import Client
from django.urls import reverse
from django.test import TestCase
from nose.tools import *
from django.contrib.auth import get_user_model
User = get_user_model()
from amon.apps.settings.models import data_retention_model
class TestDataRetention(TestCase):
def setUp(self):
... | {
"content_hash": "44437953b4756240b491d89eabfffb4e",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 85,
"avg_line_length": 24.444444444444443,
"alnum_prop": 0.6345454545454545,
"repo_name": "martinrusev/amonone",
"id": "4f30f9e7f2d7fcd6599ef5b82a4604f5c2a68299",
"size": "... |
import argparse
from fabric.api import *
from fabric.contrib.files import exists
from dlab.meta_lib import *
import os
from fabric.contrib.files import exists
from dlab.fab import *
parser = argparse.ArgumentParser()
parser.add_argument('--cluster_name', type=str, default='')
parser.add_argument('--spark_version', typ... | {
"content_hash": "3035778644bea14d6c48f24926b7bd16",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 137,
"avg_line_length": 54.22950819672131,
"alnum_prop": 0.6689842805320435,
"repo_name": "epam/DLab",
"id": "9e55ca1738551d7bd97750c0efad95639f55cac3",
"size": "4077",
"... |
from django.db import models
class Ledjure(models.Model):
''' A ledjure of transactions'''
shoky = models.DecimalField(max_digits=6,decimal_places=2,null=True,blank=True,) # Yeah not More than 4 digits!
shoky_description = models.TextField(blank=True,null=True) #You better ha... | {
"content_hash": "5835f06cdb45ccbb5a09e95f00921887",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 149,
"avg_line_length": 56.083333333333336,
"alnum_prop": 0.7087667161961367,
"repo_name": "NavaneethBhat/lekkachara",
"id": "c0dfee6975d6270112f520ee8c774e5ea398bf99",
"si... |
"""Xgboost pyspark integration submodule for helper functions."""
import inspect
import json
import logging
import sys
from threading import Thread
from typing import Any, Callable, Dict, List, Set, Type
import pyspark
from pyspark import BarrierTaskContext, SparkContext
from pyspark.sql.session import SparkSession
fr... | {
"content_hash": "e8db937da023cf403eadb12dec9451f7",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 87,
"avg_line_length": 34.342465753424655,
"alnum_prop": 0.6747108097327483,
"repo_name": "dmlc/xgboost",
"id": "36705459ae4f6f4f308b0c92e2028916b8c0fe07",
"size": "5014",... |
"""Dump memory that does not belong to any symbol."""
import sys
from elftools.elf.elffile import ELFFile # type: ignore
import memdf.collect
import memdf.report
import memdf.select
from memdf import Config, ConfigDescription
CONFIG: ConfigDescription = {
**memdf.util.config.CONFIG,
**memdf.select.SECTION... | {
"content_hash": "56984e29358c05b9d5b03791683c7c90",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 73,
"avg_line_length": 30.729166666666668,
"alnum_prop": 0.4711864406779661,
"repo_name": "project-chip/connectedhomeip",
"id": "21db90650144d45b4bab054ef86599a6e3f294b8",
... |
from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.contrib.auth.backends import ModelBackend
class ShibbolethUserBackend(ModelBackend):
"""
This backend is to be used in conjunction with the ``OpenIdUserMiddleware... | {
"content_hash": "3858c87f5f0fdab42f78309ce2cef712",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 79,
"avg_line_length": 39.71830985915493,
"alnum_prop": 0.6365248226950354,
"repo_name": "biancini/Django-AccountLinking",
"id": "155d3e2154e507e17646f8cb3dac2408d34df23d",
... |
import base64
import re
import marshmallow
from nose.tools import assert_equal, assert_in, assert_true, raises
from . import BaseTestCase
from tuxedo_mask import models, views
from tuxedo_mask.views import users_view
class TestContainsAtLeast:
def test(self):
value = 'foo'
validator = users_vie... | {
"content_hash": "03273995f2316f812512b056962c3c68",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 76,
"avg_line_length": 32.18,
"alnum_prop": 0.5922933499067744,
"repo_name": "dnguyen0304/tuxedo-mask",
"id": "cd1e5f239ff18bd86dc30b36df454357eebbda16",
"size": "3243",
... |
"""sqlalchemy.orm.interfaces.LoaderStrategy
implementations, and related MapperOptions."""
from .. import exc as sa_exc, inspect
from .. import util, log, event
from ..sql import util as sql_util, visitors
from .. import sql
from . import (
attributes, interfaces, exc as orm_exc, loading,
unitofwork, util a... | {
"content_hash": "c9172e73056421a0068715c7b0b0db93",
"timestamp": "",
"source": "github",
"line_count": 1598,
"max_line_length": 81,
"avg_line_length": 36.084480600750936,
"alnum_prop": 0.5667065535958934,
"repo_name": "bootandy/sqlalchemy",
"id": "b9ef5808bb9de5a01e346a8739fe31d9f822ad97",
"size":... |
"""
Collection of test scripts for datumio
"""
| {
"content_hash": "e2277c18f7b1c2eb5c6f835f504dc1b0",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 38,
"avg_line_length": 15.666666666666666,
"alnum_prop": 0.7021276595744681,
"repo_name": "longubu/datumio",
"id": "3c5fe08fad615020039d0b7e030af0fea0473e85",
"size": "47",
... |
"""Implementation of DPLL algorithm
Further improvements: eliminate calls to pl_true, implement branching rules,
efficient unit propagation.
References:
- http://en.wikipedia.org/wiki/DPLL_algorithm
- http://bioinformatics.louisville.edu/ouyang/MingOuyangThesis.pdf
"""
from sympy.core import Symbol
from sympy imp... | {
"content_hash": "d06ee55b0310814e5eb9b49d37781e62",
"timestamp": "",
"source": "github",
"line_count": 290,
"max_line_length": 98,
"avg_line_length": 31.455172413793104,
"alnum_prop": 0.5959219469414602,
"repo_name": "pernici/sympy",
"id": "a769b6ba0cef063f230e6406446cfc462eeeb4dd",
"size": "9122"... |
from classes.om import Density
class Seismic(Density):
tid = 'seismic'
_TID_FRIENDLY_NAME = 'Seismic'
_SHOWN_ATTRIBUTES = [
('_oid', 'Object Id')
]
def __init__(self, data, **attributes):
super().__init__(data, **attributes)
def _get_max_dimensions(self):
return 5
| {
"content_hash": "475b3bd9bb1f10191d534285a4ed5d24",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 44,
"avg_line_length": 19.875,
"alnum_prop": 0.5691823899371069,
"repo_name": "giruenf/GRIPy",
"id": "402b0206858017aa817e6f71aec14356719b64ac",
"size": "318",
"binary": ... |
import re
from django.core.exceptions import ValidationError
from django.core.validators import BaseValidator
from django.core.validators import MinLengthValidator
from django.core.validators import RegexValidator
from django.utils.translation import ugettext_lazy as _
from django.conf import settings as django_setting... | {
"content_hash": "b2a3cc243536bd9293a9139b523b06f1",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 77,
"avg_line_length": 28.645833333333332,
"alnum_prop": 0.5729090909090909,
"repo_name": "eldest-daughter/django-strongerpassword",
"id": "9f59a65c123dba25bdb9a011067e2dc01... |
from __future__ import print_function
import time
from proton.reactor import Reactor
# Not every event goes to the reactor's event handler. If we have a
# separate handler for something like a scheduled task, then those
# events aren't logged by the logger associated with the reactor's
# handler. Sometimes this is use... | {
"content_hash": "8b821dc15765d69b0e86f029780233e6",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 70,
"avg_line_length": 31.102564102564102,
"alnum_prop": 0.720527617477329,
"repo_name": "Karm/qpid-proton",
"id": "3cbe11c21cba0fcb603e6d1f509e6db814162899",
"size": "2021... |
"""Tests for Java Cache IDX file parser."""
import unittest
from plaso.parsers import java_idx
from tests.parsers import test_lib
class IDXTest(test_lib.ParserTestCase):
"""Tests for Java Cache IDX file parser."""
def testParse602(self):
"""Tests the Parse function on a version 602 IDX file."""
parser... | {
"content_hash": "dded2ac508a6315ba0acd22be2353e11",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 77,
"avg_line_length": 34.64102564102564,
"alnum_prop": 0.6839378238341969,
"repo_name": "joachimmetz/plaso",
"id": "966b57be123ae0d9a13934368ffd35cb5c5ecddb",
"size": "274... |
"""Setup/installation tests for this package."""
from dmc.sitecontent.testing import IntegrationTestCase
from plone import api
class TestInstall(IntegrationTestCase):
"""Test installation of dmc.sitecontent into Plone."""
def setUp(self):
"""Custom shared utility setup for tests."""
self.por... | {
"content_hash": "e92c0b590eb97b24fe85c6c64a5d4b09",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 78,
"avg_line_length": 39.724137931034484,
"alnum_prop": 0.7152777777777778,
"repo_name": "a25kk/dmc",
"id": "bf2ff43dd61877eca5a46a5eec45cf7ee8e54454",
"size": "1176",
"... |
from oslo_serialization import jsonutils
from nova.db import api as db
from nova.objects import base
from nova.objects import fields
@base.NovaObjectRegistry.register
class ResourceMetadata(base.NovaObject):
# Version 1.0: Initial version
VERSION = "1.0"
# This is parent object of specific resources.
... | {
"content_hash": "3fdfeed8721a0dd1ba02853990095492",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 77,
"avg_line_length": 31.78125,
"alnum_prop": 0.6443788921665028,
"repo_name": "rahulunair/nova",
"id": "6ac97a57855e35f325f2e6e3b03953759277991e",
"size": "3657",
"bina... |
from time import time
from twisted.python import log
class Session(object):
"""A period of time that a Vehicle is online."""
def __init__(self, start_timestamp):
self.start_timestamp = start_timestamp
self.rides = []
self.in_progress = True
self.end_timestamp = None
def en... | {
"content_hash": "1ddd9e6ce54cf7bebe84a1ecb4bcccc0",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 76,
"avg_line_length": 30.756756756756758,
"alnum_prop": 0.5900702987697716,
"repo_name": "aj-michael/Hailstorm",
"id": "3f71ce25777223c3b4ff7476089f4e27651cf3e2",
"size": ... |
from base64 import urlsafe_b64encode
import pytest
from satosa.context import Context
from satosa.exception import SATOSAError, SATOSAConfigurationError
from satosa.internal_data import InternalRequest
from satosa.micro_services.custom_routing import DecideIfRequesterIsAllowed
TARGET_ENTITY = "entity1"
@pytest.fix... | {
"content_hash": "b19fedb6756dcaa107eadbb3104813fa",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 109,
"avg_line_length": 32.30379746835443,
"alnum_prop": 0.5920846394984326,
"repo_name": "irtnog/SATOSA",
"id": "46b7c6b4a037ea9fc0b7f336ed861f88317e66a9",
"size": "5104"... |
try:
from pint import UnitRegistry
except ImportError:
raise ImportError("The pint package is not installed, please install this library to use quantity fields.")
# Common unit registry
registry = UnitRegistry()
| {
"content_hash": "8cb96a75fa0714ecc721d8bb96b84499",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 111,
"avg_line_length": 31.571428571428573,
"alnum_prop": 0.7737556561085973,
"repo_name": "tjmcewan/odin",
"id": "a1ce5f7ec0be1140efad6ea0e31ce19b5a43044e",
"size": "245",
... |
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--files",nargs="+")
parser.add_argument("--patfile", type=argparse.FileType("r"))
args = parser.parse_args()
import subprocess,os,os.path as osp
from control4.config import CTRL_ROOT
from control4.misc.test_utils import filelist_from_patterns
from... | {
"content_hash": "f959b541777f7a8dadf6a9eb1d34f065",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 118,
"avg_line_length": 35.84375,
"alnum_prop": 0.7306015693112468,
"repo_name": "SFPD/rlreloaded",
"id": "c712dedafb20eb75922f9b8563d67ad8a4868e75",
"size": "1169",
"bin... |
from django.conf import settings
from django.db.models import Q
from django.core.exceptions import ValidationError
import re
APPEND_TO_SLUG = "-copy"
COPY_SLUG_REGEX = re.compile(r'^.*-copy(?:-(\d+)*)?$')
def is_valid_page_slug(page, parent, lang, slug, site, path=None):
"""Validates given slug depending on setti... | {
"content_hash": "98147c842f1bd05d4e6e39ed66e7779c",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 134,
"avg_line_length": 35.362637362637365,
"alnum_prop": 0.6093847110006215,
"repo_name": "pbs/django-cms",
"id": "4e2117873c06b71f1cfd7cead78ffc1cc3eefb2b",
"size": "3242... |
import logging
import multiprocessing
import os
import pickle
import sys
# Add the root dir to the path
sys.path.append(os.path.abspath(os.path.join(sys.path[0],'../')))
# Custom libs
from lib.ids import IDS
from lib.printer import Printer
from lib.flags import *
flags['output_value'] = 'pager'
flags['sig'] = True
f... | {
"content_hash": "3a505fce62e5d23a20501e0da1adb1b8",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 134,
"avg_line_length": 21.944444444444443,
"alnum_prop": 0.6310126582278481,
"repo_name": "ut-dacs/https-ids",
"id": "939eb057c5579537f787de809e859adc83e2b76e",
"size": "1... |
"""
A standalone partial implementation of sbt
https://www.solutionsbytext.com/api-support/api-documentation/
"""
from .resources import RequireVBT, RequestVBT, Carrier, SendTemplateMessage, GetMessageStatus
__all__ = [
'RequireVBT', 'SendTemplateMessage', 'Carrier', 'GetMessageStatus', 'RequestVBT'
]
__version... | {
"content_hash": "ee8a80da5590eb156f6fe50cf9ed3fc7",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 93,
"avg_line_length": 25.615384615384617,
"alnum_prop": 0.7357357357357357,
"repo_name": "worthwhile/sbt",
"id": "bcff984dd3f9fe4b5322f3efa2cbb42d16824889",
"size": "333",... |
from genericpath import isfile
import os
from os.path import isdir
from yaiep.core.WorkingMemory import WorkingMemory
##
# Fornisce un modo per poter garantire all'utente un'interazione più amichevole
# con il motore inferenziale
#
class UIManager:
##
# Richiede dei parametri all'utente per poter configurare ... | {
"content_hash": "a5bca17c488479e7ade021c17db93784",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 149,
"avg_line_length": 39.333333333333336,
"alnum_prop": 0.5087313816127376,
"repo_name": "aleSuglia/YAIEP",
"id": "6e70603e7c1524cf31559350fe8df26957f14a7c",
"size": "389... |
"""
This is just a stub to redirect a function to its new location. This module
and the containing package can be deleted after a few days.
"""
from metatools.deprecate import renamed_func
from sgfs.maya.workspace import open_parent_in_shotgun
# The only function that was exporter previously.
run = renamed_func(op... | {
"content_hash": "cb16cd47de8f30f1aad5f709b023883d",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 75,
"avg_line_length": 27.615384615384617,
"alnum_prop": 0.7604456824512534,
"repo_name": "westernx/sgfs",
"id": "0d28e83b5d2dfd76ce8a02d9235e2f1c86416121",
"size": "359",
... |
import copy
import hashlib
from bson.json_util import dumps
from datetime import datetime, timedelta
from eve.tests import TestBase
from eve.utils import parse_request, str_to_date, config, weak_date, \
date_to_str, querydef, document_etag, extract_key_values, \
debug_error_message, validate_filters
class Tes... | {
"content_hash": "640d8f899213bc8a1ed4abe2011e13e5",
"timestamp": "",
"source": "github",
"line_count": 305,
"max_line_length": 79,
"avg_line_length": 46.118032786885244,
"alnum_prop": 0.5844589790985355,
"repo_name": "hustlzp/eve",
"id": "fc2a66a508ed4c148ee456b4108137092dbb760b",
"size": "14091",... |
import unittest2 as unittest
from nose.plugins.attrib import attr
from mock import MagicMock, patch
import sys
from jnpr.junos.console import Console
if sys.version < '3':
builtin_string = '__builtin__'
else:
builtin_string = 'builtins'
@attr('unit')
class TestSerial(unittest.TestCase):
@patch('jnpr.ju... | {
"content_hash": "e299c976dc79c4e969ff9055af8fb074",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 76,
"avg_line_length": 38.82608695652174,
"alnum_prop": 0.6364315042926465,
"repo_name": "fostasha/pynet_test",
"id": "8a1a5e1f9838530f3c455047f588517b7b39893b",
"size": "2... |
from django.conf.urls import patterns, url
from stackclient.views import RegisterView
urlpatterns = patterns('',
url(r'^register$', RegisterView.as_view(), name='register'),
)
| {
"content_hash": "6c04d7ccf8db30bbadc29dc8e8c7848d",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 83,
"avg_line_length": 25.25,
"alnum_prop": 0.6633663366336634,
"repo_name": "JamesMura/furry-meme-py",
"id": "7d543ca7f259e502c9201ede7cba8e7be40c9d91",
"size": "202",
"b... |
from fabric.api import *
from fabric.tasks import execute
env.roledefs = {
'qemu': ['ec2-user@qemu-us1.cloudpebble.net', 'ec2-user@qemu-us2.cloudpebble.net'],
'ycmd': ['root@ycm2.cloudpebble.net', 'root@ycm3.cloudpebble.net', 'root@ycm4.cloudpebble.net'],
}
env.key_filename = ['~/.ssh/id_rsa', '~/Downloads/kat... | {
"content_hash": "c1ec4f05474806f8486fd1638ff79ee3",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 124,
"avg_line_length": 26.02836879432624,
"alnum_prop": 0.6474114441416894,
"repo_name": "math-foo/cloudpebble",
"id": "3ea5069b138e3dcc8cf771dc9f30c714865526a9",
"size":... |
import sys
import getpass
import cx_Oracle # the package used for accessing Oracle in Python
import login
import menu
import bookings
import user
import search
def connect(connection_url):
menu.clearScreen()
print("Connect to Airline Booking Database\n")
# get username
user = input("Oracle Username:... | {
"content_hash": "b519df85dadbf1fa4b54bdefc0e8e862",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 67,
"avg_line_length": 24.075949367088608,
"alnum_prop": 0.6088328075709779,
"repo_name": "k----n/AirlineBooking",
"id": "604f2094a8d3f1e3a2106774930ba1adbd3fa3ed",
"size":... |
"""Convenience functions for opening GUIs."""
# Authors: Christian Brodbeck <christianbrodbeck@nyu.edu>
#
# License: BSD-3-Clause
from ..utils import verbose, get_config, warn
@verbose
def coregistration(tabbed=False, split=True, width=None, inst=None,
subject=None, subjects_dir=None, guess_mri_s... | {
"content_hash": "b5dbbdcc4951ff7dc871be9e0c50616b",
"timestamp": "",
"source": "github",
"line_count": 296,
"max_line_length": 79,
"avg_line_length": 39.777027027027025,
"alnum_prop": 0.6065058603703074,
"repo_name": "pravsripad/mne-python",
"id": "569e01b396257ff5725033741baa8c58af0cafc6",
"size"... |
import sys
import cyclone.auth
import cyclone.escape
import cyclone.web
from twisted.python import log
from twisted.internet import reactor
from pycket.session import SessionMixin
class Application(cyclone.web.Application):
def __init__(self):
handlers = [
(r"/", MainHandler),
(r... | {
"content_hash": "c612e2ec4238a9471ae744f042f50a26",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 77,
"avg_line_length": 27.344827586206897,
"alnum_prop": 0.5565363598150483,
"repo_name": "fiorix/cyclone",
"id": "cf9b7cd9915330f9c638d777d9f126d9e5b002b3",
"size": "3043"... |
import graphene
from ...core.permissions import OrderPermissions, ProductPermissions
from ..core.enums import ReportingPeriod
from ..core.fields import FilterInputConnectionField, PrefetchingConnectionField
from ..decorators import permission_required
from ..descriptions import DESCRIPTIONS
from ..translations.mutatio... | {
"content_hash": "9bebb714ad3ca8467e61d6c444fe6a14",
"timestamp": "",
"source": "github",
"line_count": 423,
"max_line_length": 87,
"avg_line_length": 37.548463356974,
"alnum_prop": 0.7059119813637222,
"repo_name": "maferelo/saleor",
"id": "e9a2ea9d6bffa4401e0a7ca8cf3604285244a52b",
"size": "15883"... |
import unittest
from nova import crypto
from nova import flags
from nova import log as logging
from nova import test
from nova.auth import manager
from nova.api.ec2 import cloud
from nova.auth import fakeldap
FLAGS = flags.FLAGS
LOG = logging.getLogger('nova.tests.auth_unittest')
class user_generator(object):
d... | {
"content_hash": "dc8319c0b152f82e9dae5803446eb76c",
"timestamp": "",
"source": "github",
"line_count": 349,
"max_line_length": 79,
"avg_line_length": 46.893982808022926,
"alnum_prop": 0.5939753146767689,
"repo_name": "KarimAllah/nova",
"id": "bdc7f3142b4a706734ccd5d0dc204a6957670af5",
"size": "171... |
'''
7D2D entities/map markers Tornado Server
by: Adam Dybczak (RaTilicus)
'''
import time
import tornado.web, tornado.ioloop
import motor
from bson.json_util import loads as json_decode, dumps as json_encode
from tornado import gen
from handlers import IndexHandler, RecipesHandler, AboutHandler, LoginHandler, LogoutH... | {
"content_hash": "d4296b4e1f940741518f1f0f7abcbb93",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 107,
"avg_line_length": 28.523809523809526,
"alnum_prop": 0.6338341680578742,
"repo_name": "ratilicus/sdtd",
"id": "5d9838a4ab274edf160aa8b0e4cbc3460aeaefdf",
"size": "1816... |
import json
import os
import path
import shutil
import socket
import tempfile
import urllib2
from django.conf import settings
import mock
from nose.tools import eq_
from PIL import Image
import amo
import amo.tests
from addons.models import Addon
from amo.tests.test_helpers import get_image_path
from amo.urlresolver... | {
"content_hash": "ea42dae67b6d237405509d6cbbfc6c17",
"timestamp": "",
"source": "github",
"line_count": 306,
"max_line_length": 79,
"avg_line_length": 34.47712418300654,
"alnum_prop": 0.6283412322274882,
"repo_name": "jbalogh/zamboni",
"id": "478cc78d0ef3e22eb0839dd5a3ff5d794212e844",
"size": "1055... |
from datetime import datetime
import time
from pytibrv.Tibrv import *
import unittest
class TimerTest(unittest.TestCase, TibrvTimerCallback):
@classmethod
def setUpClass(cls):
status = Tibrv.open()
if status != TIBRV_OK:
raise TibrvError(status)
@classmethod
def tearDownCl... | {
"content_hash": "2154c0b122040fc141a507966a0912fa",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 79,
"avg_line_length": 26.439393939393938,
"alnum_prop": 0.5908309455587393,
"repo_name": "arienchen/pytibrv",
"id": "50c666539a9f0732ba14f668f035806f1133cbe7",
"size": "17... |
from os import scandir
from django.contrib import admin
from django import forms
from django.contrib.admin.widgets import FilteredSelectMultiple
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.models import User
from django.conf import settings
from .models import *
class Tal... | {
"content_hash": "7c7af0cc47b0b56a5c00858ea5a8e4a0",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 78,
"avg_line_length": 28.55778894472362,
"alnum_prop": 0.6802745029033961,
"repo_name": "ScanOC/trunk-player",
"id": "c3ab34b56c8ad8b76a538acbc5a6c5cac013ad96",
"size": "... |
from __future__ import absolute_import
import pytest
from django.http import HttpRequest
from rest_framework.exceptions import AuthenticationFailed
from sentry.api.authentication import ClientIdSecretAuthentication, DSNAuthentication
from sentry.models import ProjectKeyStatus
from sentry.testutils import TestCase
... | {
"content_hash": "2909f9cfe308f02293e6637ca96550b0",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 95,
"avg_line_length": 33.577319587628864,
"alnum_prop": 0.6751611912803193,
"repo_name": "mvaled/sentry",
"id": "8e270ac9115a00930a00f59d602c5134148ff3b6",
"size": "3257",... |
import eventlet
import os
import sys
if os.name == 'nt':
# eventlet monkey patching causes subprocess.Popen to fail on Windows
# when using pipes due to missing non blocking I/O support
eventlet.monkey_patch(os=False)
else:
eventlet.monkey_patch()
# If ../murano/__init__.py exists, add ../ to Python s... | {
"content_hash": "9a35ccf76b1ff0ec2dda653c4c037a1b",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 79,
"avg_line_length": 31,
"alnum_prop": 0.684863523573201,
"repo_name": "telefonicaid/murano",
"id": "3721f8d6deca01f30af94e8899d9588e20aca590",
"size": "2250",
"binary"... |
"""
Test basic DataFrame functionality.
"""
import pandas as pd
import pytest
import weld.grizzly as gr
def get_frames(cls, strings):
"""
Returns two DataFrames for testing binary operators.
The DataFrames have columns of overlapping/different names, types, etc.
"""
df1 = pd.DataFrame({
... | {
"content_hash": "cf5a669ca6df238ce2d5a198b038eea7",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 81,
"avg_line_length": 31.67,
"alnum_prop": 0.6248815914114304,
"repo_name": "sppalkia/weld",
"id": "519b501fb021ba52fd9fd84b6faa31a7557aa394",
"size": "3167",
"binary":... |
from PyQt4 import QtCore, QtGui
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(1100, 808)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.MinimumExpanding)
sizePolicy.setHorizontalStret... | {
"content_hash": "67ce35d63f6ed6e5565c01bcdcd66dd2",
"timestamp": "",
"source": "github",
"line_count": 504,
"max_line_length": 188,
"avg_line_length": 64.95238095238095,
"alnum_prop": 0.7231182795698925,
"repo_name": "singleswitch/ticker",
"id": "4f24ad50ae74cd6620ca06143c58e292c0da635a",
"size": ... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0002_auto_20180128_2257'),
]
operations = [
migrations.AlterField(
model_name='user',
name='id',
field=... | {
"content_hash": "a12fa06faf5adeb2ddc9e5d34d24b966",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 158,
"avg_line_length": 26.555555555555557,
"alnum_prop": 0.6359832635983264,
"repo_name": "DiegoCorrea/ouvidoMusical",
"id": "c8c8f011a809f6113b0ff315faeec208001682b0",
"s... |
"""
test correct setup/teardowns at
module, class, and instance level
"""
from __future__ import absolute_import, division, print_function
import pytest
def test_module_and_function_setup(testdir):
reprec = testdir.inline_runsource("""
modlevel = []
def setup_module(module):
assert n... | {
"content_hash": "1b033f864ba2c0e5ba9fe400a16625dd",
"timestamp": "",
"source": "github",
"line_count": 319,
"max_line_length": 94,
"avg_line_length": 27.61755485893417,
"alnum_prop": 0.5662883087400681,
"repo_name": "tareqalayan/pytest",
"id": "fc931f86720ac3903bfa205b7887c4df6b4e407b",
"size": "8... |
import logging
from django.contrib.auth import authenticate, login
from .crowd_client import crowd_validate_session, CrowdError
log = logging.getLogger('kompassi_crowd')
class KompassiCrowdAuthenticationMiddleware(object):
def process_request(self, request):
if request.user.is_anonymous():
... | {
"content_hash": "e99a59e1bddff82f300ee9272cc7ac90",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 85,
"avg_line_length": 27.82758620689655,
"alnum_prop": 0.6158612143742255,
"repo_name": "mniemela/kirppu",
"id": "7dee88f9c578f35977c419dd3329ef1e45cdd921",
"size": "807",... |
"""Copyright 2020 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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... | {
"content_hash": "5cbbf9d9aab98fbb6f193fb127bfb039",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 79,
"avg_line_length": 30.337349397590362,
"alnum_prop": 0.7029388403494837,
"repo_name": "googleinterns/via-content-understanding",
"id": "b2474ec4138f1ab385dc133579838ac0cd... |
"""The tests for the Home Assistant HTTP component."""
from datetime import timedelta
from ipaddress import ip_network
from unittest.mock import patch
from aiohttp import BasicAuth, web
from aiohttp.web_exceptions import HTTPUnauthorized
import pytest
from homeassistant.auth.providers import trusted_networks
from hom... | {
"content_hash": "0c0af4c1a0bbe3da55de9bd3dbfb95ec",
"timestamp": "",
"source": "github",
"line_count": 263,
"max_line_length": 85,
"avg_line_length": 33.136882129277566,
"alnum_prop": 0.6707974756167527,
"repo_name": "adrienbrault/home-assistant",
"id": "71c01630a671e6eee91b60d8dbd72a79001f5061",
... |
import db_objects as db
import Database
import datetime
import Functions
def movement_average_for_stamp(session, stamp):
current_trips = Functions.current_trips(session, 1)
deltas = [Functions.trip_movement(session, x, stamp, datetime.timedelta(minutes=6)) for x in
current_trips]
deltas = [... | {
"content_hash": "b9113d08c7abdd7daa503c7abe9e7753",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 96,
"avg_line_length": 30.75862068965517,
"alnum_prop": 0.7130044843049327,
"repo_name": "nettube/mbtapuller",
"id": "d0fc9d856e5c4507e07f33566071339aa60987e3",
"size": "89... |
'''
@author: Frank
'''
import os
import zstackwoodpecker.operations.deploy_operations as deploy_operations
import zstackwoodpecker.operations.config_operations as config_operations
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_util as test_util
USER_PATH = os.path.expanduser('~')
EXTRA_SU... | {
"content_hash": "dd619700cad5b4f2e6d99887766fcaec",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 89,
"avg_line_length": 32.46666666666667,
"alnum_prop": 0.728952772073922,
"repo_name": "zstackio/zstack-woodpecker",
"id": "e1a8e1d91e5f349b6559f63525e5201c4c91f50e",
"siz... |
"""
Common utilities.
"""
import os.path
import sys
import traceback
__all__ = [
'wraps',
'Emitter',
'samefile',
'sameuuid',
'setdefault',
'extend',
'decode_ay',
'exc_message',
'format_exc',
]
try:
from black_magic.decorator import wraps
except ImportError:
from functool... | {
"content_hash": "33f51df9e9bf9aa10f80efb1b6517854",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 77,
"avg_line_length": 24.559748427672957,
"alnum_prop": 0.5708066581306018,
"repo_name": "pstray/udiskie",
"id": "1b009b6db7cab30fa6b82470c431bc07ded5e249",
"size": "3905... |
def execute(args):
return args
| {
"content_hash": "6aac12f264997f3143135804c9303497",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 18,
"avg_line_length": 9.8,
"alnum_prop": 0.4897959183673469,
"repo_name": "mabotech/maboss.py",
"id": "8182694b0dc0d348a1d2deb6202ac27aa7409a7d",
"size": "51",
"binary": ... |
from scrapy.selector import Selector
from scrapy.spider import Spider
from familynames.items import FontFamilyItem
class NouvelleNoireSpider(Spider):
name = 'nouvellenoire'
allowed_domains = [
'nouvellenoire.ch'
]
start_urls = [
'https://nouvellenoire.ch/collections/all'
]
d... | {
"content_hash": "4e6fc006804575c696aaae424d7833a7",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 64,
"avg_line_length": 25.571428571428573,
"alnum_prop": 0.5628491620111732,
"repo_name": "lowks/fontbakery-cli",
"id": "a0067254ea41afb4a0eb6f6b556974bbd034ef9b",
"size": ... |
import tweepy
def loadkeys(filename):
""""
load parrt's keys/tokens from CSV file with form
consumer_key, consumer_secret, access_token, access_token_secret
"""
with open(filename) as f:
items = f.readline().strip().split(', ')
return items
consumer_key, consumer_secret, \
access... | {
"content_hash": "433010aac9b1da95ffef406beaa30fdd",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 80,
"avg_line_length": 27.074074074074073,
"alnum_prop": 0.707250341997264,
"repo_name": "parrt/msan692",
"id": "b58b9b49c68403226ba164397ee0a0aad915a154",
"size": "731",
... |
""" Unit test file for the InitCommand class.
"""
import os
import sys
import unittest
from io import StringIO
from snapshot_dbg_cli import cli_run
from snapshot_dbg_cli import data_formatter
from snapshot_dbg_cli.cli_services import CliServices
from snapshot_dbg_cli.gcloud_cli_service import GcloudCliService
from sn... | {
"content_hash": "bf2dde1a3ad8b84d847ce17b8845c358",
"timestamp": "",
"source": "github",
"line_count": 487,
"max_line_length": 91,
"avg_line_length": 43.65092402464066,
"alnum_prop": 0.6951735817104149,
"repo_name": "GoogleCloudPlatform/snapshot-debugger",
"id": "75e8b1575ddd8152b83e440bca182feb1365... |
"""
Tests for frameworks
"""
import inspect
from calvin.utilities import calvinlogger
from calvin.runtime.south.async import get_frameworks
from calvin.runtime.south.async import twistedimpl
from twisted.internet import defer, threads
import pytest
pytestmark = pytest.mark.unittest
_LOG = calvinlogger.get_logg... | {
"content_hash": "043f17f8f533b650027bd86ce9c26d8c",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 137,
"avg_line_length": 45.56962025316456,
"alnum_prop": 0.5325,
"repo_name": "EricssonResearch/calvin-base",
"id": "7165fb0fdcd8fa62ebbc492aa6b99b8f7734a3da",
"size": "420... |
"""Run an ssh agent and set SSH_AUTH_SOCK so that clients will use it
Example:
with ssh_agent.SshAgent() as agent:
agent.add_key(private_key_string)
# do ssh stuff
# as agent loses scope, the ssh agent is killed
"""
from __future__ import with_statement
import atexit
import tempfile
import os
... | {
"content_hash": "388e16bb443dc1709c3acdc2b0b1f9a8",
"timestamp": "",
"source": "github",
"line_count": 492,
"max_line_length": 120,
"avg_line_length": 31.010162601626018,
"alnum_prop": 0.5335911384938061,
"repo_name": "drewandersonnz/openshift-tools",
"id": "94f8b65dd7eb1e88015cc328f6a3930cdf586948"... |
"""
Helper functions to move files around.
"""
import os
from string import ascii_lowercase
def split_file_and_return_names(raw_data_file):
"""
Splits an input raw data file into files of different
line lengths. Returns the created files.
"""
rawfilesize = os.path.getsize(raw_data_file)
# ... | {
"content_hash": "20be4f042ec121d197fcd0a8c19f1bfc",
"timestamp": "",
"source": "github",
"line_count": 237,
"max_line_length": 132,
"avg_line_length": 40.65822784810127,
"alnum_prop": 0.5639269406392694,
"repo_name": "thomasgurry/amplicon_sequencing_pipeline",
"id": "b61328c31b012f11525705a4459bb41b... |
"""Plain text writer.
Use save() to save a page layout to a plain text file.
"""
def load(file_):
"""Die hard: loading a page layout from a plain text file is impossible."""
raise NotImplemented('Plain text parsing is neither available nor feaseable.')
def save(page, file_):
"""Save a page layout to a p... | {
"content_hash": "74283eb122f2f05f2197570a73515aa0",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 82,
"avg_line_length": 36,
"alnum_prop": 0.5813492063492064,
"repo_name": "ksa242/pdfsed-tools",
"id": "ac1f339494f4704050bdeb41ed0490a4879fd47c",
"size": "2427",
"binary... |
from google.cloud import aiplatform_v1beta1
def sample_update_dataset():
# Create a client
client = aiplatform_v1beta1.DatasetServiceClient()
# Initialize request argument(s)
dataset = aiplatform_v1beta1.Dataset()
dataset.display_name = "display_name_value"
dataset.metadata_schema_uri = "meta... | {
"content_hash": "45afbc68a374ae6aa16cf47ed47f9243",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 81,
"avg_line_length": 28.541666666666668,
"alnum_prop": 0.7284671532846715,
"repo_name": "googleapis/python-aiplatform",
"id": "96bbc054596b25776641c1c474ce529e7503434b",
... |
"""Generates the contents of an Cronet LICENSE file for the third-party code.
It makes use of src/tools/licenses.py and the README.chromium files on which
it depends. Based on android_webview/tools/webview_licenses.py.
"""
import optparse
import os
import sys
import textwrap
REPOSITORY_ROOT = os.path.abspath(os.path... | {
"content_hash": "0908cc6d871635361ca93a5ada8b8702",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 79,
"avg_line_length": 28.72340425531915,
"alnum_prop": 0.6340740740740741,
"repo_name": "hujiajie/chromium-crosswalk",
"id": "63a7b07e21d47f79294e7953dd6bbadbff55daf4",
"s... |
"""
past: compatibility with Python 2 from Python 3
===============================================
``past`` is a package to aid with Python 2/3 compatibility. Whereas ``future``
contains backports of Python 3 constructs to Python 2, ``past`` provides
implementations of some Python 2 constructs in Python 3 and tools t... | {
"content_hash": "4576fc70a19e4e9e2a13b59acc9cdf19",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 90,
"avg_line_length": 31.53191489361702,
"alnum_prop": 0.6754385964912281,
"repo_name": "krischer/python-future",
"id": "b434acb90b48126f6ad4f254b60c1c3d22f13a03",
"size":... |
def extractVictoriatranslationBlogspotCom(item):
'''
Parser for 'victoriatranslation.blogspot.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'transl... | {
"content_hash": "9055437c940f11e1984699a3e04052db",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 104,
"avg_line_length": 27.38095238095238,
"alnum_prop": 0.6452173913043479,
"repo_name": "fake-name/ReadableWebProxy",
"id": "bd1338c1c995ba08258efc4b32c76fee030cc715",
"s... |
import os, glob, sys
from time import sleep
directory = sys.argv[1]
sleep_time = int(sys.argv[2])
files = None
os.chdir(directory)
files = os.listdir()
while (True):
for file in files:
if file.endswith(".jpg") or file.endswith(".png"):
cmd = "feh --bg-fill " + file
os.system(cmd)
... | {
"content_hash": "9e7a39095d3fd642c56ef552385a6503",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 58,
"avg_line_length": 21.875,
"alnum_prop": 0.5942857142857143,
"repo_name": "magic-sudo/wallpaper-changer",
"id": "68530c2ed0ec02b1518e4f978b11aabc312c3f65",
"size": "350... |
# Copyright (c) 2001, Stanford University
# All rights reserved.
#
# See the file LICENSE.txt for information on redistributing this software.
import sys
sys.path.append( "../glapi_parser" )
import apiutil
apiutil.CopyrightC()
print """/* DO NOT EDIT! THIS CODE IS AUTOGENERATED BY unpack.py */
#include "unpacker... | {
"content_hash": "229aaa111e3694fed77bf84642b8f5e6",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 100,
"avg_line_length": 26.881226053639846,
"alnum_prop": 0.6748859749144812,
"repo_name": "excid3/chromium",
"id": "f566f32f8d0eaa066a4f67755a17e3d00607966e",
"size": "70... |
from rtruffle.node import Node
class ExpressionNode(Node):
def __init__(self, source_section):
Node.__init__(self, source_section)
def create_trivial_method(self, _signature):
return None
def is_trivial_in_sequence(self):
return False
def handle_inlining(self, mgenc): # pyl... | {
"content_hash": "16acf8096f23b1ae3fef40028f8e0e7a",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 58,
"avg_line_length": 23.6,
"alnum_prop": 0.6313559322033898,
"repo_name": "smarr/PySOM",
"id": "2d41a9a50e811e5e7edec8f76f9eb99c8977fcad",
"size": "472",
"binary": fals... |
"""Implements an Agent that interacts with Google Cloud Storage."""
import io
import time
from apiclient.http import MediaIoBaseDownload
from .gcp_agent import GcpAgent
STORAGE_READ_ONLY_SCOPE = 'https://www.googleapis.com/auth/devstorage.read_only'
STORAGE_READ_WRITE_SCOPE = 'https://www.googleapis.com/auth/devsto... | {
"content_hash": "7f34b28b3336060bd568f10fe4b3370b",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 82,
"avg_line_length": 33.932038834951456,
"alnum_prop": 0.6669527896995708,
"repo_name": "google/citest",
"id": "4ce16f34f8b96237e4e147f7a1a34ee35a8848c0",
"size": "4092"... |
from __future__ import absolute_import, division, print_function
import numpy as np
from glue.core.component import Component, CategoricalComponent
from glue.core.data import Data
def test_histogram_data():
data = Data(label="Test Data")
comp_a = Component(np.random.uniform(size=500))
comp_b = Component... | {
"content_hash": "98311e68299cf5c75723f6d3173783e3",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 64,
"avg_line_length": 28.919354838709676,
"alnum_prop": 0.6307863915225879,
"repo_name": "saimn/glue",
"id": "b6d92c2e45920998973b5350d39e61e674020b69",
"size": "1793",
... |
"""
Tests for django.core.servers.
"""
import os
import urllib2
from django.core.exceptions import ImproperlyConfigured
from django.test import LiveServerTestCase
from django.core.servers.basehttp import WSGIServerException
from django.test.utils import override_settings
from .models import Person
TEST_ROOT = os.pa... | {
"content_hash": "250d9abcf77fbc4a9ddaa3e02d890008",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 78,
"avg_line_length": 32.5,
"alnum_prop": 0.6368836291913215,
"repo_name": "aleida/django",
"id": "9537e1feb3622740c608e67caa59405cbef7c749",
"size": "5070",
"binary": ... |
import pytest
from sigopt.urllib3_patch import ExpiringHTTPConnectionPool, ExpiringHTTPSConnectionPool
@pytest.mark.parametrize("pool_cls", [ExpiringHTTPConnectionPool, ExpiringHTTPSConnectionPool])
def test_pool_reuses_connections(pool_cls):
pool = pool_cls(host="sigopt.com", expiration_seconds=30)
conn1 = pool.... | {
"content_hash": "1fd899116bde0d46c9d4f1b77b9862e9",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 95,
"avg_line_length": 37.578947368421055,
"alnum_prop": 0.7647058823529411,
"repo_name": "sigopt/sigopt-python",
"id": "365e641282df2d265c57cbc9f377231f81fa3ffd",
"size": ... |
from unittest import main, TestCase
from tempfile import NamedTemporaryFile
from labcontrol.db.configuration_manager import ConfigurationManager
class TestConfigurationManager(TestCase):
def test_create(self):
with NamedTemporaryFile() as tmp_f:
ConfigurationManager.create(
tm... | {
"content_hash": "317a4f3ef7e3c28dbbb2c4750d53e969",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 79,
"avg_line_length": 30.103092783505154,
"alnum_prop": 0.5486301369863014,
"repo_name": "jdereus/labman",
"id": "3ae51ef13c6286162a87f8a1d5019d2255b90ec8",
"size": "3269"... |
from sqlalchemy import Index
from ceilometer.storage.sqlalchemy import models
def upgrade(migrate_engine):
index = Index('idx_meter_rid_cname', models.Meter.resource_id,
models.Meter.counter_name)
index.create(bind=migrate_engine)
def downgrade(migrate_engine):
index = Index('idx_mete... | {
"content_hash": "b3fc910dafe40c75354dabe178136f57",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 66,
"avg_line_length": 29.4,
"alnum_prop": 0.6984126984126984,
"repo_name": "rackerlabs/instrumented-ceilometer",
"id": "d275c511111cf4fb3f4c54a29082748ea4a41e8a",
"size": ... |
"""Implementation of an image service that uses Glance as the backend."""
from __future__ import absolute_import
import copy
import inspect
import itertools
import random
import sys
import time
import cryptography
import glanceclient
from glanceclient.common import http
import glanceclient.exc
from oslo_config impor... | {
"content_hash": "a36d7f89daac1c1fc7e199dbdb847a5d",
"timestamp": "",
"source": "github",
"line_count": 744,
"max_line_length": 79,
"avg_line_length": 39.331989247311824,
"alnum_prop": 0.5828862385948126,
"repo_name": "HybridF5/jacket",
"id": "91bea867b58b24d59f909825be4d98ae31ce334c",
"size": "298... |
from geogotchi.base import Geogotchi
__version__ = "0.2.1"
| {
"content_hash": "f8042f8d18f34d762e8ed6e6ca2cafe5",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 36,
"avg_line_length": 20,
"alnum_prop": 0.7,
"repo_name": "NarrativeTeam/geogotchi",
"id": "3b3db9397bc0428e369350d1670023a36a2122d1",
"size": "1149",
"binary": false,
... |
from __future__ import absolute_import, division, print_function
import logging
import numpy as np
from .. import roi
from .. import utils as core
import itertools
from skimage import morphology
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_almost_equal)
... | {
"content_hash": "320e30a85df8b36baa5fd3c024625b31",
"timestamp": "",
"source": "github",
"line_count": 307,
"max_line_length": 78,
"avg_line_length": 37.44951140065147,
"alnum_prop": 0.5941549969557276,
"repo_name": "hainm/scikit-xray",
"id": "51dc1d9cc96ab1e405106d2e3a29ccd1e797b1ff",
"size": "13... |
import arcpy, os, math, json
from arcpy import env
from arcpy import sa
import ErrorHandling as ErrorHandling
class Viewshed:
#def __init__(self, observers, imageService, radius, height, mask, wkidin, wkidproc, wkidout):
def __init__(self, observers, imageService, radius, height, mask, wkid):
if arcpy... | {
"content_hash": "ac7e3383e59977a184c4573bc9539e7b",
"timestamp": "",
"source": "github",
"line_count": 286,
"max_line_length": 133,
"avg_line_length": 41.31818181818182,
"alnum_prop": 0.5225522552255225,
"repo_name": "abrowning80/solutions-geoevent-java",
"id": "a4dbeab1c410856554e902ef94d0f5af641d5... |
import unittest
from wordpress_xmlrpc import Client
from cwpoliticl import settings
from cwpoliticl.extensions.rpc.images_downloader import ImagesDownload
class WDXmlRpcTest(unittest.TestCase):
def setUp(self):
url = "{}/xmlrpc.php".format(settings.WD_HOST)
self.wp = Client(url, settings.WD_USER... | {
"content_hash": "d0d8f33cf88626be00bf1f588ce59504",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 116,
"avg_line_length": 38.247191011235955,
"alnum_prop": 0.5264394829612221,
"repo_name": "trujunzhang/djzhang-targets",
"id": "dc39161c24d0f15759b938abf7f900c3078df54a",
... |
from django.apps import AppConfig
class ComplainConfig(AppConfig):
name = 'complains'
| {
"content_hash": "641468a4d607e5c46e0b00f59800cd17",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 33,
"avg_line_length": 18.4,
"alnum_prop": 0.7608695652173914,
"repo_name": "Brunux/shityjobs",
"id": "a032f28925e12eb1ee0fa43de7e2be5b6d1be1ad",
"size": "92",
"binary": f... |
from __future__ import unicode_literals
import uuid
from django.contrib.gis.db.backends.base.adapter import WKTAdapter
from django.contrib.gis.db.backends.base.operations import BaseSpatialOperations
from django.contrib.gis.db.backends.utils import SpatialOperator
from django.contrib.gis.geometry.backend import Geome... | {
"content_hash": "1fc06241b5a6e4ea6b04ddd313ad05df",
"timestamp": "",
"source": "github",
"line_count": 356,
"max_line_length": 120,
"avg_line_length": 38.92134831460674,
"alnum_prop": 0.5953377598152425,
"repo_name": "mathebox/django_hana_pyhdb",
"id": "cf5ba9d0f408b65f4f6575ea7b0a679e7f80be5c",
"... |
import os
import random
import signal
import torch
from fairseq import distributed_utils, options
from train import main as single_process_main
def main(args):
# Set distributed training parameters for a single node.
args.distributed_world_size = torch.cuda.device_count()
args.distributed_init_method = ... | {
"content_hash": "0b41e3efe668b6184fb9fb0bb70b0c13",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 85,
"avg_line_length": 32.55,
"alnum_prop": 0.6620583717357911,
"repo_name": "mlperf/training_results_v0.6",
"id": "062067adf65d6699d860a219d9d6ed716c5b21d3",
"size": "2916... |
name = "Polycyclic Ring Corrections"
shortDesc = u""
longDesc = u"""
"""
| {
"content_hash": "375bccc4ce393fd441bf407185d4c791",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 36,
"avg_line_length": 12.5,
"alnum_prop": 0.64,
"repo_name": "Molecular-Image-Recognition/Molecular-Image-Recognition",
"id": "fd2f3c03417646fce84f91df75fea6b072ae285f",
"s... |
"""Used to confirm and act on delete requests from the Admin Console."""
import os
import re
import urllib
from google.appengine.api import capabilities
from google.appengine.api import datastore
from google.appengine.ext import webapp
from google.appengine.ext.datastore_admin import config
from google.appengine... | {
"content_hash": "512e48c4fee9cd647850b4106622db90",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 80,
"avg_line_length": 32.59183673469388,
"alnum_prop": 0.6579524107701941,
"repo_name": "ychen820/microblog",
"id": "c78917e22f97fd7dc4c3ada9aa5f90eebdfe0963",
"size": "6... |
""" Bitbucket Cloud common package """
| {
"content_hash": "bd74681fa95430bc19da0b05516d9fbc",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 38,
"avg_line_length": 39,
"alnum_prop": 0.6923076923076923,
"repo_name": "MattAgile/atlassian-python-api",
"id": "02c9e932dbf98eba12cb7548727d1316543439e5",
"size": "39",
... |
"""Tests for PCI request."""
from nova import exception
from nova.openstack.common import jsonutils
from nova.pci import pci_request as pci_request
from nova import test
_fake_alias1 = """{
"name": "QuicAssist",
"capability_type": "pci",
"product_id": "4443",
... | {
"content_hash": "9b9c98681d65c1e332f63fe9f44f710a",
"timestamp": "",
"source": "github",
"line_count": 279,
"max_line_length": 74,
"avg_line_length": 36.44086021505376,
"alnum_prop": 0.4932625159830825,
"repo_name": "imsplitbit/nova",
"id": "af06c4c9ea200a170b71d4e8a25e929ff9e0708f",
"size": "1088... |
import datetime
import decimal
import enum
import functools
import math
import os
import re
import uuid
from unittest import mock
import custom_migration_operations.more_operations
import custom_migration_operations.operations
from django import get_version
from django.conf import SettingsReference, settings
from dja... | {
"content_hash": "04a90cc06b4653df31ddd766d32e8c79",
"timestamp": "",
"source": "github",
"line_count": 749,
"max_line_length": 118,
"avg_line_length": 41.28170894526035,
"alnum_prop": 0.6139068564036223,
"repo_name": "georgemarshall/django",
"id": "ca924f35ecc56f23445bc185fcb6f36a452f6211",
"size"... |
from sqlalchemy import Column, ForeignKey
from sqlalchemy.sql.sqltypes import Boolean, BigInteger, Integer, CHAR, SmallInteger
from destiny.main.bdd import Base
from destiny.utils import rep_model
class TeamStats(Base):
__tablename__ = 'teamstats'
gameId = Column(BigInteger, ForeignKey("matches.gameId"), pr... | {
"content_hash": "3b81f83c26077c1201b4608f4e23e302",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 84,
"avg_line_length": 32.592592592592595,
"alnum_prop": 0.7261363636363637,
"repo_name": "Schluucht/Destiny",
"id": "8ae4c77a86e3d3e0683002add2162cd1d16e33a8",
"size": "88... |
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 'FeaturedResource'
db.create_table('resources_featuredresource', (
('id', self.gf('django.db.models.field... | {
"content_hash": "aafeb1206a3d6b587b057ea00fdf7d18",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 182,
"avg_line_length": 72.88495575221239,
"alnum_prop": 0.5618018455560952,
"repo_name": "amitskwalia/codesters",
"id": "08b7813dcdeedddeec5eca348877ddf26d6b7439",
"size"... |
import constant
from database import Database
from arduino import Arduino
from flask import Flask, jsonify, request, render_template
from flask_socketio import SocketIO, emit
app = Flask(__name__)
socketio = SocketIO(app)
arduino = Arduino()
database = Database()
@app.route("/")
def index():
return render_template("... | {
"content_hash": "4c8ee184f63a91b1af3dbc79a5891dbf",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 97,
"avg_line_length": 24.893617021276597,
"alnum_prop": 0.6965811965811965,
"repo_name": "MakerLabsVan/ACM",
"id": "2b1a32bcb5e3390efa0b5a734e51348e1dec638b",
"size": "234... |
"""Sample and helpers for Google Assistant API."""
| {
"content_hash": "2e7554941c5db4f1338c137bba4294d5",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 50,
"avg_line_length": 51,
"alnum_prop": 0.7254901960784313,
"repo_name": "Jay2645/Unreal-Google-Assistant",
"id": "e771e048ee4a50a0e6e3cd050d6be89c235e49c1",
"size": "631",... |
from threading import Thread
from obnl.core.impl.node import ClientNode as _ClientNodeImpl
class ClientNode(object):
def __init__(self, host, vhost, username, password, config_file, input_attributes=None, output_attributes=None, is_first=False):
self._node_impl = _ClientNodeImpl(host, vhost, username, p... | {
"content_hash": "488f5ace37885225843efe57068424d4",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 140,
"avg_line_length": 29.904109589041095,
"alnum_prop": 0.6106275767292716,
"repo_name": "IntegrCiTy/obnl",
"id": "6c48fbab9b492563f6ce022cafaa9cb05669f49c",
"size": "218... |
from jsonable import JSONable
from .unavailable import Unavailable
class Page(JSONable):
__slots__ = ('id', 'namespace', 'title')
def initialize(self, id, namespace, title):
self.id = Unavailable.otherwise(id, int)
self.namespace = int(namespace)
self.title = str(title)
| {
"content_hash": "42fe79e54ac5fe7794b732a530a27f28",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 48,
"avg_line_length": 27.818181818181817,
"alnum_prop": 0.6601307189542484,
"repo_name": "halfak/MediaWiki-events",
"id": "7cf484e8577e1ecbd2b88f34b8dfaa36ea806392",
"size... |
"""Support for binary sensor using GC100."""
from __future__ import annotations
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import DEVICE_DEFAULT_NAME
from homeassistant.core import HomeAssistant
import homeassistant.helpers.... | {
"content_hash": "d4ed4a5feb15091f375e91a9a07e2d3d",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 86,
"avg_line_length": 31.231884057971016,
"alnum_prop": 0.6719257540603248,
"repo_name": "toddeye/home-assistant",
"id": "f93076196a342d389fa76a276446731a765240fb",
"size"... |
from model.contact import Contact
#from random import randrange
import random
def test_delete_some_contact(app, db, check_ui):
if len(db.get_contact_list()) == 0:
app.contact.create(Contact(firstname="testcontact"))
old_contacts = db.get_contact_list()
contact = random.choice(old_contacts)
app... | {
"content_hash": "adad5ead4b29013bdbe2054589b3d709",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 123,
"avg_line_length": 38.5625,
"alnum_prop": 0.7050243111831442,
"repo_name": "dariansk/python_training",
"id": "4193dfde20cbeac857c10dd9d30d4532fdd4a394",
"size": "617",... |
import time
import pathlib
import math
import ezdxf
from ezdxf.math import (
global_bspline_interpolation,
BoundingBox,
linspace,
BSpline,
)
from ezdxf.render import random_3d_path
CWD = pathlib.Path("~/Desktop/Outbox").expanduser()
if not CWD.exists():
CWD = pathlib.Path(".")
def profile_bspline_... | {
"content_hash": "c3a62ad677bb8633ed9f0d1569f7f3a4",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 77,
"avg_line_length": 24.918032786885245,
"alnum_prop": 0.6657894736842105,
"repo_name": "mozman/ezdxf",
"id": "a6e3dc1cc831f12057a6164a5942c8e15377602a",
"size": "1585",
... |
'''
Created on 5 Mar 2010
@author: tcezard
'''
import logging
from utils import DNA_tools, utils_logging
import sys
from pprint import pprint
#############################################
# Genes and transcript objects #
#############################################
_all_genes={}
_all_transcripts={}
_... | {
"content_hash": "7089fd51d3a7204d46717785c6b874c3",
"timestamp": "",
"source": "github",
"line_count": 1420,
"max_line_length": 199,
"avg_line_length": 44.8830985915493,
"alnum_prop": 0.5662911475821383,
"repo_name": "tcezard/RADmapper",
"id": "1334b737b5e30b0a4b85b19067741ecb36c3c0aa",
"size": "6... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.