text stringlengths 4 1.02M | meta dict |
|---|---|
import time
def busy_sleep(seconds):
max_time = time.time() + int(seconds)
while time.time() < max_time:
pass
def swallow_exception():
try:
while True:
pass
except:
pass
| {
"content_hash": "87107165c98879d2108843c06feaf83b",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 41,
"avg_line_length": 16.071428571428573,
"alnum_prop": 0.5466666666666666,
"repo_name": "Senseg/robotframework",
"id": "00291c26454d33bf67a59504497cae0061fc7a79",
"size":... |
from msrest.serialization import Model
class Provider(Model):
"""Resource provider information.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: The provider ID.
:vartype id: str
:param namespace: The namespace of the resource provider.
:t... | {
"content_hash": "e0ed87dc18068d763f0dee42a180e8b9",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 85,
"avg_line_length": 33.94736842105263,
"alnum_prop": 0.6364341085271318,
"repo_name": "v-iam/azure-sdk-for-python",
"id": "a6203659a6beb364d8dbb5fc6ee3125c81bac287",
"si... |
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
f... | {
"content_hash": "495c774575655a019e0456fbc220e75b",
"timestamp": "",
"source": "github",
"line_count": 331,
"max_line_length": 209,
"avg_line_length": 42.41087613293051,
"alnum_prop": 0.6441088474141615,
"repo_name": "Azure/azure-sdk-for-python",
"id": "9936d55e256bf148d79fb6059c2fede07e8c4b54",
"... |
import speech_recognition as sr
from gtts import gTTS
import pygame
class Speech:
"""
class for TTS and STT
"""
def __init__(self):
self.r = sr.Recognizer()
pygame.mixer.init()
def create_talk(self, str, fname, l='en'):
"""
function takes (text) and saves it to (... | {
"content_hash": "a09ec9b11f3d75ce5435b837cfa3fd86",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 63,
"avg_line_length": 22.440677966101696,
"alnum_prop": 0.513595166163142,
"repo_name": "HackRoboy/EmotionGame",
"id": "77ef4004cf3a035fc572f2a9aba9b5074bc65bb3",
"size": ... |
from django.test import TestCase
from zerver.decorator import \
REQ, has_request_variables, RequestVariableMissingError, \
RequestVariableConversionError, JsonableError
from zerver.lib.validator import (
check_string, check_dict, check_bool, check_int, check_list
)
import ujson
class DecoratorTestCase(Te... | {
"content_hash": "b9f6670405c97d29815bbf196a5f4c13",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 84,
"avg_line_length": 31.790419161676645,
"alnum_prop": 0.562817856470145,
"repo_name": "ryansnowboarder/zulip",
"id": "bc06ea374e5ec054f57fd79f4504c7b3961c4ae1",
"size":... |
import os # needed to start shell commands from python
import argparse # parsing commandline arguments
import sys
import config # import config.py file
import dataaccess # class which is responsible for manipulating the commands_file
import autoconfig #class which can determine some important thi... | {
"content_hash": "588e2378dd528a7c0b060ac384f60357",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 107,
"avg_line_length": 34.743801652892564,
"alnum_prop": 0.5685061845861085,
"repo_name": "czerwonyd/comfi",
"id": "47242fab8c68f2bdc789286daed087e37fc4e695",
"size": "42... |
import io
import urllib3
""" This module is pulled out from auto-generated swagger python client for flespi gateway"""
class ApiException(Exception):
def __init__(self, status=None, reason=None, http_resp=None):
if http_resp:
self.status = http_resp.status
self.reason = http_resp... | {
"content_hash": "7d8d61bbba932460e95ec8e89b9befd7",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 93,
"avg_line_length": 28.911392405063292,
"alnum_prop": 0.5621716287215411,
"repo_name": "janbartnitsky/flespi_receiver",
"id": "2a382bf6b4876e3c98881c6197423f25c2c9075f",
... |
"""
Test script for ingesting PDFs from the file system using Tika
Some code directly ripped from Katrina's autonomy work
"""
import json
import re
import os
from celery import shared_task, task
TIKA_ENDPOINT="http://0.0.0.0:9998"
ELASTICSEARCH_HOST="http://0.0.0.0:9200"
from elasticsearch import Elasticsearch
fro... | {
"content_hash": "f93213b94d5c9cd4731f65f38e5bc3a5",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 97,
"avg_line_length": 33.79807692307692,
"alnum_prop": 0.5963015647226173,
"repo_name": "kod3r/memex-explorer",
"id": "b7f0decc47905db10546813bb1aec93ff3959ab7",
"size": ... |
from Tag import Tag
import time
from datetime import datetime
__author__ = "Peter Wolf"
__mail__ = "pwolf2310@gmail.com"
__date__ = "2016-12-25"
DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
class Item:
""" An item retrieved from pr0gramm.com """
def __init__(self, id):
self.id = id
self.tags = []
... | {
"content_hash": "1cedd2bfb56c2f098fef0b02092fb231",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 75,
"avg_line_length": 29.386206896551723,
"alnum_prop": 0.5301572400844872,
"repo_name": "BigPeet/pr0tagger",
"id": "5d0a68a0dba466d8c67216991059ebdf611b0859",
"size": "4... |
import logging
_LOG_LEVEL_NOTSET = 'NOTSET'
def get_logger(logger_name):
return _LOGGING_MANAGER.get_logger(logger_name)
def get_log_manager():
return _LOGGING_MANAGER
def _cfg_var_exists(cfg, var_name):
var = None
if isinstance(cfg, dict):
var = cfg.get(var_name)
elif hasattr(cfg, v... | {
"content_hash": "9227730df8f7f7d5e7f684b9f85dd01c",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 74,
"avg_line_length": 25.23611111111111,
"alnum_prop": 0.6042927903137039,
"repo_name": "zinic/chuckbox",
"id": "172b0fa3de70d16ecd9e882ed16b7446737c6167",
"size": "1817",... |
"""
Usage: ./clean_cargo_all <root_dir>
Find all project directories containg a `Cargo.toml` and run
`cargo clean` in them.
"""
import os
import sys
def find_dirs_with_file(root_dir, file_name):
result = []
for root, dirs, files in os.walk(root_dir):
if file_name in files:
result.append(r... | {
"content_hash": "e06fbdebddd409e427d315134fbd72b1",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 64,
"avg_line_length": 26.62962962962963,
"alnum_prop": 0.6203059805285118,
"repo_name": "thorbenk/dotfiles",
"id": "e913a54dda03ea591c93c04a5564442be055f275",
"size": "743... |
from decimal import *
import getpass
import math
import os
import os.path
import platform
import sys
import time
from jsonrpc import ServiceProxy, json
BASE_FEE=Decimal("0.001")
def check_json_precision():
"""Make sure json library being used does not lose precision converting BTC values"""
n = Decimal("20000... | {
"content_hash": "7a095cec433a37c18a185bea425d6d65",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 111,
"avg_line_length": 38.21031746031746,
"alnum_prop": 0.6147055769031052,
"repo_name": "aspirecoin/aspire",
"id": "51c272ee5ab2bcc2e14bd6bc55319d3c56b9f0e7",
"size": "1... |
from typing import List, Optional
import unittest
from pyreach import core
from pyreach.common.python import types_gen
from pyreach.force_torque_sensor import ForceTorqueSensorState
from pyreach.impl import force_torque_sensor_impl
from pyreach.impl import test_utils
from pyreach.impl import thread_util
class ForceT... | {
"content_hash": "1dcf5504ddda0cfd2786f2a85cfb02da",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 110,
"avg_line_length": 40.3963963963964,
"alnum_prop": 0.5594335414808207,
"repo_name": "google-research/pyreach",
"id": "c15608ae50dd688d02f8adf3e5711cf8a37a8d2f",
"size... |
from distutils.core import setup
from Cython.Build import cythonize
from distutils.extension import Extension
setup(name="APzdtheta", ext_modules=cythonize('aptestmetricdt.pyx'),)
#ext_modules=[Extension("demo",sources=["demo.pyx"],libraries=["m"] # Unix-like specific)]
#setup( name = "Demos",ext_modules = cythonize(... | {
"content_hash": "a66c493e483a6f700ba9f668d836e8e6",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 90,
"avg_line_length": 37.22222222222222,
"alnum_prop": 0.7611940298507462,
"repo_name": "rohinkumar/galsurveystudy",
"id": "6651afbab612a9c53abb81e65310b6a821d2b2fb",
"size... |
#!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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, publish,
... | {
"content_hash": "7aba558c0817bd679523ed23b81857ad",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 73,
"avg_line_length": 29.805194805194805,
"alnum_prop": 0.6910675381263617,
"repo_name": "azatoth/scons",
"id": "83b2f9c002661bdce69c812cd4ee6c50eaf8f227",
"size": "2295",... |
from os.path import join, isfile
from os import unlink
from subprocess import call
from re import compile
from numpy import array, mean, genfromtxt, zeros_like, arange
from sqlalchemy import distinct
from scipy.stats import ttest_ind
from trnlib import settings, timing
from trnlib.omeORM import *
from itertools impor... | {
"content_hash": "0a5f74a9390acc8e73141dc08d641c46",
"timestamp": "",
"source": "github",
"line_count": 236,
"max_line_length": 142,
"avg_line_length": 44.08898305084746,
"alnum_prop": 0.6249879865449304,
"repo_name": "steve-federowicz/om",
"id": "4d7640224e258926ad2e366bd58f622405edb048",
"size": ... |
import os
import socket
import sys
import csv
HAPROXY_DIR = '/var/lib/contrail/loadbalancer/haproxy/'
STATS_MAP = {
'active_connections': 'qcur',
'max_connections': 'qmax',
'current_sessions': 'scur',
'max_sessions': 'smax',
'total_sessions': 'stot',
'bytes_in': 'bin',
'bytes_out': 'bout',... | {
"content_hash": "c2105f5068fcf6cfa49d0fe1dc47628b",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 80,
"avg_line_length": 31.96511627906977,
"alnum_prop": 0.5405602037104401,
"repo_name": "codilime/contrail-controller",
"id": "aef4b325cc0df7478a6378296be4c00f847f1872",
"... |
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrestazure.azure_operation import AzureOperationPoller
import uuid
from .. import models
class JobCollectionsOperations(object):
"""JobCollectionsOperations operations.
:param client: Client for service r... | {
"content_hash": "a939eb028caeac51495e55afb0c5bc7a",
"timestamp": "",
"source": "github",
"line_count": 586,
"max_line_length": 155,
"avg_line_length": 46.26109215017065,
"alnum_prop": 0.644914972887233,
"repo_name": "rjschwei/azure-sdk-for-python",
"id": "d5b4f00b0a8c1157443871782a0e4cc59f79d817",
... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/furniture/all/shared_frn_all_light_lamp_free_s01.iff"
result.attribute_template_id = 6
result.stfName("frn_n","frn_lamp_free_blueleaf")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return... | {
"content_hash": "5434e2d98742aceba945f9a4935ff704",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 89,
"avg_line_length": 25.153846153846153,
"alnum_prop": 0.7003058103975535,
"repo_name": "obi-two/Rebelion",
"id": "520302b3b45544d05d6ea0694a01c0e48bbdf3ed",
"size": "472... |
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
import sys
import setuptools
from setuptools.command.test import test as TestCommand
from codecs import open
from os import path
class PyTest(TestCommand):
def initialize_o... | {
"content_hash": "e2777cc02e084e602be43b20f5e31d11",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 110,
"avg_line_length": 33.595588235294116,
"alnum_prop": 0.6616327423943971,
"repo_name": "AntonSax/plantcv",
"id": "dfa247c072d6f6568e6301973e7c01302d3ed884",
"size": "4... |
from pynodegl_utils.misc import scene
from pynodegl_utils.tests.cmp_fingerprint import test_fingerprint
from pynodegl_utils.toolbox.colors import COLORS
import pynodegl as ngl
@test_fingerprint(tolerance=1)
@scene()
def text_0_to_127(_):
s = ""
for y in range(8):
for x in range(16):
c = y... | {
"content_hash": "cbb604535afb73cb96bfc111752a152a",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 77,
"avg_line_length": 20.567901234567902,
"alnum_prop": 0.6596638655462185,
"repo_name": "gopro/gopro-lib-node.gl",
"id": "66481967ce5869a499570b07db87e2600b3c43f4",
"size... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Band',
fields=[
('... | {
"content_hash": "e37e0f91221f8057b908baac2674e639",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 139,
"avg_line_length": 36.75609756097561,
"alnum_prop": 0.5461181154611812,
"repo_name": "forever-Agriculture/lyrics_site",
"id": "0ff67c15b970e905bd3fcc952480971a8a84fc9f",... |
"""The tests for the MQTT cover platform."""
from unittest.mock import patch
import pytest
from homeassistant.components import cover
from homeassistant.components.cover import (
ATTR_CURRENT_POSITION,
ATTR_CURRENT_TILT_POSITION,
ATTR_POSITION,
ATTR_TILT_POSITION,
)
from homeassistant.components.mqtt ... | {
"content_hash": "9c12c719f4530f0853da3388a51c183c",
"timestamp": "",
"source": "github",
"line_count": 3059,
"max_line_length": 107,
"avg_line_length": 32.10624387054593,
"alnum_prop": 0.5565658314072475,
"repo_name": "home-assistant/home-assistant",
"id": "794d143ac832a69b52404f6643e4698173c3e6b1",... |
from __future__ import unicode_literals
from wtl.wtparser import parsers
__all__ = ['parse', 'get_parser_for_filename']
def parse(content, filetype=None):
"""
Parse the packages file and return the data in the following format::
{
'filename': 'Gemfile',
'language': 'Objecti... | {
"content_hash": "c50ed1785df3b26ca1fd136b75879125",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 75,
"avg_line_length": 26,
"alnum_prop": 0.5810439560439561,
"repo_name": "elegion/djangodash2013",
"id": "a5419703ee1b1249474bc35cbae80d83420dfefc",
"size": "1456",
"bin... |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import python_2_unicode_compatible
class Redirect(models.Model):
old_path = models.CharField(_('redirect from'), max_length=200, db_index=True, unique=True,
help_text=_("This should be an absolut... | {
"content_hash": "97c8e784c5db6fad7d0b9f454d14527e",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 490,
"avg_line_length": 74,
"alnum_prop": 0.637065637065637,
"repo_name": "onepercentclub/onepercentclub-site",
"id": "d5879c504623da7d65193e61fa64286626fb362d",
"size": "2... |
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.25
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from kubernete... | {
"content_hash": "bd2a7ee9e92902af817393bc982ff627",
"timestamp": "",
"source": "github",
"line_count": 230,
"max_line_length": 576,
"avg_line_length": 40.76521739130435,
"alnum_prop": 0.6546501706484642,
"repo_name": "kubernetes-client/python",
"id": "afc682b7b6177ea4e11d90e86369e7f14bfcffa7",
"si... |
import torch
from torch import nn
from torch.autograd import Function
from torch.autograd.function import once_differentiable
from torch.nn.modules.utils import _pair
from maskrcnn_benchmark import _C
from apex import amp
class _ROIAlign(Function):
@staticmethod
def forward(ctx, input, roi, output_size, spat... | {
"content_hash": "926bed69d2941b59a3d580ffcb0a972b",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 85,
"avg_line_length": 30.61764705882353,
"alnum_prop": 0.5965417867435159,
"repo_name": "mlperf/training_results_v0.6",
"id": "e68c96b6c0444989e9c1d1a07b9d5e97da2b2eb3",
"... |
from __future__ import absolute_import, division, print_function
from future.builtins import range, zip
from future.utils import viewitems
import six
import re
import collections
import copy
import numbers
from contextlib import contextmanager
import numpy as np
from scipy.spatial.distance import hamming
import pand... | {
"content_hash": "f7d235fc4a5ccce3405fe8e901eebdc0",
"timestamp": "",
"source": "github",
"line_count": 2453,
"max_line_length": 79,
"avg_line_length": 32.657969832857724,
"alnum_prop": 0.5366620896267632,
"repo_name": "jdrudolph/scikit-bio",
"id": "44a8674bcd34bdf1c69581b476e4af1386f00ab6",
"size"... |
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from horizon import exceptions
from horizon import forms
from horizon import messages
from akanda.horizon.api import neutron_extensions_client
from akanda.horizon.tabs import alias_tab_redirect
class BaseHostAliasForm(fo... | {
"content_hash": "f124933e29d610311181ca7c6507e428",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 76,
"avg_line_length": 33.40677966101695,
"alnum_prop": 0.602232369355657,
"repo_name": "dreamhost/akanda-horizon",
"id": "d25dfb5ee087c9d4216ce16a40f53410de2a8124",
"size"... |
"""Preprocess the input to include sentences with edit distance one."""
import collections
import random
import tensorflow.compat.v1 as tf
app = tf.app
flags = tf.flags
gfile = tf.gfile
logging = tf.logging
flags.DEFINE_string("input_path", None, "Path containing sentence data")
flags.DEFINE_integer("num_pertubation... | {
"content_hash": "ab625b1aaf5ea2814f871cb2514f03c1",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 80,
"avg_line_length": 28.42168674698795,
"alnum_prop": 0.6748622297583722,
"repo_name": "google-research/language",
"id": "c75e20e24e03956a45d1dbb13d4a3a672ae7e0db",
"size... |
"""
sentry.utils.csp
~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2015 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from sentry.utils.http import is_valid_origin
# Default block list sourced from personal experience as well as
# re... | {
"content_hash": "9391d8cdf536e3e8424efdfe8c83b0be",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 97,
"avg_line_length": 28.495726495726494,
"alnum_prop": 0.6484703059388123,
"repo_name": "JackDanger/sentry",
"id": "ff8d8ddf5c6d667a66436238504dc9829d484664",
"size": "3... |
__version__ = '3.2.3'
import os
import sys
import sysconfig
import platform
#reload(sys).setdefaultencoding('UTF-8')
sys.dont_write_bytecode = True
current_path = os.path.dirname(os.path.abspath(__file__))
root_path = os.path.abspath( os.path.join(current_path, os.pardir, os.pardir))
python_path = os.path.join(root... | {
"content_hash": "fd53b3a98914618fd975fc0b6ff1366d",
"timestamp": "",
"source": "github",
"line_count": 1172,
"max_line_length": 285,
"avg_line_length": 48.95477815699659,
"alnum_prop": 0.5886013071895425,
"repo_name": "viger/docker",
"id": "e17b2a894932359003d02ac6b1d7cabf2d84efee",
"size": "59840... |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Entrevista'
db.create_table(u'analisis_entrevista', (
(u'id', self.gf... | {
"content_hash": "d768cfccd29ff5565ba150a2af6030e4",
"timestamp": "",
"source": "github",
"line_count": 824,
"max_line_length": 187,
"avg_line_length": 63.599514563106794,
"alnum_prop": 0.5938060527420524,
"repo_name": "shiminasai/ciat_plataforma",
"id": "654ca43f4dda5773dd2c61d780ea313a0140a1bf",
... |
from django.test import TestCase
import json
from django_comments_xtd.models import XtdComment
from wagtail.wagtailcore.models import Page
from django.contrib.auth.models import User
from .models import (BlogPage, BlogTag, BlogPageTag, BlogIndexPage,
BlogCategory, BlogCategoryBlogPage)
from .manage... | {
"content_hash": "4f76f4c9307c35f0418d6d065455ca66",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 78,
"avg_line_length": 45.98571428571429,
"alnum_prop": 0.6595215905560733,
"repo_name": "geminibleep/myblog",
"id": "4ca291631aad1beb6ebe68caf7edfcfdfa29bce7",
"size": "32... |
import itertools
from functools import partial
import warnings
import numpy as np
from scipy.spatial import distance
from scipy.sparse import csr_matrix
from scipy.sparse import issparse
from joblib import Parallel, effective_n_jobs
from ..utils.validation import _num_samples
from ..utils.validation import check_non_... | {
"content_hash": "3bb2e5e07fd5415e069afafd195cab50",
"timestamp": "",
"source": "github",
"line_count": 2037,
"max_line_length": 100,
"avg_line_length": 33.72164948453608,
"alnum_prop": 0.6131662080913074,
"repo_name": "shyamalschandra/scikit-learn",
"id": "d493ad68603ea89d0b613947c4f5e0c60b89ecd4",
... |
import os
import sys
from tornado.util import ObjectDict
# server name
SERVER_NAME = 'jinja2-support'
# server dir
SERVER_DIR = os.path.dirname(os.path.abspath(__file__))
# project dir
PROJECT_DIR = os.path.dirname(SERVER_DIR)
sys.path.append(PROJECT_DIR)
# tornado web application settings
# details in http://www.to... | {
"content_hash": "cbbf58f1e87ee6f374695c86a97d56be",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 90,
"avg_line_length": 28.675,
"alnum_prop": 0.6756756756756757,
"repo_name": "tao12345666333/app-turbo",
"id": "dfd6860d20b7ef6f0b42540717a6569fdd04880f",
"size": "1147",
... |
from unittest.mock import MagicMock, patch
from zerver.lib.test_classes import WebhookTestCase
from zerver.lib.webhooks.git import COMMITS_LIMIT
class GogsHookTests(WebhookTestCase):
STREAM_NAME = 'commits'
URL_TEMPLATE = "/api/v1/external/gogs?&api_key={api_key}&stream={stream}"
FIXTURE_DIR_NAME = 'gogs... | {
"content_hash": "3f2728853a508b2cfd801d8aae5f145a",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 368,
"avg_line_length": 69.99397590361446,
"alnum_prop": 0.6918839831310784,
"repo_name": "showell/zulip",
"id": "c8f867e60f368d3c8ac4f122b8efac4650c5a58a",
"size": "11619... |
from flask import Flask, request, jsonify
from collections import deque
import sys
app = Flask(__name__)
queue = deque([])
@app.route('/init', methods=['GET', 'POST'])
def initialize():
if request.method == 'POST':
global queue
data = request.get_json();
#print( data)
queue = deque(data['list'])
resp =... | {
"content_hash": "3373b3a0b41c04f7810d749ce9ca6d2f",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 56,
"avg_line_length": 19.643478260869564,
"alnum_prop": 0.6007082779991146,
"repo_name": "fossdevil/Assignments",
"id": "7dd2382fc06072a92785d7eeef01618f3193caf2",
"size"... |
from hisclient import exc
from hisclient.v2.client import Client as his_cli
from conveyor.conveyorheat.engine.clients import client_plugin
from conveyor.conveyorheat.engine import constraints
class HISClientPlugin(client_plugin.ClientPlugin):
exceptions_module = exc
service_types = [HIS] = ['his']
def _... | {
"content_hash": "6991487e50b6b87885ab12e9cf13a538",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 67,
"avg_line_length": 34.724137931034484,
"alnum_prop": 0.6355511420059583,
"repo_name": "Hybrid-Cloud/conveyor",
"id": "925a292fe77267187260deec0b7044a22dc2f006",
"size":... |
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa:... | {
"content_hash": "ca5d6f6231f15e5a774a73779ba1148f",
"timestamp": "",
"source": "github",
"line_count": 278,
"max_line_length": 131,
"avg_line_length": 41.201438848920866,
"alnum_prop": 0.5856469355683604,
"repo_name": "onshape-public/onshape-clients",
"id": "af0344b122cb8e3502337335954e1e9bcd2cf3e7"... |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/creature/player/shared_rodian_female.iff"
result.attribute_template_id = -1
result.stfName("species","rodian")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "1858f715be078a24e4ce2b1350e3c968",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 68,
"avg_line_length": 22.53846153846154,
"alnum_prop": 0.6928327645051194,
"repo_name": "obi-two/Rebelion",
"id": "fab67f073b8e9ac3da97bb510f3bcf798c9aced0",
"size": "438"... |
"""
Copyright 2012 GroupDocs.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... | {
"content_hash": "d436eb7eeaf11c0a7b60e2a75b084345",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 77,
"avg_line_length": 31.64864864864865,
"alnum_prop": 0.6575576430401366,
"repo_name": "liosha2007/temporary-groupdocs-python-sdk",
"id": "eabb0a81d0d67c27433fe08ddb1072837... |
""" Manifest Test Settings
"""
# pylint: disable=invalid-name
from django.shortcuts import render
from django.urls import include, path, re_path
from django.views.generic import TemplateView
from rest_framework_jwt.views import (
obtain_jwt_token,
refresh_jwt_token,
verify_jwt_token,
)
from manifest impo... | {
"content_hash": "728ae75f39f50f2d195eda6681ddcb7a",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 78,
"avg_line_length": 28.30597014925373,
"alnum_prop": 0.6111257579752175,
"repo_name": "ozgurgunes/django-manifest",
"id": "7107c00805a887518f9f987129d124b45d9e90c2",
"s... |
'''
Created on Apr 30, 2012
@author: h87966
Homework 3 - Basic blog
In order to be graded correctly for this homework, there are a
few things to keep in mind. We'll be grading your web app by
POSTing new blog entries to your form and checking that they
appear on your blog's front page. There are a few main issues... | {
"content_hash": "8a39c27934dc152c6654fb700bdb8abd",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 84,
"avg_line_length": 36.422764227642276,
"alnum_prop": 0.6591517857142857,
"repo_name": "cdoremus/udacity-python_web_development-cs253",
"id": "9d42bf458895f3a5ac5acad6822... |
"""Append module search paths for third-party packages to sys.path.
****************************************************************
* This module is automatically imported during initialization. *
****************************************************************
This will append site-specific paths to the module sear... | {
"content_hash": "40a97e5e4f9a50e5c9fbda232b47fe7a",
"timestamp": "",
"source": "github",
"line_count": 640,
"max_line_length": 84,
"avg_line_length": 33.8265625,
"alnum_prop": 0.6160561688761605,
"repo_name": "zooba/PTVS",
"id": "ad1146332b0ab7b65df640069bbeb4b6494bbad9",
"size": "21649",
"binar... |
EMAILS = 'Emails'
RECIPIENTS = 'Recipients'
# Special variable names
BODY = 'email_body'
DATE = 'email_date'
FROM = 'email_from'
REPLY_TO = 'email_reply_to'
SUBJECT = 'email_subject'
PREFIX = '__prefix__'
# Recipient column names
HIGHLIGHT = 'highlight'
| {
"content_hash": "adaae83d1722894ad94ec0948a84ca6d",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 27,
"avg_line_length": 19.692307692307693,
"alnum_prop": 0.69921875,
"repo_name": "WhiteHalmos/emailer",
"id": "205fc4ba66bbd06527f1715eafdf153d92d42f52",
"size": "270",
... |
"""
<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>
A Noder defines Child ordered dicts with <DoStr> as KeyStr.
The items inside are automatically setted with Noded<DoStr><TypeStr> and have
a Pointer to the parent InstanceVariable. This is the beginning for buiding h... | {
"content_hash": "7bc6fcd8104d2c9fccd7ef806c65a29e",
"timestamp": "",
"source": "github",
"line_count": 302,
"max_line_length": 107,
"avg_line_length": 25.5,
"alnum_prop": 0.7093883911180366,
"repo_name": "Ledoux/ShareYourSystem",
"id": "e08be7a33bb3e2b51dd9c0036dad1eb404fe6d7f",
"size": "7725",
... |
import IECore
import Gaffer
import GafferUI
## The NameLabel class displays a label which is kept in sync with the name of
# a particular GraphComponent. The label acts as a drag source for dragging the
# GraphComponent to another widget.
class NameLabel( GafferUI.Label ) :
def __init__( self, graphComponent, horiz... | {
"content_hash": "452ca71dbf8d062e0d4b7999e876d039",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 164,
"avg_line_length": 34.21311475409836,
"alnum_prop": 0.7307139434595112,
"repo_name": "DoubleNegativeVisualEffects/gaffer",
"id": "86756ceb1d92b2f0bbc3a3580a30f6407f3e557... |
"""Generated message classes for fusiontables version v1.
API for working with Fusion Tables data.
"""
# NOTE: This file is autogenerated and should not be edited by hand.
from protorpc import messages
package = 'fusiontables'
class Column(messages.Message):
"""Specifies the id, name and type of a column in ... | {
"content_hash": "10addf39cca841a387b7e352551a61d4",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 79,
"avg_line_length": 34.0078125,
"alnum_prop": 0.7093958189754193,
"repo_name": "wemanuel/smry",
"id": "fd727a0aa25ef746f9616d50053d7c546b30e739",
"size": "4353",
"bin... |
import pandas as pd
import pytz
from pandas.testing import assert_index_equal
from pandas_market_calendars.exchange_calendar_tsx import TSXExchangeCalendar, VictoriaDay
def test_time_zone():
assert TSXExchangeCalendar().tz == pytz.timezone('Canada/Eastern')
assert TSXExchangeCalendar().name == 'TSX'
def te... | {
"content_hash": "f14ff4a318f414b2fa7a68c6bcdf1be6",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 90,
"avg_line_length": 29.483870967741936,
"alnum_prop": 0.6356673960612691,
"repo_name": "rsheftel/pandas_market_calendars",
"id": "00eb589c073fa4594c529f51185c94acb5e8d3cf"... |
from collections import defaultdict, deque
from Queue import Queue
import unittest
class Graph:
def __init__(self, adj_list):
"""
Process the graph with the given adjacent list.
:param adj_list:
The given adjacent list. A dictionary with parent node as keys and
valu... | {
"content_hash": "ba78cd47f59ce338f2dcaca15d8c3da1",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 83,
"avg_line_length": 34.97752808988764,
"alnum_prop": 0.4376806938644395,
"repo_name": "gzc/CLRS",
"id": "4c57a3d74da4ac539c234a20086b9f1f641959fd",
"size": "6226",
"b... |
from twisted.python import log
from twisted.internet import defer
from twisted.words.protocols.jabber import error, ijabber, jstrports, xmlstream
from twisted.words.protocols.jabber import component
class XmppTestServerFactory(xmlstream.XmlStreamServerFactory):
def __init__(self, starter):
def authenticato... | {
"content_hash": "a310654ab6441982cb1dbc5b0ca24169",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 79,
"avg_line_length": 29.772727272727273,
"alnum_prop": 0.5946564885496183,
"repo_name": "ojab/bnw",
"id": "654195351a9db65e409c1ded9b130bd6ffd1a0b6",
"size": "2620",
"b... |
'''
Created on Jun 14, 2013
class to iterate through the TCGA directories and report on counts per cancer per platform
@author: michael
'''
from datetime import datetime
import sys
import parse_tcga
from technology_type_factory import technology_type_factory
sampleheader = ['cnv', 'rna', 'meth', 'mirna', 'total']
p... | {
"content_hash": "e2ab0d899d8018f489b25c2a8a662b6c",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 152,
"avg_line_length": 45.61038961038961,
"alnum_prop": 0.6862186788154897,
"repo_name": "cancerregulome/gidget",
"id": "2c19f64b484b53cd6bb46c81322f050306116904",
"size":... |
"""Mean time error."""
import numpy as np
from scipy.spatial.distance import cdist
from ruptures.metrics.sanity_check import sanity_check
def meantime(true_bkps, my_bkps):
"""For each computed changepoint, the mean time error is the average number
of points to the closest true changepoint. Not a symetric fun... | {
"content_hash": "ace9621268211664287f3ef896fcbc90",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 79,
"avg_line_length": 31.310344827586206,
"alnum_prop": 0.6530837004405287,
"repo_name": "deepcharles/ruptures",
"id": "9bbd44931ad964bb839a72f46dc21be66f6d941e",
"size": ... |
import warnings
import copy as cp
import numpy as np
from scipy.fftpack import fftfreq
from ..io.pick import pick_types
from ..utils import logger, verbose
from ..time_frequency.multitaper import (dpss_windows, _mt_spectra,
_csd_from_mt, _psd_from_mt_adaptive)
class CrossSpe... | {
"content_hash": "fd39f69b067a07bc2071886d990e24c7",
"timestamp": "",
"source": "github",
"line_count": 254,
"max_line_length": 79,
"avg_line_length": 38.838582677165356,
"alnum_prop": 0.5854029396857577,
"repo_name": "dimkal/mne-python",
"id": "e147da2858248eb5dd6d0e1995fbd00c9a1e4332",
"size": "9... |
from .engine import (
Engine,
)
| {
"content_hash": "f0e71f4d999c04d933634b637f5277ee",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 21,
"avg_line_length": 12,
"alnum_prop": 0.6111111111111112,
"repo_name": "rsk-mind/rsk-mind-framework",
"id": "e8861b4603cf4f09b84091609a92a56d7e3a6930",
"size": "36",
"b... |
from setuptools import setup
setup(name = 'confit',
version = '0.0.0',
install_requires = [],
description = 'An object-oriented DSL for system automation',
maintainer = 'Jason Dusek',
maintainer_email = 'jason.dusek@gmail.com',
url = 'ht... | {
"content_hash": "e9be574566f6b59f2a0b966034c864f5",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 72,
"avg_line_length": 45.6,
"alnum_prop": 0.46271929824561403,
"repo_name": "solidsnack/confit",
"id": "dc5077ff7ce240117ffd1846d4c45a845b15bac2",
"size": "935",
"binary... |
import factory
from django.contrib.gis import geos
class PointFactory(factory.django.DjangoModelFactory):
title = factory.Sequence(lambda n: 'point-{}'.format(n))
description = 'description'
geom = geos.fromstr('POINT (0 0)')
class Meta:
model = 'points.Point'
| {
"content_hash": "342f723ddd8fdc083fbb5a6ab6022b77",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 60,
"avg_line_length": 26.181818181818183,
"alnum_prop": 0.6909722222222222,
"repo_name": "KlubJagiellonski/poznaj-app-backend",
"id": "1712a8375844d70fc87ee3f9a34ba7caba7844... |
from django.contrib import admin
from .models import Person, SantaList
admin.site.register(Person)
class SantaListAdmin(admin.ModelAdmin):
list_display = ['name', 'organiser_email']
ordering = ['name']
readonly_fields = ['slug', 'secure_hash_signup', 'secure_hash_review']
admin.site.register(SantaLi... | {
"content_hash": "66b479929f6e720772d7dabe0df4f820",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 74,
"avg_line_length": 21.25,
"alnum_prop": 0.7264705882352941,
"repo_name": "TheUKDave/secret_santa",
"id": "a4d1de56f06862f62fdff579682e4d3fe5dd09c3",
"size": "340",
"b... |
import os
from celery import Celery
# set the default Django settings module for the 'celery' program.
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webquills.settings")
app = Celery("webquills")
# Using a string here means the worker doesn't have to serialize
# the configuration object to child processes.
# - n... | {
"content_hash": "014ca5e5a01e12b8520318daea866d20",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 69,
"avg_line_length": 33.588235294117645,
"alnum_prop": 0.7723292469352014,
"repo_name": "veselosky/webquills",
"id": "e602b3539d98452801295994c847b46e7b3ccaf6",
"size": "... |
"""
TNC: A python interface to the TNC non-linear optimizer
TNC is a non-linear optimizer. To use it, you must provide a function to
minimize. The function must take one argument: the list of coordinates where to
evaluate the function; and it must return either a tuple, whose first element is the
value of the function... | {
"content_hash": "dc4a2526ea0af7b28b40c19a6d86379c",
"timestamp": "",
"source": "github",
"line_count": 404,
"max_line_length": 84,
"avg_line_length": 37.35643564356435,
"alnum_prop": 0.5932282003710575,
"repo_name": "Universal-Model-Converter/UMC3.0a",
"id": "d8ea6d41ed16bc069b33f7923b2cf91c6c404a13... |
from Database.Controllers.Predio import Predio
from Database.Controllers.Resp_sala import Resp_sala
class Sala(object):
def __init__(self,dados=None):
if dados is not None:
self.id = dados ['id']
self.id_resp_sala = dados ['id_resp_sala']
self.codigo = dados ['codigo']
self.id_predio = dados ['id_predi... | {
"content_hash": "8675f838bbe1922b3645380626719ce5",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 79,
"avg_line_length": 23.564102564102566,
"alnum_prop": 0.6800870511425462,
"repo_name": "AEDA-Solutions/matweb",
"id": "a9cedb135e718541a69bddfeff7e94f31f2ddd84",
"size":... |
"""
Enhanced Unit Converter
This is my solution to the "Enhanced Unit Converter" problem. [1] Here, we are presented with
a simple script that runs conversions between kilometres and miles. The task at hand is to ex-
tend the script to run conversions between kilograms and pounds and fahrenheit and celsius.
[1] Saha... | {
"content_hash": "661adc43026b2309da0805fe5e9f60ec",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 94,
"avg_line_length": 41.39393939393939,
"alnum_prop": 0.6504392386530015,
"repo_name": "mathmare/Misc",
"id": "a31814614ae17cd5e734b831ea340d114d5a6d8c",
"size": "2733",
... |
""" The differential evolution strategy that optimizes the search through the parameter space """
from scipy.optimize import differential_evolution
from kernel_tuner.searchspace import Searchspace
from kernel_tuner.strategies.minimize import get_bounds, _cost_func, scale_from_params
from kernel_tuner import util
supp... | {
"content_hash": "0cc7d75c9a3db067545234063e22425a",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 120,
"avg_line_length": 39.71212121212121,
"alnum_prop": 0.7134681419305609,
"repo_name": "benvanwerkhoven/kernel_tuner",
"id": "30cee8c1fa7c07752c5497659a074509f47661b3",
... |
"""Create table GenomicGCROutreachEscalationNotified
Revision ID: b7971e81863c
Revises: b64334fe7ec7, 68e4e375cec3
Create Date: 2022-11-08 16:46:57.006039
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b7971e81863c'
down_revision = ('b64334fe7ec7', '68e4e375c... | {
"content_hash": "ae9a5b4005d74e766e52574fc67cb662",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 165,
"avg_line_length": 31.11864406779661,
"alnum_prop": 0.6944444444444444,
"repo_name": "all-of-us/raw-data-repository",
"id": "eef8265a3e54fc10d3468d79f4ed1cc49ef1f93f",
... |
"""
The MIT License (MIT)
Copyright (c) 2017 LeanIX GmbH
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": "cf8d462d7cd43cb3ef18e48e1cb23c21",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 105,
"avg_line_length": 39.067796610169495,
"alnum_prop": 0.6646420824295011,
"repo_name": "leanix/leanix-sdk-python",
"id": "44dfa24f9745bea4e752702b27f37e0963b92fde",
"si... |
def run(impl):
impl.save_file('file', 'First line\nThis is the second line\n')
impl.add_new_file('file')
impl.commit_all('Add files')
impl.save_file('file', 'First line\nThis is the \tsecond line \nThe last line\n')
return []
| {
"content_hash": "9292db926667b4ad5159c8079e2405e5",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 89,
"avg_line_length": 30,
"alnum_prop": 0.6666666666666666,
"repo_name": "erdavila/git-svn-diff",
"id": "be557012d763177a04861a0757455bc3c3bc2c97",
"size": "240",
"binary... |
"""Support for Sensibo wifi-enabled home thermostats."""
import asyncio
import logging
import aiohttp
import async_timeout
import pysensibo
import voluptuous as vol
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
from homeassistant.components.climate.const import (
HVAC_MODE_COOL,
... | {
"content_hash": "29226b7d46e9e8f9b9c3ebd7a31b9f79",
"timestamp": "",
"source": "github",
"line_count": 402,
"max_line_length": 88,
"avg_line_length": 32.039800995024876,
"alnum_prop": 0.593944099378882,
"repo_name": "adrienbrault/home-assistant",
"id": "10ceaa39a38b191283cd52cb603e2346b07a36aa",
"... |
import mock
from stevedore import dispatch
from ironic.common import driver_factory
from ironic.common import exception
from ironic.tests import base
class FakeEp:
name = 'fake'
class DriverLoadTestCase(base.TestCase):
def setUp(self):
super(DriverLoadTestCase, self).setUp()
driver_factory... | {
"content_hash": "38ed7bf80097189cd9d61309bca12218",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 79,
"avg_line_length": 41.46808510638298,
"alnum_prop": 0.6269881990764494,
"repo_name": "rackerlabs/ironic",
"id": "9749befdf0630de13536d6fae119ac26c81b762c",
"size": "253... |
import pygame
from random import randint
import os
EXEC_DIR = os.path.dirname(__file__)
class Reward(pygame.sprite.Sprite):
""" This is the main reward class """
def __init__(self, position):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.image.load('reward.png')
self.rect = se... | {
"content_hash": "77bdee1eb3c9d1d92fd725e48329a4f7",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 68,
"avg_line_length": 34.74074074074074,
"alnum_prop": 0.6044776119402985,
"repo_name": "btnpushnmunky/cupcake",
"id": "d6074f83330e237bf7f48f154028511a2dca9657",
"size": ... |
from .. import ContainerAbilityInterface
from .. import QLayout
from .. import ui_extension
@ui_extension
class Layout(QLayout, ContainerAbilityInterface):
pass
| {
"content_hash": "799e7a2eb2ccffb3c16779bdca468610",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 49,
"avg_line_length": 20.875,
"alnum_prop": 0.7844311377245509,
"repo_name": "SF-Zhou/quite",
"id": "f7a87c23ef69830cae44f78f8764b9caf91f3203",
"size": "167",
"binary": f... |
import frappe
import json
from frappe import _
from frappe.boot import get_allowed_pages, get_allowed_reports
from frappe.desk.doctype.desktop_icon.desktop_icon import set_hidden, clear_desktop_icons_cache
from frappe.cache_manager import build_domain_restriced_doctype_cache, build_domain_restriced_page_cache, build_ta... | {
"content_hash": "985af5eb4c390a85e102d19fa9674722",
"timestamp": "",
"source": "github",
"line_count": 552,
"max_line_length": 129,
"avg_line_length": 28.628623188405797,
"alnum_prop": 0.6952477377713092,
"repo_name": "almeidapaulopt/frappe",
"id": "7a9c211c3c3d395cf3a1f8791301514b4466fe5c",
"size... |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Difference'] , ['PolyTrend'] , ['Seasonal_Second'] , ['LSTM'] ); | {
"content_hash": "6a80cdc206dc7020ca2fff814dc085e9",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 87,
"avg_line_length": 40,
"alnum_prop": 0.7125,
"repo_name": "antoinecarme/pyaf",
"id": "7209b6080d9c674f6450196fa9898398f2766a79",
"size": "160",
"binary": false,
"cop... |
"""
/get/client/ resource
"""
from zunzuncito import tools
class APIResource(object):
def dispatch(self, request, response):
request.log.debug(tools.log_json({
'API': request.version,
'Method': request.method,
'URI': request.URI,
'path': request.path,
... | {
"content_hash": "27c48cccb2cdac368ba3a7e5f7399501",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 42,
"avg_line_length": 19.75,
"alnum_prop": 0.5468354430379747,
"repo_name": "nbari/zunzuncito",
"id": "1780782bcf6c00ce580dda2550edfba9dc84a960",
"size": "395",
"binary"... |
class IncorrectTextFieldCount(Exception):
"""Raise if there is an incorrect number of text fields in
the QuestionFormAnswer"""
def __init__(self,message):
raise self | {
"content_hash": "bebe8ecb8f9b852229dccd6207c43bf4",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 63,
"avg_line_length": 38,
"alnum_prop": 0.6842105263157895,
"repo_name": "tturpen/django-csaesrapp",
"id": "2d290df4efa4fd223354cd7d5ab3c94edc879ad1",
"size": "860",
"bin... |
import sublime, sublime_plugin, subprocess, threading, base64, os, tempfile
class RunScriptTestCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.settings = sublime.load_settings('ScriptTestTool.sublime-settings')
script = self.get_raw_script()
sublime.set_timeout_async(lambda:... | {
"content_hash": "2d0012ddf7cce91babb2930d6df6ad68",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 146,
"avg_line_length": 34.81818181818182,
"alnum_prop": 0.60411227154047,
"repo_name": "xEdelweiss/sublime-script-test-tool",
"id": "6d4e5ac6b4ed72ab883c9c511ca601bb7ef11a90... |
import sys
import time
import re
from fastscore.pneumo import EngineStateMsg, EngineConfigMsg, SensorReportMsg
from fastscore.pneumo import WebSocketTimeoutException
from fastscore import Sensor
from .stable import JetStable
from .terminal import Terminal
from .layout import *
from ..colors import tcol
def monitor... | {
"content_hash": "01f55e6c04a1806d62866f061f87a66e",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 90,
"avg_line_length": 37.410404624277454,
"alnum_prop": 0.4538009888751545,
"repo_name": "opendatagroup/fastscore-cli",
"id": "83e870204ba34bea052a523c3a214b917820ee33",
... |
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.doctest',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode']
... | {
"content_hash": "835e820d65f883b0306328b9c18c35ff",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 62,
"avg_line_length": 22.753846153846155,
"alnum_prop": 0.5949966193373901,
"repo_name": "sbrisard/janus",
"id": "bf69945e56838ac8b56f3d42e75c2becb8890965",
"size": "1724"... |
import datetime, simplejson
from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponseRedirect, Http404, HttpResponse
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.contrib.auth... | {
"content_hash": "892c62b627a641f670b9a7383393736c",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 171,
"avg_line_length": 36.86486486486486,
"alnum_prop": 0.6659335288367546,
"repo_name": "winhamwr/django-reservations",
"id": "1a244b0225f648b3600ddc56485d9f8852a12b21",
... |
import logging
import sys
from collections import defaultdict
from itertools import groupby
from ete3 import Tree
from jcvi.apps.base import OptionParser, glob
from jcvi.formats.base import LineFile
from jcvi.formats.sizes import Sizes
from jcvi.graphics.base import (
FancyBboxPatch,
Rectangle,
linear_sh... | {
"content_hash": "0436c1ec770bae5e55136d753f95e4ef",
"timestamp": "",
"source": "github",
"line_count": 683,
"max_line_length": 88,
"avg_line_length": 29.765739385065885,
"alnum_prop": 0.5105755041810133,
"repo_name": "tanghaibao/jcvi",
"id": "dbb5164e3df51877465666b123ee259867802dec",
"size": "203... |
import _plotly_utils.basevalidators
class OutlinecolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self,
plotly_name="outlinecolor",
parent_name="layout.mapbox.layer.fill",
**kwargs,
):
super(OutlinecolorValidator, self).__init__(
pl... | {
"content_hash": "68e55243eed56730d95cc33aeaf0187e",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 73,
"avg_line_length": 29.1875,
"alnum_prop": 0.588865096359743,
"repo_name": "plotly/plotly.py",
"id": "2e5e9d29c7b8e581e2c17a4b3e3b1112921dfcab",
"size": "467",
"binary... |
import os, tempfile
import json
def write_command(output_directory=None,
command_name=None,
target_device=None,
command_id=None,
directory=None):
command = {}
def __write(key, parameter):
nonlocal command
if parameter is not None:
... | {
"content_hash": "65bad2464703fca915082964d264e624",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 47,
"avg_line_length": 27.857142857142858,
"alnum_prop": 0.5754985754985755,
"repo_name": "bigfix/trask",
"id": "676883fcaca3c2bdf42ea417df2a4134b186d280",
"size": "1774",
... |
import pytest
from unittest.mock import mock_open
from Tests.configure_and_test_integration_instances import XSOARBuild, create_build_object, \
options_handler, XSIAMBuild, get_turned_non_hidden_packs, update_integration_lists, \
get_packs_with_higher_min_version, filter_new_to_marketplace_packs
XSIAM_SERVERS... | {
"content_hash": "70fef803d1c9e49f90953fc0b3bc2474",
"timestamp": "",
"source": "github",
"line_count": 232,
"max_line_length": 128,
"avg_line_length": 38.077586206896555,
"alnum_prop": 0.6281412723568033,
"repo_name": "demisto/content",
"id": "c1390a3183e48bf217806e97a63e623b39d8822b",
"size": "88... |
import ew
from ew import jinja2_ew
from allura.lib import validators as v
from forgetracker import model
class BinForm(ew.SimpleForm):
template = 'jinja:forgetracker:templates/tracker_widgets/bin_form.html'
defaults = dict(
ew.SimpleForm.defaults,
submit_text="Save Bin")
class hidden_fie... | {
"content_hash": "b634645aeb5fb6f9bb26d5512cd97ca8",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 75,
"avg_line_length": 29.791666666666668,
"alnum_prop": 0.6531468531468532,
"repo_name": "apache/allura",
"id": "7040ff39202c43d2ca099515f9c06048196837cb",
"size": "1585",... |
import unittest
from katas.beta.knight_or_knave import knight_or_knave
class KnightOrKnaveTestCase(unittest.TestCase):
def test_equal_1(self):
self.assertEqual(knight_or_knave(True), 'Knight!')
def test_equal_2(self):
self.assertEqual(knight_or_knave(False), 'Knave! Do not trust.')
def ... | {
"content_hash": "d87960600e451773da41127d2fd3c7e3",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 77,
"avg_line_length": 32.68292682926829,
"alnum_prop": 0.6048507462686568,
"repo_name": "the-zebulan/CodeWars",
"id": "d3a60005e47b38ba9b69035d698cf12b709684e3",
"size": ... |
"""Module for accessing pre-trained `fastText word embeddings
<https://fasttext.cc/>`_ and `Word2Vec embeddings from NLPL
<http://vectors.nlpl.eu/repository/>`_. Two sets of models are available
from fastText, one being trained only on corpora taken from
Wikipedia (`249 languages
<https://fasttext.cc/docs/en/pretrained... | {
"content_hash": "10d63c0dcc73fd6e154ffe380a466ede",
"timestamp": "",
"source": "github",
"line_count": 564,
"max_line_length": 195,
"avg_line_length": 39.8031914893617,
"alnum_prop": 0.584257650674863,
"repo_name": "kylepjohnson/cltk",
"id": "e11245ec5ba782b993619316fa3834a77f779fc6",
"size": "224... |
from __future__ import absolute_import, division, print_function, unicode_literals
from collections import OrderedDict
import csv
import datetime
import functools
import json
import io
from datetime import timedelta
import itertools
import time
from concurrent.futures import as_completed
from dateutil.tz import tzutc... | {
"content_hash": "afa04e7ab3c14bf60fa6469c566fe269",
"timestamp": "",
"source": "github",
"line_count": 2006,
"max_line_length": 99,
"avg_line_length": 32.98354935194417,
"alnum_prop": 0.5734451749414343,
"repo_name": "Sutto/cloud-custodian",
"id": "1f6bdd0c6828feda6a2540a1b1db09471d8fb529",
"size"... |
from trezorlib import *
from trezorlib.client import TrezorClient
from trezorlib.transport_hid import HidTransport
import trezorlib.messages_pb2 as proto
import trezorlib.types_pb2 as types
import binascii
# 1.2.0
getRootNode = 0x080108c0
oledClear = 0x0801af38
oledDrawString = 0x0801b0fc
oledRefresh = 0x0801af48
fic... | {
"content_hash": "0b1cc64508253322a75d02461211be1c",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 126,
"avg_line_length": 26.841269841269842,
"alnum_prop": 0.6655824955647546,
"repo_name": "btchip/trezor-security-exploits",
"id": "39fd34c52e72e5ed6e69973f8fefe9624554ff55... |
import functools
import pytest
from plenum.common.average_strategies import MedianLowStrategy
from plenum.server.instances import Instances
from plenum.server.monitor import Monitor
from plenum.test.helper import sdk_eval_timeout, sdk_send_random_request, sdk_get_reply
from plenum.test.testing_utils import FakeSometh... | {
"content_hash": "0f981f84b7c82a05ff0df90630d15a74",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 111,
"avg_line_length": 35.78333333333333,
"alnum_prop": 0.7377736376339078,
"repo_name": "evernym/zeno",
"id": "c408b76b01480a3be2a935dc56f0b44ee213516f",
"size": "2147",
... |
from olympia import amo
def match_rules(rules, app, action):
"""
This will match rules found in Group.
"""
for rule in rules.split(','):
rule_app, rule_action = rule.split(':')
if rule_app == '*' or rule_app == app:
if (rule_action == '*'
or rule_action ... | {
"content_hash": "38636c398593abfac499338ba965b7d0",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 77,
"avg_line_length": 33.656488549618324,
"alnum_prop": 0.627126332501701,
"repo_name": "jpetto/olympia",
"id": "81c658bcff50ad1d13c1a999bb18e7600dce5cf6",
"size": "4409"... |
from typing import List
from shapely.geometry import Polygon, mapping, shape
from rastervision.core.box import Box
from rastervision.core.data import (
ClassConfig, CRSTransformer, GeoJSONVectorSourceConfig, RasterioSource,
RasterizedSource, Scene, SemanticSegmentationLabelSource,
transform_geojson, geomet... | {
"content_hash": "8a12e399e2c6de204664275e9400713f",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 76,
"avg_line_length": 36.661764705882355,
"alnum_prop": 0.690734055354994,
"repo_name": "azavea/raster-foundry",
"id": "c25643e82428333ce7181998b944192480132627",
"size": ... |
"""distutils.emxccompiler
Provides the EMXCCompiler class, a subclass of UnixCCompiler that
handles the EMX port of the GNU C compiler to OS/2.
"""
# issues:
#
# * OS/2 insists that DLLs can have names no longer than 8 characters
# We put export_symbols in a def-file, as though the DLL can have
# an arbitrary len... | {
"content_hash": "94540a340f6d6cf856918fd7b7bb4ea3",
"timestamp": "",
"source": "github",
"line_count": 315,
"max_line_length": 97,
"avg_line_length": 37.63492063492063,
"alnum_prop": 0.5602699283002952,
"repo_name": "nvoron23/socialite",
"id": "f52e63232db1afa9b14ee4a074d57c2a004b2b3d",
"size": "1... |
import json
import os.path
from typing import List
from typing import Tuple
from typing import TypeVar
from typing import Dict
import random
import arrow
import attr
import requests
@attr.s
class StockInfo(object):
ticker = attr.ib(type=str)
price = attr.ib(converter=float)
week_ago = attr.ib(converter=f... | {
"content_hash": "f44ffbc5b250dca02946050e7a060ddb",
"timestamp": "",
"source": "github",
"line_count": 268,
"max_line_length": 100,
"avg_line_length": 38.34701492537314,
"alnum_prop": 0.6012454996594336,
"repo_name": "dotslash/MiniProjects",
"id": "90a1590aacb3d24daceab902103c9acf2dcfc562",
"size"... |
import os
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test
class Tox(test):
def finalize_options(self):
test.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
import tox
errno = tox.cm... | {
"content_hash": "e9a6b484ef85fc316fac30cf3adc76b1",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 75,
"avg_line_length": 28.934782608695652,
"alnum_prop": 0.6153268219383922,
"repo_name": "kxz/waapuro",
"id": "97d052f371ad6c9a487bf3ca5b9a367d67968573",
"size": "1353",
... |
import re
import zipfile
def main():
'''
Hint: zip, now there are pairs
In the readme.txt:
welcome to my zipped list.
hint1: start from 90052
hint2: answer is inside the zip
Last nothing = 46145
Collect the comments
'''
nothing = '90052'
file_ext = '.txt'
file_patter... | {
"content_hash": "34f105f9ed3f0344cc495260f6bc652f",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 73,
"avg_line_length": 23.069767441860463,
"alnum_prop": 0.5655241935483871,
"repo_name": "HKuz/PythonChallenge",
"id": "3c754f784bc80017d9e863abf925804b68c87b20",
"size": ... |
"""Runs Aerospike (http://www.aerospike.com).
Aerospike is an opensource NoSQL solution. This benchmark runs a read/update
load test with varying numbers of client threads against an Aerospike server.
This test can be run in a variety of configurations including memory only,
remote/persistent ssd, and local ssd. The ... | {
"content_hash": "ec18776eb5eb20c80b883e404e51c428",
"timestamp": "",
"source": "github",
"line_count": 212,
"max_line_length": 80,
"avg_line_length": 35.83490566037736,
"alnum_prop": 0.6509148348032118,
"repo_name": "xiaolihope/PerfKitBenchmarker-1.7.0",
"id": "4eb25c544a79ce3c877dff62273359102c744c... |
'''
Created on Aug 9, 2013
@author: jimzhai
功能:分类学习模块
training(self,fileName): 对分析器进行训练
reportPrecision(self,fileName):报告分析器对测试文本分析的精度
'''
from pymining.math.text2matrix import Text2Matrix
from pymining.common.global_info import GlobalInfo
from pymining.common.configuration import Configuration
from pymining.prepr... | {
"content_hash": "c48f8de376f1421bb49186f5661d461e",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 104,
"avg_line_length": 38.391304347826086,
"alnum_prop": 0.7021517553793885,
"repo_name": "zhaishuai/NewsfeedsService",
"id": "9b7044c28c9a42445a8701a9856e15574e7fe809",
"... |
import BaseHTTPServer, SimpleHTTPServer
import ssl
httpd = BaseHTTPServer.HTTPServer(('localhost', 4443), SimpleHTTPServer.SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket (httpd.socket, certfile='./server.pem', server_side=True)
httpd.serve_forever()
| {
"content_hash": "2935df11f8e68c0d43d82ba5f82b7d69",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 97,
"avg_line_length": 43.5,
"alnum_prop": 0.8045977011494253,
"repo_name": "yukihirai0505/tutorial-program",
"id": "f33813b221cbfd0b235b9f82cd194b5a7187edc8",
"size": "261"... |
import logging
#import pylab
import matplotlib.pyplot as plt
from skimage import measure
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
class Plotter(object):
logging.basicConfig(level=logging.INFO)
log = logging.getLogger(__name__)
def plot_3d(self, image, threshold=-300):
"""
... | {
"content_hash": "c51e24e6ae39f17947dbdeb5c7d7c131",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 90,
"avg_line_length": 32.15217391304348,
"alnum_prop": 0.6382691007437458,
"repo_name": "2PacIsAlive/DeepOncology",
"id": "be4f91f2a1b78b948761fccd6f45c39174857ccc",
"size... |
"""This example creates custom fields.
To determine which custom fields exist, run get_all_custom_fields.py.
The LoadFromStorage method is pulling credentials and properties from a
"googleads.yaml" file. By default, it looks for this file in your home
directory. For more information, see the "Caching authentication i... | {
"content_hash": "d0fdeed77211b38dea8edccf1f7eade9",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 77,
"avg_line_length": 28.96,
"alnum_prop": 0.6636740331491713,
"repo_name": "googleads/googleads-python-lib",
"id": "ece4fb1b84fe1928ea21a2cd56d5f01e30327c16",
"size": "20... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.