text stringlengths 4 1.02M | meta dict |
|---|---|
import yaml
import sys
layout = yaml.load(open('zuul/layout.yaml'))
def check_merge_template():
"""Check that each job has a merge-check template."""
errors = False
print("\nChecking for usage of merge template")
print("====================================")
for project in layout['projects']:
... | {
"content_hash": "08dd4842b9637cdd10481188a7fe7820",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 79,
"avg_line_length": 29.133333333333333,
"alnum_prop": 0.532418001525553,
"repo_name": "CiscoSystems/project-config-third-party",
"id": "daf1619440afb2238fcd52fec48e3deef66... |
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": "fd1860a00779478f61a05ba8e81599bd",
"timestamp": "",
"source": "github",
"line_count": 272,
"max_line_length": 80,
"avg_line_length": 31.613970588235293,
"alnum_prop": 0.7017095011047796,
"repo_name": "fracek/mail-dylan",
"id": "875d719598697456c39cddac25b37ba00fa5ca5a",
"size": "9... |
class TimeoutError(Exception):
"""Raised when a timer runs out."""
pass
def timeout(seconds, e=None):
"""
A decorator for blocking methods to cause them to timeout. Can be used
like this:
@timeout(30)
def foo(arg1, kwarg="baz"):
for x in xrange(1000000000):
... | {
"content_hash": "dea0654561766d2d33acfb6911db8e3f",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 74,
"avg_line_length": 33.427083333333336,
"alnum_prop": 0.5403552508569648,
"repo_name": "hackerberry/ooni-probe",
"id": "e03fd7408c60c2da179dd4339c09cc478025ae8c",
"size"... |
from zxtest import zxCoreTestCase
class OracleSPTest(zxCoreTestCase):
def setUp(self):
zxCoreTestCase.setUp(self)
c = self.cursor()
try:
try:
c.execute("drop table sptest")
except:... | {
"content_hash": "756f8d659eb7f7cf6be57835dd787e3a",
"timestamp": "",
"source": "github",
"line_count": 220,
"max_line_length": 174,
"avg_line_length": 44.486363636363635,
"alnum_prop": 0.3957290283028507,
"repo_name": "babble/babble",
"id": "9e6c12cc825ba815d1633a1c14580eb4dc3959db",
"size": "9941... |
class Solution:
"""
@param matrix, a list of lists of integers
@param target, an integer
@return a boolean, indicate whether matrix contains target
"""
def searchMatrix(self, matrix, target):
# write your code here
i, j = len(matrix) - 1, 0
while (i >= 0 and j < len(matri... | {
"content_hash": "04cbb828c188c556bad843510d35b29b",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 62,
"avg_line_length": 30.823529411764707,
"alnum_prop": 0.4961832061068702,
"repo_name": "Rhadow/leetcode",
"id": "5a6fff879cd57a0d1e09c38caca5f930dd0b5d70",
"size": "524"... |
from pprint import pprint
from datetime import timedelta
from fo2.connections import db_cursor_so
from base.views import O2BaseGetPostView
from utils.table_defs import TableDefs
import cd.forms
from cd.queries.novo_modulo import atividade_cd63
class AtividadeCD63(O2BaseGetPostView):
def __init__(self, *args, ... | {
"content_hash": "b77bc5ea31a0f6d2bc002d0a79a3c424",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 65,
"avg_line_length": 29.568627450980394,
"alnum_prop": 0.5709549071618037,
"repo_name": "anselmobd/fo2",
"id": "0d8eb725bf73e386dc5f53613834837c0e662197",
"size": "1510",... |
import numpy as np
import blockmodels as bm
import css_em as em
# Do it
# 1) With k > 2
# 2) Different rates for diffent groups
#
G_true = bm.blocked_matrix(20, 2, dim=2) # on=1, off=0
X = [bm.blocked_matrix(20, 2, dim=2, on=.8, off=.2) for i in range(5)]
X += [bm.blocked_matrix(20, 2, dim=2, on=.9, off=.1) for i in... | {
"content_hash": "12a5f4db03c795274c42aa7e9e037239",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 85,
"avg_line_length": 30.69047619047619,
"alnum_prop": 0.674166020170675,
"repo_name": "amloewi/css-blockmodels",
"id": "3049bf1c67390464519f9d7c121aac9b0262956a",
"size":... |
"""Local filesystem-based filesystem plugin."""
import glob
import os
import shutil
from typing import Any, Callable, Iterable, List, Optional, Tuple
from tfx.dsl.io import filesystem
from tfx.dsl.io import filesystem_registry
from tfx.dsl.io.filesystem import PathType
class LocalFilesystem(filesystem.Filesystem):... | {
"content_hash": "4e0fa0aa15570354dfdfa79e3f73545f",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 76,
"avg_line_length": 27.026785714285715,
"alnum_prop": 0.6788899900891973,
"repo_name": "tensorflow/tfx",
"id": "21dceef40981153a058da0b3e975a01005fdc913",
"size": "3623... |
import sys
import os
import django
from django.conf import settings
from django.core.management import execute_from_command_line
urlpatterns = []
DEBUG = True
TEMPLATE_DEBUG = DEBUG
BASE_DIR = os.path.dirname(__file__)
ROOT_URLCONF = __name__
SECRET_KEY = 'qwerty'
TEMPLATES = [{
'BACKEND': 'django.template.back... | {
"content_hash": "5387b525463a0f20491780231aea922f",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 66,
"avg_line_length": 18.244444444444444,
"alnum_prop": 0.6577344701583435,
"repo_name": "redisca/django-redisca",
"id": "30ee9dc19a1885f28f915751857316321ab60c55",
"size"... |
import os
import sys
import string
class bcolors:
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
ENDC = '\033[0m'
def disable(self):
self.BLUE = ''
self.GREEN = ''
... | {
"content_hash": "f5837ff259eba3cfcedf2ae8b93621eb",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 123,
"avg_line_length": 31.632653061224488,
"alnum_prop": 0.5075268817204301,
"repo_name": "Yoshi325/luhn_check",
"id": "d345740ecd7f98c92c03cb144782858149454651",
"size":... |
"""Tests for the CNN divergence."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow.compat.v1 as tf
import towards_gan_benchmarks.lib.flags
import towards_gan_benchmarks.lib.nn_divergence
lib = towards_gan_benchmarks.li... | {
"content_hash": "c84808dadce37d68ad4f0b8a931a41a0",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 80,
"avg_line_length": 25.195121951219512,
"alnum_prop": 0.6660212971926428,
"repo_name": "google-research/google-research",
"id": "23c6cb8a631d119451918368048981628ec32bcb",... |
import collections
import re
import warnings
import astropy.io.fits as fits
import numpy as np
import pandas as pd
import requests
from threeML.utils.fermi_relative_mission_time import compute_fermi_relative_mission_times
from threeML.plugins.spectrum.pha_spectrum import PHASpectrumSet
class GBMTTEFile(object):
... | {
"content_hash": "13a6431d552be9bc18941bef7bcbf892",
"timestamp": "",
"source": "github",
"line_count": 369,
"max_line_length": 135,
"avg_line_length": 27.349593495934958,
"alnum_prop": 0.5723345223939754,
"repo_name": "volodymyrss/3ML",
"id": "fff80e1c594b869734fcdbb91404cfe59726bf5f",
"size": "10... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lectura_ciclica.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "445b691f635ed0262b50bfc010c519cd",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 79,
"avg_line_length": 26.22222222222222,
"alnum_prop": 0.7161016949152542,
"repo_name": "luisza/lectura_ciclica",
"id": "e8e1280623f8777ca518ef2fcf664d56c745fd00",
"size": ... |
from rest_framework import viewsets, filters
from imageupload_rest.serializers import UploadedImageSerializer
from imageupload.models import UploadedImage
# ViewSet for our UploadedImage Model
# Gets all images from database and serializes them using UploadedImageSerializer
class UploadedImagesViewSet(viewsets.ModelV... | {
"content_hash": "d881f3b4c4d0e8b1db05cf473e00c793",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 81,
"avg_line_length": 38.18181818181818,
"alnum_prop": 0.8404761904761905,
"repo_name": "ChristianKreuzberger/django-rest-imageupload-example",
"id": "19395b98ce177f7efe9075... |
import pandas as pd
def RSI(data,window_length=14):
# Get only closing price
close = data['Closing Price']
# Get difference in price
delta = close.diff()
# Make positive gains and negative gains Series
up, down = delta.copy(), delta.copy()
down[down > 0] = 0
up[up < 0] = 0
# Calc... | {
"content_hash": "06efa13fc1ea25ba364841bfa0b2cc10",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 68,
"avg_line_length": 29.962962962962962,
"alnum_prop": 0.6242274412855378,
"repo_name": "samshara/Stock-Market-Analysis-and-Prediction",
"id": "c7b2ba23d49983f825dcf7b45333... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from tensorflow.python.ops import control_flow_ops
# from datasets import dataset_factory
from deployment import model_deploy
from nets import nets_factory
# from preprocessing import p... | {
"content_hash": "c184354c3402241cac911425d3ea229f",
"timestamp": "",
"source": "github",
"line_count": 364,
"max_line_length": 80,
"avg_line_length": 35.41208791208791,
"alnum_prop": 0.6228083785880527,
"repo_name": "wenxichen/tensorflow_yolo2",
"id": "08dcacc937cb6465b0781185b9df5e42b1732d4e",
"s... |
"""
WSGI config for sitetest 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.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sitetest.settings")
from django.core... | {
"content_hash": "aab4eebea7df7e401b3ad5c6da18e665",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 78,
"avg_line_length": 27.928571428571427,
"alnum_prop": 0.7749360613810742,
"repo_name": "guillaume-havard/testdjango",
"id": "84253da47cf73c0c87269044916840f7ac24da81",
"... |
"""This module enables the GUI, buttons and control logic for Room-based plots."""
# coding=utf-8
from __future__ import print_function
import bisect
import numbers
import sys
import numpy as np
from PyQt4 import QtCore,QtGui
from dataStructures.timeSeries import TimeArray
from readStadicData.processVisData import ... | {
"content_hash": "559871e0b8252febc33d228f1d1fcc90",
"timestamp": "",
"source": "github",
"line_count": 967,
"max_line_length": 190,
"avg_line_length": 43.47156153050672,
"alnum_prop": 0.6354639960035207,
"repo_name": "sariths/stadicViewer",
"id": "e962fcde2fb9cbb178c6668f0941cae75f1fbeae",
"size":... |
'''A module to run the development server.'''
from wordfusion import app
app.run(debug=True)
| {
"content_hash": "38cba94028eed886985d46110651fedc",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 45,
"avg_line_length": 31,
"alnum_prop": 0.7526881720430108,
"repo_name": "krerkkiat/word-fusion",
"id": "acd059a23cf59cd579477cdd53eb88e203320ab1",
"size": "117",
"binary... |
from keystoneclient.v2_0 import Client as KeystoneClient
import collectd
global NAME, OS_USERNAME, OS_PASSWORD, OS_TENANT_NAME, OS_AUTH_URL, VERBOSE_LOGGING
NAME = "keystone_plugin"
OS_USERNAME = "username"
OS_PASSWORD = "password"
OS_TENANT_NAME = "tenantname"
OS_AUTH_URL = "http://localhost:5000/v2.0"
VERBOSE_LOGG... | {
"content_hash": "3d03ceb4bb7b01dcadc0f56a93b1f3cc",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 103,
"avg_line_length": 31.91358024691358,
"alnum_prop": 0.6123791102514506,
"repo_name": "zxcq/chef-openstack-ubuntu-13.10",
"id": "e82cff70f53faee68447ad3f8bb2d47c7d17f837"... |
"""
URL patterns for the OpenStack Dashboard.
"""
from django.conf import settings
from django.conf.urls import include # noqa
from django.conf.urls import patterns # noqa
from django.conf.urls.static import static # noqa
from django.conf.urls import url # noqa
from django.contrib.staticfiles.urls import staticfil... | {
"content_hash": "c487c1fd5faaf9f0335a7d00342c8020",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 77,
"avg_line_length": 33.42424242424242,
"alnum_prop": 0.7343608340888486,
"repo_name": "neudesk/neucloud",
"id": "b719bcee40723939b9946fdbd8b2e4b7643ac718",
"size": "1912... |
"""Tests for specification."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import interval_bound_propagation as ibp
import numpy as np
import tensorflow.compat.v1 as tf
MockLinearModule = collections.namedtuple('MockLinearModule', ... | {
"content_hash": "bc8fc51d455f28b16306f955fabd0ac2",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 80,
"avg_line_length": 38.19672131147541,
"alnum_prop": 0.6484978540772532,
"repo_name": "deepmind/interval-bound-propagation",
"id": "e672ab1b3c5262837d7b8fbf10802ea2b97068... |
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.6.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class V1Secret(... | {
"content_hash": "01b9934274708b20517a53b044ee7f5d",
"timestamp": "",
"source": "github",
"line_count": 242,
"max_line_length": 317,
"avg_line_length": 33.96280991735537,
"alnum_prop": 0.5995863243703614,
"repo_name": "skuda/client-python",
"id": "edd624620c1b789ef492537c3135f03169685906",
"size": ... |
from django.views.generic import FormView
from .forms import RoundForms
class HomePageView(FormView):
template_name = 'civ/home.html'
form_class = RoundForms
def get(self, request, *args, **kwargs):
self.initial.update(request.session.get('base_initial', {}))
return super(HomePag... | {
"content_hash": "d9a62affc31cbafdcd1e6961b84b5fc4",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 97,
"avg_line_length": 32.6551724137931,
"alnum_prop": 0.6219640971488912,
"repo_name": "kuza/civhelper-II",
"id": "5449466b4db9651cd2ae2007064a7dd90067e640",
"size": "947"... |
from celery.app import shared_task
from celery.app.base import Celery
from scrapy.crawler import Crawler
from scrapy.conf import settings
from scrapy import log, project, signals
from twisted.internet import reactor
from billiard import Process
from scrapy.utils.project import get_project_settings
from craigslist_sampl... | {
"content_hash": "f58ea5d906e7141f69bd00652f51702b",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 86,
"avg_line_length": 29.975,
"alnum_prop": 0.6872393661384487,
"repo_name": "gerosalesc/scrapy-celery-sample",
"id": "0329a9d79ec3b7ad55a44e50160fcdbbe8357c24",
"size": "... |
import unittest
from pypika import (
Field as F,
Interval,
)
from pypika.enums import Dialects
dt = F("dt")
class AddIntervalTests(unittest.TestCase):
def test_add_microsecond(self):
c = dt + Interval(microseconds=1)
self.assertEqual("\"dt\"+INTERVAL '1 MICROSECOND'", str(c))
def t... | {
"content_hash": "1700f9298d55ab2131e5c932cfa0a9a8",
"timestamp": "",
"source": "github",
"line_count": 179,
"max_line_length": 86,
"avg_line_length": 30.972067039106147,
"alnum_prop": 0.6181457431457431,
"repo_name": "kayak/pypika",
"id": "38db8ef2f8e812a97c6980a7ec6b9a3909d804fb",
"size": "5544",... |
from setuptools import setup
setup(
name='onetimepad',
version='1.4',
description='A hacky implementation of One-time pad',
long_description=open('README.rst').read(),
py_modules=['onetimepad'],
url='http://jailuthra.in/onetimepad',
author='Jai Luthra',
author_email='me@jailuthra... | {
"content_hash": "6c7703819c8f1ef561628ca6c42859be",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 57,
"avg_line_length": 23.4375,
"alnum_prop": 0.576,
"repo_name": "jailuthra/onetimepad",
"id": "0b12f3776c60700ef53c3f83816d30701b6418b5",
"size": "750",
"binary": false... |
import re
from django.db import models
from django.contrib.contenttypes.models import ContentType
from . fields import TaggedRelationFormField
from taggit.models import Tag, TaggedItem
from taggit.managers import TaggableManager
from taggit.utils import parse_tags
def get_model():
return Tag
def get_tag_mana... | {
"content_hash": "2d43320d5efa0b423fc27614e82cfd55",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 78,
"avg_line_length": 31.619565217391305,
"alnum_prop": 0.6352698521828807,
"repo_name": "ff0000/scarlet",
"id": "70faad7ba3c22293c6d361b2fc7ac858af42b536",
"size": "2909"... |
import _plotly_utils.basevalidators
class TickmodeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="tickmode", parent_name="volume.colorbar", **kwargs):
super(TickmodeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_n... | {
"content_hash": "71d60e1e42ebe09ce146b9857c06021a",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 88,
"avg_line_length": 41.61538461538461,
"alnum_prop": 0.609981515711645,
"repo_name": "plotly/plotly.py",
"id": "96ed16998502fe5c9b84f06177e8a45550581271",
"size": "541",... |
"""Configuration parameters for client builder and server packaging."""
import os
import time
from grr.lib import config_lib
from grr.lib import rdfvalue
from grr.lib import type_info
# Windows Memory driver information.
config_lib.DEFINE_string("MemoryDriver.driver_service_name",
"Pmem",
... | {
"content_hash": "a4aa749ef018461461ebf94a4879229f",
"timestamp": "",
"source": "github",
"line_count": 455,
"max_line_length": 80,
"avg_line_length": 32.995604395604396,
"alnum_prop": 0.6643575567841205,
"repo_name": "ojengwa/grr",
"id": "35dff2d449d9d8bae043238898484a4e6018baeb",
"size": "15035",... |
'''
Auxiliary space class and helper functions.
'''
import time
import numpy as np
import scipy.linalg.blas
from pyscf import lib
from pyscf.lib import logger
from pyscf import __config__
from pyscf.lib.parameters import LARGE_DENOM
class AuxiliarySpace(object):
''' Simple container to hold the energies, couplin... | {
"content_hash": "94d0e0443c3e7bd9964e60667083be77",
"timestamp": "",
"source": "github",
"line_count": 742,
"max_line_length": 101,
"avg_line_length": 29.796495956873315,
"alnum_prop": 0.5652449228820842,
"repo_name": "sunqm/pyscf",
"id": "6969f5899cb259f963da8210d509cd68a384ce57",
"size": "22826"... |
from .app import app, logger
| {
"content_hash": "ccb5f4ba580a18b81d54554d23749c65",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 28,
"avg_line_length": 29,
"alnum_prop": 0.7586206896551724,
"repo_name": "Lvxingpai/viae-worker",
"id": "5286a59bde105a6e9700cd4e611b87e210115cbf",
"size": "29",
"binary"... |
'''
The MIT License (MIT)
Copyright (c) 2017 Sean UN Wood
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge,... | {
"content_hash": "19a0a1805fc4d7497f4847e0dd87d217",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 133,
"avg_line_length": 43.118110236220474,
"alnum_prop": 0.6539444850255661,
"repo_name": "seanwood/gcc-nmf",
"id": "c5f0ed8bffb165fd54f0ca55a12f64e1db79d810",
"size": "5... |
"""Tests cyclical mapper relationships.
We might want to try an automated generate of much of this, all combos of
T1<->T2, with o2m or m2o between them, and a third T3 with o2m/m2o to one/both
T1/T2.
"""
from itertools import count
from sqlalchemy import bindparam
from sqlalchemy import event
from sqlalchemy import ... | {
"content_hash": "48ced782e2c4c33ae7a6950904b220d4",
"timestamp": "",
"source": "github",
"line_count": 2006,
"max_line_length": 79,
"avg_line_length": 29.166999002991027,
"alnum_prop": 0.4655010340289528,
"repo_name": "monetate/sqlalchemy",
"id": "c75f2a549a5004d0d4ad47bb023f6f11c9132a48",
"size":... |
"""geometry module"""
from __future__ import (division,absolute_import)
from geode import *
from numpy import asarray
BoxTrees = {2:BoxTree2d,3:BoxTree3d}
def BoxTree(X,leaf_size):
X = asarray(X)
return BoxTrees[X.shape[1]](X,leaf_size)
ParticleTrees = {2:ParticleTree2d,3:ParticleTree3d}
def ParticleTree(X,leaf... | {
"content_hash": "c120695175c7faa2b87c6b9034511499",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 98,
"avg_line_length": 25.62,
"alnum_prop": 0.7096018735362998,
"repo_name": "mikest/geode",
"id": "fcd8217ca2dc147f81fa6a5c4bb80fe5b4e5709d",
"size": "1281",
"binary": f... |
from django import template
from django.core import paginator
import urllib.request, urllib.parse, urllib.error
register = template.Library()
@register.simple_tag(takes_context=True)
def paginate(context, qs, count=20):
pages = paginator.Paginator(qs, int(count))
try:
ix = int(context['request'].GET... | {
"content_hash": "668fab061931a2ab4d9d0e2ec80e698d",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 55,
"avg_line_length": 25.333333333333332,
"alnum_prop": 0.6486842105263158,
"repo_name": "EuroPython/epcon",
"id": "98cc8bacd4af469812adb39f59374d7a1a4fd09d",
"size": "760... |
from tempfile import NamedTemporaryFile
import pytest
import openai
from openai import util
@pytest.fixture(scope="function")
def api_key_file():
saved_path = openai.api_key_path
try:
with NamedTemporaryFile(prefix="openai-api-key", mode="wt") as tmp:
openai.api_key_path = tmp.name
... | {
"content_hash": "f4d0943a9156ca617fa4e9500143301f",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 75,
"avg_line_length": 26.566666666666666,
"alnum_prop": 0.6649937264742786,
"repo_name": "openai/openai-python",
"id": "d0ce0ac5c4a35dbebdd936c875dcca81b5d8e5fc",
"size": ... |
from functools import reduce
from operator import iadd
import itertools
import numpy
from PyQt4.QtGui import (
QFormLayout, QGraphicsRectItem, QGraphicsGridLayout,
QFontMetrics, QPen, QIcon, QPixmap, QLinearGradient, QPainter, QColor,
QBrush, QTransform, QGraphicsWidget
)
from PyQt4.QtCore import Qt, QRe... | {
"content_hash": "999771090234c74c5c1d850822821f9f",
"timestamp": "",
"source": "github",
"line_count": 660,
"max_line_length": 80,
"avg_line_length": 33.557575757575755,
"alnum_prop": 0.5793751128770092,
"repo_name": "qusp/orange3",
"id": "c64229a52cd011c56eda5ff308356dbe7b22c3e1",
"size": "22148"... |
import gmsh
gmsh.initialize()
gmsh.merge('param.txt')
print(gmsh.onelab.get())
bcs = gmsh.onelab.getNames("Conditions aux limites.*")
for bc in bcs:
print(bc, gmsh.onelab.getNumber(bc))
| {
"content_hash": "1e9e68bf291b7a3151803809776c2dba",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 54,
"avg_line_length": 23.875,
"alnum_prop": 0.7225130890052356,
"repo_name": "rboman/progs",
"id": "4c5b8f7a10ca649550bd5def934c2ee291516104",
"size": "191",
"binary": fa... |
"""Tests for n-gram layer."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensor2tensor.layers import ngram
from tensor2tensor.utils import test_utils
import tensorflow.compat.v1 as tf
tf.enable_eager_execution()
class NGramTest(tf.test.TestCas... | {
"content_hash": "8aa7a4371f21bd934fd9b62b96e73bf7",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 77,
"avg_line_length": 30.604166666666668,
"alnum_prop": 0.6337644656228727,
"repo_name": "tensorflow/tensor2tensor",
"id": "a7b8e8787f92503a14fac6c6e822c35af17757f7",
"siz... |
"""Various classes representing distributed values."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import weakref
from tensorflow.python.distribute import device_util
from tensorflow.python.distribute import distribute_lib
from tensorflow.python.distri... | {
"content_hash": "38c4999d7d0b47be566d30dbbdada1b6",
"timestamp": "",
"source": "github",
"line_count": 1586,
"max_line_length": 116,
"avg_line_length": 35.32534678436318,
"alnum_prop": 0.6642451718844822,
"repo_name": "gunan/tensorflow",
"id": "fda258578aa4ac6458cb3187f09e048dcd877e24",
"size": "5... |
from settings.base import rel
STATIC_ROOT = rel('public', 'static')
MEDIA_ROOT = rel('public', 'media')
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
STATICFILES_DIRS = (rel('static'),)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDire... | {
"content_hash": "81f3963e73b2fa9052e6b2322ad3ac13",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 62,
"avg_line_length": 25.066666666666666,
"alnum_prop": 0.7180851063829787,
"repo_name": "pinkevich/django-project-template",
"id": "6b07512250a660d41b3d82bd94a57921dc97941d... |
def can_build(env, platform):
return True
def configure(env):
env.use_ptrcall = True
def get_doc_classes():
return [
"ARVRInterfaceGDNative",
"GDNative",
"GDNativeLibrary",
"MultiplayerPeerGDNative",
"NativeScript",
"PacketPeerGDNative",
"PluginScr... | {
"content_hash": "09d254fe348ab22a985632aca0c86202",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 39,
"avg_line_length": 19.884615384615383,
"alnum_prop": 0.6073500967117988,
"repo_name": "ex/godot",
"id": "bf371ed95b124ab55ed3f99d52809305aeaeb202",
"size": "517",
"bi... |
from django.apps import AppConfig
# Pip package update 12/10/2018 (davve.ath)
# import watson
from watson import search as watson
class VerceRegConfig(AppConfig):
name = 'vercereg'
verbose_name = "VERCE dispel4py Registry"
def ready(self):
workspace = self.get_model('Workspace')
pe = ... | {
"content_hash": "30012816f2e77c3dc888c6f24653e8df",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 47,
"avg_line_length": 25.263157894736842,
"alnum_prop": 0.6645833333333333,
"repo_name": "iaklampanos/dj-vercereg",
"id": "b1dd08c40077dfdb8387f72f551b4ca254a872f0",
"size... |
import re
import subprocess
from datetime import datetime as DT, date
CONFIG_FILE="~/.todo.cfg"
_tagTest = re.compile(r'.+:.+')
_prioTest = re.compile(r'\([A-Z]\)$')
_validPrio = re.compile(r'[A-Z]')
def _makeDate(word):
if word is None: return None
if isinstance(word, date): return word
return DT.strpti... | {
"content_hash": "2a0ef4d6368ddedc3b38bddf8ea22cb8",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 89,
"avg_line_length": 27.6968085106383,
"alnum_prop": 0.5285193009410409,
"repo_name": "sophacles/todo-scripts",
"id": "7874fdcf67b61362c523fdbe685d82a66c06da28",
"size":... |
from AppKit import NSPathControl, NSPathStyleStandard, NSColor, NSFocusRingTypeNone, NSURL, NSPathStylePopUp, NSRoundedBezelStyle
import os
from vanilla.vanillaBase import VanillaBaseControl
_pathStylesMap = {
"standard": NSPathStyleStandard,
"popUp": NSPathStylePopUp,
}
class PathControl(VanillaBaseControl... | {
"content_hash": "0a44e9b83dbf452a90e9fb944a6cf33e",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 129,
"avg_line_length": 29.988095238095237,
"alnum_prop": 0.5613338626439063,
"repo_name": "moyogo/vanilla",
"id": "0cd78824c93903e56ac9c4394275f92a7d68ef52",
"size": "2519... |
from jsk_network_tools.msg import FC2OCS, OCS2FC
from jsk_network_tools.silverhammer_util import *
from threading import Lock, Thread
from socket import *
from struct import Struct
import diagnostic_updater
from diagnostic_msgs.msg import DiagnosticStatus
import os
import rospy
import signal
import sys
import roslib
f... | {
"content_hash": "7f478b338b8b0aa1a3fe51a7178c02f2",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 95,
"avg_line_length": 43.50833333333333,
"alnum_prop": 0.5998850794866883,
"repo_name": "cretaceous-creature/jsk_mbzirc_task3",
"id": "d0c36431a63ddb9b8004fcbce4bcabc828ccc... |
from random import sample
from shenfun import *
from ChannelFlow import KMM
np.warnings.filterwarnings('ignore')
class MicroPolar(KMM):
"""Micropolar channel flow solver
Parameters
----------
N : 3-tuple of ints
The global shape in physical space (quadrature points)
domain : 3-tuple of 2-t... | {
"content_hash": "667b11b3b2cf1c53c9223f7610bdd594",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 161,
"avg_line_length": 44.35532994923858,
"alnum_prop": 0.5426871137560082,
"repo_name": "spectralDNS/shenfun",
"id": "498f018f090cb2d05e4a72f4769c9b134a60c867",
"size": ... |
"""vtdiscourse
NAME
vtd - create content for category and topic talk.vTaiwan
SYNOPSIS
vtd [OPTION]
DESCRIPTION
-n, --name
user name for Discourse api_user.
-p, --password
password for Discourse api_eky.
-g, --repo name
github's repo name
-s, --service
GET: ... | {
"content_hash": "c193056e3f1b3fac93aa2c37a0191448",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 104,
"avg_line_length": 23.39252336448598,
"alnum_prop": 0.5585297642828606,
"repo_name": "chairco/vtdiscourse",
"id": "e68acfc5ad11d20c23cc932e0578f53f6d9b11e2",
"size": ... |
from stagecraft.apps.dashboards.models.module import(
ModuleType,
Module)
import os
import json
import pprint
import jsonschema
# For this script to work correctly, you need to run
# run it like this:
# workon/source the virtualenv
# run export DJANGO_SETTINGS_MODULE=stagecraft.settings.production
# venv/bin/p... | {
"content_hash": "ec6e5e0fa88356b1baf917eb6d6b9071",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 79,
"avg_line_length": 31.60377358490566,
"alnum_prop": 0.6328358208955224,
"repo_name": "alphagov/stagecraft",
"id": "568531c1325cd3e83d1bf72be4034c09e802625f",
"size": "... |
"""
Code to support Off-line Microscope and transfer of coordinates to Sample Stage
main functions:
uscope2sample(suffix=''):
transfer all named positions saved for the IDE Microscope (off-line)
to IDE SampleStage (on-line), applying the rotation matrix saved by
the function `make_uscope_rotation()`
make_u... | {
"content_hash": "09f82ffb73216f7aaa97fdc64c63f5b4",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 79,
"avg_line_length": 29.983870967741936,
"alnum_prop": 0.6167294244217321,
"repo_name": "newville/microprobe_docs",
"id": "d72bbd5366164ed233180e487a153c820a5da925",
"si... |
"""IBEA selector"""
from __future__ import division
# from past.builtins import xrange # pylint: disable=W0622
"""
Copyright (c) 2016, EPFL/Blue Brain Project
This file is part of BluePyOpt <https://github.com/BlueBrain/BluePyOpt>
This library is free software; you can redistribute it and/or modify it under
th... | {
"content_hash": "d3bb1bf96e42bfa98531f9f48e2bf93d",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 79,
"avg_line_length": 34.31654676258993,
"alnum_prop": 0.7039832285115304,
"repo_name": "Ginfung/FSSE",
"id": "b05c40f5ea2463d90e87b7cd1b66a64696ab1f55",
"size": "4770",
... |
from eda.components.ST import *
| {
"content_hash": "53c28f44b12693c346d2ee6e13904e93",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 31,
"avg_line_length": 32,
"alnum_prop": 0.78125,
"repo_name": "32bitmicro/EDA",
"id": "89551b72d08b7daa3b86e6d52500c2b1c4b43371",
"size": "32",
"binary": false,
"copies... |
from collections import defaultdict
def _single_trie(string_to_value_pairs, index):
"""Build a single trie from a dict of input string to output values.
This function assumes that all of the strings in
string_to_value_pairs have the same length.
The input
{'abcd': 'ABCD', 'adef': 'ADEF', 'adeg': ... | {
"content_hash": "4ce499aebd9fd610ddca51e4bfd7f42e",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 72,
"avg_line_length": 27.943396226415093,
"alnum_prop": 0.5685347738014855,
"repo_name": "chromium/chromium",
"id": "2a159e261a44270dd1443a9cbe0098d424dff987",
"size": "16... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import signal
from rq import Connection, Queue, Worker
from tornado.options import parse_command_line
from .debug import debug_on_signal
if __name__ == '__main__':
parse_command_line()
debug_on_sig... | {
"content_hash": "1ef602ffc0abcf8a758683f6912ef71f",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 66,
"avg_line_length": 22.6,
"alnum_prop": 0.6460176991150443,
"repo_name": "mikegreen7892003/PythonToy",
"id": "3001ca6892468dd85dcaff8f101e19947a5a7689",
"size": "476",
... |
import base64
import hashlib
import re
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.models import User
from django.db.models import Q
from mozilla_django_oidc.auth import OIDCAuthenticationBackend
from mozillians.users.models import ExternalAccount
def calculate_use... | {
"content_hash": "dbd805b2b0939a83a2d9ca4fa1686aab",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 96,
"avg_line_length": 37,
"alnum_prop": 0.6453222453222454,
"repo_name": "fxa90id/mozillians",
"id": "e9e89a04cfc9cd354a73617a0ca363057fa0f179",
"size": "2405",
"binary"... |
"""Mycroft util library.
A collections of utils and tools for making skill development easier.
"""
from __future__ import absolute_import
import os
import mycroft.audio
from mycroft.util.format import nice_number
from .string_utils import camel_case_split
from .audio_utils import (play_audio_file, play_wav, play_ogg... | {
"content_hash": "a7abbd424c4f8ce6cfcc0e4be7dfc6c5",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 72,
"avg_line_length": 33.333333333333336,
"alnum_prop": 0.701,
"repo_name": "forslund/mycroft-core",
"id": "8cb5ab71951cb4ba76095021830903a0f9f2b1d7",
"size": "1580",
"b... |
def kernelcache_process_external_methods(ea=None, struct_type=None, count=None):
import idc
import ida_kernelcache as kc
import ida_kernelcache.ida_utilities as idau
kIOUCVariableStructureSize = 0xffffffff
kIOUCTypeMask = 0xf
kIOUCScalarIScalarO = 0
kIOUCScalarIStructO = 2
kIOUCStructI... | {
"content_hash": "a27643df8dd09f0342a0f8c680ce83d4",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 105,
"avg_line_length": 38.46788990825688,
"alnum_prop": 0.6355831147150012,
"repo_name": "bazad/ida_kernelcache",
"id": "4ce91466d479f5523882830e6f8d16c56259b784",
"size"... |
import geopandas as gpd
import pandas as pd
import shared
import osmnx
# this script is used to assign an ESRI jobs dataset which comes with lat-lng
# locations. We're not using this right now - instead we're using assign_jobs.py
# which uses maz-level control totals to place jobs. This is subject to change
# in the... | {
"content_hash": "3513c158457c7792860dc005f0c89979",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 81,
"avg_line_length": 39.445454545454545,
"alnum_prop": 0.7354229085042636,
"repo_name": "oaklandanalytics/cutting_board",
"id": "c2e922bee7bf2eaf497448db18120f6abbcbfad2",... |
""" An action manager item that represents an actual action. """
# Enthought library imports.
from traits.api import Any, Instance, List, Property, Str, on_trait_change
# Local imports.
from pyface.action.action import Action
from pyface.action.action_manager_item import ActionManagerItem
# Import the toolkit speci... | {
"content_hash": "630d0123ed59b466245390a17fcf0039",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 79,
"avg_line_length": 36.0472972972973,
"alnum_prop": 0.5555763823805061,
"repo_name": "geggo/pyface",
"id": "b0b4000c58fe2d0235759b52db0805a44f7e226b",
"size": "5978",
... |
import functools
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.trans... | {
"content_hash": "115d38641a7a1a7de7aa6dc4ff814fd3",
"timestamp": "",
"source": "github",
"line_count": 830,
"max_line_length": 264,
"avg_line_length": 45.51566265060241,
"alnum_prop": 0.648816771666049,
"repo_name": "Azure/azure-sdk-for-python",
"id": "d93b3da5be6f3eb9c9e187fc3675ce54bf2495af",
"s... |
"""Bridges between the `asyncio` module and Tornado IOLoop.
.. versionadded:: 3.2
This module integrates Tornado with the ``asyncio`` module introduced
in Python 3.4 (and available `as a separate download
<https://pypi.python.org/pypi/asyncio>`_ for Python 3.3). This makes
it possible to combine the two libraries on... | {
"content_hash": "f2ef33e461bef608e348f93236f1a356",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 80,
"avg_line_length": 35.89592760180995,
"alnum_prop": 0.6272532459347031,
"repo_name": "cyrusin/tornado",
"id": "3fd67dbd89cf3713e3b771b4312e616de85f0ef0",
"size": "7933... |
def pytest_configure(config):
config.addinivalue_line(
'markers', 'flake8: marks tests checking for flake8 compliance')
| {
"content_hash": "dac01819bbc265530c553bd8ba8b317f",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 72,
"avg_line_length": 44,
"alnum_prop": 0.7196969696969697,
"repo_name": "ament/ament_lint",
"id": "92b36911c7ed2047408908c4e56ea47254ea9463",
"size": "735",
"binary": fa... |
"""
DNRM Supervisor resource and resource factory exceptions.
"""
from dnrm.exceptions import base
class InvalidResource(base.SupervisorException):
message = _("Resource validation failed.")
class InvalidResourceType(base.SupervisorException):
message = _('Invalid resource type name: %(type_name)s')
clas... | {
"content_hash": "d82cde7d2dbb34396ff9bbdd22f2ca83",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 63,
"avg_line_length": 25.857142857142858,
"alnum_prop": 0.7513812154696132,
"repo_name": "Brocade-OpenSource/OpenStack-DNRM",
"id": "7323b3161fe3d01212f78ddf63ea987f0495b879... |
import pymysql
DEBUG = True
if DEBUG:
from .dev import *
else:
from .prod import *
pymysql.install_as_MySQLdb() | {
"content_hash": "f72466bf13675fe1b3a5eba6cf6d1d99",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 28,
"avg_line_length": 14.333333333333334,
"alnum_prop": 0.6434108527131783,
"repo_name": "zhengze/zblog",
"id": "ca82ebb2e2f10d501ca2cf73a3bae99aabe2255c",
"size": "129",
... |
'****************************************************'
'Created by C. Nichols #B0)~ '
'E-mail: oldnich@digitaldarknet.net '
'Created: 11/16/02 '
'Updated! 11/19/02 '
'Version: Python 2+ ... | {
"content_hash": "82065844562ce8abbc50e405f67fc4a7",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 141,
"avg_line_length": 44.23529411764706,
"alnum_prop": 0.5088652482269503,
"repo_name": "ActiveState/code",
"id": "11de294000e8d36c6a090c93a5a6469585c40310",
"size": "45... |
class Trie(object):
def __init__(self):
self.root = {}
def insert(self, word):
"""
Inserts a word into the trie.
:type word: str
:rtype: void
"""
node = self.root
for c in word:
if c not in node:
node[c] = {}
... | {
"content_hash": "442cada7752986d3c0f0f72c4b2cdf05",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 48,
"avg_line_length": 23.674418604651162,
"alnum_prop": 0.43909626719056977,
"repo_name": "ChuanleiGuo/AlgorithmsPlayground",
"id": "d18d94ec8b81408567a9f69f7dcdba028e53a3b8... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0001_squashed_0016_change_page_url_path_to_text_field'),
('home', '0004_auto_20150907_1916'),
]
operations = [
migrations.Cre... | {
"content_hash": "f0839924299e9c8f7ce05b766996b080",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 146,
"avg_line_length": 31.04,
"alnum_prop": 0.5721649484536082,
"repo_name": "taedori81/gentlecoffee",
"id": "1f2f7746ebf49860efc30d724d5bca2b161a28ad",
"size": "800",
"... |
import sys
import argparse
from flask import Flask, g, session
from flask.ext.github import GitHub
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
github = GitHub()
db = SQLAlchemy()
@app.before_request
def before_request():
from fish_bundles_web.models import User
g.user = None
if '... | {
"content_hash": "a61cbc2cab791bdc350a42924ccd35cb",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 124,
"avg_line_length": 26.344827586206897,
"alnum_prop": 0.6662303664921466,
"repo_name": "fish-bundles/fish-bundles-web",
"id": "6aea87f764d3cb6f5a07f0fe206df9663751d9d0",
... |
from __future__ import print_function
from bcc import BPF, USDT
from unittest import main, TestCase
from subprocess import Popen, PIPE
import ctypes as ct
import inspect, os, tempfile
class TestUDST(TestCase):
def setUp(self):
common_h = b"""
#include "folly/tracing/StaticTracepoint.h"
static inline void ... | {
"content_hash": "b0e806329286bdb11d469f3d8daa62a8",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 109,
"avg_line_length": 29.758389261744966,
"alnum_prop": 0.5466847090663058,
"repo_name": "iovisor/bcc",
"id": "70fa5a028df9fcdd8ff40ad06c15599463637aae",
"size": "4581",... |
from msrest.serialization import Model
class PagedApplicationTypeInfoList(Model):
"""The list of application types that are provisioned or being provisioned in
the cluster. The list is paged when all of the results cannot fit in a
single message. The next set of results can be obtained by executing the
... | {
"content_hash": "d0896219821a97b2e80494876d7b573e",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 81,
"avg_line_length": 37.458333333333336,
"alnum_prop": 0.692992213570634,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "62997960a61de7837bb9f5a3368a16a33e56d38e",
... |
"""Configuration schemas for Django."""
| {
"content_hash": "b6ca96bc1d285235c84aeece6c0a92d6",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 39,
"avg_line_length": 40,
"alnum_prop": 0.725,
"repo_name": "benoitbryon/django-confit",
"id": "79bb84e6170ac252e7b1b55ca6de5dc7c1c774ad",
"size": "40",
"binary": false,
... |
"""
XX. Generating HTML forms from models
This is mostly just a reworking of the ``form_for_model``/``form_for_instance``
tests to use ``ModelForm``. As such, the text may not make sense in all cases,
and the examples are probably a poor fit for the ``ModelForm`` syntax. In other
words, most of these tests should be r... | {
"content_hash": "53dfa77626325b637d78e9ea4dd2cda7",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 95,
"avg_line_length": 32.520161290322584,
"alnum_prop": 0.6669559826410415,
"repo_name": "disqus/django-old",
"id": "5dcc0391ce3759e49e30c4a55890e8670d50af13",
"size": "8... |
from django.test import TestCase
from core.tests.mommy_utils import make_recipe
from cla_eventlog import event_registry
from cla_eventlog.tests.base import EventTestCaseMixin
from cla_eventlog.constants import LOG_TYPES, LOG_LEVELS
class AssignToProviderEventTestCase(EventTestCaseMixin, TestCase):
EVENT_KEY = "a... | {
"content_hash": "d87ecfa4bd2c59d6ea699d8f20720e36",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 119,
"avg_line_length": 38.967948717948715,
"alnum_prop": 0.6510939299226847,
"repo_name": "ministryofjustice/cla_backend",
"id": "78ec488b77a14f56ec0863c3758a44d03155cf60",... |
'''
Compare sample's similarity
Input: a square matrix (rows=samples, cols=samples, cells=similarity)
clonesize info (sample --> number of clones)
Output:
normalized matrix
'''
import os
import sys
import re
import math
import numbers
import cPickle as pickle
import gzip
import numpy as np
from jobTree.... | {
"content_hash": "7ce32bb85f761571217b45de65bed4a4",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 81,
"avg_line_length": 26.979166666666668,
"alnum_prop": 0.5945945945945946,
"repo_name": "ngannguyen/aimseqtk",
"id": "9455232e6d306c93f3dc8a454e5885b5ac17348c",
"size": "... |
from __future__ import division,print_function
import sys
sys.dont_write_bytecode = True
from lib import *
import numpy as np
import pandas
import statsmodels.formula.api as smf
import statsmodels.api as sm
from scipy.stats import spearmanr
from scipy.stats.stats import skew
__author__ = 'panzer'
def make_formula(mo... | {
"content_hash": "2eb07583f23a08a9a557e9c2b427dca1",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 100,
"avg_line_length": 34.01904761904762,
"alnum_prop": 0.6856103023516238,
"repo_name": "ai-se/george",
"id": "b36a435f2393fb038cc9f1bb522e840e45e98358",
"size": "3572",... |
"""
Defines LineSplitter and helper functions.
-----
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License. See http://scipy.org.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
Author: Pearu Peterson <pearu@cens.ioc.ee>
Created: May 2006
-----
"""
__all__ ... | {
"content_hash": "d5299054fa67842d5f6aac8a89706f68",
"timestamp": "",
"source": "github",
"line_count": 425,
"max_line_length": 87,
"avg_line_length": 29.978823529411766,
"alnum_prop": 0.4635428930225257,
"repo_name": "elezar/fortran-beautifier",
"id": "6024d61c4a7d23c59df54635f0e500b5b824d553",
"s... |
"""setuptools.command.egg_info
Create a distribution's .egg-info directory and contents"""
from distutils.filelist import FileList as _FileList
from distutils.util import convert_path
from distutils import log
import distutils.errors
import os
import re
import sys
try:
import packaging.version
except ImportError... | {
"content_hash": "78de1412bed3498048ac7f193b700dd4",
"timestamp": "",
"source": "github",
"line_count": 447,
"max_line_length": 79,
"avg_line_length": 34.83221476510067,
"alnum_prop": 0.5958895311496467,
"repo_name": "boooka/GeoPowerOff",
"id": "43df87dcb547a4902aa323ef596cc8c029d74415",
"size": "1... |
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class RestAPIConfig(AppConfig):
name = 'osmaxx.rest_api'
verbose_name = _("Rest API")
| {
"content_hash": "398d2aa754a9800f125fab751ed03868",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 54,
"avg_line_length": 26.428571428571427,
"alnum_prop": 0.7351351351351352,
"repo_name": "geometalab/osmaxx-frontend",
"id": "478e5dd77c6d14e67e0f06782540703b4647bb36",
"si... |
"""Tests for conversions from markdown to other formats"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import re
from copy import copy
from IPython.utils.py3compat import string_types
from IPython.testing import decorators as dec
from ...tests.base import Tes... | {
"content_hash": "6084f762837254e11b75ab41f9462af3",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 142,
"avg_line_length": 33.37748344370861,
"alnum_prop": 0.5412698412698412,
"repo_name": "mattvonrocketstein/smash",
"id": "9ffcb8a5eb06d626d86cac97cc601f943222c063",
"si... |
'test pep8'
import os
from integration.python_integration_check_base import run_command, \
AbstractPythonCheckerTest
# pylint: disable=R0904,C0111
class Pep8Test(AbstractPythonCheckerTest):
def test_all(self):
cmd = ["unilint", "-spep8", "-l0"]
output = run_command(self.stackfolder, cmd)
... | {
"content_hash": "76cb9b35eaa0b6e2899927cf82a95878",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 77,
"avg_line_length": 49.17857142857143,
"alnum_prop": 0.6474219317356572,
"repo_name": "tkruse/unilint",
"id": "0c9ff4b721d754002726de007d6bd52a4df3b129",
"size": "2754",... |
"""Test/benchmark deep_dream.py."""
from pathlib import Path
import logging
import time
import click
from PIL import Image
import deep_dream as dd
from deep_dream import tile_worker
import utils
utils.setup_traceback()
logger = logging.getLogger(__name__)
handler = logging.StreamHandler(dd.stream)
handler.setFormat... | {
"content_hash": "1f12dbd7a825a1b00c11c0be047289cb",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 92,
"avg_line_length": 36.520833333333336,
"alnum_prop": 0.6714204221334854,
"repo_name": "crowsonkb/deep_dream",
"id": "2246bd6a95c87368143d260f562bb0912381b9bb",
"size": ... |
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
from .base import * # noqa
from .base import DATABASES, MIDDLEWARE, env
SECRET_KEY = env("SECRET_KEY")
# CELERY_BROKER_URL = env("CELERY_BROKER_URL")
USE_SCHEDULER = False
# if FRONTEND_URL == "http://testfrontend.it/":
# raise Impro... | {
"content_hash": "ca7fb94d608fe7e6bea6774cfc0ff73f",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 80,
"avg_line_length": 32.83720930232558,
"alnum_prop": 0.726628895184136,
"repo_name": "patrick91/pycon",
"id": "58a2bfaa37911f1a55f1a86d99af8a4bf4e5fa47",
"size": "1412",... |
import requests
from bs4 import BeautifulSoup
from bs4.dammit import EncodingDetector
import urllib.parse
import logging
import time
import reppy
import re
class Spider:
__headers = {'User-Agent': 'MedBot', 'Content-type': 'text/html'}
__robots_agent = {}
__base_urls = set()
__unknown_urls = []
_... | {
"content_hash": "2fcf861e65e318c37972aa1f658e88d2",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 120,
"avg_line_length": 36.16216216216216,
"alnum_prop": 0.5311410064773293,
"repo_name": "YorovSobir/informational_retrieval",
"id": "475952eeda3e3c53e7be9d203c1ae47eb0cf2c... |
from PIL import Image
SHRED_WIDTH = 32
NUMBER_SHREDS = 20
class Region(object):
def __init__(self, x1, y1, x2, y2):
self.x1, self.y1, self.x2, self.y2 = x1, y1, x2, y2
def __unicode__(self):
return "({0},{1},{2},{3})".format(self.x1,self.x2,self.x3,self.x4)
class Shred(object):
def __ini... | {
"content_hash": "43bc3d622b9552e0b4dde96910f9edac",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 159,
"avg_line_length": 37.124260355029584,
"alnum_prop": 0.5615237488045903,
"repo_name": "ehopealot/image-unshredder",
"id": "0591bcedb62f484cea0fa21d0e40de2ea772a98a",
... |
"""
Connection classes to connect to the Lookup/Ibis web service and allow API
methods to be invoked.
"""
import base64
from datetime import date
from httplib import HTTPSConnection
import socket
import os
import urllib
from dto import IbisDto, IbisError, IbisResult, IbisResultParser
try:
import ssl
_have_ss... | {
"content_hash": "eb7518c16038d4a502a39e379a5bdd07",
"timestamp": "",
"source": "github",
"line_count": 349,
"max_line_length": 77,
"avg_line_length": 36.919770773638966,
"alnum_prop": 0.5829258828094683,
"repo_name": "abrahammartin/django-ucamlookup",
"id": "9557c8d8af9422459237ec5dac0dcb1c313c3915"... |
from app import create_app
import unittest
class TestCase(unittest.TestCase):
def setUp(self):
self.app = create_app('Testing')
self.app_context = self.app.app_context()
self.app_context.push()
self.client = self.app.test_client()
def tearDown(self):
self.app_context.po... | {
"content_hash": "7e81a4f92f58e0a0cb6aed1b6fa885d5",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 82,
"avg_line_length": 27.473684210526315,
"alnum_prop": 0.6187739463601533,
"repo_name": "alfredfrancis/ai-chatbot-framework",
"id": "c86ae8985a9d45c5ce818694e545ff7fe6d7078... |
import csv
from mapping_classes import FunctionMapper
import sys
def build_key_func_dict(fields, hashing_func=None, separator="|"):
if fields.__class__ not in ([].__class__, ().__class__):
fields = [fields]
def hash_func(input_dict):
key_list = []
for field in fields:
key_... | {
"content_hash": "307efd69a21bd5f3e2ecb621d942bb34",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 113,
"avg_line_length": 29.828125,
"alnum_prop": 0.5605028810895757,
"repo_name": "jhajagos/CommonDataModelMapper",
"id": "cdfcc0bdf264fd9d97065d107a4dc7c79e0d18f8",
"size"... |
import io
import importlib
import os
import shutil
import pytest
from optimus.setup_project import setup_project
from optimus.conf.loader import import_pages_module
from optimus.pages.builder import PageBuilder
from optimus.assets.registry import register_assets
def DummyFilter(content):
return "DummyFilter: {}... | {
"content_hash": "3bb6e71c6c14c5ce02f1123b36452f3c",
"timestamp": "",
"source": "github",
"line_count": 214,
"max_line_length": 88,
"avg_line_length": 30.39252336448598,
"alnum_prop": 0.6383763837638377,
"repo_name": "sveetch/Optimus",
"id": "875cdd5cb57c6ee53ca1191299b460ad03918147",
"size": "6504... |
from parsley import wrapGrammar
from ometa.grammar import OMeta
from ometa.runtime import OMetaBase
from core.search.compiler.invparsley import grammar
name = 'InvDSL'
B = OMeta.makeGrammar(grammar, name=name).createParserClass(
OMetaBase, globals()
)
class ICompiler(B):
def directive(self, d, v):
... | {
"content_hash": "1bb7214a93b25a466e630f98776015ae",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 63,
"avg_line_length": 20.90625,
"alnum_prop": 0.5994020926756353,
"repo_name": "rtucker-mozilla/mozilla_inventory",
"id": "02c36eb00b3b38180a9d26e254c269491ab5dc7f",
"size... |
'''
Created on 23/10/2015
@author: david
'''
from abc import ABCMeta
class I2CSensor(object):
'''
Abstract class for I2C sensors
'''
__metaclass__ = ABCMeta
def _setAddress(self, address):
self._address = address
def _readWord(self, regH, regL):
byteH =... | {
"content_hash": "06fd784462fe2f6d9602dfa19e3e6419",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 61,
"avg_line_length": 19.79310344827586,
"alnum_prop": 0.5435540069686411,
"repo_name": "dpm76/Bot1",
"id": "4209bc0edc1dc62178386dd94c1c1066f9209126",
"size": "1148",
"... |
import requests
def scrape_vsco(username):
#start a new web-browsing session
s = requests.session()
#make containers for all the links to be collected
messy_links, clean_links = [],[]
#download the user's profile page
profile_page = s.get('http://vsco.co/'+username)
#check if account exists
if '<p class="pa... | {
"content_hash": "5a20ef936af77fadf789e00d70075e7f",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 142,
"avg_line_length": 35.94,
"alnum_prop": 0.7084028937117418,
"repo_name": "matthewnau/mirror-mirror",
"id": "0f4dc3304d2bf99463470a4f929ff494c42c4c98",
"size": "1797",
... |
import json
import logging
import multiprocessing as mp
import pickle
import time
from collections import Counter
from copy import deepcopy
from typing import List, Union, Tuple
import numpy as np
from flare.env import AtomicEnvironment
from flare.gp_algebra import (
get_like_from_mats,
get_neg_like_grad,
... | {
"content_hash": "d72de104ff11424c071770e30076dcb7",
"timestamp": "",
"source": "github",
"line_count": 1408,
"max_line_length": 88,
"avg_line_length": 34.38210227272727,
"alnum_prop": 0.5494525924395786,
"repo_name": "mir-group/flare",
"id": "c22b6cb07af34ff291a74bba9c5236d630dd1db8",
"size": "484... |
class channel(object):
def __init__(self, gen):
self.gen = gen
self.args = ()
self.kwargs = {}
def __iter__(self):
return self
def next(self):
self.args = ()
self.kwargs = {}
return self.gen.next()
def send(self, *args, **kwargs):
self.args = args
self.kwargs = kwargs
ret... | {
"content_hash": "fd9a083d507fa711e1f24eddadd0d0d4",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 67,
"avg_line_length": 21.225,
"alnum_prop": 0.5936395759717314,
"repo_name": "ActiveState/code",
"id": "15612d7e447a635e2c7ba795837f4e932bf2a797",
"size": "849",
"binary... |
'''This generates the yaml file called john-smith-labels.yaml
'''
from __future__ import absolute_import, print_function
from collections import defaultdict
import os
import sys
import yaml
def paths():
original = os.path.join(os.path.dirname(__file__), 'original')
for root, dirs, fnames in os.walk(original):... | {
"content_hash": "b8ca24d85017bae6f196221b445a2799",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 149,
"avg_line_length": 32.32203389830509,
"alnum_prop": 0.631882538017829,
"repo_name": "trec-kba/streamcorpus-pipeline",
"id": "f50c614215b2eec766c11dd2c52589481f3ed17d",
... |
from __future__ import absolute_import
from .base import *
########## IN-MEMORY TEST DATABASE
DATABASES = {
"default": env.db('sqlite://:memory:'),
}
########## EMAIL CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-backend
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBa... | {
"content_hash": "c4bb0d15c786bc4d7f68ab67ec80af32",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 72,
"avg_line_length": 26.485714285714284,
"alnum_prop": 0.6494066882416397,
"repo_name": "DeppSRL/open-partecipate",
"id": "1cf76a774e51e903f35fd10ae744b147b873d131",
"siz... |
from itertools import islice
import os
import numpy as np
import pandas._libs.json as json
from pandas._libs.tslibs import iNaT
from pandas.compat import StringIO, long, to_str, u
from pandas.errors import AbstractMethodError
from pandas.core.dtypes.common import is_period_dtype
from pandas import DataFrame, MultiI... | {
"content_hash": "eb68bb5d6e1aab15e4af3dbbf871f147",
"timestamp": "",
"source": "github",
"line_count": 950,
"max_line_length": 79,
"avg_line_length": 35.386315789473684,
"alnum_prop": 0.5480262962191749,
"repo_name": "GuessWhoSamFoo/pandas",
"id": "4bbccc8339d7cf789ea038318d46677b0b81a3ac",
"size"... |
from django.shortcuts import render,redirect
from django.views.generic import View
from .models import Perfil
from .forms import SolicitudColaboracionForm
# Create your views here.
class Solicitud_colaboracion(View):
def get(self,request):
template_name = 'registro/registro.html'
form = SolicitudColabora... | {
"content_hash": "86992633525afa072f375d9ca97ef39d",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 60,
"avg_line_length": 21.575,
"alnum_prop": 0.7427578215527231,
"repo_name": "SurielRuano/Orientador-Legal",
"id": "c9b53f0be0e791d7b939569282a0c4969e6b7282",
"size": "863... |
"""OTA image generator
This script generates OTA image file from the input hex files.
The XS data would be compressed into OTA image with the given LZSS tool.
"""
import argparse
import pathlib
import subprocess
import sys
import zlib
from intelhex import IntelHex
from struct import pack, pack_into
def main():
... | {
"content_hash": "ac9ef28570c9aea0350a1a049aca8ca8",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 88,
"avg_line_length": 30.594871794871796,
"alnum_prop": 0.5953737847804224,
"repo_name": "project-chip/connectedhomeip",
"id": "aa7755287525bf08a1900be093e2b4e45e05179b",
... |
import string
import valve.source.a2s
import re
import logging
class GameServer(object):
def __init__(self, ip, port, password=None):
self.ip = ip
try:
self.port = int(port) # Port number cannot be string
except TypeError:
logging.error("Cannot parse port number!")... | {
"content_hash": "930c589d868a3c525a16a2f7a0b7ed14",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 130,
"avg_line_length": 34.967032967032964,
"alnum_prop": 0.6209930861093652,
"repo_name": "darkChozo/FAbot",
"id": "c0beee1a5c481acff343a0a33922d5cb7733b5d1",
"size": "320... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.