text stringlengths 4 1.02M | meta dict |
|---|---|
"""
Test functions for models.regression
"""
# TODO: Test for LM
from statsmodels.compat.python import long, lrange
import warnings
import pandas
import numpy as np
from numpy.testing import (assert_almost_equal, assert_approx_equal,
assert_raises, assert_equal, assert_allclose)
from scipy.l... | {
"content_hash": "4f8a928317eaad513ff85afdb55b0c02",
"timestamp": "",
"source": "github",
"line_count": 1067,
"max_line_length": 131,
"avg_line_length": 34.829428303655106,
"alnum_prop": 0.5906143206953153,
"repo_name": "detrout/debian-statsmodels",
"id": "15956c98a081643ac89db3c7b1366e168acd87a3",
... |
from unittest import mock
import functools
from metafunctions.tests.util import BaseTestCase
from metafunctions.tests.simple_nodes import *
from metafunctions.api import store, recall, node, bind_call_state
from metafunctions.core import SimpleFunction, CallState
class TestUnit(BaseTestCase):
def test_bind_call_... | {
"content_hash": "8a24ac0de6bd48ed11c224d4fd425735",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 97,
"avg_line_length": 29.174418604651162,
"alnum_prop": 0.5328816261458749,
"repo_name": "ForeverWintr/metafunctions",
"id": "80b9ac76bf3054cc2751af597d81d36e0fd85ff2",
"s... |
from django import template
import json
import itertools
register = template.Library()
@register.filter
def decodejson(data):
return json.loads(data)
@register.filter
def encode2json(data):
return json.dumps(data)
| {
"content_hash": "3d384ea1b027939c44936aa4fcffbe71",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 29,
"avg_line_length": 17.307692307692307,
"alnum_prop": 0.7688888888888888,
"repo_name": "Pazitos10/TNT",
"id": "832d7d53ca04957d22f58fbd46fe794dae4fca0e",
"size": "225",
... |
"""Support for HomematicIP Cloud binary sensor."""
import logging
from typing import Any, Dict
from homematicip.aio.device import (
AsyncAccelerationSensor,
AsyncContactInterface,
AsyncDevice,
AsyncFullFlushContactInterface,
AsyncMotionDetectorIndoor,
AsyncMotionDetectorOutdoor,
AsyncMotion... | {
"content_hash": "d80663b2f9eb0b8f83b62c832e044166",
"timestamp": "",
"source": "github",
"line_count": 455,
"max_line_length": 88,
"avg_line_length": 34.51428571428571,
"alnum_prop": 0.6703387671930718,
"repo_name": "titilambert/home-assistant",
"id": "aae7f881be0dfa8e35d81d552bed2b4981e89e86",
"s... |
import unittest
import sys
import os
PROJECT_PATH = os.path.sep.join(os.path.abspath(__file__).split(os.path.sep)[:-2])
ROOT_PATH = os.path.dirname(__file__)
def main():
path_setup()
tests = unittest.TestLoader().discover(ROOT_PATH, "*.py")
result = unittest.TextTestRunner(verbosity=2).run(tests)
if ... | {
"content_hash": "c0a3e476192f12190e744c3fa45c1fe2",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 82,
"avg_line_length": 21.130434782608695,
"alnum_prop": 0.6440329218106996,
"repo_name": "viollarr/cursoaulahu",
"id": "391419d3ce31f4abff8a8b65888c060d70634bc4",
"size": ... |
from ..mpi import MPI
from .mpi import MPITestCase
import sys
import os
import re
import shutil
import unittest
import numpy as np
import numpy.testing as nt
from ..dist import *
from .. import qarray as qa
from ..tod import Interval, TODCache, TODGround
from ._helpers import (create_outdir, create_distdata, bor... | {
"content_hash": "05b7aa0f3e7063925c5acfad98df6612",
"timestamp": "",
"source": "github",
"line_count": 547,
"max_line_length": 83,
"avg_line_length": 32.80438756855576,
"alnum_prop": 0.5691038787338386,
"repo_name": "tskisner/pytoast",
"id": "ad50da9c8e8cd41addddc6ebed0bee9bd3ce9845",
"size": "181... |
import argparse
import os
import sys
import yaml
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(base_dir)
#sys.path.append(os.path.join(base_dir, '/netconf/protos/third_party'))
from common.... | {
"content_hash": "71e3e1286590ddff2d006a10e3a8d020",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 90,
"avg_line_length": 32.43981481481482,
"alnum_prop": 0.5326102468959611,
"repo_name": "opencord/voltha",
"id": "f51a8ff83132d8256aa2b6a3faaee6eaded92fe7",
"size": "7629... |
from collections import defaultdict
import copy
import numpy as np
import torch
import torch.nn as nn
import torch.utils.data
from torch_deep_neural_classifier import TorchDeepNeuralClassifier
__author__ = "Atticus Geiger"
__version__ = "CS224u, Stanford, Spring 2022"
class IITModel(torch.nn.Module):
def __init_... | {
"content_hash": "e5a7d01c104be6e9798002eca1d5cd86",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 116,
"avg_line_length": 36.80203045685279,
"alnum_prop": 0.5984827586206897,
"repo_name": "cgpotts/cs224u",
"id": "53de83712460127f2deb44c8f763d4b40722a5a6",
"size": "7250... |
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 field 'SubtaskIssue.description'
db.add_column(u'project_subtaskissue', 'description',
self.gf('djang... | {
"content_hash": "2874055c74d7070cf67cafc48376ed4f",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 118,
"avg_line_length": 70.94214876033058,
"alnum_prop": 0.5540540540540541,
"repo_name": "sushant-hiray/teamflowy",
"id": "1c418e64dfd6a0d3115091110eb1b072784eafed",
"siz... |
__title__ = 'latinpigsay'
__license__ = 'MIT'
__author__ = 'Steven Cutting'
__author_email__ = '[email protected]'
__created_on__ = '12/3/2014'
from data import charpool as charp
import generalfunctions as gfunc
import re
import string
from string import ascii_letters
import logging
_LOG = logging.getLogg... | {
"content_hash": "9ec4e88967e9950c577132e97330e4a5",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 77,
"avg_line_length": 30.180722891566266,
"alnum_prop": 0.4782435129740519,
"repo_name": "steven-cutting/latinpigsay",
"id": "09798bd5ece2a6770996e0d8307e7586933af463",
"s... |
from __future__ import annotations
import json
import re
import unittest
from unittest import mock
from unittest.mock import patch
import pytest
from parameterized import parameterized
from trino.transaction import IsolationLevel
from airflow import AirflowException
from airflow.models import Connection
from airflow... | {
"content_hash": "28478d5ddb604a094221a2bf48a7c235",
"timestamp": "",
"source": "github",
"line_count": 290,
"max_line_length": 108,
"avg_line_length": 38.43448275862069,
"alnum_prop": 0.6240803875829894,
"repo_name": "cfei18/incubator-airflow",
"id": "11d95c2bcce31ce3facb472b77960d19dfe34ab9",
"si... |
from typing import Optional
from es.elastic.api import Connection as ESConnection, connect
from airflow.hooks.dbapi import DbApiHook
from airflow.models.connection import Connection as AirflowConnection
class ElasticsearchHook(DbApiHook):
"""
Interact with Elasticsearch through the elasticsearch-dbapi.
... | {
"content_hash": "413ce332e8e90cc28496c16dd10d39fe",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 110,
"avg_line_length": 31.233766233766232,
"alnum_prop": 0.6070686070686071,
"repo_name": "sekikn/incubator-airflow",
"id": "df1561911e38700b15fbe1af04b268d2efdd4511",
"si... |
import rosbag
import yaml
import matplotlib
import sys
if "-o" in sys.argv: # write to file mode
matplotlib.use("AGG")
else:
matplotlib.use("WXAgg")
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from matplotlib.widgets import Button
import time
#from progressbar import *
from... | {
"content_hash": "bc626fdfe3ddfff5a0aa536bc97082d5",
"timestamp": "",
"source": "github",
"line_count": 335,
"max_line_length": 131,
"avg_line_length": 40.376119402985076,
"alnum_prop": 0.5207748040810292,
"repo_name": "AtsushiSakai/jsk_visualization_packages",
"id": "bcf9967562e489787d3f79f14e671d1b... |
from .io import load_scoring_matrix
import array
import itertools
class Directions:
undefined, diag, up, left = range(4)
def __init__(self):
pass
def levenshtein(first, second, scoring_matrix=None, gap=1):
"""
Calculate the levenshtein distance between two sequences. http://en... | {
"content_hash": "471a41e3f0e8ad17605415b8e71ce640",
"timestamp": "",
"source": "github",
"line_count": 451,
"max_line_length": 132,
"avg_line_length": 38.4390243902439,
"alnum_prop": 0.5369173973234886,
"repo_name": "billletson/rosalind",
"id": "f614d939a42161e5eb65413ba8c8c3d4af0dfa9e",
"size": "... |
import random
import copy
from matplotlib import pyplot as plt
import csv
class Kmean(object):
"""docstring for Kmean"""
def __init__(self, k):
super(Kmean, self).__init__()
self.k = k
self.data = []
self.dim = int
self.centers = []
self.clusters = {}
self.index2point = {}
self.label = {}
self.get... | {
"content_hash": "860f71bd6566334a8e9e2f00d50b3be7",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 117,
"avg_line_length": 22.236559139784948,
"alnum_prop": 0.6112185686653772,
"repo_name": "hitlonewind/PR-experiment",
"id": "cfffae6f852a188e43008407f6e7bd4275bab605",
"... |
from server import Server
# Create an echo server class
class EchoServer(Server):
def onStart(self):
print "Echo server has started"
def onMessage(self, socket, message):
# This function takes two arguments: 'socket' and 'message'.
# 'socket' can be used to send a message string ba... | {
"content_hash": "f306539ab10ef6aaa5f56affb5a67261",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 82,
"avg_line_length": 33.21052631578947,
"alnum_prop": 0.6450079239302694,
"repo_name": "QasAshraf/cloaked-octo-hipster.py",
"id": "d05d47af6970bfe87827f9200f23bdbc38be5e05"... |
"""
Django settings for develop project.
Generated by 'django-admin startproject' using Django 1.10.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os... | {
"content_hash": "649180f54bc7120c6e937019ddfa7d4f",
"timestamp": "",
"source": "github",
"line_count": 297,
"max_line_length": 127,
"avg_line_length": 30.316498316498315,
"alnum_prop": 0.5638605064415815,
"repo_name": "munisisazade/developer_portal",
"id": "0e6869e24cc434ef85162bf1f870aefaa0f82cc8",... |
"""
Common functions used by two or more scripts
"""
def board_full(board, glength):
"""
Returns True if the board is full or False if not
"""
for i in range(glength):
for j in range(glength):
if board[i][j] == -1:
return False
return True
def win(board, playe... | {
"content_hash": "235d90009d771f8ba259420ae5c6c4fd",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 54,
"avg_line_length": 21.545454545454547,
"alnum_prop": 0.48860759493670886,
"repo_name": "sk364/N_by_N_Tic_Tac_Toe",
"id": "791add960c5a348fd9c4ee57415ef0daf86ff8d5",
"si... |
from .testutils import FullStackTests
import os
import time
import json
import yaml
from datetime import datetime
from webrecorder.models.usermanager import CLIUserManager
from webrecorder.models.datshare import DatShare
from webrecorder.utils import get_new_id, today_str
import responses
from itertools import coun... | {
"content_hash": "ea9df80a6568f7b1d37b062c10b91a82",
"timestamp": "",
"source": "github",
"line_count": 313,
"max_line_length": 140,
"avg_line_length": 38.11182108626198,
"alnum_prop": 0.6106966216782631,
"repo_name": "webrecorder/webrecorder",
"id": "63927bf2f3f98c80a1b3a1e8d7078ea1582b75b0",
"siz... |
from bs4 import BeautifulSoup
import urllib
import urllib2
import cookielib
import re
import json
import os
import sys
from meiju import Meiju
from meiju import Season
from meiju import Episode
import logger
logger = logger.get_logger(__name__)
def dumper(obj):
try:
return obj.to_json()
except:
... | {
"content_hash": "c6e9eb1994143a2acd957309c4696526",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 143,
"avg_line_length": 47.651933701657455,
"alnum_prop": 0.5935072463768116,
"repo_name": "leodengyx/LeoMeijuDownloader",
"id": "d748724eff779d94c19579ae6bb7cafaeb85aa91",
... |
from direct.actor.Actor import Actor
from direct.task.Task import Task
from panda3d.core import *
from panda3d.direct import *
from otp.otpbase.OTPBase import OTPBase
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocalizer
from toontown.parties.DistributedPartyActivity import Distributed... | {
"content_hash": "82d22f4325488445b0acfcc5601912e6",
"timestamp": "",
"source": "github",
"line_count": 232,
"max_line_length": 171,
"avg_line_length": 39.366379310344826,
"alnum_prop": 0.6548779152523815,
"repo_name": "silly-wacky-3-town-toon/SOURCE-COD",
"id": "e143162207a9e2e7895b6b859d95f81596539... |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Youtube'
db.create_table(u'filer_embeddable_youtube', (
(u'embeddable... | {
"content_hash": "0e554b255cb71a78943dc625cee5e0c8",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 195,
"avg_line_length": 77.17,
"alnum_prop": 0.5621355449008683,
"repo_name": "sthzg/djf-embeddable",
"id": "c2dd47314e7df83c60b1a7255e61f863c6243405",
"size": "7741",
"... |
import os
import re
import subprocess
from django.utils.text import slugify
from django.conf import settings
from django.core.cache import cache
# These options are passed to Fabric as: fab task --abort-on-prompts=True --user=root ...
fabric_special_options = ['no_agent', 'forward-agent', 'config', 'disable-known-hos... | {
"content_hash": "17809ce5800394ac2c57139cc6bc09e6",
"timestamp": "",
"source": "github",
"line_count": 277,
"max_line_length": 129,
"avg_line_length": 34.35379061371841,
"alnum_prop": 0.5994115174443043,
"repo_name": "paperreduction/fabric-bolt",
"id": "c4f60625ee6806b6750f6c5ed9b88cd229e3b79b",
"... |
"""
Opens a window that displays an image.
Usage:
from viewer import GlobalViewer
GlobalViewer.update(image)
"""
import numpy as np
import os
import contextlib
class TkViewer:
def __init__(self, title="HyperGAN", viewer_size=1, enabled=True):
self.screen = None
self.title = title
... | {
"content_hash": "0a2cc907e06c6374a233e691bd27386a",
"timestamp": "",
"source": "github",
"line_count": 227,
"max_line_length": 164,
"avg_line_length": 41.72687224669603,
"alnum_prop": 0.5482474662162162,
"repo_name": "255BITS/HyperGAN",
"id": "5c9c9b69a77fc40fd2e41b431969a91758803185",
"size": "94... |
from arcgis.gis import GIS
from arcgis import features
from arcgis.features import FeatureLayerCollection
import glob, os
#Credentials
gis = GIS("https://www.arcgis.com",'Username', "Password")
#ZipGDB file path
#create list of paths
dir = r"C:\Users\SROSS-C\Documents\ArcGIS\Projects\UpdateSericeTest\Shps"
dirlist = ... | {
"content_hash": "dcfdd501cfe175d523bd3e3aa10607cf",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 73,
"avg_line_length": 21.90909090909091,
"alnum_prop": 0.7040110650069157,
"repo_name": "TxDOT/python",
"id": "ade4b3f7e07eed5e40dcc8bc76a3ec355534cc07",
"size": "723",
... |
from __future__ import absolute_import
from . import _base
class Filter(_base.Filter):
def __init__(self, source, encoding):
_base.Filter.__init__(self, source)
self.encoding = encoding
__init__.func_annotations = {}
def __iter__(self):
state = u"pre_head"
meta_found = (sel... | {
"content_hash": "30eacf7d0ba5e2c9b73f87847560cfad",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 104,
"avg_line_length": 43.215384615384615,
"alnum_prop": 0.4421502313990744,
"repo_name": "rcarmo/soup-strainer",
"id": "106ca33a34cd0aa4b767ca061351bb99a5dd54c8",
"size":... |
'''ordering services keys'''
from callchain.services.queue import KService
class KRandom(KService):
'''random key'''
def choice():
'''random choice of/from incoming things'''
def sample(n):
'''
random sampling drawn from `n` incoming things
@param n: number of incoming... | {
"content_hash": "1165bf1458b1c17300cc994e3f2f720e",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 78,
"avg_line_length": 21.454545454545453,
"alnum_prop": 0.590042372881356,
"repo_name": "lcrees/callchain",
"id": "2e40794f3a2cfc5a258e476b7ab440eea0b56cb2",
"size": "1028... |
"""
==================
`match_wrapper.io`
==================
I/O for MATCH-related files.
Classes
-------
======================= ==================================================
`CMDParam` Class for storing CMD information.
`CalcsfhParam` Class for storing calcsfh parameter file
... | {
"content_hash": "a0d2c258c828ea035d5604b6182cb5a1",
"timestamp": "",
"source": "github",
"line_count": 985,
"max_line_length": 96,
"avg_line_length": 32.169543147208124,
"alnum_prop": 0.5210338624672579,
"repo_name": "jesaerys/match-wrapper",
"id": "4187b0056140fe717cb76b2b775913d7cf77daca",
"size... |
import os
import shutil
from PyQt4 import QtCore, QtGui
from serieswatcher.const import SERIES_IMG, SERIES_BANNERS
from serieswatcher.models import Serie, Episode
from serieswatcher.widgets.listseries import ListSeries
from serieswatcher.widgets.selectfolder import SelectFolder
class EditSeries(QtGui.QDialog):
""... | {
"content_hash": "c9d69fb301f873b226b845f8836d5f7a",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 79,
"avg_line_length": 36.61052631578947,
"alnum_prop": 0.6408855664174813,
"repo_name": "lightcode/SeriesWatcher",
"id": "3da1a6cb88242937f6c72c1906d2a3ed71e364ee",
"size"... |
import pickle
import sys, os
from GPSReader import *
from VideoReader import *
from WGS84toENU import *
from GPSReprojection import *
from transformations import euler_matrix
from numpy import array, dot, zeros, around, divide, nonzero, float32, maximum
import numpy as np
from cv2 import imshow, waitKey, resize, warpPe... | {
"content_hash": "0b1a672d03082dc2c4357ee42a5cb166",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 133,
"avg_line_length": 32.178082191780824,
"alnum_prop": 0.6121753937845892,
"repo_name": "sameeptandon/sail-car-log",
"id": "e3e876048173d90bbbaaa1a79d8428e1a0607252",
"... |
"""
Interface for monitoring clients
"""
import pghoard
class Metrics:
def __init__(self, **configs):
self.clients = self._init_clients(configs)
def _init_clients(self, configs):
clients = []
if not isinstance(configs, dict):
return clients
map_client = pghoard.... | {
"content_hash": "e73ce432d6e3dfa933fefa6a43a10950",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 60,
"avg_line_length": 29.878048780487806,
"alnum_prop": 0.5975510204081632,
"repo_name": "saaros/pghoard",
"id": "735eeb8f6b4e3fa19fce402a1d832af37acad1af",
"size": "1225"... |
"""
Set or get caller's attrubutes.
"""
from muddery.statements.statement_function import StatementFunction
class FuncSetAttr(StatementFunction):
"""
Set the caller's attribute.
Args:
args[0]: (string) attribute's key
args[1]: attribute value. Optional, default: None
Returns:
... | {
"content_hash": "b240c62e7b57391293cf509b2d65a99a",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 98,
"avg_line_length": 19.533333333333335,
"alnum_prop": 0.5535836177474402,
"repo_name": "MarsZone/DreamLand",
"id": "81adb5c106f84afc3a348e97e103f23d551e442c",
"size": "... |
"""
Wavefront REST API Documentation
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST API... | {
"content_hash": "787ab2645f1126634f37eda751642889",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 409,
"avg_line_length": 33.189189189189186,
"alnum_prop": 0.6140065146579805,
"repo_name": "wavefrontHQ/python-client",
"id": "c90630f49085919cb005abae2513e734824f7dba",
"... |
from api.decorators import api_view, request_data
from api.permissions import IsAdmin, IsSuperAdminOrReadOnly
from api.dc.storage.api_views import DcStorageView
__all__ = ('dc_storage_list', 'dc_storage')
@api_view(('GET',))
@request_data(permissions=(IsAdmin, IsSuperAdminOrReadOnly))
def dc_storage_list(request, d... | {
"content_hash": "45d1e9a1f5cea675299d18cd058df338",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 101,
"avg_line_length": 35.47572815533981,
"alnum_prop": 0.6048166392993979,
"repo_name": "erigones/esdc-ce",
"id": "be832b244dbbf8dae39692562ceff95badd64923",
"size": "36... |
from django.apps import AppConfig
class CodeSnippetsConfig(AppConfig):
name = 'code_snippets'
| {
"content_hash": "d326f457ed3fe6b18a2ba2fdc1b7e14d",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 36,
"avg_line_length": 20,
"alnum_prop": 0.77,
"repo_name": "thjwhite/personal_website",
"id": "e7530d72602a55455a40871a44f801840e4c0e3c",
"size": "100",
"binary": false,
... |
import sqlite3
conn = sqlite3.connect('database name')
print("Opened database successfully")
conn.execute('''CREATE TABLE IF NOT EXISTS QUERY_TABLE
(Q_ID INT NOT NULL ,
Q_STRING VARCHAR(40) PRIMARY KEY );''')
print("Table created successfully")
conn.execute('''CREATE TABLE IF NOT EXISTS ... | {
"content_hash": "ef65ce3116df3f76f292012f7fa57731",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 57,
"avg_line_length": 32.95652173913044,
"alnum_prop": 0.6094986807387863,
"repo_name": "mzmmoazam/Entity-Extraction-from-Google-searches-use-database-",
"id": "df707d9afab3... |
import math
import re
import textwrap
import operator
import numpy as np
import unittest
from numba.core.compiler import compile_isolated
from numba import jit
from numba.core import types
from numba.core.errors import TypingError
from numba.core.types.functions import _header_lead
from numba.tests.support import Tes... | {
"content_hash": "4d809fb3d0df64e1101a7260b743b93f",
"timestamp": "",
"source": "github",
"line_count": 241,
"max_line_length": 101,
"avg_line_length": 31.439834024896264,
"alnum_prop": 0.6018213013065857,
"repo_name": "sklam/numba",
"id": "ce3bcc6dddc9e3212226da8b35372f7edd89cdf3",
"size": "7577",... |
"""
Grafeas API
An API to insert and retrieve annotations on cloud artifacts. # noqa: E501
OpenAPI spec version: v1alpha1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import grafeas
from grafeas.models.build_signa... | {
"content_hash": "fb5b807db1309b6581f7cc95d023d04a",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 95,
"avg_line_length": 23.973684210526315,
"alnum_prop": 0.6981339187705817,
"repo_name": "grafeas/client-python",
"id": "690f6d7908ead0be73fb9289b44bd196ee245cf0",
"size":... |
from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
import pytest
from openpyxl.xml.functions import fromstring, tostring
from openpyxl.tests.helper import compare_xml
@pytest.fixture
def ChartsheetProperties():
from ..properties import ChartsheetProperties
return ChartsheetProperties... | {
"content_hash": "431b2609afe5ad4f4a6b54854ce1e6e6",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 58,
"avg_line_length": 28.790697674418606,
"alnum_prop": 0.6534733441033925,
"repo_name": "cgimenop/Excel2Testlink",
"id": "3ba3874ec87594f2cdd3d209c12db793dcf99f9f",
"size... |
import datetime
from typing import List, Dict, TYPE_CHECKING
from collections import deque
from gravity.models import TiltConfiguration, GravityLogPoint, GravitySensor
# from asgiref.sync import sync_to_async
class TiltHydrometer(object):
# These are all the UUIDs currently available as Tilt colors
tilt_col... | {
"content_hash": "72f524d771757da3a9e29c9131b65691",
"timestamp": "",
"source": "github",
"line_count": 269,
"max_line_length": 122,
"avg_line_length": 43.54275092936803,
"alnum_prop": 0.6108597285067874,
"repo_name": "thorrak/fermentrack",
"id": "7b2a2699920139ba4b25fece9cf6af8bf05189a1",
"size": ... |
from __future__ import unicode_literals
from ..base import StdOutCommandLine
def test_StdOutCommandLine_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefault=True,
),
out_file=dict(argstr='> ... | {
"content_hash": "9c4f0e7691aab966baaf68661611a71a",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 66,
"avg_line_length": 24.40740740740741,
"alnum_prop": 0.629742033383915,
"repo_name": "mick-d/nipype",
"id": "ad49a04abb16c7977efeabb592add9a0dba4c534",
"size": "713",
... |
import copy
import uuid
import ldap
import mock
from testtools import matchers
from keystone import assignment
from keystone.common import cache
from keystone.common import ldap as common_ldap
from keystone.common.ldap import core as common_ldap_core
from keystone.common import sql
from keystone import config
from ke... | {
"content_hash": "2b9a240426df659fa6a51fc24faa0d8c",
"timestamp": "",
"source": "github",
"line_count": 2780,
"max_line_length": 79,
"avg_line_length": 43.84496402877698,
"alnum_prop": 0.5955172328922216,
"repo_name": "ging/keystone",
"id": "d46f675bb53d0121e396599eb5f7978d7b94b752",
"size": "12260... |
from builtins import input
import matplotlib
matplotlib.use("TkAgg")
import pylab
pylab.ion() # turn on interactivity
pylab.plot([1,2,3])
pylab.ylabel('Y')
pylab.draw() # draw the current plot
ans=input('press [s] to save figure, any other key to quit: ')
if ans=='s':
pylab.savefig('myfig.eps')
| {
"content_hash": "42e3397502368bea13f6b1dd75788572",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 62,
"avg_line_length": 27.818181818181817,
"alnum_prop": 0.7026143790849673,
"repo_name": "Caoimhinmg/PmagPy",
"id": "1e5a29e30b1bdb11e6e86e23143c92f6b1b249ef",
"size": "32... |
from pymongo import MongoClient
from config import MONGO_URI, MONGO_DBNAME, MONGO_ACCOUNTSCOLLECTION, MONGO_SPFYIDSCOLLECTION
# Connection to MongoDB
client = MongoClient(MONGO_URI, connect=False)
# Access Spfy's DB in MongoDB
db = client[MONGO_DBNAME]
# Access the collection of accounts information from Spfy's DB
col... | {
"content_hash": "68078a3154b995cbd6e0a473689fb666",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 93,
"avg_line_length": 45.03448275862069,
"alnum_prop": 0.7281776416539051,
"repo_name": "superphy/backend",
"id": "4a7c0029820cd4f9268b9f064920c75d1bc49e65",
"size": "1306... |
"""Top-level presubmit script for Chromium.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built into gcl.
"""
import re
import subprocess
import sys
_EXCLUDED_PATHS = (
r"^breakpad[\\\/].*",
r"^native_client_sdk[\\\/]src[\\\/]build_tool... | {
"content_hash": "56355c41a2956ac3e00f623e14a331f3",
"timestamp": "",
"source": "github",
"line_count": 875,
"max_line_length": 80,
"avg_line_length": 36.369142857142855,
"alnum_prop": 0.650724318888854,
"repo_name": "timopulkkinen/BubbleFish",
"id": "a5ea9e45b442405f8db7a086ab7218c239effde2",
"siz... |
"""Robotiq 2-finger 85 adaptive gripper class."""
from typing import List, Tuple, Optional
from dm_control import mjcf
from dm_robotics.moma.models import types
from dm_robotics.moma.models import utils as models_utils
from dm_robotics.moma.models.end_effectors.robot_hands import robot_hand
from dm_robotics.moma.mode... | {
"content_hash": "1e23ab0cdd1c278768cc74509dba71e0",
"timestamp": "",
"source": "github",
"line_count": 393,
"max_line_length": 94,
"avg_line_length": 36.73791348600509,
"alnum_prop": 0.6481507133952071,
"repo_name": "deepmind/dm_robotics",
"id": "263f73c5f57c9cb4d91751602dcd655fa151d739",
"size": ... |
from rest_framework import serializers
from rest_framework.authtoken.models import Token
from chronos.settings import MEDIA_URL
from urlparse import urlparse
import app
##############################
# --------- Users! --------- #
##############################
class ChronosPublicUserSerializer(serializers.ModelSe... | {
"content_hash": "7a8f3f7305399e57644bccbdfab16d6c",
"timestamp": "",
"source": "github",
"line_count": 344,
"max_line_length": 211,
"avg_line_length": 38.81395348837209,
"alnum_prop": 0.6358597962852007,
"repo_name": "paulmoon/chronos",
"id": "a34e6199f26bd5f03084a12d27763528c8936df2",
"size": "13... |
"""
Computes auto-correlation function for irregularly sampled time series.
Uses the method proposed in:
Rehfeld, K., Marwan, N., Heitzig, J., & Kurths, J. (2011). Comparison of correlation analysis techniques for irregularly sampled time series. Nonlinear Processes in Geophysics, 18(3), 389-404.
This script provide... | {
"content_hash": "84120b463f0ccacaf555cdaed76ab5d9",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 192,
"avg_line_length": 25.866666666666667,
"alnum_prop": 0.6461141950832673,
"repo_name": "pik-copan/pyregimeshifts",
"id": "4df7f69f361443c28b6842f8f396c0647a92a172",
"s... |
"""
WSGI config for get_a_room 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.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SE... | {
"content_hash": "20c9d333d397bc9869aced1c2e9142e8",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 24.8125,
"alnum_prop": 0.7632241813602015,
"repo_name": "ViktorMarinov/get-a-room",
"id": "b37f9e8c9cad598ea8fd74c0bf7b6463e3f501c8",
"size": "397",
... |
"""Airflow module for email backend using AWS SES"""
from typing import List, Optional, Union
from airflow.providers.amazon.aws.hooks.ses import SesHook
def send_email(
from_email: str,
to: Union[List[str], str],
subject: str,
html_content: str,
files: Optional[List] = None,
cc: Optional[Uni... | {
"content_hash": "1148ec448ec8cc8817f48b269c7b7712",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 58,
"avg_line_length": 25.757575757575758,
"alnum_prop": 0.6011764705882353,
"repo_name": "mistercrunch/airflow",
"id": "33cca1a28e017380e5d8fa628783a78b010b30b8",
"size": ... |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'BuildConfiguration.build_script'
db.add_column(u'webui_buildconfiguration', 'buil... | {
"content_hash": "520c9e1b3f0975b79d022a5636da0403",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 128,
"avg_line_length": 59.810344827586206,
"alnum_prop": 0.5601037763044104,
"repo_name": "daniel-yavorovich/cpan2repo",
"id": "9b97f71d7607b034e46267426a99eee1fd79d32f",
... |
from rest_framework_3 import serializers
class PostSerializer(serializers.Serializer):
"""
Blog post serializer
"""
title = serializers.CharField(max_length=50)
| {
"content_hash": "7dd2a7927ab7cc2d79a21fa1e0d8acca",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 48,
"avg_line_length": 20,
"alnum_prop": 0.7166666666666667,
"repo_name": "coUrbanize/rest_framework_ember",
"id": "cc9005574b132225af987eb847268bf49a8fdd1a",
"size": "180",... |
class GuildUpgrade(object):
"""
https://wiki.guildwars2.com/wiki/API:2/guild/upgrades
"""
def __init__(self):
pass
def __repr__(self):
return ''
| {
"content_hash": "43d0227040ac8a68aaf249c3fda8356b",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 54,
"avg_line_length": 15.6,
"alnum_prop": 0.6282051282051282,
"repo_name": "anasazy/gw2api-python",
"id": "bbb42e218ef4b2dbc0c27a2253c92f405c3f93e7",
"size": "245",
"bin... |
"""
Copyright (c) 2012, Rui Carmo
Description: Docstring utility functions
License: MIT (see LICENSE.md for details)
"""
import os, sys, logging
import inspect
from bottle import app
log = logging.getLogger()
def docs():
"""Gather all docstrings related to routes and return them grouped by module"""
routes ... | {
"content_hash": "ee637d46ea05d3d8147b4ee2ac783c04",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 83,
"avg_line_length": 27.151515151515152,
"alnum_prop": 0.5959821428571429,
"repo_name": "Velmont/digital-signage-server",
"id": "5b8cd3da3d2b9adcc30867012bb38534162c1376",
... |
from blueman.plugins.AppletPlugin import AppletPlugin
import dbus
from gi.repository import GObject
from blueman.main.SignalTracker import SignalTracker
from blueman.gui.Notification import Notification
from blueman.Sdp import *
from blueman.Functions import get_icon, composite_icon
import weakref
class ConnectionHand... | {
"content_hash": "74bc495d1b5128f95ff797bac2673caa",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 110,
"avg_line_length": 28.885714285714286,
"alnum_prop": 0.6752390372568414,
"repo_name": "nmercier/linux-cross-gcc",
"id": "84ab1f72e02358b2a3c06601b075668046d44553",
"s... |
from rest_framework.views import APIView
from rest_framework.exceptions import APIException, NotFound
from rest_framework.response import Response
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from returntoclinicstation.models import *
from datetime... | {
"content_hash": "a36f698589b735efd5723122ff0ad743",
"timestamp": "",
"source": "github",
"line_count": 309,
"max_line_length": 130,
"avg_line_length": 33.19093851132686,
"alnum_prop": 0.5113104524180967,
"repo_name": "slogan621/tscharts",
"id": "e429852217d595eec8d6ec6156c2f59bfd1f457a",
"size": "... |
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import ugettext_lazy as _
from autoslug import AutoSlugField
from . import utils
class Category(models.Model):
name = models.CharField(max_length=200, db_index=True,
... | {
"content_hash": "0831109c8e1b07d7202331228248fe87",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 79,
"avg_line_length": 35.57988165680474,
"alnum_prop": 0.5983701979045402,
"repo_name": "samitnuk/online_shop",
"id": "eaede28f22fef53b7a25f547d6963f108a8057d4",
"size": ... |
import os
import csv
import math
rawdata_dir = 'rawdata_to_select/'
selected_dir = 'selected/'
filelist = os.listdir(rawdata_dir)
write_recurerror = open('ErrorList/RecursionErrorList.txt', 'a')
write_unexperror = open('ErrorList/UnexpectedErrorList.txt', 'a')
# 2D array declaration
rawdata = []
zerorow = []
image = ... | {
"content_hash": "14f551d1c41d5796e6d90ade0053d70c",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 165,
"avg_line_length": 37.77064220183486,
"alnum_prop": 0.5273257226135536,
"repo_name": "seungwonpark/SunSpotTracker",
"id": "e21b72b30450a80c47937a4df15653fd243b6374",
... |
from __future__ import print_function
import os
import sys
import unittest
import tempfile
import shutil
import platform
import getpass
import time
import glob
import logging
import numpy
from analysis_server.server import start_server, stop_server
from analysis_server.client import Client
from analysis_server.arrwr... | {
"content_hash": "ab83292e722874dde4623848c10d3074",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 87,
"avg_line_length": 32.666666666666664,
"alnum_prop": 0.5730229591836735,
"repo_name": "naylor-b/aserver",
"id": "4dccfd8876e683b50c4892c32fa04d9277777bb5",
"size": "313... |
"""
helloworld.py
Author: <your name here>
Credit: <list sources used, if any>
Assignment:
Write and submit a Python program that prints the following:
Hello, world!
"""
| {
"content_hash": "1f8462210230e8f4ac20fd72de277a02",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 60,
"avg_line_length": 14.5,
"alnum_prop": 0.7241379310344828,
"repo_name": "HHS-IntroProgramming/Hello-world",
"id": "782a95aaa82188ac87f9042d55d4e2159831155b",
"size": "1... |
import numpy as np
import pandas as pd
def get_msd(traj, dt, with_nan=True, with_std=False, label=None):
shifts = np.arange(1, len(traj), dtype='int')
if with_std:
msd = np.empty((len(shifts), 3), dtype='float')
else:
msd = np.empty((len(shifts), 2), dtype='float')
msd[:] = np.nan
... | {
"content_hash": "7232b7d8b32c0120e00b9a39dfe97418",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 94,
"avg_line_length": 28,
"alnum_prop": 0.5483516483516484,
"repo_name": "hadim/spindle_tracker",
"id": "685ff56a91a38cc9bd48a289a965100cea590ffd",
"size": "1820",
"bina... |
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
app = Flask('rest_server')
app.config['SECRET_KEY'] = "NOT_FOR_PRODUCTION"
app.config.setdefault('SQLALCHEMY_DATABASE_URI', 'mysql://tmp:[email protected]/tmp')
#app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['SQLALCHEMY_COMMIT_ON_TEARDOWN'] ... | {
"content_hash": "f6cba595569dea46959bca44619fcde5",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 81,
"avg_line_length": 36.75,
"alnum_prop": 0.6137566137566137,
"repo_name": "devopsec/threatdetectionservice",
"id": "2d14ddaceb5519258964f5054dfe4f1eda35b02e",
"size": "1... |
"""Test for neg_log_likelihood.py."""
import logging
from absl.testing import absltest
from gpax import utils
from gpax.models import gp
from gpax.objectives import neg_log_likelihood as nll
from jax import numpy as jnp
from jax import random
class NLLTest(absltest.TestCase):
def test_objective(self):
key1 =... | {
"content_hash": "0bf01e947b3dd996058d0bcbf3df8cc0",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 70,
"avg_line_length": 25.264705882352942,
"alnum_prop": 0.6658905704307334,
"repo_name": "google-research/gpax",
"id": "8cac3a97327cb66be9ed10231dd40125cb4c7c9c",
"size": ... |
from django.conf.urls import url
from django.contrib import admin
from .views import (
PostDetailsAPIView,
PostCreateUpdateAPIView,
PostUpdateAPIView,
PostDeleteAPIView,
PostListAPIView
)
urlpatterns = [
url(r'^$', PostListAPIView.as_view(), name='list'),
url(r'^create/$', PostCreateUpdateAPIView.as_view(), na... | {
"content_hash": "261a6dd74f32af1204d166ac6886c55e",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 79,
"avg_line_length": 31.61111111111111,
"alnum_prop": 0.6906854130052724,
"repo_name": "fengxuangit/blog-api-view",
"id": "7f0f9c679d3e18a1651de549586571f54e429a2d",
"siz... |
"""Wordcount exercise
Google's Python class
La función main() de abajo ya está definida y completa. Llama a las funciones
print_words() y print_top() que escribiste.
1. Para la bandera --count, implementar una función print_words(nombre_archivo) que cuenta
qué tan frecuentemente cada palabra aparece en el texto e imp... | {
"content_hash": "72d6ec2d403d90e6a3097422e201dad9",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 96,
"avg_line_length": 32.357142857142854,
"alnum_prop": 0.7214128035320089,
"repo_name": "cursoweb/python-archivos",
"id": "34a79263ac5b3b2f31af723799f241030c06ed62",
"siz... |
import numpy as np
import re
import matplotlib.pyplot as plt
file1 = '../alphaWhales/train/validation/train.csv'
file2 = '../alphaWhales/train/train/train.csv'
fileTrain = '../alphaWhales/train/train/train.csv'
data1 = np.genfromtxt(file1, skip_header=1, dtype=[('image', 'S13'), ('label', 'S11')], delimiter=',')
data2... | {
"content_hash": "e85cc9efd4a5d37dda42021efcbb630a",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 110,
"avg_line_length": 32.5625,
"alnum_prop": 0.6641074856046065,
"repo_name": "andpol5/whaleDetector",
"id": "9d9a819ae52725728ba2f78f55ba2d3cfb571afb",
"size": "1042",
... |
"""Unit test for cgroups module.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import io
import os
import shutil
import tempfile
import unittest
import mock
import treadmill
from treadmill import cgroups
from ... | {
"content_hash": "f81139bec7b30d2c0bda94e7a64b9cd3",
"timestamp": "",
"source": "github",
"line_count": 301,
"max_line_length": 78,
"avg_line_length": 42.67774086378738,
"alnum_prop": 0.5224972754164721,
"repo_name": "captiosus/treadmill",
"id": "480300036c4352af7eb2dbe09ec6945e72ba4138",
"size": "... |
from flask import Flask
from flask_restful import Api
# files
from iAS.uicontroller.uicontroller import *
from iAS.uicontroller.authentication import *
from iAS.uicontroller.sample_app_uicontroller import * | {
"content_hash": "4859afd6354b3486e740d62322cbc743",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 54,
"avg_line_length": 29.571428571428573,
"alnum_prop": 0.8309178743961353,
"repo_name": "CodeLankaHack/team---iAS",
"id": "5846651c4e10c15adaddf03c6f5d61190d6d3cf3",
"size... |
from .. import types, functions
from ... import utils
class InlineResult:
"""
Custom class that encapsulates a bot inline result providing
an abstraction to easily access some commonly needed features
(such as clicking a result to select it).
Attributes:
result (:tl:`BotInlineResult`):
... | {
"content_hash": "21efbaa96d2307df546ee469e3297593",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 96,
"avg_line_length": 35.53409090909091,
"alnum_prop": 0.5887432043492165,
"repo_name": "LonamiWebs/Telethon",
"id": "15639aa5135776f6f1d9033626aafb82a5f5373e",
"size": "... |
from __future__ import absolute_import
from __future__ import print_function
import os
import random
import re
import sys
import time
from happy.ReturnMsg import ReturnMsg
from happy.utils.IP import IP
from happy.HappyNode import HappyNode
from happy.HappyNetwork import HappyNetwork
from WeaveTest import WeaveTest
fr... | {
"content_hash": "ac730b51081bc7c15305d78b90e49092",
"timestamp": "",
"source": "github",
"line_count": 442,
"max_line_length": 105,
"avg_line_length": 39.52488687782805,
"alnum_prop": 0.5615912993703491,
"repo_name": "openweave/openweave-core",
"id": "51f0a7181251d7083c08651852dc2e04569cb667",
"si... |
from google.cloud import bigquery_storage_v1
async def sample_append_rows():
# Create a client
client = bigquery_storage_v1.BigQueryWriteAsyncClient()
# Initialize request argument(s)
request = bigquery_storage_v1.AppendRowsRequest(
write_stream="write_stream_value",
)
# This method ... | {
"content_hash": "8bdf0c9b5e53c6126954c009c27ff114",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 67,
"avg_line_length": 28,
"alnum_prop": 0.7016129032258065,
"repo_name": "googleapis/python-bigquery-storage",
"id": "34fb01321fd298f603e2446160990e66652c4b18",
"size": "2... |
from pyvips import ffi, glib_lib, vips_lib, gobject_lib, \
_to_string, _to_bytes, Error
def leak_set(leak):
"""Enable or disable libvips leak checking.
With this enabled, libvips will check for object and area leaks on exit.
Enabling this option will make libvips run slightly more slowly.
"""
... | {
"content_hash": "011ab3daa37bb6a4c9ee3fa8b71ba9b6",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 77,
"avg_line_length": 22.692307692307693,
"alnum_prop": 0.6172573189522342,
"repo_name": "jcupitt/pyvips",
"id": "b939ae5e53542cd0992391e884f7804b698fc3b4",
"size": "3276... |
from pyjamas import DOM
from pyjamas import Factory
from pyjamas.ui.ButtonBase import ButtonBase
from pyjamas.ui import Event
from pyjamas.ui import Focus
_CheckBox_unique_id=0;
class CheckBox(ButtonBase):
_props = [("name", "Name", "Name", None),
]
def __init__(self, label=None, asHTML=False, *... | {
"content_hash": "0379c5f3c7ca7af508079b23f033b10d",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 74,
"avg_line_length": 29.71171171171171,
"alnum_prop": 0.6276531231049121,
"repo_name": "anandology/pyjamas",
"id": "63b8594693484a58f73122d3b1f2f371bc2a8332",
"size": "3... |
import alignments
import re
import read
import binaryIO
import math
import os
import preprocess
import time
class Compressor:
aligned = None
# 0 - zlib
# 1 - lzma
# 2 - bz2
compressMethod = 0
covSize = 0
totalSize = 0
def __init__(self, frag_len_cutoff):
if self.compressMetho... | {
"content_hash": "5c6d7313e8606a86be35e888b1dc9ba7",
"timestamp": "",
"source": "github",
"line_count": 441,
"max_line_length": 158,
"avg_line_length": 36.70748299319728,
"alnum_prop": 0.5169261181121818,
"repo_name": "jpritt/boiler",
"id": "8b175f7db934339e171858a403bdb58fb2024d98",
"size": "16188... |
from __future__ import unicode_literals
import deepserve.fileupload.models
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('fileupload', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='File... | {
"content_hash": "859da75d6b96be4b64dd3dccd889c6c9",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 114,
"avg_line_length": 32.074074074074076,
"alnum_prop": 0.5923787528868361,
"repo_name": "nathanhi/deepserve",
"id": "955cadad08f31565d7dd227c827b653c8d1e0cbb",
"size": "... |
from abc import ABCMeta, abstractproperty
from charlesbot.slack.slack_base_object import SlackBaseObject
class SlackRoomJoined(SlackBaseObject, metaclass=ABCMeta):
def __init__(self, **kwargs):
super().__init__(**kwargs)
@abstractproperty
def compatibility_key(self):
pass
def load(s... | {
"content_hash": "776ef268be1a29fbdf9f005162971321",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 90,
"avg_line_length": 30.72222222222222,
"alnum_prop": 0.6528028933092225,
"repo_name": "marvinpinto/charlesbot",
"id": "7e9d3242f1196ccd788958cda15a5fa8bdc7b9d0",
"size":... |
import unittest
import test
def main():
suites = test.all()
runner = unittest.TextTestRunner(verbosity=2).run(suites)
if __name__ == '__main__':
main()
| {
"content_hash": "d973092e398b072997f63712f7da99b0",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 61,
"avg_line_length": 18.444444444444443,
"alnum_prop": 0.6325301204819277,
"repo_name": "zqqf16/clipboard",
"id": "3cc348ef63888159b2d073652c039af1762d4d0a",
"size": "213"... |
import re
import time
import json
from random import randint
from calvin.Tools import cscompiler as compiler
from calvin.runtime.north.appmanager import Deployer
from calvin.runtime.north import metering
from calvin.utilities.calvinlogger import get_logger
from calvin.utilities.calvin_callback import CalvinCB
from calv... | {
"content_hash": "243fe8b96dd55fef35fbf96e9d3499f6",
"timestamp": "",
"source": "github",
"line_count": 1610,
"max_line_length": 134,
"avg_line_length": 39.74596273291925,
"alnum_prop": 0.5603444234345455,
"repo_name": "les69/calvin-base",
"id": "2836e0cacae30e6fd49512236507336ff68a46bb",
"size": "... |
"""
You are given a list of 999,998 integers, which include all the integers between 1 and 1,000,000 (inclusive on both
ends) in some unknown order, with the exception of two numbers which have been removed. By making only one pass through
the data and using only a constant amount of memory (i.e. O(1) memory usage), ca... | {
"content_hash": "b21bb64ed3c912dd0870d58cd03e9151",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 119,
"avg_line_length": 31.3,
"alnum_prop": 0.6445686900958466,
"repo_name": "DayGitH/Python-Challenges",
"id": "801a4961f64abe1cf55a02cbdef9d0ed7a674aff",
"size": "1252",
... |
import cv2
import sys
faceCascade = cv2.CascadeClassifier('haarcascade_frontalface_alt.xml')
video_capture = cv2.VideoCapture(0)
while True:
# Capture frame-by-frame
ret, frame = video_capture.read()
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
faces = faceCascade.detectMultiScale(
gray,
... | {
"content_hash": "e2b7812f9c9d3cf787e2499783cdd81c",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 70,
"avg_line_length": 23.470588235294116,
"alnum_prop": 0.6365914786967418,
"repo_name": "creativcoder/opencv_exp",
"id": "59f91377a457550c19a05f5608b8abf1de2de6a0",
"size... |
import array
import ImpactPacket
import dot11
import IP6
import ICMP6
import IP6_Extension_Headers
from cdp import CDP
from Dot11Crypto import RC4
from impacket import wps, eap, dhcp
from impacket.dot11 import Dot11WEPData
from impacket import LOG
"""Classes to convert from raw packets into a hierarchy of
ImpactPack... | {
"content_hash": "ddac2c3f62fc29de43a5f82e9ace86bd",
"timestamp": "",
"source": "github",
"line_count": 985,
"max_line_length": 126,
"avg_line_length": 34.387817258883246,
"alnum_prop": 0.6133384506376949,
"repo_name": "tholum/PiBunny",
"id": "eb475e58755dcf0cbf891b018a7d24dba3d24ba9",
"size": "342... |
"""
EasyBuild support for building and installing foofoo, implemented as an easyblock
@author: Kenneth Hoste (Ghent University)
"""
from easybuild.easyblocks.foo import EB_foo
from easybuild.framework.easyconfig import CUSTOM, MANDATORY
class EB_foofoo(EB_foo):
"""Support for building/installing foofoo."""
... | {
"content_hash": "b595bb57e720e80ccac23d54a3f11f9c",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 105,
"avg_line_length": 33.23809523809524,
"alnum_prop": 0.6919770773638968,
"repo_name": "ULHPC/modules",
"id": "94ec86ef89924b9c92359ad9cc45e9091fa0e1c7",
"size": "1756",... |
from __future__ import absolute_import, division, print_function
from salt.ext.tornado.ioloop import IOLoop
from salt.ext.tornado.netutil import ThreadedResolver
# When this module is imported, it runs getaddrinfo on a thread. Since
# the hostname is unicode, getaddrinfo attempts to import encodings.idna
# but blocks ... | {
"content_hash": "d755ebbe792604c01a0e03347262757b",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 72,
"avg_line_length": 44.90909090909091,
"alnum_prop": 0.7975708502024291,
"repo_name": "saltstack/salt",
"id": "111a7269e0e42a2a95d7cea4c0d8b2f695259b8d",
"size": "514",
... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Suggest',
fields=[
('id', models.AutoF... | {
"content_hash": "927da850988e9339b88744a258f23f69",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 114,
"avg_line_length": 29.047619047619047,
"alnum_prop": 0.5754098360655737,
"repo_name": "tomming233/blog",
"id": "fbebfa00f31a5e1516224c2d5dbe65cfd09ce223",
"size": "695... |
import collections
import uuid
import mock
import webob
from ooi.api import helpers
from ooi.api import network_link as network_link_api
from ooi import exception
from ooi.occi.core import collection
from ooi.occi.infrastructure import compute
from ooi.occi.infrastructure import network
from ooi.openstack import netw... | {
"content_hash": "a517d699db8e4ab699d55f70217e9cf3",
"timestamp": "",
"source": "github",
"line_count": 236,
"max_line_length": 79,
"avg_line_length": 41.26271186440678,
"alnum_prop": 0.5949887040460053,
"repo_name": "orviz/ooi",
"id": "fc230b0f8c7136c5c13fa4e83f16d756bf07179c",
"size": "10362",
... |
import tensorflow as tf
import argparse
import sys
import time
FLAGS = None
def main(_):
ps_hosts = FLAGS.ps_hosts.split(',')
worker_hosts = FLAGS.worker_hosts.split(',')
cluster = tf.train.ClusterSpec({"ps":ps_hosts, "worker":worker_hosts})
# start a server for a specific task
... | {
"content_hash": "6c94395427885e4ef70f9c76b9be4b10",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 119,
"avg_line_length": 38.45177664974619,
"alnum_prop": 0.486996699669967,
"repo_name": "pozhijisi/Distributed-TensorFlow-Using-MPI",
"id": "75c7e5014be5c9e8765288f4e355bb0... |
import argparse
def parse(args):
parser = argparse.ArgumentParser()
parser.add_argument(
"--debug", action="store_true", default=False, help="Enable debug logging"
)
parser.add_argument("--xml")
parser.add_argument(
"--module", action="store_true", default=False, help="Trace a m... | {
"content_hash": "9afb576b55a0ac63f3db2127ad691502",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 82,
"avg_line_length": 25.09090909090909,
"alnum_prop": 0.6521739130434783,
"repo_name": "github/codeql",
"id": "8e909367c32716b4ef71d73dcfaf9407c3211a9b",
"size": "552",
... |
"""
* Copyright 2007 Fred Sauer
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http:#www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, so... | {
"content_hash": "2c4adb202dae7c401976febbb67290a0",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 125,
"avg_line_length": 32.81395348837209,
"alnum_prop": 0.6169383416017009,
"repo_name": "jaredly/pyjamas",
"id": "207d48f3629b7391259b4b94741d06b3319a04ed",
"size": "2822... |
'''
Dependency checker for CAmkES.
'''
# This script can only import parts of the Python standard library, or it
# becomes useless as a dependency checker.
import abc, argparse, importlib, os, shutil, subprocess, sys, tempfile
class CheckDepException(Exception):
pass
class Package(object):
__metaclass__ = ab... | {
"content_hash": "401847668dba196e18f49252bb9918b7",
"timestamp": "",
"source": "github",
"line_count": 200,
"max_line_length": 107,
"avg_line_length": 42.115,
"alnum_prop": 0.6016858601448415,
"repo_name": "smaccm/camkes-tool",
"id": "7a3684ce6843ee77ff6b106d717d7b60a87530c0",
"size": "8694",
"b... |
revision = '67fb47689b'
down_revision = '619369f92a'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('text_version', sa.Column('title', sa.Text(), nullable=True))
op.execute("UPDATE text_version SET title=''")
op.alter_column('text_version', 'title', nullable=False)
op.alt... | {
"content_hash": "e78f8e57f73474535fcb60e175676977",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 79,
"avg_line_length": 33.31578947368421,
"alnum_prop": 0.6951026856240127,
"repo_name": "mgax/mptracker",
"id": "1764ebe827f3ce5e08bc234c39ed946714f16dfd",
"size": "633",
... |
__author__ = 'steffenfb'
import os
import re
import pickle
import datetime
import time
import hashlib
import operator
def localtest(userList, fromhour):
#os.chdir('/Users/steffenfb/Documents/facelogs')
logpath= 'facelogs'
files = os.listdir(logpath)
files.pop(0)
mydict={}
#Adding user... | {
"content_hash": "3abb8ff746a9d734deaef79b86a7aac3",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 117,
"avg_line_length": 28.244897959183675,
"alnum_prop": 0.5411849710982659,
"repo_name": "Steffb/facelogger",
"id": "449d3d8f922957bea1ff13854ab80fbe8d8cdcbd",
"size": "... |
import webbrowser
class ScriptHandler:
def __init__(self):
self.commands = ['google ([\w ]+)', 'search ([\w ]+)']
def runScript(self, args):
searchTerm = str(args(1))
terms = searchTerm.split()
first = True
url = 'www.google.com/search?q='
for term in terms:
... | {
"content_hash": "678320333b12ff3cc7fc29417b4dba12",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 62,
"avg_line_length": 26.555555555555557,
"alnum_prop": 0.47280334728033474,
"repo_name": "edbrown23/Chives",
"id": "9e5bf1eb662469ee0170662a655158535520fd68",
"size": "47... |
"""A non-blocking, single-threaded TCP server."""
from __future__ import absolute_import, division, print_function, with_statement
import errno
import os
import socket
from hurray.server.log import app_log
from hurray.server.ioloop import IOLoop
from hurray.server.iostream import IOStream, SSLIOStream
from hurray.ser... | {
"content_hash": "fcc22674e3947ce384d3af2688e688d4",
"timestamp": "",
"source": "github",
"line_count": 275,
"max_line_length": 83,
"avg_line_length": 42.36,
"alnum_prop": 0.6065756717314791,
"repo_name": "meteotest/hurray",
"id": "50015d86a60c39109e736dc960a60d27d7c602a8",
"size": "12287",
"bina... |
from setuptools import setup
setup(
name='azure-mgmt-common',
version='0.20.0rc1',
description='Microsoft Azure Resource Management Client Library for Python (Common)',
long_description=open('README.rst', 'r').read(),
license='Apache License 2.0',
author='Microsoft Corporation',
author_emai... | {
"content_hash": "bdd0532b54fc61e6e720bd625797b8df",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 89,
"avg_line_length": 31.59375,
"alnum_prop": 0.5974282888229476,
"repo_name": "ParallaxIT/azure-sdk-for-python",
"id": "e67ddea6ba7f962e1935452e7e23094ed99c5c70",
"size":... |
from feti.models.national_qualifications_framework import \
NationalQualificationsFramework
from haystack import indexes
__author__ = 'Rizky Maulana Nugraha "lucernae" <[email protected]>'
__date__ = '24/04/15'
class NationalQualificationsFrameworkIndex(indexes.SearchIndex,
... | {
"content_hash": "971ae1b1e31b2931d53f518fa90734be",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 70,
"avg_line_length": 32.86363636363637,
"alnum_prop": 0.681881051175657,
"repo_name": "lucernae/feti",
"id": "cb04a1bacc84c4d626bd8d46ad9b5c5c38f0be2a",
"size": "738",
... |
from pygenius import *
#Bambu's Golden Era Shower
#s = song.song(489522)
#Cool Calm Pete's 2 A.M.
#s = song.song(255949)
#Blue Scholar's Sagab
s = song(3893)
#prints the song title
print s.name
#prints the lyrics
for i in s.lyrics:
print i
#concatenate the lyrics into one string
str = cat_lyrics(s)
print str
... | {
"content_hash": "de9c78144651be36f192030beb9e2547",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 63,
"avg_line_length": 15.892857142857142,
"alnum_prop": 0.7112359550561798,
"repo_name": "aorti017/pygenius",
"id": "2806d731aba8cddb6c696986d5f9480e5b62051f",
"size": "89... |
"""Set up pytradfri."""
from pathlib import Path
from setuptools import find_packages, setup
PROJECT_DIR = Path(__file__).parent.resolve()
README_FILE = PROJECT_DIR / "README.md"
LONG_DESCRIPTION = README_FILE.read_text(encoding="utf-8")
VERSION = (PROJECT_DIR / "pytradfri" / "VERSION").read_text().strip()
GITHUB_U... | {
"content_hash": "59cbf6c5275d7b837a4aa05fcb6b089d",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 69,
"avg_line_length": 30.97222222222222,
"alnum_prop": 0.694170403587444,
"repo_name": "rubenbe/pytradfri",
"id": "d954d857343af96a372f952593fefbf857717785",
"size": "1139... |
import collections
import pecan
from barbican import api
from barbican.api import controllers
from barbican.common import hrefs
from barbican.common import utils
from barbican.common import validators
from barbican import i18n as u
from barbican.model import repositories as repo
LOG = utils.getLogger(__name__)
def ... | {
"content_hash": "6fa2f0fef2ed575613d4630ea680c05d",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 79,
"avg_line_length": 40.70414201183432,
"alnum_prop": 0.6278528855938363,
"repo_name": "openstack/barbican",
"id": "8f31a8224214886ff5f6558d684adc93f6375fa3",
"size": "7... |
"""Tests for tensorflow.ops.resource_variable_ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import gc
import os
import pickle
import numpy as np
from tensorflow.python.eager import context
from tensorflow.python.framework import const... | {
"content_hash": "9713d0e79a23dd45d3b9aedc714de587",
"timestamp": "",
"source": "github",
"line_count": 988,
"max_line_length": 88,
"avg_line_length": 42.60931174089069,
"alnum_prop": 0.6543066178915863,
"repo_name": "hehongliang/tensorflow",
"id": "e85b04469b1f97ebad98d24e28aba86970b17a88",
"size"... |
"""
Context manager for switching the current working directory
"""
from __future__ import unicode_literals
from __future__ import absolute_import, division, print_function
__author__ = "Graham Klyne ([email protected])"
__copyright__ = "Copyright 2011-2014, University of Oxford"
__license__ = "MIT (http://openso... | {
"content_hash": "beb3765f2397e8d5c136f6b87d9ec148",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 94,
"avg_line_length": 25.818181818181817,
"alnum_prop": 0.6091549295774648,
"repo_name": "gklyne/annalist",
"id": "f15b4d6986ec80e2fae8b7e984287191e1e646bd",
"size": "1154... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.