text stringlengths 4 1.02M | meta dict |
|---|---|
'''
InfUserExtensionsObject
'''
from Logger import StringTable as ST
from Logger import ToolError
import Logger.Log as Logger
from Library import GlobalData
from Library.Misc import Sdict
class InfUserExtensionItem():
def __init__(self,
Content = '',
UserId = '',
... | {
"content_hash": "e5f80ed3000e8955ed208391cf2c2c94",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 98,
"avg_line_length": 37.88235294117647,
"alnum_prop": 0.5312777284826974,
"repo_name": "egraba/vbox_openbsd",
"id": "ac7e7db5cff0aa0153f0003dc1ee87d8b614686b",
"size": "... |
from prometheus_client import Counter, Histogram
from django_prometheus.utils import Time, TimeSince, PowersOf
requests_total = Counter(
'django_http_requests_before_middlewares_total',
'Total count of requests before middlewares run.')
responses_total = Counter(
'django_http_responses_before_middlewares_t... | {
"content_hash": "06115c6e659bb1055d6e3c15b5a05769",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 75,
"avg_line_length": 39.66233766233766,
"alnum_prop": 0.6743614931237721,
"repo_name": "DingaGa/django-prometheus",
"id": "6196e4727997ca0b13eab6809bef2e6895459839",
"si... |
import math
class Sensor_Velocidad:
def __init__(self, radio_, sensor_, nro_secciones):
self.radio = radio_
self.sensor = sensor_
self.nro_seccion = nro_secciones
def get_desplazamiento(self):
#obtener el perimetro de la rueda, el radio debe estar en metros
perimetro =... | {
"content_hash": "50540f937c6bacfb44b0a5195ef246d7",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 72,
"avg_line_length": 30.95,
"alnum_prop": 0.6639741518578353,
"repo_name": "GeorgEncinas/backtraking",
"id": "92bc78382f5ced30631efa4c188b56d5d3cbb0a7",
"size": "619",
... |
import os
import platform
import subprocess
import lit.formats
import lit.util
# name: The name of this test suite.
config.name = 'Clang-Unit'
# suffixes: A list of file extensions to treat as test files.
config.suffixes = []
# test_source_root: The root path where tests are located.
# test_exec_root: The root path... | {
"content_hash": "77303b9cabf0b17ae4b99a613bb89fb7",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 79,
"avg_line_length": 34.9811320754717,
"alnum_prop": 0.6957928802588996,
"repo_name": "youtube/cobalt_sandbox",
"id": "342b6928eceaf473a41488d434298bfe2d274465",
"size": ... |
"""
.. _tut_stats_cluster_source_rANOVA:
======================================================================
Repeated measures ANOVA on source data with spatio-temporal clustering
======================================================================
This example illustrates how to make use of the clustering funct... | {
"content_hash": "a460aa96970afa00aff4b8713b6cf63a",
"timestamp": "",
"source": "github",
"line_count": 283,
"max_line_length": 79,
"avg_line_length": 42.78091872791519,
"alnum_prop": 0.6292227636904271,
"repo_name": "ARudiuk/mne-python",
"id": "ef899f7c3266695692a87067dbd676d9d1ff37c7",
"size": "1... |
import omniORB, _omnipy
from omniORB import CORBA, PortableServer
_0_CORBA = CORBA
_omnipy.checkVersion(4,2, __file__, 1)
try:
property
except NameError:
def property(*args):
return None
# #include "CosPersistencePID.idl"
import CosPersistencePID_idl
_0_CosPersistencePID = omniORB.openModule("CosPe... | {
"content_hash": "6acfae76fea217b32678a5f68b8871b3",
"timestamp": "",
"source": "github",
"line_count": 337,
"max_line_length": 371,
"avg_line_length": 45.35014836795252,
"alnum_prop": 0.7401033828436825,
"repo_name": "amonmoce/corba_examples",
"id": "86951dc1324796d05b7da41d09b7b133fcd45ec5",
"siz... |
import httplib2
import dateutil.parser
import dateutil.tz
from django.utils import simplejson
from django.utils.encoding import force_unicode
from django.conf import settings
from flowrepo import settings
from flowrepo.providers.utils.anyetree import etree
from flowrepo import default_header
DEFAULT_HTTP_HEADERS = {
... | {
"content_hash": "db5419b2970eba2d603390bc294e6ded",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 101,
"avg_line_length": 28.166666666666668,
"alnum_prop": 0.6627218934911243,
"repo_name": "strogo/djpcms",
"id": "0676b67cb87a09ca8c2f94dd1b6c7f3a5fca5a6d",
"size": "2704"... |
from CIM15.IEC61970.LoadModel.LoadGroup import LoadGroup
class ConformLoadGroup(LoadGroup):
"""A group of loads conforming to an allocation pattern.A group of loads conforming to an allocation pattern.
"""
def __init__(self, ConformLoadSchedules=None, EnergyConsumers=None, *args, **kw_args):
"""In... | {
"content_hash": "40e73bf1da6402494fc7021918663e2b",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 113,
"avg_line_length": 35.16901408450704,
"alnum_prop": 0.6768121746095315,
"repo_name": "rwl/PyCIM",
"id": "c45331bc179e7ff2c18c32d53d4f234ccffb5f77",
"size": "3597",
"... |
import numpy
from numpy import asarray, tan, exp, ones, squeeze, sign, \
all, log, sqrt, pi, shape, array, minimum, where
from numpy import random
__all__ = ['anneal']
_double_min = numpy.finfo(float).min
_double_max = numpy.finfo(float).max
class base_schedule(object):
def __init__(self):
self.dwell... | {
"content_hash": "7236278ae03f3ea8ba1a2fa65093037e",
"timestamp": "",
"source": "github",
"line_count": 331,
"max_line_length": 128,
"avg_line_length": 33.368580060422964,
"alnum_prop": 0.5540968764146673,
"repo_name": "johnbachman/pysb",
"id": "46ecadac3ae287b2cf2de635d241088ff946932c",
"size": "1... |
"""Test config flow."""
from homeassistant.components.hassio.handler import HassioAPIError
from homeassistant.const import EVENT_HOMEASSISTANT_START
from homeassistant.setup import async_setup_component
from tests.async_mock import Mock, patch
async def test_hassio_discovery_startup(hass, aioclient_mock, hassio_clie... | {
"content_hash": "d9fc7831b787738d6834bf25260caba9",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 82,
"avg_line_length": 32.68639053254438,
"alnum_prop": 0.45727733526430125,
"repo_name": "tboyce021/home-assistant",
"id": "3bb97a6662e1128cb8a912a24160c7215e5ab29a",
"si... |
import heapq
from random import random
from warnings import warn
#--- PRIORITY QUEUE ----------------------------------------------------------------------------------
# Currently not in use.
INFINITY = 1e20
class priorityqueue(dict):
def push(self, e, w):
self[e] = w
def pop(self):
... | {
"content_hash": "bef70711130478bbc77d3c1218b62f3c",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 102,
"avg_line_length": 34.21484375,
"alnum_prop": 0.5247174334969745,
"repo_name": "est/nodebox-gl",
"id": "9d9e38626e55b5053eba0582fc2313ef6b9b64e0",
"size": "8759",
"... |
"""Simple tool for inspecting nearest neighbors and analogies."""
from __future__ import print_function
import re
import sys
from getopt import GetoptError, getopt
from vecs import Vecs
try:
opts, args = getopt(sys.argv[1:], 'v:e:', ['vocab=', 'embeddings='])
except GetoptError as e:
print(e, file=sys.stderr)
... | {
"content_hash": "3be717546faae80dd62fad8fa3f3c748",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 77,
"avg_line_length": 20.8,
"alnum_prop": 0.6121794871794872,
"repo_name": "derekjchow/models",
"id": "0fa828b66b7958ae06f115216cea0106ec029033",
"size": "1869",
"binary... |
import tomviz.operators
class BinaryThreshold(tomviz.operators.CancelableOperator):
def transform(self, dataset, lower_threshold=40.0, upper_threshold=255.0):
"""This filter computes a binary threshold on the data set and
stores the result in a child data set. It does not modify the dataset
... | {
"content_hash": "cd474eb36ad938a5bfb8b1fb913e9b06",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 79,
"avg_line_length": 38.70238095238095,
"alnum_prop": 0.5933558904952322,
"repo_name": "OpenChemistry/tomviz",
"id": "de4e9b43e261ebd181c3167610f673596bb7d5a1",
"size": "... |
import collections
import concurrent.futures
import copy
import datetime
import decimal
import functools
import hashlib
import itertools
import jinja2
import json
import os
import requests
from tarfile import ReadError
import time
from pathlib import PosixPath, WindowsPath
from contextlib import contextmanager
from db... | {
"content_hash": "4c183167e5e33c3c4b58de4ef4867b24",
"timestamp": "",
"source": "github",
"line_count": 658,
"max_line_length": 97,
"avg_line_length": 30.26595744680851,
"alnum_prop": 0.6260607582224454,
"repo_name": "analyst-collective/dbt",
"id": "e1f3fe537c1c230d1fb163e3327a4fdd45e611cc",
"size"... |
from numpy import *
from numpy.linalg import svd
from scipy.stats import norm as normal
from scipy import linalg as lin
import time
import itertools
import random
from learners import *
from cvxopt import matrix, solvers, spdiag
solvers.options['show_progress'] = False
solvers.options['maxiters'] = 2000
class Hinge... | {
"content_hash": "ca88369f5e221d3e4bbd903c4774754d",
"timestamp": "",
"source": "github",
"line_count": 1060,
"max_line_length": 172,
"avg_line_length": 33.34905660377358,
"alnum_prop": 0.557001414427157,
"repo_name": "Kaushikpatnaik/Active-Learning-and-Best-Response-Dynamics",
"id": "8b9dd3ef0e5d2be... |
"""Module for the application configuration"""
import os
class Config(object):
"""Common configurations"""
SQLALCHEMY_DATABASE_URI = os.getenv('db_url')
SQLALCHEMY_TRACK_MODIFICATIONS = False
CSRF_ENABLED = True
SECRET_KEY = os.getenv('secret')
SWAGGER_UI_DOC_EXPANSION = 'list'
class Develo... | {
"content_hash": "fd89e8915564037c9af23a4d1621f82d",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 73,
"avg_line_length": 22.871794871794872,
"alnum_prop": 0.6894618834080718,
"repo_name": "machariamarigi/shopping_list_api",
"id": "aca86c34a1b04b008e56a649c2bba72442410a61"... |
from base import Task
from common import phases
from common.tools import log_check_call
from bootstrap import Bootstrap
from common.tasks import apt
import volume
class Format(Task):
description = 'Formatting the volume'
phase = phases.volume_preparation
@classmethod
def run(cls, info):
from base.fs.partitions... | {
"content_hash": "1f55d6621d6aa194961a69a1695d0d72",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 92,
"avg_line_length": 28.023952095808383,
"alnum_prop": 0.6493589743589744,
"repo_name": "brianspeir/Vanilla",
"id": "4f79af5ce12ab2d2a7850a6c7103001eeb0a6f26",
"size": "... |
import os
import glob
import subprocess as sp
import unittest
import numpy as np
import numpy.testing as npt
# ========================================================================
#
# Function definitions
#
# ========================================================================
def runcode(workdir, deck, coded... | {
"content_hash": "4a96c21730949cc772233862c719f3b9",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 79,
"avg_line_length": 34,
"alnum_prop": 0.48602033405954975,
"repo_name": "marchdf/dg1d",
"id": "736de43707c89491b331488f939d41e08a136140",
"size": "5672",
"binary": fa... |
from write import write, writebr
import sys
IN_BROWSER = sys.platform in ['mozilla', 'ie6', 'opera', 'oldmoz', 'safari']
IN_JS = sys.platform in ['mozilla', 'ie6', 'opera', 'oldmoz',
'safari', 'spidermonkey', 'pyv8']
if IN_BROWSER:
from pyjamas.Timer import Timer
class UnitTest:
def... | {
"content_hash": "8b054f126d65388bd917fcc77a0e0e9e",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 163,
"avg_line_length": 33.49145299145299,
"alnum_prop": 0.5379609544468547,
"repo_name": "lancezlin/pyjs",
"id": "1ec3a4ecad58c06622355192287c8e8c8d5669db",
"size": "7837... |
import core.models
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('sponsors', '0018_openrole'),
('events', '0024_auto_20200319_1924'),
]
operations = [
migrations.CreateModel(
name='Jo... | {
"content_hash": "64af3bdfe12135de70c2914fa46ef8e5",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 305,
"avg_line_length": 61.241379310344826,
"alnum_prop": 0.6103603603603603,
"repo_name": "pycontw/pycontw2016",
"id": "3299df8c235666fe97b45cc77b9be92fe8a1b8ae",
"size": ... |
import os
import time
try:
from pysqlite2 import dbapi2 as sqlite
except ImportError:
from sqlite3 import dbapi2 as sqlite
Error = sqlite.Error
class DB(object):
def __init__(self, path, text=None, timeout=0):
encpath = path
if isinstance(encpath, unicode):
encpath = path.enco... | {
"content_hash": "8e8edfb5614b036ffd0148eadb72c1dd",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 61,
"avg_line_length": 25.794117647058822,
"alnum_prop": 0.5043709616115546,
"repo_name": "bdunnette/omeka2anki",
"id": "c66813c24e9ce2b537025662c7c5f481c059952d",
"size":... |
import sys
import os
import json, requests
import unittest
class Rest_API_tests(unittest.TestCase):
def setUp(self):
r = requests.get('http://169.254.169.254/latest/meta-data/public-ipv4')
self.ip_url = "http://"+r.text #'http://54.173.105.55'
def test_query1(self):
"""
Test Que... | {
"content_hash": "a636a0314fea4a86f3f328b0ffa0ce20",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 83,
"avg_line_length": 36.56349206349206,
"alnum_prop": 0.58389407423486,
"repo_name": "slac207/cs207project",
"id": "e5b745736bdc4c73a06c41aedc706eed6373fbb9",
"size": "4... |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | {
"content_hash": "a076be9ecd5773afa03bd42d5c6db107",
"timestamp": "",
"source": "github",
"line_count": 277,
"max_line_length": 158,
"avg_line_length": 33.581227436823106,
"alnum_prop": 0.5765426789937648,
"repo_name": "apache/solr",
"id": "768a74195e416409cfae3667450141fba75c3358",
"size": "9302",... |
"""Functional test for moving_averages.py."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.compiler.xla.experimental.xla_sharding import xla_sharding
from tensorflow.python.eager import context
from tensorflow.python.f... | {
"content_hash": "4ecc9525b34261e52f3be0ec5ae0bdbc",
"timestamp": "",
"source": "github",
"line_count": 499,
"max_line_length": 80,
"avg_line_length": 41.72745490981964,
"alnum_prop": 0.6709249831908558,
"repo_name": "sarvex/tensorflow",
"id": "6e277dd9c9dcfe9b908caf96d1b1a7dbee8e012e",
"size": "21... |
"""Example of decorators."""
from flask import Flask
from flask_apscheduler import APScheduler
class Config:
"""App configuration."""
SCHEDULER_API_ENABLED = True
scheduler = APScheduler()
# interval examples
@scheduler.task("interval", id="do_job_1", seconds=30, misfire_grace_time=900)
def job1():
... | {
"content_hash": "95caee740f3b88d5b48d189500ebd4dc",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 78,
"avg_line_length": 19.88888888888889,
"alnum_prop": 0.6256983240223464,
"repo_name": "viniciuschiele/flask-apscheduler",
"id": "5fb003bde5266f75648704661fbe8d98ca61db52",... |
import datetime
import json
class Range:
def __init__(self, time):
self.startTime = time
self.endTime = time
self.count = 0
def inc(self):
self.count += 1
def label(self):
return self.startTime.strftime("%H:%M") + " - " + self.endTime.strftime("%H:%M")
class Ext... | {
"content_hash": "8de5c3ba744a4523d8f172a1fe20b337",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 88,
"avg_line_length": 26.913793103448278,
"alnum_prop": 0.5118513773222293,
"repo_name": "Leprechaunz/chisinau-marathon-2014",
"id": "14fe328a5dcd9e0c7da9b06daa805632b9e61a4... |
from lxml import etree
from caldav.lib.namespace import nsmap, nsmap2
from caldav.lib.python_utilities import isPython3, to_unicode
class BaseElement(object):
children = None
tag = None
value = None
attributes = None
def __init__(self, name=None, value=None):
self.children = []
se... | {
"content_hash": "c211b10c235c446bb7782007d69227e1",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 70,
"avg_line_length": 29.08955223880597,
"alnum_prop": 0.5915854284248332,
"repo_name": "glibin/caldav",
"id": "fa301b1f3f3cf2f5347bd77d9a6d4d672194fceb",
"size": "1998",
... |
import IECore
import Gaffer
import GafferUI
QtCore = GafferUI._qtImport( "QtCore" )
QtGui = GafferUI._qtImport( "QtGui" )
class BoolWidget( GafferUI.Widget ) :
DisplayMode = IECore.Enum.create( "CheckBox", "Switch" )
def __init__( self, text="", checked=False, displayMode=DisplayMode.CheckBox, **kw ) :
Gaffer... | {
"content_hash": "5df48c5af043b1db3526cff012096292",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 89,
"avg_line_length": 24,
"alnum_prop": 0.7050653594771242,
"repo_name": "goddardl/gaffer",
"id": "f7a54daaeca0653dbecd4843986273f5c931c9a5",
"size": "3032",
"binary": f... |
from unittest import main, TestCase
from simhash import Simhash, SimhashIndexWithMongo
class TestSimhash(TestCase):
def test_value(self):
self.assertEqual(Simhash(['aaa', 'bbb']).value, 8637903533912358349)
def test_distance(self):
sh = Simhash('How are you? I AM fine. Thanks. And you?')
... | {
"content_hash": "e4fa379bd605c6459caad0ab9356b749",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 108,
"avg_line_length": 34.25316455696203,
"alnum_prop": 0.6016260162601627,
"repo_name": "likaiguo/simhashpy",
"id": "06f900025fdec92b4fd4288e7deca0a73c489866",
"size": "2... |
from __future__ import unicode_literals
from django import forms
from django.forms import ModelForm
from django.utils.translation import ugettext_lazy as _
from .models import Goal
class GoalCloneForm(ModelForm):
class Meta:
model = Goal
exclude = []
copy_tasks = forms.BooleanField(label=_("... | {
"content_hash": "fae9f828a1eb387c4b51dd0b0b6869a0",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 120,
"avg_line_length": 32.6,
"alnum_prop": 0.7321063394683026,
"repo_name": "glomium/django-bmf",
"id": "939a5196c9c4d00754c94ba3fa0439e0025ae84c",
"size": "537",
"binar... |
"""
Django settings for janus project.
Generated by 'django-admin startproject' using Django 1.9.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
# B... | {
"content_hash": "b868362a3c1fd885a5d4da32f357e98d",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 78,
"avg_line_length": 26.53939393939394,
"alnum_prop": 0.6512902489152774,
"repo_name": "HCCB/janus",
"id": "c633e0fdbec3d3a4a6b296d1834b43bff7fd6228",
"size": "4379",
... |
import mock
from jsl import fields
from jsl._compat import iteritems, with_metaclass
from jsl.document import Document, DocumentMeta, Options
class OptionsStub(Options):
"""An options container that allows storing extra options."""
def __init__(self, a=None, b=None, c=None, d=None, **kwargs):
super(O... | {
"content_hash": "cbef5be858fc8caacee731595eecfe56",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 85,
"avg_line_length": 28.375,
"alnum_prop": 0.5753303964757709,
"repo_name": "aromanovich/jsl",
"id": "881d0b1699ff0891c36c8b7df8fb43c177966b70",
"size": "2286",
"binary... |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from numpy import asarray
from scipy.linalg import svd
__all__ = ["pca_numpy"]
def pca_numpy(data):
"""Compute the principle components of a set of data points.
Parameters
----------
data :... | {
"content_hash": "324521b864579f835cdd5048a97ead55",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 113,
"avg_line_length": 34.43333333333333,
"alnum_prop": 0.6592449177153921,
"repo_name": "compas-dev/compas",
"id": "efcf64173e0bcdb0f028411191e2c968a2300f6b",
"size": "30... |
import os
import sys
from rl_coach.base_parameters import TaskParameters, Frameworks
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
import tensorflow as tf
from tensorflow import logging
import pytest
logging.set_verbosity(logging.INFO)
@pytest.mark.unit_test
def test_get_QActionStateV... | {
"content_hash": "0c205ddc990edfd6c209cf07d48e3d2a",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 113,
"avg_line_length": 40.27272727272727,
"alnum_prop": 0.6952595936794582,
"repo_name": "NervanaSystems/coach",
"id": "77f0a89e12de348b14bf66ff7857ebbe9c34ab10",
"size": ... |
"""
Command line tool.
"""
import sys
from dox.config import init_environment, get_keyfields, get_cfg, write_keyfields, get_keymap, write_keymap, clean_hashes, is_modified, write_hash
from dox.client import ping_library, get_content_keys, get_content_item
from os import walk, getcwd
from dox.uploader import upload_docu... | {
"content_hash": "5c9bfe6bc50feb146d97bb450fc6ab78",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 145,
"avg_line_length": 33.21875,
"alnum_prop": 0.5920351207275008,
"repo_name": "Axilent/Dox",
"id": "c235f5de5fc95c9e6a5fa37b8be0eb2c9ded2b48",
"size": "3189",
"binary"... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/wearables/jacket/shared_jacket_s24.iff"
result.attribute_template_id = 11
result.stfName("wearables_name","jacket_s24")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "2b1bc71af9820a6ccb15554b923cff9f",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 75,
"avg_line_length": 23.923076923076923,
"alnum_prop": 0.7041800643086816,
"repo_name": "anhstudios/swganh",
"id": "26aebd3782d6e90f5ca135477c56490e2b12d4b4",
"size": "45... |
'''
Mouse module, porting from pywinauto project
code.google.com/p/pywinauto
'''
import ctypes
from ctypes import \
c_int, c_uint, c_long, c_ulong, c_void_p, c_wchar, c_char, \
c_ubyte, c_ushort, c_wchar_p, \
POINTER, sizeof, alignment, Union
SendInput = ctypes.windll.user32.SendInput
SetCurso... | {
"content_hash": "f9d5321e052173287e3eb72edf7c734a",
"timestamp": "",
"source": "github",
"line_count": 375,
"max_line_length": 103,
"avg_line_length": 33.413333333333334,
"alnum_prop": 0.5913008778930566,
"repo_name": "xcgspring/AXUI",
"id": "485d27004db146dd39fa9fa9e98365ca6404a4c3",
"size": "125... |
"""
Exceptions and errors for use in twisted.internet modules.
"""
from __future__ import division, absolute_import
import socket
from twisted.python import deprecate
from twisted.python.versions import Version
class BindError(Exception):
"""An error occurred binding to an interface"""
def __str__(self):... | {
"content_hash": "8ef10c1465995c99a265806e57a4745f",
"timestamp": "",
"source": "github",
"line_count": 452,
"max_line_length": 79,
"avg_line_length": 24.29646017699115,
"alnum_prop": 0.6277545073757057,
"repo_name": "biddisco/VTK",
"id": "687988636125cc27daf966f248ab9548b2aaf41d",
"size": "11055",... |
"""
This module provides code for various distance measures.
Functions:
euclidean Euclidean distance between two points
euclidean_py Pure Python implementation of euclidean.
"""
# XXX cosine distance
import math
try:
from Numeric import *
except ImportError, x:
raise ImportError, "This module require... | {
"content_hash": "3c6c92f9c0b7dd1eef91e61feb1e556e",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 74,
"avg_line_length": 28.954545454545453,
"alnum_prop": 0.6766091051805337,
"repo_name": "dbmi-pitt/DIKB-Micropublication",
"id": "c1f62bbcce201e2a6d4a3ed852a20ff0939197bc",... |
class Queue(object):
""" Implement a queue data structure, ie. FIFO.
Attrs:
head: head of the queue.
tail: tail of the queue.
"""
def __init__(self):
self.head = None
self.tail = None
def enqueue(self, value):
node = {'value': value, 'prev': None}
i... | {
"content_hash": "cd26da5aabe8bde3c0a0aebff13b4ce7",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 51,
"avg_line_length": 23.93103448275862,
"alnum_prop": 0.49855907780979825,
"repo_name": "topliceanu/learn",
"id": "5c7c9f94024336ef5619bbc1045a474b36245645",
"size": "720... |
from selenium import webdriver
from django.test import Client
from myblog.models import Post, Category
import datetime
client = Client()
import unittest
class Setup_Teardown(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Firefox()
self.browser.implicitly_wait(3)
self.verifi... | {
"content_hash": "15487dabf42db866d3993d5f798691f2",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 93,
"avg_line_length": 25.87878787878788,
"alnum_prop": 0.6604215456674473,
"repo_name": "robalford/reConstruct",
"id": "9c1862caf848cf6fdd6124fdd03f7bae709071da",
"size": ... |
"""
`cloud_monitoring_mql.py`
Cloud Monitoring backend implementation with MQL (Monitoring Query Language).
"""
import logging
import pprint
import typing
import warnings
from collections import OrderedDict
from datetime import datetime
from typing import List, Optional, Tuple
from google.api.distribution_pb2 import D... | {
"content_hash": "445987f061a3b65149aa99e858cafb0c",
"timestamp": "",
"source": "github",
"line_count": 257,
"max_line_length": 87,
"avg_line_length": 35.98054474708171,
"alnum_prop": 0.6109008327024981,
"repo_name": "google/slo-generator",
"id": "419e20fb8576d9ec5b84e0fcf655da5064f043a7",
"size": ... |
"""Test making many calls and immediately cancelling most of them."""
import threading
import unittest
from grpc._cython import cygrpc
from grpc.framework.foundation import logging_pool
from tests.unit.framework.common import test_constants
from tests.unit._cython import test_utilities
_EMPTY_FLAGS = 0
_EMPTY_METADA... | {
"content_hash": "ac7bf1ab5ccf103de701c8d7e58f8ee9",
"timestamp": "",
"source": "github",
"line_count": 210,
"max_line_length": 80,
"avg_line_length": 36.642857142857146,
"alnum_prop": 0.5578947368421052,
"repo_name": "jboeuf/grpc",
"id": "b279f3d07c53aacd8e501647f85c73c822db5f89",
"size": "8272",
... |
"""
Template answer for REST Workshop
"""
##########################################################################
## Imports
##########################################################################
import json
import pprint
import requests
########################################################################... | {
"content_hash": "4945bfcfefc577d8dad798cc5843bbe6",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 81,
"avg_line_length": 29.677419354838708,
"alnum_prop": 0.44782608695652176,
"repo_name": "rebeccabilbro/cipactli",
"id": "20fc1d1aaab582c3501e624060ba10483e1fb24b",
"size... |
from setuptools import setup, find_packages
import os
import re
import tempfile
def read_version():
source_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'cedexis/radar/__init__.py')
with open(source_path) as fp:
source = fp.read()
major_match = re.search('__sampler_major_version__... | {
"content_hash": "c777cf84c2e710a9336182d40fabed42",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 103,
"avg_line_length": 31.653846153846153,
"alnum_prop": 0.580498177399757,
"repo_name": "cedexis/cedexis.radar",
"id": "ca4afb91e61259caa5951ae9eaf32f53b9633fac",
"size"... |
import attr
import sqlite3
import logging
@attr.s
class ContactsProcessor:
"""
The processor of contacts data.
:param sakia.data.repositories.ContactsRepo _contacts_repo: the repository of the contacts
"""
_contacts_repo = attr.ib()
_logger = attr.ib(default=attr.Factory(lambda: logging.getLo... | {
"content_hash": "3f1d8c77959e2004a6b17cb4f828a839",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 94,
"avg_line_length": 26.4,
"alnum_prop": 0.6448863636363636,
"repo_name": "ucoin-io/cutecoin",
"id": "71b484cdc7b3728de8df19d3bcb9d013c9a74573",
"size": "1056",
"binary... |
from . import api
class OpenWebcastLectures():
# OpenWebcastLectures.OpenWebcasts
def open_webcasts(self, acadYear, semester, titleOnly=False, mediaChannelId=None, auth=True):
params = {'AcadYear': acadYear, 'Semester': semester, 'TitleOnly': titleOnly, 'MediaChannelID': mediaChannelId}
return ... | {
"content_hash": "a515dccecdd10cee5fc4f9b624b2f5c2",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 119,
"avg_line_length": 55,
"alnum_prop": 0.7333333333333333,
"repo_name": "karenang/ivle-bot",
"id": "9b5385d089301f4fdb33e39dda355b1429db65d3",
"size": "660",
"binary":... |
import os
from setuptools import setup, find_packages, findall
PACKAGE_NAME = 'yawf'
CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))
REQUIREMENTS_FILEPATH = os.path.join(CURRENT_DIR, 'requirements', 'default.txt')
README_FILEPATH = os.path.join(CURRENT_DIR, 'README.rst')
VERSION_FILEPATH = os.path.join(CURRE... | {
"content_hash": "8d27a97b54f1bd8e698eca0f68a6cecb",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 84,
"avg_line_length": 29.816666666666666,
"alnum_prop": 0.6400223588596982,
"repo_name": "freevoid/yawf",
"id": "466475b06f66207950afbf238cb5a42b103ef818",
"size": "1789",... |
import time
from netforce.model import Model, fields, get_model
from netforce import database
class Notification(Model):
_name = "hr.notification"
_fields = {
"subject": fields.Char("Title", required=True),
"description": fields.Text("Description"),
'birthday_ntf': fields.Boolean("Bir... | {
"content_hash": "be7547915e50aaa54d9a07fb0b097033",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 124,
"avg_line_length": 39.56363636363636,
"alnum_prop": 0.45955882352941174,
"repo_name": "anastue/netforce",
"id": "9d66f4d368207ea74e3a30f3fedcfed62b1c78b8",
"size": "32... |
"""
WSGI config for maestor project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "maestor.settings")
from django.core.w... | {
"content_hash": "d2fbfbe3d21d6b514c8ce684af1494dc",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 78,
"avg_line_length": 27.785714285714285,
"alnum_prop": 0.7737789203084833,
"repo_name": "amschaal/maestor",
"id": "60a746962d4c3b2fb6ff201e8e7419ae75ebb03b",
"size": "389... |
"""
Bog standard Sheepdog example script.
Defines a simple function, a short list of arguments to run it with,
then submits it to a GridEngine cluster and waits for the results.
"""
import sheepdog
def f(a, b):
return a + b
args = [(1, 1), (1, 2), (2, 2)]
print("Running f(a,b) for arguments:")
print(args)
con... | {
"content_hash": "550d9647bfa9eade0c19c2b7f9bd767c",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 68,
"avg_line_length": 17.44,
"alnum_prop": 0.6651376146788991,
"repo_name": "adamgreig/sheepdog",
"id": "72de561334c75ea8fc7d84bffd4a63d83c8d449e",
"size": "436",
"binar... |
from rest_framework import permissions
class IsOwnerOrReadOnly(permissions.BasePermission):
def has_object_permission(self, request, view, obj):
if request.method in permissions.SAFE_METHODS:
return True
return obj.payer == request.user
class AnonymousCanCreate(permissions.BasePerm... | {
"content_hash": "0757a6e2867778187f480ec859b1bae4",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 56,
"avg_line_length": 25.875,
"alnum_prop": 0.714975845410628,
"repo_name": "linkleonard/braintree-tutorial",
"id": "15ac7c48ae3894e5dcdbfb89db8dd84e8bfb3aaa",
"size": "41... |
"""Unit tests."""
import mock
import pytest
from google.rpc import status_pb2
from google.cloud import automl_v1beta1
from google.cloud.automl_v1beta1.proto import annotation_spec_pb2
from google.cloud.automl_v1beta1.proto import column_spec_pb2
from google.cloud.automl_v1beta1.proto import dataset_pb2
from google.c... | {
"content_hash": "9bb771f6ae298c2f12683e715610b0cc",
"timestamp": "",
"source": "github",
"line_count": 1239,
"max_line_length": 88,
"avg_line_length": 37.17756255044391,
"alnum_prop": 0.625621431517704,
"repo_name": "tseaver/google-cloud-python",
"id": "e3a5ce12f7cf70c378a7cbba447c785112add97f",
"... |
from __future__ import print_function
"""
MOSEK interface to solve QP problems
"""
from builtins import range
import numpy as np
import scipy.sparse as spa
from mathprogbasepy.quadprog.results import QuadprogResults
from mathprogbasepy.quadprog.solvers.solver import Solver
import mathprogbasepy.quadprog.problem as qp
... | {
"content_hash": "05e3fdfa59ed4ffb1a433ca0b403ae22",
"timestamp": "",
"source": "github",
"line_count": 254,
"max_line_length": 85,
"avg_line_length": 34.724409448818896,
"alnum_prop": 0.535374149659864,
"repo_name": "bstellato/mathprogbasepy",
"id": "1278ccd238653d0e65b8ba7bdc6f747ce3321186",
"siz... |
import sys
from os import path as osp
this = osp.splitext(osp.basename(__file__))[0]
BASE_DIR = osp.dirname(__file__)
from django.conf import settings
SETTINGS = dict(
DATABASES={'default': {'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'test.db'}},
DEBUG=True,
TEMPLATE_DEBUG... | {
"content_hash": "4dd90cd9e0a7bf10cf13487cbc3b576b",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 79,
"avg_line_length": 30.883116883116884,
"alnum_prop": 0.6269974768713205,
"repo_name": "YPCrumble/django-annoying",
"id": "70969f184def76444c05e4df08b9f6890712f6e7",
"si... |
from django.conf.urls.defaults import patterns, url
from .views import IndexView
from .views import UploadView
from .views import LaunchHeatView
from .views import DetailView
urlpatterns = patterns('',
url(r'^$', IndexView.as_view(), name='index'),
url(r'^launch/$', LaunchHeatView.as_view(), name='launch'),
... | {
"content_hash": "7b6dbe3c8168f4dce5959f50c02585e1",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 63,
"avg_line_length": 34.42857142857143,
"alnum_prop": 0.6473029045643154,
"repo_name": "hanney/heat-horizon",
"id": "8455b179199023ae6af6e57ed997b623e912920a",
"size": "4... |
'''
:codeauthor: :email:`Bo Maryniuk <bo@suse.de>`
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
Mock,
MagicMock,
call,
patch,
NO_MOCK,
NO_MOCK_REASON
)
from salt.exceptions... | {
"content_hash": "c90c8d9ce39372b06cc1fea9d04e287b",
"timestamp": "",
"source": "github",
"line_count": 656,
"max_line_length": 119,
"avg_line_length": 41.83536585365854,
"alnum_prop": 0.540008745080892,
"repo_name": "stephane-martin/salt-debian-packaging",
"id": "308bf9429a5ad0c6a75b4b6ded1e5459a9ef... |
import unittest as ut
from ctypes import windll, POINTER, byref, HRESULT
from comtypes import IUnknown, STDMETHOD, GUID
# XXX leaks references!
def method_count(interface):
return sum([len(base.__dict__.get("_methods_", ()))
for base in interface.__mro__])
class BasicTest(ut.TestCase):
... | {
"content_hash": "0b198699f94acc90205337a47b0a4c1e",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 81,
"avg_line_length": 32.50375939849624,
"alnum_prop": 0.5896368262780477,
"repo_name": "ezarko/cfn-init",
"id": "6aa8a44b4731e76f3defb0302af34005eb1a1e2f",
"size": "4336... |
from setuptools import setup
setup(name='genesisclient',
version='0.0.8',
description='Genesis (DeStatis et. al.) client for Python',
author='Marian Steinbach',
author_email='marian@sendung.de',
url='https://github.com/marians/genesisclient',
license="MIT",
packages=['genesisc... | {
"content_hash": "d8806c97e25543519cdcb9b10db71855",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 65,
"avg_line_length": 26.63157894736842,
"alnum_prop": 0.5810276679841897,
"repo_name": "marians/genesisclient",
"id": "daf1881060768355cb5bbbec5ceb56a13629ff29",
"size": ... |
import argparse
import json
import logging
import os
import pickle
import platform
import re
import socket
import subprocess
import sys
import tempfile
import shlex
from shutil import which, move
default_compiler = "gcc"
cstub = "{headers}\nint main(int argc, char **argv){{\n {fragment} return 0;\n}}"
log_disclaimer =... | {
"content_hash": "ef89d500b51c63b5116cf18b443e2a5e",
"timestamp": "",
"source": "github",
"line_count": 587,
"max_line_length": 122,
"avg_line_length": 33.57410562180579,
"alnum_prop": 0.5784960422163589,
"repo_name": "zolkis/soletta",
"id": "7e7299086bb86451d51178a0d60882fcee41dfca",
"size": "2038... |
import pygame
import time
#import thread
import fmuglobals
if fmuglobals.RUN_ON_RASPBERRY_PI:
import RPi.GPIO as GPIO
"""
AnalogButtons
"""
class AnalogButtons:
def __init__(self):
if fmuglobals.RUN_ON_RASPBERRY_PI:
GPIO.setmode(GPIO.BCM)
#import rotary_encoder
#self.encoder = rotary_encoder.RotaryE... | {
"content_hash": "9d4dd609ff6bb70f4f8e2f1e4069bbbe",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 102,
"avg_line_length": 32.495726495726494,
"alnum_prop": 0.6685954760652288,
"repo_name": "jwayneroth/mpd-touch",
"id": "c45c964ec6acd497d6e5583987cbb28a1d04c9a7",
"size"... |
from selenium.webdriver.remote.remote_connection import RemoteConnection
class ChromiumRemoteConnection(RemoteConnection):
def __init__(self, remote_server_addr, keep_alive=True):
RemoteConnection.__init__(self, remote_server_addr, keep_alive)
self._commands["launchApp"] = ('POST', '/session/$ses... | {
"content_hash": "2e7937078ed42c1e07a71a0bcf10c6d0",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 108,
"avg_line_length": 72.125,
"alnum_prop": 0.6906412478336221,
"repo_name": "oddui/selenium",
"id": "71770b02c9c89ea1427b814f50e389ec5b6c8e04",
"size": "1942",
"binary... |
"""Fichier contenant la fonction nb_familiers."""
from fractions import Fraction
from primaires.scripting.fonction import Fonction
class ClasseFonction(Fonction):
"""Retourne le nombre de familiers."""
@classmethod
def init_types(cls):
cls.ajouter_types(cls.nb_familiers, "Personnage")
@sta... | {
"content_hash": "464169c69375c0f2e39d7ea86d81f316",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 70,
"avg_line_length": 25,
"alnum_prop": 0.6752,
"repo_name": "stormi/tsunami",
"id": "9ebb83d896078e6a78da5d4663f8199e3c6fb907",
"size": "2194",
"binary": false,
"copi... |
import cgi
form = cgi.FieldStorage()
val1=form.getvalue("comments")
print "Content-type:text/html"
print
print "The form input is:<br/>"
print val1
| {
"content_hash": "09c513109d771004457d7e22eca7e27e",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 31,
"avg_line_length": 21.142857142857142,
"alnum_prop": 0.75,
"repo_name": "zturchan/CMPUT410-Lab3",
"id": "a64b1169e34d4ff7da19e080f72f4ba8b8a1ead9",
"size": "170",
"bin... |
import matplotlib.pyplot as plt
import sys
import os
import json
def report(samples, pid):
plt.figure(figsize=(25, 10))
x = [s['t'] for s in samples if s['type'] == 'proc']
lines = [s for s in samples if s['type'] == 'event']
# minuss = min(s['uss'] for s in samples if s['type'] == 'proc')
ussp... | {
"content_hash": "f29ce02c62d96d6d2d8a1c56ca0f245a",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 79,
"avg_line_length": 23.220588235294116,
"alnum_prop": 0.5756808106396454,
"repo_name": "squeaky-pl/japronto",
"id": "2906f16e66fb693c8ce8567ed1e7987a648d00db",
"size": "... |
"""
Test Manager - Fetch test results.
"""
__copyright__ = \
"""
Copyright (C) 2012-2015 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
you can redistribute it and/or modify it under the terms of the GNU
General Pu... | {
"content_hash": "ef7b148c61ab830256ef5b7ffd4ee9f7",
"timestamp": "",
"source": "github",
"line_count": 1786,
"max_line_length": 130,
"avg_line_length": 42.66013437849944,
"alnum_prop": 0.5349975718916933,
"repo_name": "egraba/vbox_openbsd",
"id": "9a4a35d95ca3020d07815584f99a67f8eabf9a60",
"size":... |
from . import __version__
from os.path import join
from requests_toolbelt import user_agent
from urlparse import urljoin
import logging
import logging.handlers
import requests
class Client(object):
LOG_INFO = logging.INFO
LOG_DEBUG = logging.DEBUG
VERBS = ('delete', 'get', 'post', 'put')
def __init_... | {
"content_hash": "5938c604b480f8f197c5a59517df98b2",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 119,
"avg_line_length": 38.58490566037736,
"alnum_prop": 0.5574572127139364,
"repo_name": "Panopta/python-panopta-api-client",
"id": "5f661cd3d40fb84136ba801db9dedc7ed93e5586... |
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General configurat... | {
"content_hash": "9e52e3cc214d5957936396443bc7b705",
"timestamp": "",
"source": "github",
"line_count": 235,
"max_line_length": 80,
"avg_line_length": 32.18723404255319,
"alnum_prop": 0.7020095187731359,
"repo_name": "iancmcc/droppy",
"id": "c4517bd0a49e6c30c61e1b38081061510319b046",
"size": "7981"... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'BlogUser'
db.delete_table('blogs_bloguser')
def backwards(self, orm):
# Adding model 'BlogUser'
... | {
"content_hash": "b6f7e6bbd1f7397507c8ca12354bd665",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 195,
"avg_line_length": 91.16776315789474,
"alnum_prop": 0.5382283961753563,
"repo_name": "carquois/blobon",
"id": "3fb490018b66427183871c25196299e1a8a52b80",
"size": "277... |
"""Tests for the replace script and ReplaceRobot class."""
#
# (C) Pywikibot team, 2015
#
# Distributed under the terms of the MIT license.
#
from __future__ import unicode_literals
__version__ = '$Id$'
#
import os
from pywikibot import fixes
from scripts import replace
from tests import _data_dir
from tests.aspect... | {
"content_hash": "17dcb45a9f3d23556b22bd89ab050c01",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 79,
"avg_line_length": 36.55688622754491,
"alnum_prop": 0.6152334152334152,
"repo_name": "valhallasw/pywikibot-core",
"id": "610b81155199c5f70d1e7b1bbd0fa9b8ea26222f",
"si... |
"""
This module contains classes for XML Schema elements, complex types and model groups.
"""
from __future__ import unicode_literals
from decimal import Decimal
from elementpath import XPath2Parser, ElementPathSyntaxError, XPathContext
from elementpath.xpath_helpers import boolean_value
from elementpath.datatypes impo... | {
"content_hash": "e1f54ffc4f316232929b9ef3615fe321",
"timestamp": "",
"source": "github",
"line_count": 849,
"max_line_length": 116,
"avg_line_length": 42.588928150765604,
"alnum_prop": 0.573925548979479,
"repo_name": "brunato/xmlschema",
"id": "ad38660fc4774a619f80e5cf9ba15ed230cf42a0",
"size": "3... |
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
from gias3.mapclientpluginutilities.viewers.mayaviscenewidget import MayaviSceneWidget
class Ui_Dialog(object):
def setupUi(self, Dialog):
if not Dialog.objectName():
Dialog.setObjectName(u"Dialog")
... | {
"content_hash": "75afdae26662fc6ec89016e10d981e02",
"timestamp": "",
"source": "github",
"line_count": 658,
"max_line_length": 152,
"avg_line_length": 50.787234042553195,
"alnum_prop": 0.7352025854330002,
"repo_name": "mapclient-plugins/fieldworklowerlimb2sidegenerationstep",
"id": "68bac7638cef908b... |
import asyncio
from typing import Sequence, Optional, TYPE_CHECKING
import aiorpcx
from .util import bh2u, VerifiedTxInfo, NetworkJobOnDefaultServer
from .bitcoin import Hash, hash_decode, hash_encode
from .transaction import Transaction
from .blockchain import hash_header
from .interface import GracefulDisconnect
fr... | {
"content_hash": "d7fdf45229b8920f5a40764fc41dec3d",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 129,
"avg_line_length": 44.005847953216374,
"alnum_prop": 0.6336212624584717,
"repo_name": "cryptapus/electrum",
"id": "714bd8f9a204e4a19bc74aea9823a45de5845049",
"size": ... |
from django.shortcuts import render, get_object_or_404
from django.template import RequestContext
from pbl.models import Treatment
def view_treatment(request,slug):
treatment = get_object_or_404(Treatment, slug=slug)
return render(request, 'pbl/treatment.html', {'treatment': treatment,
'treatments': Treatment... | {
"content_hash": "24d743932e34bc6b4bf33434864c9e29",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 83,
"avg_line_length": 40,
"alnum_prop": 0.759090909090909,
"repo_name": "hamole/pbl8",
"id": "bfdf2071e57281f654d333324085b7cfb06aa4a0",
"size": "440",
"binary": false,
... |
__author__ = 'cmantas'
from sys import stderr
from os.path import exists
from os import mkdir, remove, makedirs
from time import time, sleep
import ntpath
import thread
from lib.scp_utils import *
from lib.persistance_module import env_vars, home
from lib.tiramola_logging import get_logger
#choose the IaaS provider
... | {
"content_hash": "bed469fc4bca0eea59c2289f269f1819",
"timestamp": "",
"source": "github",
"line_count": 320,
"max_line_length": 124,
"avg_line_length": 32.125,
"alnum_prop": 0.540272373540856,
"repo_name": "cmantas/tiramola_v3",
"id": "432b2740f80250cf5d6301bc3316693167c97b44",
"size": "10280",
"... |
import simple_web_server
simple_web_server.close = True
print("Server Stopped.")
| {
"content_hash": "79e6070d0eb78281f783f24753745f39",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 30,
"avg_line_length": 21.5,
"alnum_prop": 0.7325581395348837,
"repo_name": "astinaam/Server",
"id": "a691d6d79b6668528b2b576496c50380f5df50b0",
"size": "86",
"binary": fa... |
"""
sphinx.ext.autosummary
~~~~~~~~~~~~~~~~~~~~~~
Sphinx extension that adds an autosummary:: directive, which can be
used to generate function/method/attribute/etc. summary lists, similar
to those output eg. by Epydoc and other API doc generation tools.
An :autolink: role is also provided.
... | {
"content_hash": "e89f16d7cebb6d624da72aca8e449e24",
"timestamp": "",
"source": "github",
"line_count": 566,
"max_line_length": 79,
"avg_line_length": 32.22791519434629,
"alnum_prop": 0.54377501233485,
"repo_name": "bitcraft/pyglet",
"id": "cfd5961b9b7bd0bede5701d4bdbf406914c4c98a",
"size": "18265"... |
"""Commands that can be used to operate on explorations.
All functions here should be agnostic of how ExplorationModel objects are
stored in the database. In particular, the various query methods should
delegate to the Exploration model class. This will enable the exploration
storage model to be changed without affect... | {
"content_hash": "2d6418dc5b052f60fed7f75d1a10a39a",
"timestamp": "",
"source": "github",
"line_count": 1284,
"max_line_length": 80,
"avg_line_length": 41.06464174454829,
"alnum_prop": 0.6691069091736681,
"repo_name": "Dev4X/oppia",
"id": "327a158dd1fd56f4af044a4ff1ace868e640f4f6",
"size": "53350",... |
"""
Utility functions for manipulation with Python dictionaries.
"""
def group_keys_by_values(d):
"""
Take a dict (A -> B( and return another one (B -> [A]). It groups keys
from the original dict by their values.
.. testsetup::
from proso.dict import group_keys_by_values
from pprint ... | {
"content_hash": "100f86844260e7e229842b9954c10eac",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 99,
"avg_line_length": 28.403225806451612,
"alnum_prop": 0.5820556501987507,
"repo_name": "adaptive-learning/proso-apps",
"id": "db34397ee4c98153c5003ae628e87b5041667d74",
... |
def test_modflow():
import flopy
mf = flopy.modflow.Modflow()
assert isinstance(mf, flopy.modflow.Modflow)
assert not mf.has_package("DIS") # not yet
dis = flopy.modflow.ModflowDis(mf)
assert mf.has_package("DIS")
assert mf.has_package("dis") # case-insensitive
assert not mf.has_packa... | {
"content_hash": "257bd59c658c123d2279c5bc040f2cd9",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 52,
"avg_line_length": 35.03846153846154,
"alnum_prop": 0.6948408342480791,
"repo_name": "jentjr/flopy",
"id": "a508e748bcebbd7ec54f59da0d293617864128e5",
"size": "951",
... |
"""
pygments.formatters.latex
~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for LaTeX fancyvrb output.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
from pygments.token import Token, STANDARD_TYPES
fro... | {
"content_hash": "4f811b07742b55f4bfa62514da058fea",
"timestamp": "",
"source": "github",
"line_count": 377,
"max_line_length": 80,
"avg_line_length": 36.93103448275862,
"alnum_prop": 0.5437046613517201,
"repo_name": "blighli/SublimeHighlight",
"id": "15c13d81b71b46def26bf1f9d6666ce2e418a94f",
"siz... |
from collections import defaultdict
import optparse
import re
import socket
from swift.common.utils import expand_ipv6, is_valid_ip, is_valid_ipv4, \
is_valid_ipv6
def tiers_for_dev(dev):
"""
Returns a tuple of tiers for a given device in ascending order by
length.
:returns: tuple of tiers
"... | {
"content_hash": "ac789b6bd96e3d750a057f7f42cf8aed",
"timestamp": "",
"source": "github",
"line_count": 649,
"max_line_length": 79,
"avg_line_length": 37.21109399075501,
"alnum_prop": 0.5290269151138717,
"repo_name": "larsbutler/swift",
"id": "a59fb3115ca85d1294a1561d6f15080795f0cddd",
"size": "247... |
import base64
import random
from pathlib import Path
from ... import options as opts
from ... import types
from ...charts.chart import Chart
from ...commons.utils import JsCode
from ...exceptions import WordCloudMaskImageException
from ...globals import ChartType
SHAPES = ("cardioid", "diamond", "triangle-... | {
"content_hash": "919db075f857287c81ba5179fa7bd4ff",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 88,
"avg_line_length": 35.26086956521739,
"alnum_prop": 0.512741471434443,
"repo_name": "chenjiandongx/pyecharts",
"id": "09842779642eba16a41ee56f104cd1e32a55ed7f",
"size"... |
from __future__ import print_function
import traceback
import errno
import filecmp
import os
import random
import re
import shutil
import stat
import subprocess
import sys
import tarfile
import tempfile
import time
from color import Coloring
from git_command import GitCommand, git_require
from git_config import GitCon... | {
"content_hash": "7f829e14365331bd473ad2ddb9e6f7ed",
"timestamp": "",
"source": "github",
"line_count": 2657,
"max_line_length": 102,
"avg_line_length": 30.825366955212647,
"alnum_prop": 0.5796002588427774,
"repo_name": "lshain/repo",
"id": "127176e54b6c5f38c3ebc258947a493c4de3df8a",
"size": "82504... |
import io
import os
import re
import sys
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
# intentionally *not* adding an encoding option to open, See:
# https://github.com/pypa/virtualenv/issues/201#issuecomment-3145690
return io.open(os.... | {
"content_hash": "ea0ee6b69bdf57a59543250fd181ffb7",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 103,
"avg_line_length": 43.18627450980392,
"alnum_prop": 0.6161180476730987,
"repo_name": "h3llrais3r/subliminal",
"id": "ccc1cdab7a0346d472e13a05744a841dbc8621c8",
"size"... |
import itertools
import logging
import os
import posixpath
import urllib.parse
from typing import List
from pip._vendor.packaging.utils import canonicalize_name
from pip._internal.models.index import PyPI
from pip._internal.utils.compat import has_tls
from pip._internal.utils.misc import normalize_path, redact_auth_f... | {
"content_hash": "932b68daaa2bd30c35558fa9b42be9fd",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 85,
"avg_line_length": 34.91729323308271,
"alnum_prop": 0.5546942291128337,
"repo_name": "sbidoul/pip",
"id": "a64af73899de1a292ebadebb3cf4ad9bae27d6fc",
"size": "4644",
... |
"""
Methods and interface objects used to interact with external APIs.
API method calls return objects that are in many cases objects with
attributes that are direct maps to the data returned from the API http call.
Unfortunately, these objects are also often constructed dynamically, making
it difficult to kno... | {
"content_hash": "67638e54f9e2d0e4479e7c6141f5c79e",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 76,
"avg_line_length": 32.666666666666664,
"alnum_prop": 0.7476190476190476,
"repo_name": "zhaogaolong/oneFinger",
"id": "66d0285ca754642aab98df656293801ea357436a",
"size":... |
"""
Decorators used for testing.
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from nose import SkipTest
from functools import wraps
from unittest import TestCase
from chevah.compat import process_capabilities
def skipOnCondition(callback, message):
... | {
"content_hash": "29f58945320a6464f7509d3d32bb476c",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 72,
"avg_line_length": 26.024390243902438,
"alnum_prop": 0.6091846298031866,
"repo_name": "chevah/empirical",
"id": "9d14a8b7ffec85188ce778636f7a9f7868a30e9b",
"size": "219... |
import os
import cv2
import numpy as np
import sqlite3
class face_rec():
def getProfile(self,id):
conn=sqlite3.connect("email_sys")
cmd="select Name from User where ID=" +str(id)
cursor=conn.execute(cmd)
data = cursor.fetchone()
conn.close()
return data
def rec(se... | {
"content_hash": "83e7dde8dd403bb3aed4b282828c2ee0",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 75,
"avg_line_length": 27.90909090909091,
"alnum_prop": 0.5822475570032574,
"repo_name": "yahya-idriss/Python-Personal-assistant",
"id": "188f60fb65cb284290da1f93b14afe5b4136... |
"""Script of running base tests on utils."""
from simplified_models import TrueModel
from utils import Coordinate2d
def create_input_data():
"""Utility function for creating input data."""
position = Coordinate2d(3.0, 4.0)
speed = Coordinate2d(2.0, 5.0)
sample_time = 0.1
return {'position': posit... | {
"content_hash": "677cf5b02693eac65b94df8c05004311",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 69,
"avg_line_length": 37.05042016806723,
"alnum_prop": 0.5622590156498072,
"repo_name": "lparolin/state_estimation",
"id": "260e7f08a64fe4578e6b487f26be3c5c01838ccb",
"si... |
import sys
import unittest
from stratuslab.VersionChecker import VersionChecker
class VersionCheckTest(unittest.TestCase):
MIN_SAVE = ()
VERSION_INFO_SAVE = ()
def setUp(self):
VERSION_INFO_SAVE = sys.version_info
sys.version_info = (2, 6, 5, 'final', 0)
VersionCheckTest.MIN_SAVE... | {
"content_hash": "cda79785f032e87fb51a08101854882e",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 66,
"avg_line_length": 24.341463414634145,
"alnum_prop": 0.6132264529058116,
"repo_name": "StratusLab/client",
"id": "856fd044659acf946ccfeb333b387067f91dc801",
"size": "17... |
"""EXRIOTensor"""
import tensorflow as tf
from tensorflow_io.python.ops import io_tensor_ops
from tensorflow_io.python.ops import core_ops
class EXRPartIOTensor(io_tensor_ops._TableIOTensor): # pylint: disable=protected-access
"""EXRPartIOTensor"""
# ========================================================... | {
"content_hash": "e8ec1667d307a0507668828035d2bdfa",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 88,
"avg_line_length": 41.01754385964912,
"alnum_prop": 0.4632164242942686,
"repo_name": "tensorflow/io",
"id": "a36e29c8f74c06ad6a8f122359fec19adab6eacf",
"size": "3027",
... |
"""Utility functions for LipidFinder."""
from __future__ import print_function
import os
def normalise_path(path):
# type: (str) -> str
"""Return a valid path for the current OS.
Keyword Arguments:
path -- path to normalize
"""
return os.path.normpath(os.path.realpath(path))
def trace... | {
"content_hash": "ead15c139b15fb135b941235ab559138",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 75,
"avg_line_length": 37.773109243697476,
"alnum_prop": 0.6093437152391546,
"repo_name": "cjbrasher/LipidFinder",
"id": "fc05f0fbeb642c29b2d5ec81825a7206eaf34abb",
"size"... |
"""
sentry.rules.conditions.regression_event
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: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
from sentry.rules.conditions.base import EventCondition
class Reg... | {
"content_hash": "f19e82d44d2d5a1c96730a29a9a9e523",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 75,
"avg_line_length": 27.555555555555557,
"alnum_prop": 0.6915322580645161,
"repo_name": "looker/sentry",
"id": "6227697ae5bac482a7d2081b9d1cdc28f938df96",
"size": "496",
... |
from gearshift import view, config
import unittest
class TestView(unittest.TestCase):
def setUp(self):
#if not view.engines:
# view.load_engines()
pass
def test_cycle(self):
oe = view.base.cycle(('odd','even'))
assert str(oe) == str(None)
assert oe.next() =... | {
"content_hash": "a979c8deafafe9c91f85ea651152aa93",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 90,
"avg_line_length": 41.088,
"alnum_prop": 0.6016355140186916,
"repo_name": "dbrattli/python-gearshift",
"id": "623b3d321489616b10866883da59d2d5c9a49895",
"size": "5162"... |
from pprint import pprint
import systextil.models
import lotes.models
def sync_regra_colecao():
colecoes = systextil.models.Colecao.objects.exclude(
colecao=0).order_by('colecao')
regra_colecao = lotes.models.RegraColecao.objects.all(
).order_by('colecao')
acoes = {}
inter_col = co... | {
"content_hash": "84826f2edca733925e778bbaa9d828fb",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 82,
"avg_line_length": 26.972972972972972,
"alnum_prop": 0.49749498997995995,
"repo_name": "anselmobd/fo2",
"id": "a4bfc4be3786dea9cbc6dcbc5a972c0a91583d20",
"size": "2000"... |
from app import db
from app.models.base_model import BaseEntity
class Location(db.Model, BaseEntity):
__tablename__ = 'location'
city = db.Column(db.String(256))
country = db.Column(db.String(256))
address = db.Column(db.String(256))
zip = db.Column(db.String(32))
postoffice_box = db.Column(d... | {
"content_hash": "3329ef8ae89dca0409a7f763a59c9112",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 63,
"avg_line_length": 31.333333333333332,
"alnum_prop": 0.6023936170212766,
"repo_name": "viaict/viaduct",
"id": "040ec36a791dee593664b0cbb7c6aaf0249c982d",
"size": "752",... |
""" (disabled by default) support for testing pytest and pytest plugins. """
import inspect
import sys
import os
import codecs
import re
import time
import platform
from fnmatch import fnmatch
import subprocess
import py
import pytest
from py.builtin import print_
from _pytest.core import HookRelay
from _pytest.main ... | {
"content_hash": "f224ac0e967ee3e3bc602feecff50be2",
"timestamp": "",
"source": "github",
"line_count": 702,
"max_line_length": 96,
"avg_line_length": 35.03703703703704,
"alnum_prop": 0.5642380874939015,
"repo_name": "mitodl/xanalytics",
"id": "9e987ae039ecd15f11cd112ddd07e53aecb859c1",
"size": "24... |
"""Tools for testing."""
# pylint: disable=too-many-lines
from __future__ import absolute_import, print_function, division
import time
import gzip
import struct
import traceback
import numbers
import subprocess
import sys
import os
import errno
import logging
import bz2
from contextlib import contextmanager
import nump... | {
"content_hash": "693b5241005f03a6154b6399aa6446a7",
"timestamp": "",
"source": "github",
"line_count": 1504,
"max_line_length": 100,
"avg_line_length": 38.297872340425535,
"alnum_prop": 0.5834722222222222,
"repo_name": "ShownX/incubator-mxnet",
"id": "bc92257176bd5cc8d6347aa26cc1f63d4f70d95d",
"si... |
"""Factory method for easily getting imdbs by name."""
__sets = {}
import datasets.pascal_voc
import datasets.nyud2_voc
import numpy as np
def _selective_search_IJCV_top_k(split, year, top_k):
"""Return an imdb that uses the top k proposals from the selective search
IJCV code.
"""
imdb = datasets.pas... | {
"content_hash": "c789fc949e76a917dba4bf991dba347b",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 77,
"avg_line_length": 36.80392156862745,
"alnum_prop": 0.6004262120404902,
"repo_name": "s-gupta/fast-rcnn",
"id": "28099ac18616271e0b46ab33fe806c39ea509234",
"size": "212... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.