text stringlengths 4 1.02M | meta dict |
|---|---|
import json
from django.conf import settings
class SVGReaderError(Exception):
pass
class BaseReader(object):
"""Base reader class not for direct use
Subclass this to have your own implementation, the class
to use can be defined in the settings with
SVG_ICONS_READER_CLASS
"""
def... | {
"content_hash": "0717176f315795acc1e1b41f2fde7f0a",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 79,
"avg_line_length": 29.472727272727273,
"alnum_prop": 0.5650832819247378,
"repo_name": "mikedingjan/django-svg-icons",
"id": "311be7b5cd08070be51e05930e4feb7e638bdcdf",
... |
"""A PHP devappserver2 runtime."""
import base64
import cStringIO
import httplib
import logging
import os
import subprocess
import sys
import time
import urllib
import google
from google.appengine.api import appinfo
from google.appengine.tools.devappserver2 import environ_utils
from google.appengine.tools.devappser... | {
"content_hash": "6e8eee2cc0338ce891b8fd5ccbcc7549",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 80,
"avg_line_length": 38.33971291866029,
"alnum_prop": 0.65443654062149,
"repo_name": "levibostian/myBlanky",
"id": "4d7bda19803d8e8420b43b51f20e6c288efc0ae7",
"size": "8... |
"""Tests for exploration domain objects and methods defined on them."""
import os
from core.domain import exp_domain
from core.domain import exp_services
from core.domain import param_domain
from core.tests import test_utils
import feconf
import utils
# Dictionary-like data structures within sample YAML must be form... | {
"content_hash": "67e5dbb0bdb83aebf43c0def5fef9a48",
"timestamp": "",
"source": "github",
"line_count": 2845,
"max_line_length": 115,
"avg_line_length": 30.85202108963093,
"alnum_prop": 0.5767995078269191,
"repo_name": "shaz13/oppia",
"id": "aa2ecf78dfedb16400fecc29dbad18d3390003b6",
"size": "88397... |
"""Functional tests for segment reduction ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
class SegmentReductionHelper(tf.test.TestCase):
def _input(self, input_shape, dtype=tf.int32):
num_elem = 1
... | {
"content_hash": "46abb9a9d0169b10f3666e1c43649567",
"timestamp": "",
"source": "github",
"line_count": 503,
"max_line_length": 80,
"avg_line_length": 38.37972166998012,
"alnum_prop": 0.5816627816627816,
"repo_name": "awni/tensorflow",
"id": "c094be4ac0ead6e26c744b2930edc219d9588f29",
"size": "1998... |
from pox.core import core
import pox.boot
log = core.getLogger("tests")
_first = True
_tests = []
def _up (e):
log.info("Starting")
for test in _tests:
log.info("Test %s", test)
if pox.boot._do_import("tests." + test) is True:
log.error("Test %s not found", test)
return
def launch (**kw):
... | {
"content_hash": "8e0530b64a36105f99bd0ca4389e3a16",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 52,
"avg_line_length": 19.615384615384617,
"alnum_prop": 0.6019607843137255,
"repo_name": "damomeen/pox-datapath",
"id": "1b349a4bae72e1e36e2bd51e291906e758f0409b",
"size":... |
"""
We create a singleton console instance at the module level or as an attribute
of your top-level object.
"""
from rich.console import Console
console = Console()
printf = console.print
| {
"content_hash": "e309deee63a08c56d28a7e91fd5db8ac",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 77,
"avg_line_length": 21.11111111111111,
"alnum_prop": 0.7578947368421053,
"repo_name": "tanghaibao/jcvi",
"id": "77a52cf26811a420093e1855e5cc1d7672f7e637",
"size": "355",
... |
#-----------------------------------------------------#
# AI Final Project #
# Front End #
# #
# #
#-----------------------------------------------------#
import os
import random
import shutil
from features import *
#import sklearn
class IOclass:
... | {
"content_hash": "8f694ddefbfaff17330e16c4bab985bb",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 90,
"avg_line_length": 27.066225165562916,
"alnum_prop": 0.5989723513579642,
"repo_name": "Behemyth/ForgeryML",
"id": "ba43e8a37bb429c3b25b391b14f6e317aec8db60",
"size": "... |
import cProfile
def do_cprofile(func):
def profiled_func(*args, **kwargs):
profile = cProfile.Profile()
try:
profile.enable()
result = func(*args, **kwargs)
profile.disable()
return result
finally:
profile.print_stats()
return ... | {
"content_hash": "1cc0dd9280ed5b493394a1200aa8c0af",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 58,
"avg_line_length": 29.425,
"alnum_prop": 0.5089209855564996,
"repo_name": "hasadna/OpenTrain",
"id": "e38f7f2091367aba945e52854fe3097e2428d88b",
"size": "1177",
"bina... |
"Example showing how to add a column on a existing column"
from tables import *
class Particle(IsDescription):
name = StringCol(16, pos=1) # 16-character String
lati = Int32Col(pos=2) # integer
longi = Int32Col(pos=3) # integer
pressure = Float32Col(pos=4) # f... | {
"content_hash": "6d895c4171a7cf06c78e167b5787e523",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 78,
"avg_line_length": 29.112676056338028,
"alnum_prop": 0.6729559748427673,
"repo_name": "cpcloud/PyTables",
"id": "670e2152cde79182d3b3d0012a4946014f2d2b69",
"size": "206... |
from __future__ import absolute_import
from . import _graph as __graph
from ._graph import *
from .. import Configuration
from . import opt
from . opt import multicut
from . opt import lifted_multicut
from . opt import mincut
from . opt import minstcut
import numpy
from functools import partial
import types
import s... | {
"content_hash": "9978e4171b6ad1ccbf436c94f1fe7e2e",
"timestamp": "",
"source": "github",
"line_count": 297,
"max_line_length": 125,
"avg_line_length": 37.4006734006734,
"alnum_prop": 0.666996759092546,
"repo_name": "DerThorsten/nifty",
"id": "7fef6626ed00bdd9afdf4780c00e049c2cb6c56f",
"size": "111... |
from server import EventServer
import threading
import random
import time
import json
from message import MessageProtocol
from enum import Enum
import msgpack
import sys
import argparse
lock = threading.Lock()
class PacketId(Enum):
JOIN = 0
WELCOME = 1
ACK = 2
HEARTBEAT = 3
PLAYER_INFO = 10
P... | {
"content_hash": "89fcd2061de03ab04c7a558b077a75a4",
"timestamp": "",
"source": "github",
"line_count": 436,
"max_line_length": 124,
"avg_line_length": 34.53211009174312,
"alnum_prop": 0.5498140276301806,
"repo_name": "lxndrdagreat/udp-socket-server",
"id": "5d02ed4f0d34c5db2fb115cbb0c3821fe52fb0b7",... |
import boto
import boto.rds2
import os, subprocess, time
from boto.manage.cmdshell import sshclient_from_instance
from boto.vpc import VPCConnection
vpcc = VPCConnection()
# ********** Configuration Constant **********
# BOOLEAN_DRYRUN = True
BOOLEAN_DRYRUN = False
PROJECT_TAG = "Stratus... | {
"content_hash": "642876781ab3bb5a4866c71856eb4169",
"timestamp": "",
"source": "github",
"line_count": 348,
"max_line_length": 218,
"avg_line_length": 37.81896551724138,
"alnum_prop": 0.6421244586277638,
"repo_name": "AnthonyWC/aws_boto",
"id": "ba3bb068bc325e3dd1f8400840ea7a20d857b492",
"size": "... |
import socket
TCP_IP = '127.0.0.1'
TCP_PORT = 5005
BUFFER_SIZE = 1024
MESSAGE = "i am sean"
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((TCP_IP, TCP_PORT))
s.send(MESSAGE)
data = s.recv(BUFFER_SIZE)
s.close()
print "received data:", data
| {
"content_hash": "a8df2b86a9826c00194c0abd3b538b9e",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 53,
"avg_line_length": 17.466666666666665,
"alnum_prop": 0.6908396946564885,
"repo_name": "sean666888/The-Bomb",
"id": "9bb0c77cc343af8ba059612dbe86dbb64514a4e3",
"size": "... |
from flask import Flask, request, send_from_directory, make_response, redirect
app = Flask(__name__, static_url_path='')
@app.before_request
def before_request():
authenticatedMethods = ['/list', '/another']
session_id = request.cookies.get('session_id')
if session_id is None and any(request.path in s fo... | {
"content_hash": "601b24c1689401eccd15d505cc5ed9c0",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 110,
"avg_line_length": 24.033898305084747,
"alnum_prop": 0.6283497884344147,
"repo_name": "canmogol/LightGap",
"id": "74a39b733384d53b56b0727be3d9035c00d04b26",
"size": "1... |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name=... | {
"content_hash": "856766d03b57e54ca03fed3bc8d310a5",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 157,
"avg_line_length": 42.86046511627907,
"alnum_prop": 0.5746066196418882,
"repo_name": "upconsulting/IsisCB",
"id": "4e73ec05e83ca67dac6b314a03dc361f8a8fed35",
"size": "... |
import tkinter as tk
import DanceAnno_InputDialog
class PlotAnnotation(tk.Tk):
"""
Plot annotation lines. Two levels of annotation are supported, A and B. Each level is denoted by an instance of this
class with different levelId
"""
def __init__(self, myMainGUI, color, create_button, levelId):
... | {
"content_hash": "cffb0976c650b945e3baa3b7cf24a617",
"timestamp": "",
"source": "github",
"line_count": 255,
"max_line_length": 150,
"avg_line_length": 37.22352941176471,
"alnum_prop": 0.5929203539823009,
"repo_name": "MKLab-ITI/DanceAnno",
"id": "fc0bb97f54b1045215a69db26311af932a363d14",
"size": ... |
import copy
from constants import ENTITY_TYPES, PATH_SEPARATOR
def pluralize(input):
if input[-1] == 'y':
return '{0}ies'.format(input[:-1])
else:
return '{0}s'.format(input)
def extract_ids(node_instances, key='id'):
if node_instances:
return [instance[key]
if i... | {
"content_hash": "2520afe5683ac0d4f57a25b9ff4482c7",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 78,
"avg_line_length": 28.574324324324323,
"alnum_prop": 0.6048711279262237,
"repo_name": "isaac-s/cloudify-manager",
"id": "7fae420a7cba76d2885c34c34166f762b9e5b729",
"si... |
import json, sys
from datetime import date
sys.path.append('../..')
import angle_format
template = """// GENERATED FILE - DO NOT EDIT.
// Generated by gen_load_functions_table.py using data from load_functions_data.json
//
// Copyright {copyright_year} The ANGLE Project Authors. All rights reserved.
// Use of this so... | {
"content_hash": "df86c6c23b51446d824502ffd0ac3b00",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 115,
"avg_line_length": 34.527472527472526,
"alnum_prop": 0.5752705283259071,
"repo_name": "ecoal95/angle",
"id": "eb3e4c5bf08212d427d6ab5031d7574ec4664930",
"size": "6578... |
"""Tests for GZip files."""
# Note: do not rename file to gzip.py this can cause the exception:
# AttributeError: 'module' object has no attribute 'GzipFile'
# when using pip.
import unittest
from dtformats import gzipfile
from tests import test_lib
class GZipFileTest(test_lib.BaseTestCase):
"""GZip file tests.... | {
"content_hash": "0f664ce728f721eed77e6d6638d353a1",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 67,
"avg_line_length": 27.51063829787234,
"alnum_prop": 0.7146171693735499,
"repo_name": "libyal/dtformats",
"id": "0879c20a091a655a5cbdc7bff43ac67a281b6357",
"size": "1317... |
import os
import re
import ujson
from django.conf import settings
from django.utils.translation import ugettext as _
from typing import Optional, Tuple
from zerver.lib.request import JsonableError
from zerver.lib.upload import upload_backend
from zerver.models import Reaction, Realm, RealmEmoji, UserProfile
EMOJI_PA... | {
"content_hash": "d197b765537b877f4e431554c951eb71",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 98,
"avg_line_length": 43.52100840336134,
"alnum_prop": 0.6595867928171462,
"repo_name": "rishig/zulip",
"id": "80d6e41c67db63e6a02f8ce131f731b9b9fec480",
"size": "5180",
... |
from unittest import TestCase
import json
from emojipy.ruleset import ascii_replace,\
unicode_replace, shortcode_replace
json_path = 'emojipy/emoji.json'
class MappingTests(TestCase):
def setUp(self):
self.ascii_list = []
with open(json_path) as json_file:
content = json_file.rea... | {
"content_hash": "94323696bf21acb6c2f430edadff8ffc",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 70,
"avg_line_length": 33.52173913043478,
"alnum_prop": 0.6614785992217899,
"repo_name": "launchyard/emojipy",
"id": "ccc42d5eae94014d65564498904dafce1264b604",
"size": "82... |
"""
Production Configurations
- Use Redis for cache
"""
from __future__ import absolute_import, unicode_literals
from .common import * # noqa
# SECRET CONFIGURATION
# ------------------------------------------------------------------------------
# See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
... | {
"content_hash": "f175bf9bd79122127c280ea7545d96b8",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 117,
"avg_line_length": 38.43939393939394,
"alnum_prop": 0.5577453685455263,
"repo_name": "valerymelou/cookiecutter-django-gulp",
"id": "b9a2bc4b67ae41447849e91eda569f874a08... |
import urllib2
import urllib
from django import http
from django.utils.translation import ugettext as _
from django.shortcuts import render_to_response
from django.template import RequestContext
try:
from allauth.account.views import signup as allauth_signup
from allauth.account.forms import LoginForm
fro... | {
"content_hash": "ab3a199794298c46025a3a11588b108b",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 72,
"avg_line_length": 30,
"alnum_prop": 0.6455128205128206,
"repo_name": "sternoru/goscalecms",
"id": "629ed3c42bc069e1b46424404f0cf36402210e54",
"size": "1560",
"binary... |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('editor', '0055_customparttypeaccess'),
]
operations = [
... | {
"content_hash": "fa4419152621eef4818a6bc49d65d82c",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 153,
"avg_line_length": 35.541666666666664,
"alnum_prop": 0.6682297772567409,
"repo_name": "numbas/editor",
"id": "3b4d946088aee0afcfbabcf00ccaf678e7054ffb",
"size": "902",... |
"""
Python Interchangeable Virtual Instrument Driver
Copyright (c) 2013-2014 Alex Forencich
Modified by Coburn Wightman 2017
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,... | {
"content_hash": "4a2ea2501665c611e67f6f53666b0e69",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 77,
"avg_line_length": 35.34090909090909,
"alnum_prop": 0.7562700964630225,
"repo_name": "coburnw/hp5334-ivi",
"id": "2b16d84a36ffa57eb4ffbfda082a268d2f202015",
"size": "15... |
"""Perceiver AR Architecture implementation.
As described in:
"General-purpose, long-context autoregressive modeling with Perceiver AR"
https://arxiv.org/abs/2202.07765
"""
import dataclasses
from typing import List, Optional, Tuple
from flax import linen as nn
import jax.numpy as jnp
from flaxformer.architectures.... | {
"content_hash": "672fe73929c21abc9964ffa9cf6f97f3",
"timestamp": "",
"source": "github",
"line_count": 407,
"max_line_length": 122,
"avg_line_length": 40.842751842751845,
"alnum_prop": 0.6456716597485411,
"repo_name": "google/flaxformer",
"id": "2a3b83cb50af21d9f15647459fbb2217d14e7a51",
"size": "... |
import os
import shutil
import sys
import subprocess
import json
import yaml
import inflect
from scaffold.custom_fields import *
from scaffold.modules.replace_string import replace_string, \
new_route_string, menu_string, js_src_string, test_script_string, conf_js_string
from scaffold.modules.errors import BlueprintErr... | {
"content_hash": "7ac7b1a6c250e2e4a5e45b1c9d961e13",
"timestamp": "",
"source": "github",
"line_count": 285,
"max_line_length": 118,
"avg_line_length": 37.03859649122807,
"alnum_prop": 0.5149677908298598,
"repo_name": "jking6884/RESTapi",
"id": "f0623a851391e397851b3ae9816787634b9da53f",
"size": "1... |
from __future__ import print_function
import sys
import re
import optparse
import os
import token
import itertools
import lib2to3.pgen2.tokenize
import lib2to3.pygram
import lib2to3.pytree
import hashlib
import difflib
import traceback
from cStringIO import StringIO
def _diff_strings(a, b, filename):
"""Return a... | {
"content_hash": "419ad09b5a12834f9d274dccf9338853",
"timestamp": "",
"source": "github",
"line_count": 333,
"max_line_length": 121,
"avg_line_length": 29.92792792792793,
"alnum_prop": 0.5542845675296006,
"repo_name": "westernx/metatools",
"id": "d0279d076c0fe3f0f989e84a92b8e0bad150a1bd",
"size": "... |
from collections.abc import Iterator
import os
import pathlib
class Reader(Iterator):
def __init__(self, file=None):
if file is not None:
self.set_file(file)
else:
self.file = None
self.reset()
def set_file(self, file):
if isinstance(file, pathlib.... | {
"content_hash": "5da3fb9e18983d1a83fb7580c7216ad8",
"timestamp": "",
"source": "github",
"line_count": 394,
"max_line_length": 76,
"avg_line_length": 28.598984771573605,
"alnum_prop": 0.49148029818956335,
"repo_name": "chantera/teras",
"id": "338fa5de45fb4c77ac712417104a79b41036dbae",
"size": "112... |
import logging
import const
import os
FILE_NAME = os.path.join(const.Constant.conf_dir, 'musicbox.log')
if os.path.isdir(const.Constant.conf_dir) is False:
os.mkdir(const.Constant.conf_dir)
with open(FILE_NAME, 'a+') as f:
f.write('#' * 80)
f.write('\n')
def getLogger(name):
log = logging.getLogger... | {
"content_hash": "9416ddbf598b03c625dbef8ed894ec47",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 113,
"avg_line_length": 24.4,
"alnum_prop": 0.6688524590163935,
"repo_name": "Catofes/musicbox",
"id": "ed4db362a71ce58c329e0c21660bd6af91d9cdbe",
"size": "774",
"binary"... |
"""SEE VirtualBox Resources.
This module provides an API for creating a virDomain controlling a VirtualBox Virtual Machine.
Configuration::
{
"domain":
{
"configuration": "/etc/myconfig/see/domain.xml",
},
"disk":
{
"image": {
"uri": "/var/mystoragepool/image.vdi",
"provider": "see.... | {
"content_hash": "1a47e9bdb6024a4b35dac934265113ab",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 109,
"avg_line_length": 27.397058823529413,
"alnum_prop": 0.6427804616210413,
"repo_name": "F-Secure/see",
"id": "0f985a8886005c92eebafd9d595dc0e1f48b16a7",
"size": "4303"... |
"""
Runs the auto routine. Called once.
"""
from networktables import NetworkTable
import time
import wpilib
class Autonomous(object):
def __init__(self, drive, randy, frontGear, backGear, vision):
self.drive = drive
self.randy = randy
self.frontGear = frontGear
self.backGea... | {
"content_hash": "1d9933d2c26e84817a1ae39fa4dbdae6",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 95,
"avg_line_length": 28.61111111111111,
"alnum_prop": 0.5346278317152103,
"repo_name": "3299/2017",
"id": "629ee4aba0f47ff216e10dc3da8aa2847cc12319",
"size": "1545",
"b... |
def build_profile(first, last, **user_info):
profile = {}
profile['first_name'] = first
profile['last_name'] = last
for key, value in user_info.items():
profile[key] = value
return profile
user_profile = build_profile('Juan', 'Calzoncit', location = 'Saltillo', field = 'Systems Eng... | {
"content_hash": "14e900709939047b2837811f9a77c4e5",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 117,
"avg_line_length": 24.266666666666666,
"alnum_prop": 0.6401098901098901,
"repo_name": "AnhellO/DAS_Sistemas",
"id": "5129f39d1feeb15de4d06fefe58f420e60d92773",
"size":... |
import unittest
from unittest import mock
import grid
import util
class ProblemGenerateTests(unittest.TestCase):
@mock.patch('util.grid.Grid')
def test_generates_a_grid(self, GridMock):
GridMock.return_value.open_cells = [(0,0), (0, 1), (1, 0)]
util.generate_problem(10, 10, 0.1)
GridMo... | {
"content_hash": "fe711e3bcc84cbd2f56b11b0b611d5fe",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 74,
"avg_line_length": 36.516129032258064,
"alnum_prop": 0.6166077738515902,
"repo_name": "XeryusTC/search",
"id": "d375708f85f097a34815fd9c21d9f13d3ffc4370",
"size": "1156... |
from django.conf import settings
from django.db import migrations
from corehq.sql_db.operations import RawSQLMigration
migrator = RawSQLMigration(('corehq', 'sql_proxy_accessors', 'sql_templates'), {
'PL_PROXY_CLUSTER_NAME': settings.PL_PROXY_CLUSTER_NAME
})
class Migration(migrations.Migration):
dependenc... | {
"content_hash": "7cd4fb84142a90ee0f9e8a49b8026efb",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 96,
"avg_line_length": 27.695652173913043,
"alnum_prop": 0.6640502354788069,
"repo_name": "dimagi/commcare-hq",
"id": "14c907fc8fb8cc1fa7db644624546881fa354085",
"size": "6... |
from Global.Global_consts import Global_consts
import socket
class Network_utils():
@staticmethod
def get_udp_socket(host, port):
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind((host,port))
return s
@staticmethod
def get_test_udp_socket():
host = Global_co... | {
"content_hash": "f7b5de30f65fb5783241112429da989c",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 69,
"avg_line_length": 26.565217391304348,
"alnum_prop": 0.6317512274959084,
"repo_name": "mikesligo/distributed-search",
"id": "c7f4d33fa1ac13c2e1e9527f4d09eb40e2b40404",
... |
from __future__ import unicode_literals
import frappe
def execute():
if not frappe.db.exists("DocType", "Data Import Beta"):
return
frappe.db.sql("DROP TABLE IF EXISTS `tabData Import Legacy`")
frappe.rename_doc('DocType', 'Data Import', 'Data Import Legacy')
frappe.db.commit()
frappe.db.sql("DROP TABLE IF EX... | {
"content_hash": "b6edd495d823116a89d9622a59bfc278",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 66,
"avg_line_length": 31.46153846153846,
"alnum_prop": 0.7212713936430318,
"repo_name": "vjFaLk/frappe",
"id": "f3eed6253c4c76dec5eb2ed8d9862b77b89e263a",
"size": "510",
... |
import click
import urllib
# very simplistic file extension to mimetype mapping
mime_types = {
"css": "text/css",
"gif": "image/gif",
"ico": "image/x-icon",
"jpeg": "image/jpeg",
"jpg": "image/jpeg",
"js": "application/javascript",
"png": "image/png",
}
@click.command()
@click.argument('... | {
"content_hash": "0620428ec6e562e6338056b61f41cfd9",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 93,
"avg_line_length": 26.424242424242426,
"alnum_prop": 0.6055045871559633,
"repo_name": "marians/datauri",
"id": "d78c85f6ab9ed4176609c00109d156656a29e206",
"size": "936"... |
from py_db import db
import argparse
from decimal import Decimal
db = db('NSBL')
# Needs to be run every week after the registers are created
# Only works on years >= 2017
# Takes players who play for multiple teams in a season and splits their statistics into multiple entries (1 for each team they played on, as well... | {
"content_hash": "c12a6e63b3361889a52bab5e97a20069",
"timestamp": "",
"source": "github",
"line_count": 296,
"max_line_length": 185,
"avg_line_length": 29.679054054054053,
"alnum_prop": 0.5447922595332954,
"repo_name": "Connor-R/NSBL",
"id": "db05d46de0c750b22013f5a9aca53756ab87c95a",
"size": "8785... |
import os
import sys
import numpy as np
# Expose available (onnx::* and protobuf::*) symbols from onnxruntime to resolve references in
# the custom ops shared library. Deepbind flag is required to avoid conflicts with other
# instances of onnx/protobuf libraries.
import onnxruntime
# Restore dlopen flags.
import ortt... | {
"content_hash": "c7889f9eded05f93a7a05639ba7cb99b",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 94,
"avg_line_length": 34.05882352941177,
"alnum_prop": 0.7754749568221071,
"repo_name": "microsoft/onnxruntime",
"id": "7d3e4edf48bd825e4be956148016b5342ffeb3c0",
"size": ... |
from burlap import ServiceSatchel
from burlap.constants import *
from burlap.decorators import task
class GPSDSatchel(ServiceSatchel):
name = 'gpsd'
@property
def packager_system_packages(self):
return {
UBUNTU: ['gpsd', 'gpsd-clients', 'python-gps', 'ntp'],
DEBIAN: ['gpsd... | {
"content_hash": "045febec28d29f94589e7a1e6bcd61d5",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 66,
"avg_line_length": 29.545454545454547,
"alnum_prop": 0.496,
"repo_name": "chrisspen/burlap",
"id": "e6ec2673a6d59aea2f04fa1cadf82ac0398df597",
"size": "1626",
"binary... |
"""Commands for managing security groups."""
import click
from ...jobs import securitygroups as sg_jobs
from ...jobs.exceptions import AwsError
from ...jobs.exceptions import MissingKey
from ...jobs.exceptions import Non200Response
from ...jobs.exceptions import PermissionDenied
from ...jobs.exceptions import Resour... | {
"content_hash": "3a2d86a055a2d73197695d942d07e115",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 86,
"avg_line_length": 30.284671532846716,
"alnum_prop": 0.6693179079296216,
"repo_name": "jtpaasch/armyguys",
"id": "f95d6d2f7431ff7d7fda23ee3d6f07f472a850de",
"size": "4... |
import os
BASE_DIR = os.path.dirname(__file__)
import dj_database_url
from project_runpy import env
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = env.get('SECRET_KEY', 'Rotom')
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = env.get('DEBUG', False)
ALLOWE... | {
"content_hash": "02bfdbb54b629b83aac720578723a5e2",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 84,
"avg_line_length": 24.884615384615383,
"alnum_prop": 0.6077279752704792,
"repo_name": "crccheck/tasteinsight",
"id": "747ffa7ebf1034a318cbefdca1791fac836af8af",
"size"... |
from logging import debug
import os
from subprocess import CalledProcessError, PIPE, Popen
import sys
import logging
import subprocess
logger = logging.getLogger(__name__)
# import psutil
class ProcessList(object):
def __init__(self, processes):
"""
@param processes Process[]
"""
... | {
"content_hash": "3a7fb696d6fc8736f37176ab89d73a4c",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 132,
"avg_line_length": 25.102564102564102,
"alnum_prop": 0.5757575757575758,
"repo_name": "pywizard/pywizard",
"id": "8c09158270792db1bcfdf66eaa8869bed97a6cc3",
"size": "... |
from tournament import *
def testDeleteMatches():
deleteMatches()
print "1. Old matches can be deleted."
def testDelete():
deleteMatches()
deletePlayers()
print "2. Player records can be deleted."
def testCount():
deleteMatches()
deletePlayers()
c = countPlayers()
if c == '0':
... | {
"content_hash": "bb4114fa3244e905bfe238b2dd175ceb",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 125,
"avg_line_length": 35.29090909090909,
"alnum_prop": 0.6532715095311695,
"repo_name": "barca/Nano_Tournament",
"id": "f2cab3e29e74406b7378e2b51e3049289d121f7a",
"size"... |
"""
Models
"""
import numpy as np
import pandas as pd
from sqlalchemy import sql, create_engine, MetaData, Table, Column, Integer, VARCHAR, TIMESTAMP
from sklearn.metrics import jaccard_similarity_score
class DB:
def __init__(self):
from instance.config import PG_USER, PG_PASSWORD
# connection
... | {
"content_hash": "1c25579472476590d35af8e0fb776d0d",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 127,
"avg_line_length": 51.076470588235296,
"alnum_prop": 0.5622480709432224,
"repo_name": "donK23/shed01",
"id": "0e429769f9e2788c1f4ac6f7b679aac76f6715c2",
"size": "8683... |
from braintree.payment_method_parser import parse_payment_method
from braintree.resource import Resource
class RevokedPaymentMethodMetadata(Resource):
def __init__(self, gateway, attributes):
self.revoked_payment_method = parse_payment_method(gateway, attributes)
self.customer_id = self.revoked_pa... | {
"content_hash": "3178428ea62d38ab3e130c3fd9bd1797",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 79,
"avg_line_length": 44.44444444444444,
"alnum_prop": 0.7625,
"repo_name": "braintree/braintree_python",
"id": "b4ed3373dd493d6d5c2309ed3e2dd9df5a06f084",
"size": "400",
... |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('board', '0010_notification_checked_time'),
]
operations = [
migrations.AlterModelOptions(
name='notific... | {
"content_hash": "f203a27c3ec1f7a083d72ad12958f40b",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 96,
"avg_line_length": 26.625,
"alnum_prop": 0.6056338028169014,
"repo_name": "devunt/hydrocarbon",
"id": "b05983d48b7d4939d26da1f3e4ff3dd020ca1fd3",
"size": "663",
"bina... |
from .sub_resource import SubResource
class InboundNatRule(SubResource):
"""Inbound NAT rule of the load balancer.
Variables are only populated by the server, and will be ignored when
sending a request.
:param id: Resource ID.
:type id: str
:param frontend_ip_configuration: A reference to fr... | {
"content_hash": "1d629183c4ac07dc37f6e544cc64ad89",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 282,
"avg_line_length": 51.675,
"alnum_prop": 0.6845670053217223,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "1024de45ababdc182c8528723d54c7e1ad5291a1",
"size": "46... |
from .all import MUNSELL_COLOURS_ALL
from .experimental import MUNSELL_COLOURS_1929
from .real import MUNSELL_COLOURS_REAL
from colour.utilities import CanonicalMapping
__all__ = [
"MUNSELL_COLOURS_ALL",
]
__all__ += [
"MUNSELL_COLOURS_1929",
]
__all__ += [
"MUNSELL_COLOURS_REAL",
]
MUNSELL_COLOURS = Cano... | {
"content_hash": "75a59d5508d7953d45a439141ad4fb66",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 78,
"avg_line_length": 36,
"alnum_prop": 0.7,
"repo_name": "colour-science/colour",
"id": "0ce892ad0bcfd294cf10d61357046a9989e5d8bd",
"size": "2700",
"binary": false,
"... |
import re
text = 'abbaaabbbaaaaa'
pattern = 'ab'
for match in re.findall(pattern, text):
print('Found "%s"' % match)
for match in re.finditer(pattern, text):
s = match.start()
e = match.end()
print('Found %s at %d to %d' % (text[s:e], s, e))
| {
"content_hash": "6a3ebdc437db0a77c7739056349ed0ef",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 53,
"avg_line_length": 21.75,
"alnum_prop": 0.6015325670498084,
"repo_name": "eroicaleo/ThePythonStandardLibraryByExample",
"id": "94a8d4902b43721c2c66239be3d12f6518eed5bd",
... |
import json
import pytest
import responses
from twitch.client import TwitchClient
from twitch.constants import BASE_URL
from twitch.exceptions import TwitchAttributeException
from twitch.resources import Community, User
example_community = {
"_id": "e9f17055-810f-4736-ba40-fba4ac541caa",
"name": "DallasTeste... | {
"content_hash": "d35f0307296989239414fe85a20ab3e5",
"timestamp": "",
"source": "github",
"line_count": 419,
"max_line_length": 85,
"avg_line_length": 26.14558472553699,
"alnum_prop": 0.6485623003194888,
"repo_name": "tsifrer/python-twitch-client",
"id": "8b22e4d1c248a5fd419cb4dc89a783f169ce6d7c",
... |
from tornado import gen
from tornado.web import asynchronous
from base_handler import BaseHandler
from elephunk.records.activity import Activity
class ActivityHandler(BaseHandler):
@asynchronous
@gen.engine
def get(self):
rows = yield gen.Task(self.client_for('postgres').select_all, "SELECT * FROM ... | {
"content_hash": "6668fb6db2f19cd2a8358c9203d47a04",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 120,
"avg_line_length": 37.90909090909091,
"alnum_prop": 0.750599520383693,
"repo_name": "pitluga/elephunk",
"id": "cd7bce66abf03b1a2ad24050b982b67ac2b76ed8",
"size": "417"... |
import couchdb
import sys
def create_db(db_name,couch):
if db_name in couch:
db = couch[db_name]
else:
db = couch.create(db_name)
return db
server_url = 'http://localhost:5984'
couch = couchdb.Server(server_url)
bag_name = sys.argv[1]
db = create_db('bags',couch)
doc = { 'bag': bag_name.s... | {
"content_hash": "d777f795f4abd0eba9691be5a6519dc2",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 109,
"avg_line_length": 25.210526315789473,
"alnum_prop": 0.6680584551148225,
"repo_name": "WalkingMachine/sara_commun",
"id": "0131cb06558748bdb141bc0e5611eda1fd6b4144",
"... |
from __future__ import annotations
from edb.common import parsing
class PrecedenceMeta(parsing.PrecedenceMeta):
pass
class Precedence(parsing.Precedence, assoc='fail', metaclass=PrecedenceMeta):
pass
class P_UNION(Precedence, assoc='left', tokens=('UNION', 'EXCEPT',)):
pass
class P_INTERSECT(Preced... | {
"content_hash": "a9edeaf8a2762265dd30acfed822009f",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 77,
"avg_line_length": 19.39864864864865,
"alnum_prop": 0.6384535005224661,
"repo_name": "edgedb/edgedb",
"id": "cc27c9361471d62c2e1bc86cc71b96788b8513f7",
"size": "3552",... |
from django.conf.urls import patterns, include, url
from django.views.generic import RedirectView
from django.contrib import admin
admin.autodiscover()
handler404 = 'djtools.views.errors.four_oh_four_error'
handler500 = 'djtools.views.errors.server_error'
urlpatterns = patterns('',
#url(r'^admin/', include(admi... | {
"content_hash": "826cb5e03cbf37d0198d5eb642562886",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 68,
"avg_line_length": 28.941176470588236,
"alnum_prop": 0.7154471544715447,
"repo_name": "carthagecollege/django-djparking",
"id": "8f065ea9de386a7f80c92644695b402d1b93d2ae"... |
import cv2
from CvPyMat import CvPyMat
test = CvPyMat();
imgPath = "./buri.jpg";
# Testing the conversion of Mat object to Python
# img2 = test.loadImageInCpp_Demo(imgPath);
# cv2.imshow("pYimg", img2);
# cv2.waitKey(0);
# Testing multiorientation person detection written in C++
img = cv2.imread(imgPath);
rotation... | {
"content_hash": "b00362022e06e21455c70caa540b3e5b",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 109,
"avg_line_length": 25.043478260869566,
"alnum_prop": 0.7517361111111112,
"repo_name": "matteobustreo/cvPy",
"id": "27de6899a08b46039d44006a6be939e4955d40c0",
"size": "... |
import os
import argparse
import logging
from bootstrap import bootstrap
from gitwrapperlib import Git
from library import bump
from configuration import BRANCHES_SUPPORTED_FOR_TAG
# This is the main prefix used for logging
LOGGER_BASENAME = '''_CI.tag'''
LOGGER = logging.getLogger(LOGGER_BASENAME)
LOGGER.addHandler(l... | {
"content_hash": "9fcdd5bbaf7a3f65bd774fbd9f311816",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 91,
"avg_line_length": 35.46666666666667,
"alnum_prop": 0.6522556390977443,
"repo_name": "costastf/python_library_cookiecutter",
"id": "95016ecdd8640137c1ab5305fdc7f397a8a060... |
"""
FASTMODE -- Provide real time response for each program. First, this checks to see
if the proposal asks for fasttime response. If so, the task then copies the data
to the fast directory for that proposal on saltpipe. If it is the first object
data for that proposal, then it will also send an email to the conta... | {
"content_hash": "5484c6235b88b93b4819626f8efda0fb",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 115,
"avg_line_length": 38.03623188405797,
"alnum_prop": 0.6662221375500095,
"repo_name": "saltastro/pysalt",
"id": "a6a44ff72593deed52b92fa4fae3816e152cccab",
"size": "76... |
from baby_steps import given, then, when
from district42 import schema
from .._fixtures import * # noqa: F401, F403
def test_const_generation(*, generate, random_):
with given:
sch = schema.const
with when:
res = generate(sch)
with then:
assert res is None
def test_const_valu... | {
"content_hash": "6a1f341fae96adf0f2837893b94a9a1c",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 54,
"avg_line_length": 19,
"alnum_prop": 0.6042884990253411,
"repo_name": "nikitanovosibirsk/blahblah",
"id": "8f7d3ea7b040fa56361489c0a5ca6e0a062d047b",
"size": "513",
"... |
import os
from heartbeat import BaseTest
class Test(BaseTest):
def test_base(self):
"""
Basic test with exiting Heartbeat normally
"""
self.render_config_template(
path=os.path.abspath(self.working_dir) + "/log/*"
)
heartbeat_proc = self.start_beat()
... | {
"content_hash": "22fe4d3e78748d3b4496b74dba4d1b56",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 74,
"avg_line_length": 25.823529411764707,
"alnum_prop": 0.6127562642369021,
"repo_name": "christiangalsterer/execbeat",
"id": "758fa108641c2d4315ecba7bcf0d44a35410335b",
"... |
import bge
class Animation(object):
"""Base class for animations for Animations for 2D Sprites
frames=list(str())"""
def __init__(self,*frames):
self.frames=list()
if "list" in str(frames[0].__class__):
self.frames=frames[0]
else:
for i in range(0,len(frames)... | {
"content_hash": "286f60975605c02ba13e2673b76fee08",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 74,
"avg_line_length": 35.929577464788736,
"alnum_prop": 0.5825166601332811,
"repo_name": "hikaruAi/hikaBGE",
"id": "bd3d8b8e3d422cb8e4e87b5bef7a5a51ae467b1f",
"size": "255... |
import uuid
from xml.dom import minidom
from oslo_serialization import jsonutils
from oslo_utils import timeutils
import webob
from jacket.api.storage.storage import common
from jacket.api.storage.storage.contrib import volume_image_metadata
from jacket.api.storage.storage.openstack import wsgi
from jacket import con... | {
"content_hash": "e23f3568590f30d14bf938a6ecb68d8e",
"timestamp": "",
"source": "github",
"line_count": 349,
"max_line_length": 81,
"avg_line_length": 37.55873925501432,
"alnum_prop": 0.599023497101007,
"repo_name": "HybridF5/jacket",
"id": "8137fe54ed4d0e9f95c009456cf4be4ee10f7c7a",
"size": "13713... |
from haas import rest
from abc import ABCMeta, abstractmethod
from StringIO import StringIO
import unittest
import json
import sys
from werkzeug.routing import Map
from werkzeug.wrappers import Request
from schema import Schema, Optional
# We don't directly use this, but unless we import it, the coverage tool
# com... | {
"content_hash": "f244c61a6435f609cb5fac6912925e69",
"timestamp": "",
"source": "github",
"line_count": 344,
"max_line_length": 80,
"avg_line_length": 30.281976744186046,
"alnum_prop": 0.5837573197657675,
"repo_name": "SahilTikale/switchHaaS",
"id": "1b9151f8579414b73c2cc04be9188c2a1724ac81",
"size... |
from typing import Tuple, Union
from django.contrib import messages
from django.contrib.auth import login, update_session_auth_hash
from django.contrib.auth.mixins import UserPassesTestMixin
from django.contrib.auth.views import LoginView
from django.core.handlers.wsgi import WSGIRequest
from django.http import HttpRe... | {
"content_hash": "e815fbc5d460e1d684c123015aaece19",
"timestamp": "",
"source": "github",
"line_count": 285,
"max_line_length": 91,
"avg_line_length": 38.887719298245614,
"alnum_prop": 0.6309663448524767,
"repo_name": "CenterForOpenScience/lookit-api",
"id": "0e7675ce536171a47cd13539fb303210a28e5bfe"... |
import tensorflow as tf
from setags.data.input import EMBEDDING_SIZE
from setags.data.utils import BIOTag
from setags.utils import DictWrapper
class Features(DictWrapper):
def __init__(self):
self.id = None
self.title = None
self.title_length = None
self.content = None
sel... | {
"content_hash": "f9963029838306d290f5914e3636ad51",
"timestamp": "",
"source": "github",
"line_count": 212,
"max_line_length": 116,
"avg_line_length": 37.60377358490566,
"alnum_prop": 0.6115153035624686,
"repo_name": "pkubik/setags",
"id": "0fed00a141617109a61ae5ea7376c527e8696fa0",
"size": "7972"... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
from mock import ANY
from ansible.module_utils.network.fortios.fortios import FortiOSHandler
try:
from ansible.modules.network.fortios import fortios_firewall_vip
except ImportError:
pyt... | {
"content_hash": "ebcb33cc0e81a068889eb70ff96ede68",
"timestamp": "",
"source": "github",
"line_count": 823,
"max_line_length": 142,
"avg_line_length": 41.41555285540705,
"alnum_prop": 0.5083467801085522,
"repo_name": "thaim/ansible",
"id": "a24bdd6b8f39036340e0094a41bbf938bab34622",
"size": "34781... |
from __future__ import division
from __future__ import unicode_literals
import os
import codecs
import json
import logging
import tweepy
import time
import re
import random
import cPickle as pickle
from httplib import IncompleteRead
def ignore(method):
"""
Use the @ignore decorator on TwitterBot methods you... | {
"content_hash": "e5b2ae786826ac6bb17d3227135fe924",
"timestamp": "",
"source": "github",
"line_count": 443,
"max_line_length": 142,
"avg_line_length": 32.830699774266364,
"alnum_prop": 0.570475797579758,
"repo_name": "brianshumate/robo-pirate",
"id": "2a5dc92c193c84d18a38a70d3bd491357b985972",
"si... |
import unittest
from cpuinfo import *
import helpers
class TestParseCPUString(unittest.TestCase):
def test_to_decimal_string(self):
self.assertEqual('2.8', cpuinfo._to_decimal_string('2.80'))
self.assertEqual('2.0', cpuinfo._to_decimal_string('2'))
self.assertEqual('3.0', cpuinfo._to_decimal_string(3))
sel... | {
"content_hash": "a103cc913a58e2d089fbdcbaa384dc54",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 149,
"avg_line_length": 52.06194690265487,
"alnum_prop": 0.6734659187489376,
"repo_name": "workhorsy/py-cpuinfo",
"id": "27fdfd1313f911154ad1f2745cfea31aa21ec6f7",
"size":... |
from sklearn.datasets import load_svmlight_file
from os import listdir
from os.path import isfile, join, basename, dirname
from sklearn.linear_model import SGDClassifier
from sklearn.svm import LinearSVC
from scipy.linalg import svd
from scipy.sparse import lil_matrix
import numpy as np
import pickle
import sys
from ud... | {
"content_hash": "06fea4ff952d7ad4b24be3dbd477454b",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 123,
"avg_line_length": 40.94444444444444,
"alnum_prop": 0.6485753052917232,
"repo_name": "tmills/uda",
"id": "6efc59da7d96a9109e08b73628d777e778d23880",
"size": "2966",
... |
import collections
import json
import logging
import time
import urllib.request, urllib.parse, urllib.error
import urllib.request, urllib.error, urllib.parse
from base.APIError import APIError
from base.APIHostSwitch import *
_MAX_BACKOFF_DELAY = 1024000
class JsonDict(dict):
def __getattr__(self, item):
... | {
"content_hash": "86dcb80cb493d85cfa2a4b933b2b66c9",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 123,
"avg_line_length": 34.982658959537574,
"alnum_prop": 0.5581625908790483,
"repo_name": "jerryjobs/thirdpartPushSystem",
"id": "7533ed6dbfb673c822a23bead02ff3c42a5c6f36",... |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from generic import ConfigModel
from bbotui import settings
class BuildSlave(ConfigModel):
"""
A Build Slave
"""
project = models.ForeignKey("Project", verbose_name=_("project"))
name = models.CharFiel... | {
"content_hash": "4d3599708870e5cb4832e6a97c1d644b",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 83,
"avg_line_length": 34.38028169014085,
"alnum_prop": 0.5854158131913151,
"repo_name": "shawnchin/bbotui",
"id": "4803b01a137e31b65c0c1d36ab70e14201684502",
"size": "2441... |
from __future__ import absolute_import, division, print_function
from unittest import TestCase, main
import numpy as np
import numpy.testing as npt
import pandas as pd
from pandas.util.testing import assert_frame_equal
from skbio import DistanceMatrix
from skbio.stats.distance import (DissimilarityMatrixError,
... | {
"content_hash": "6fc7cff567bbee16f5342b10c060c48d",
"timestamp": "",
"source": "github",
"line_count": 561,
"max_line_length": 79,
"avg_line_length": 38.51693404634581,
"alnum_prop": 0.5592373195112921,
"repo_name": "jensreeder/scikit-bio",
"id": "cff8f4cf024114d8ad118a84c939d95484f1dcc5",
"size":... |
from django.core.management import BaseCommand
from django.conf import settings
from selenium import webdriver
from pyquery.pyquery import PyQuery as pq
import os, datetime, time
import requests, urllib, redis
from excel.models import CrawlExcel
from account.models import PhoneUserProfile
from django.contrib.auth.mo... | {
"content_hash": "ade557a59f076dab5eb43b1945c81c69",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 98,
"avg_line_length": 32.93333333333333,
"alnum_prop": 0.507807981492192,
"repo_name": "stone5495/zebra",
"id": "2295e068e7565875981e893066c877a07440dab9",
"size": "3575"... |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Script to create Chrome Installer archive.
This script is used to create an archive of all the files required for a
Chrome ... | {
"content_hash": "8beb1221d8800db446d1d9b8d5f46480",
"timestamp": "",
"source": "github",
"line_count": 593,
"max_line_length": 80,
"avg_line_length": 40.03878583473862,
"alnum_prop": 0.664237880638504,
"repo_name": "keishi/chromium",
"id": "b01468a7212f467a4d6b2c22f3e428a0f85f10c8",
"size": "23743... |
from setuptools import setup, Extension
import subprocess
import sys
long_description = """
This Python package is a high-level wrapper for Kerberos (GSSAPI) operations.
The goal is to avoid having to build a module that wraps the entire Kerberos.framework,
and instead offer a limited set of functions that do what is ... | {
"content_hash": "ae83486111b14d7e6f9afda641cf8009",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 91,
"avg_line_length": 32.19444444444444,
"alnum_prop": 0.6186367558239861,
"repo_name": "dave-bouchillon/pykerberos",
"id": "92072661ed59cad50cb127739eb02be416c8594e",
"si... |
try:
from rpython.rlib.unroll import unrolling_iterable
except ImportError:
"NOT_RPYTHON"
def unrolling_iterable(values):
return values
| {
"content_hash": "26b3a9268504fdbe395b8c2de6b7bd0b",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 54,
"avg_line_length": 26,
"alnum_prop": 0.717948717948718,
"repo_name": "SOM-st/RPySOM",
"id": "fe4c26ac6e1ce6bf8e189154bdce4a9760623a53",
"size": "156",
"binary": false,... |
import os
from pathlib import Path
from typing import List
import numpy as np
import pandas as pd
import csv
import eccpy
def aaa(df_or_series):
""" Function for use in debugging.
Saves pandas Series or Dataframes to a user-defined csv file.
"""
# convert any series to dataframe
if isinstance(d... | {
"content_hash": "081507edb7bd10e4c15c785f368a9405",
"timestamp": "",
"source": "github",
"line_count": 603,
"max_line_length": 125,
"avg_line_length": 41.47097844112769,
"alnum_prop": 0.6306634142440116,
"repo_name": "teese/eccpy",
"id": "d69d783cb2b71a55adfe8c2e0b123899bfafd529",
"size": "25007",... |
"""Parses a torrent file."""
import io
import logging
import os
import six
from seedbox.torrent import bencode
LOG = logging.getLogger(__name__)
class ParsingError(Exception):
"""Holds parsing error messages.
Error class representing errors that occur while parsing
the torrent content.
"""
def... | {
"content_hash": "a6bbe2c5615c02bbce74db4b14616f45",
"timestamp": "",
"source": "github",
"line_count": 220,
"max_line_length": 79,
"avg_line_length": 29.80909090909091,
"alnum_prop": 0.5439158279963403,
"repo_name": "shad7/seedbox",
"id": "428d32e14c59909b10e59bb25a9677e70094949f",
"size": "6558",... |
""" Audio Spectogram Transformer (AST) model configuration"""
from ...configuration_utils import PretrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP = {
"MIT/ast-finetuned-audioset-10-10-0.4593": (
"https://hugg... | {
"content_hash": "2d14742fc1b3e32fb4a543e08f7dac18",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 121,
"avg_line_length": 44.723214285714285,
"alnum_prop": 0.6586144939109603,
"repo_name": "huggingface/transformers",
"id": "19f85189ad0dbd0be1f35ca11595230a6ed79d21",
"s... |
posts.update({'permalink':permalink}, {'$inc': {'comments.' + comment_ordinal + '.num_likes': 1}}); | {
"content_hash": "146f5e0703f20649ad3d29c90c70ae43",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 99,
"avg_line_length": 99,
"alnum_prop": 0.6363636363636364,
"repo_name": "hemmerling/nosql-mongodb2013",
"id": "c2e45f2f13f6111d01e948c4be22ec75f87a2c57",
"size": "139",
... |
from google.appengine.ext import ndb
import datetime
import sys
import logging
def put(json):
kind = json['kind']
if 'ancestor' in json:
json_parent = json['ancestor']
parent_key = create_key(json_parent)
p = create_generic_model_with_parent(kind, parent_key)
else:
p = cre... | {
"content_hash": "5c19b58e1e214846028cc2c142d833f0",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 67,
"avg_line_length": 21.88888888888889,
"alnum_prop": 0.6095600676818951,
"repo_name": "filipesimoes/ds-api",
"id": "8b83527f86bcbd617a6ee665a10d8064e0ca8730",
"size": "... |
from __future__ import absolute_import, division, print_function, unicode_literals
from pants.java.distribution.distribution import DistributionLocator
from pants_test.subsystem.subsystem_util import init_subsystem
def is_missing_jvm(version):
init_subsystem(DistributionLocator)
try:
DistributionLocator.cach... | {
"content_hash": "a077e89e70c5c6b394640aa9d836e7a3",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 98,
"avg_line_length": 35.38461538461539,
"alnum_prop": 0.7978260869565217,
"repo_name": "twitter/pants",
"id": "8fce342fd2357c6622a7690e3891f21905b07eb4",
"size": "607",
... |
from __future__ import absolute_import, print_function, division
import struct
import sys
import construct
import six
import netlib.exceptions
from mitmproxy import exceptions
from mitmproxy.contrib.tls import _constructs
from mitmproxy.protocol import base
from netlib import utils
# taken from https://testssl.sh/... | {
"content_hash": "ecf8f604476f718962fbd11609522fa6",
"timestamp": "",
"source": "github",
"line_count": 603,
"max_line_length": 118,
"avg_line_length": 37.41293532338308,
"alnum_prop": 0.5966312056737588,
"repo_name": "jvillacorta/mitmproxy",
"id": "d08e2e329afc1c7c3fa0633a96babdfa45be6e64",
"size"... |
import tornado.web
import tornado.websocket
import tornado.httpserver
import tornado.ioloop
import serial
import threading
import asyncio
import time
clients = []
serialready = True
class ThreadReadSerial(threading.Thread):
running = 1
serialbuff = ""
def __init__(self):
threading.Thread.__init__(self)
self... | {
"content_hash": "9d5ff7d1f90d6bab9fc4c7b08ff10f1d",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 66,
"avg_line_length": 23.44927536231884,
"alnum_prop": 0.6600741656365884,
"repo_name": "hackffm/SpaceShuttle",
"id": "fd3e886f9e83c88d9495ce6428e93b05ebf01ddb",
"size": ... |
"""Dataset for chromosome ID task with baseline-formatted examples."""
import functools
from typing import Optional
from absl import logging
from flax import jax_utils
import jax
import jax.numpy as jnp
import numpy as np
from scenic.dataset_lib import dataset_utils
from scenic.dataset_lib import datasets
import tens... | {
"content_hash": "2c18fbbb4cb82903248450e109149a91",
"timestamp": "",
"source": "github",
"line_count": 281,
"max_line_length": 80,
"avg_line_length": 33.195729537366546,
"alnum_prop": 0.6677744425385935,
"repo_name": "google-research/scenic",
"id": "a3977510594dc3a26c8d97ee1b951414e19f9c24",
"size... |
import string
a = """
Daar zijn we weer, met nog een puzzel!
Af en toe willen wij als Puzzelmakers ook iets zeggen.
We gaan ieder jaar weer hard voor de puzzels, en ook dit jaar maken we het weer bont... Wat top dat dat ieder jaar ook weer kan en mag.
Het systematisch werk gaat ook echter weer door.
Afijn, onnozel gen... | {
"content_hash": "e2984b1f3214915916e8c784211b3d2f",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 135,
"avg_line_length": 39.94285714285714,
"alnum_prop": 0.7367668097281831,
"repo_name": "physicalattraction/kerstpuzzel",
"id": "8524c23442e10607f4cb9869d575d923b68d5eac",
... |
import os
from django.core.management.base import BaseCommand
from tweepy import Client
class Command(BaseCommand):
""" Twitter GET /2/users/me から自分の user_id を取得し、コンソールに表示する
https://docs.tweepy.org/en/stable/client.html#tweepy.Client.get_me
なお、取得した user_id は .env や環境変数に設定すること
"""
def han... | {
"content_hash": "f6c513775a4970cfdc1e869a6c841d0f",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 106,
"avg_line_length": 35.391304347826086,
"alnum_prop": 0.6437346437346437,
"repo_name": "thinkAmi/dj_ringo_tabetter",
"id": "a9c48c13b7dfdeabf22ce076e97694b60af4393a",
"... |
import os
import shutil
import tempfile
import zipfile
from logging import FileHandler
from django.core.files.base import ContentFile
from django.core.urlresolvers import reverse
from django.test import TransactionTestCase
from django.test.utils import override_settings
from .. import update
from ..models import Arti... | {
"content_hash": "bd5a1a34a0c4b699d5a6d1fadca46607",
"timestamp": "",
"source": "github",
"line_count": 321,
"max_line_length": 79,
"avg_line_length": 38.797507788161994,
"alnum_prop": 0.6440501043841336,
"repo_name": "rafikdraoui/vortex",
"id": "1f49b0b480ba41427379b1e7aca328c64587507d",
"size": "... |
from django.conf.urls import url
from src.apps.users.api import views
urlpatterns = [
url(
regex=r'^getList/$',
view=views.GetUserList.as_view(),
name='list'
),
]
| {
"content_hash": "76162e09f97e816e7f3f7ceb2a6c9602",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 41,
"avg_line_length": 15.307692307692308,
"alnum_prop": 0.592964824120603,
"repo_name": "airportmarc/the416life",
"id": "86546745603c69af91560110ff86e458f7e5ebc6",
"size":... |
import atexit
import signal
from . import configs, exceptions, formats, pa, streams, __version__
__all__ = \
configs.__all__ \
+ formats.__all__ \
+ exceptions.__all__ \
+ pa.__all__ \
+ streams.__all__ \
+ __version__.__all__
from .configs import *
from .exceptions import *
from .formats im... | {
"content_hash": "c4ab2998c2b5fdd0cdefaddf612b3025",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 68,
"avg_line_length": 18.724137931034484,
"alnum_prop": 0.6335174953959485,
"repo_name": "elijahr/portaudio-ctypes",
"id": "16d9b0e96f0f3fe570b25938e78031ac6a10661b",
"siz... |
import sys
import numpy
array = numpy.array([numpy.array(xs.split(), int) for xs in list(sys.stdin)[1:]])
print(numpy.transpose(array))
print(array.flatten())
| {
"content_hash": "85c1ff6dcaa7687642b50d5465a5dedb",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 81,
"avg_line_length": 23,
"alnum_prop": 0.7204968944099379,
"repo_name": "alexander-matsievsky/HackerRank",
"id": "99a4963421a18e0c1a5fdfe2dde50933052220d2",
"size": "161",... |
"""
Example Airflow DAG for Google Cloud Storage GCSTimeSpanFileTransformOperator operator.
"""
from __future__ import annotations
import os
from datetime import datetime
from pathlib import Path
from airflow import models
from airflow.models.baseoperator import chain
from airflow.providers.google.cloud.operators.gcs... | {
"content_hash": "f34c2201959cd96a45245701822d516c",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 99,
"avg_line_length": 32.43269230769231,
"alnum_prop": 0.69878446486807,
"repo_name": "cfei18/incubator-airflow",
"id": "bdc7fdd3b67b62f32eb2f17ad5d5d635b7831af3",
"size"... |
from concurrent.futures import CancelledError
from datetime import datetime
from functools import lru_cache
from itertools import count
import logging
from bndl.net.connection import NotConnected
from bndl.util.lifecycle import Lifecycle
logger = logging.getLogger(__name__)
class Job(Lifecycle):
'''
A set ... | {
"content_hash": "7face2d369d544475237beb0ca1f96ba",
"timestamp": "",
"source": "github",
"line_count": 268,
"max_line_length": 119,
"avg_line_length": 28.182835820895523,
"alnum_prop": 0.5754005031113465,
"repo_name": "bndl/bndl",
"id": "fa23e19afc836c0f519fda8ac0cbb891d834e942",
"size": "8098",
... |
import data, pygame, math
from pymunk.vec2d import Vec2d
class Texture(object):
def __init__(self, image):
self.image = image
self.width = self.image.get_width()
self.height = self.image.get_height()
self.center = (self.width/2, self.height/2)
def wrld_to_img(verts, min_v):
m_x... | {
"content_hash": "e54951010bfbf90c90b42a330c980df9",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 93,
"avg_line_length": 32.95238095238095,
"alnum_prop": 0.6078998073217726,
"repo_name": "goosemo/monkey",
"id": "1eb5d2ba2adcfcb0ef50085e61e1a99be18ef6c1",
"size": "2076",... |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import division
from future import standard_library
standard_library.install_aliases()
from builtins import * # noqa
from hamcrest import assert_that, contains, contains_inanyorder, has... | {
"content_hash": "347ca9c868c10955048e2cec9a20b113",
"timestamp": "",
"source": "github",
"line_count": 470,
"max_line_length": 79,
"avg_line_length": 30.993617021276595,
"alnum_prop": 0.5341525365552275,
"repo_name": "rfguri/vimfiles",
"id": "9712474d688abf6d9b9cb708fbcfdbe2557b9101",
"size": "152... |
""" Short description.
"""
# Copyright © 2015 1&1 Group <[email protected]>
#
# 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... | {
"content_hash": "8bd7686cdf25b7819b58e24bc2770d37",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 74,
"avg_line_length": 31.166666666666668,
"alnum_prop": 0.7366310160427807,
"repo_name": "1and1/confluencer",
"id": "d6093f3f963565b4a17baa2e8b312c15d007686f",
"size": "81... |
"""Python wrappers for Datasets."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import abc
import threading
import warnings
import numpy as np
import six
from tensorflow.python.compat import compat
from tensorflow.python.data.ops import iterator_ops
fr... | {
"content_hash": "5e992a58c80d8c35d208d41170229a7e",
"timestamp": "",
"source": "github",
"line_count": 2519,
"max_line_length": 99,
"avg_line_length": 37.85907105994442,
"alnum_prop": 0.6609833590235616,
"repo_name": "xodus7/tensorflow",
"id": "93b3a7b93b3093e3322e585415c9508d17535df6",
"size": "9... |
import _plotly_utils.basevalidators
class BordercolorsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name="bordercolorsrc",
parent_name="sankey.node.hoverlabel",
**kwargs
):
super(BordercolorsrcValidator, self).__init__(
p... | {
"content_hash": "405d847e08ba03fc1925a490623041a4",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 73,
"avg_line_length": 30.11764705882353,
"alnum_prop": 0.583984375,
"repo_name": "plotly/python-api",
"id": "39073b69a7e958d433b1a61447bfd1f0e2bdb501",
"size": "512",
"b... |
"""
This program executes SubDyn and a regression test for a single test case.
The test data is contained in a git submodule, r-test, which must be initialized
prior to running. See the r-test README or OpenFAST documentation for more info.
Get usage with: `executeSubdynRegressionCase.py -h`
"""
i... | {
"content_hash": "c677f0ad9eb8a6d7cfaa7c6bcde484dd",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 166,
"avg_line_length": 51.248,
"alnum_prop": 0.7461754605057759,
"repo_name": "OpenFAST/OpenFAST",
"id": "151049fa4ee05767b64c64fc3fbd8bf39be92169",
"size": "7011",
"bi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.