text
stringlengths
4
1.02M
meta
dict
from msrest.serialization import Model class PacketCaptureQueryStatusResult(Model): """Status of packet capture session. :param name: The name of the packet capture resource. :type name: str :param id: The ID of the packet capture resource. :type id: str :param capture_start_time: The start t...
{ "content_hash": "157fa7cf244a5ac3b0734a0c839c84c5", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 79, "avg_line_length": 44.04761904761905, "alnum_prop": 0.6470270270270271, "repo_name": "lmazuel/azure-sdk-for-python", "id": "6ac877062e185d1d134d76b0b5a4ed92ce3b2bbd", "...
""" This tutorial shows how to use cleverhans.picklable_model to create models that can be saved for evaluation later. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging import numpy as np import tensor...
{ "content_hash": "5bdaa784a49bfb51f5ee37d679f771e8", "timestamp": "", "source": "github", "line_count": 242, "max_line_length": 78, "avg_line_length": 37.735537190082646, "alnum_prop": 0.6766316250547525, "repo_name": "carlini/cleverhans", "id": "2ae9685f666a93cb405f3b1f125548cb7334948e", "size": "...
""" Load and test a pre-trained model against the entire data subset. python LUNA16_inferenceTesting_ResNet.py -b gpu -i 0 -z 128 """ from neon import logger as neon_logger from neon.models import Model from aeon import DataLoader from neon.util.argparser import NeonArgparser, extract_valid_args from neon.transforms...
{ "content_hash": "ec3d654bd59880ea29b4e2342214f257", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 94, "avg_line_length": 30.96551724137931, "alnum_prop": 0.6932071269487751, "repo_name": "mas-dse-greina/neon", "id": "3c86a99193e70e1480d3f628cbfdf180f45464bb", "size": "...
from base import APITestCase from vilya.models.project import CodeDoubanProject from vilya.models.project_issue import ProjectIssue from vilya.models.issue_comment import IssueComment from tests.utils import delete_project class ProjectIssueCommentsTest(APITestCase): def setUp(self): super(ProjectIssueCo...
{ "content_hash": "db8f293b233b56a2c5c80a46cd0b135e", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 75, "avg_line_length": 33.129411764705885, "alnum_prop": 0.5262784090909091, "repo_name": "douban/code", "id": "8128513ad632823fe6946701dde32d5a92a16f97", "size": "5650", ...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'TmpAttribute' db.create_table(u'server_tmpattribute', ( (u'id', self.gf('django.db.models.fields.AutoFie...
{ "content_hash": "9d0a201d6b14dd6da12a4d9d7d7ab4ec", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 118, "avg_line_length": 49.87234042553192, "alnum_prop": 0.5840443686006825, "repo_name": "google-code-export/evennia", "id": "19b8019fd93f4a137bd33e0e0b1564a0831a493b", "s...
"""Utility functions for system identification.""" import matplotlib import matplotlib.mlab as mlab import numpy as np import pylab def EstimateTransferFunction(x, y, *args, **kwargs): """Estimate the transfer function from x to y using Welch's method.""" pxy, f = mlab.csd(x, y, *args, **kwargs) pxx, _ = mlab....
{ "content_hash": "6b7446df9ed6ed710247ef766cef8f0b", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 80, "avg_line_length": 38.236111111111114, "alnum_prop": 0.6512895023610606, "repo_name": "google/makani", "id": "136f2c3732e482bca69b4a563331ab3843966236", "size": "6095"...
from django.db.models.signals import post_save, post_delete from django.dispatch import receiver from django.utils.timezone import now from geotrek.common.models import Attachment, AccessibilityAttachment @receiver(post_save, sender=Attachment) @receiver(post_save, sender=AccessibilityAttachment) @receiver(post_dele...
{ "content_hash": "50376e204370d74b829647c1e0867aa4", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 98, "avg_line_length": 46.11764705882353, "alnum_prop": 0.7729591836734694, "repo_name": "GeotrekCE/Geotrek-admin", "id": "8f1cf9bf3778ea83bececa6166020b294ae3c5ab", "size"...
""" OpenStreetMaps geocoder, contributed by Alessandro Pasotti of ItOpen. """ from geopy.geocoders.base import ( Geocoder, DEFAULT_FORMAT_STRING, DEFAULT_TIMEOUT, DEFAULT_SCHEME ) from geopy.compat import urlencode from geopy.location import Location from geopy.util import logger from geopy.exc import ...
{ "content_hash": "cda3bc311286bc6203130458edfe3a94", "timestamp": "", "source": "github", "line_count": 273, "max_line_length": 79, "avg_line_length": 32.989010989010985, "alnum_prop": 0.5629580279813458, "repo_name": "cchristelis/feti", "id": "796262dcb5337f0b527d08741ce640ef5229d726", "size": "90...
import logging import uuid import json import boto import boto.ec2 def _read_conf(config_file): cfile = open(config_file, 'r').read() config = {} for line in cfile.split('\n'): if line.startswith('#') or not line : continue temp = line.split('=') config[temp[0]] = temp...
{ "content_hash": "782c6a3561aebacc23f4300dfd78434c", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 90, "avg_line_length": 27.660377358490567, "alnum_prop": 0.5818553888130968, "repo_name": "yadudoc/cloud_kotta", "id": "f3df0d285fdd9e1094bdeaf20027830bace69506", "size": "...
""" File: RPS.py Author: CS 1510 Description: This is an automatic rock paper scissors game played with two comptuer players. Deadline: ONTIME """ import random random.seed() #Function getWeapon #Inputs: no inputs #Output: The strings "r", "p", or "s" def getWeapon(): """Randomly gets a weapon.""" pick = ran...
{ "content_hash": "c5b93ebbe2faf98f67e3c647bbafc171", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 83, "avg_line_length": 24.641304347826086, "alnum_prop": 0.643140714600794, "repo_name": "sgolitsynskiy/sergey.cs.uni.edu", "id": "d46f8c784088a8520a964fae2a6061cd5caa76b1", ...
'''OpenGL extension APPLE.flush_buffer_range Automatically generated by the get_gl_extensions script, do not edit! ''' from OpenGL import platform, constants, constant, arrays from OpenGL import extensions from OpenGL.GL import glget import ctypes EXTENSION_NAME = 'GL_APPLE_flush_buffer_range' _DEPRECATED = False GL_B...
{ "content_hash": "843e092659c22a110c9ec970b1c24a59", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 100, "avg_line_length": 39.638888888888886, "alnum_prop": 0.795374912403644, "repo_name": "Universal-Model-Converter/UMC3.0a", "id": "ff7fed6eb499f462fd94829f5603fc577d517d8a...
import copy import time import ddt import mock from oslo_config import cfg from manila import exception from manila.share import configuration from manila.share import driver from manila.share.drivers.netapp.dataontap.client import api as netapp_api from manila.share.drivers.netapp.dataontap.client import client_cmod...
{ "content_hash": "c1b7bbce0a3b1f7345ef072395a165ea", "timestamp": "", "source": "github", "line_count": 483, "max_line_length": 79, "avg_line_length": 45.34782608695652, "alnum_prop": 0.6020636442496462, "repo_name": "NetApp/manila", "id": "5f679cbe6a0547c25a6d75fee6364943bb3ca0a7", "size": "22533"...
import itertools import torch class Optimizer(object): """ The Optimizer class encapsulates torch.optim package and provides functionalities for learning rate scheduling and gradient norm clipping. Args: optim (torch.optim.Optimizer): optimizer object, the parameters to be optimized s...
{ "content_hash": "79d35d9dce3df908920bb0cc349f8fad", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 110, "avg_line_length": 37.60377358490566, "alnum_prop": 0.6332162568991471, "repo_name": "taras-sereda/pytorch-seq2seq", "id": "cc3bd47a4f06637e339b71788b2b56c4d57d1c94", ...
""" test_template.py """ import json import logging import os import time import urllib import signal import subprocess from collections import namedtuple from ..common import status # Test input. Please set each variable as it's own line, ended with \n, otherwise the value of lines # passed into the topology will be...
{ "content_hash": "a7e4fe5402dec9b6fa4210ec9fea41a4", "timestamp": "", "source": "github", "line_count": 339, "max_line_length": 100, "avg_line_length": 37.24778761061947, "alnum_prop": 0.6600934505424884, "repo_name": "lucperkins/heron", "id": "19ff4d1807d77eea1a0ce0191b9b4b51545843b2", "size": "13...
import logging from django.contrib.auth.models import User, Group, Permission try: from django.contrib.auth.models import Message except ImportError: Message = None from django.db import models from django.http import Http404 from django.shortcuts import get_object_or_404, _get_queryset from piston.handler im...
{ "content_hash": "74d0b93f4da302193739e5c0d02cc588", "timestamp": "", "source": "github", "line_count": 313, "max_line_length": 121, "avg_line_length": 33.26517571884984, "alnum_prop": 0.6208221283134845, "repo_name": "charles-vdulac/django-roa", "id": "e8d60edff5d403393434a56abe4591a832d6e734", "s...
from __future__ import absolute_import from django.core.urlresolvers import reverse from sentry.testutils import APITestCase class TeamMembersTest(APITestCase): def test_simple(self): org = self.create_organization() team = self.create_team(organization=org) foo = self.create_user('foo@e...
{ "content_hash": "687481e125e99f37e2e4a6cf16dd9d98", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 77, "avg_line_length": 37.166666666666664, "alnum_prop": 0.6401345291479821, "repo_name": "nicholasserra/sentry", "id": "b5bcf0c74dd07312fdfd6eaa139976fc95cd63a0", "size": ...
import json import os import sys from get_initial_pks import get_initial_pks path_files_folder = 'flashcard-exporter/data/' path_folder_full = os.path.join(os.path.dirname(os.path.abspath(__file__)),os.pardir, path_files_folder) # if filename not specified use arthistoryflash.json if len(sys.argv) < 2: json_file ...
{ "content_hash": "ddc989258576175191d89c5db9eaac4d", "timestamp": "", "source": "github", "line_count": 181, "max_line_length": 117, "avg_line_length": 32.530386740331494, "alnum_prop": 0.48046875, "repo_name": "Harvard-ATG/HarvardCards", "id": "c36239aa58e8b04a0f2eec57a2da35b25f5d62db", "size": "6...
from __future__ import absolute_import, division, print_function, unicode_literals import pytest ; pytest from bokeh.util.api import INTERNAL, PUBLIC ; INTERNAL, PUBLIC from bokeh.util.testing import verify_api ; verify_api #----------------------------------------------------------------------------- # Imports #---...
{ "content_hash": "0a1bd006b0d8b2f6a4461fb229a41927", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 83, "avg_line_length": 33.07272727272727, "alnum_prop": 0.35733919736118747, "repo_name": "rs2/bokeh", "id": "10ceb8e8c18bf49b1df3b7397c34d5d3944ca5ba", "size": "2339", "...
import os import unittest from pordego.config_loader import get_analysis_configs, load_config PATH_TO_DATA_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "data") class TestConfigLoader(unittest.TestCase): def test_include_config(self): """Include files and recursively included ...
{ "content_hash": "8ede8c109aaad366a029aa733369d83f", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 108, "avg_line_length": 47, "alnum_prop": 0.6638297872340425, "repo_name": "ttreptow/pordego", "id": "473c2d1d59b2a9d9ff0ec89c85de2dc4b8a26bd7", "size": "705", "binary": ...
import csv import datetime import json import logging import urlparse from io import BytesIO from django.conf import settings from django.core.exceptions import ValidationError as DjangoValidationError from django.core.urlresolvers import reverse from django.core.validators import validate_ipv4_address, validate_ipv46...
{ "content_hash": "d8c90eedb2ce5ce01090e961067c27d8", "timestamp": "", "source": "github", "line_count": 1412, "max_line_length": 122, "avg_line_length": 39.126770538243626, "alnum_prop": 0.5680127427733632, "repo_name": "kaoscoach/crits", "id": "a91d5dcad42930d0f53eb1a0032854c9b2b0f770", "size": "5...
__author__ = 'wei' from ..protobuf import * from . import igt_base_template class LinkTemplate(igt_base_template.BaseTemplate): def __init__(self): igt_base_template.BaseTemplate.__init__(self) self.text = "" self.title = "" self.logo = "" self.logoURL = "" ...
{ "content_hash": "081ed378a4712a9676e38eaf087ab459", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 93, "avg_line_length": 32.38333333333333, "alnum_prop": 0.6103962943901183, "repo_name": "alphapigger/igetui", "id": "542bff455a1f8d7db343e5d7e5786e173524772b", "size": "19...
__author__ = 'mikael.brandin@devolver.se' # coding=utf-8 import os import subprocess import io import sys from urllib.parse import urlparse from client import exceptions from client import protocol class ClientException(exceptions.ArmoryException): def __init__(self, msg): super(ClientException, self)._...
{ "content_hash": "1ba9e4d1f2a8e37eeb97da3e13ca937b", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 123, "avg_line_length": 27.554054054054053, "alnum_prop": 0.5669445806768023, "repo_name": "mikaelbrandin/armory", "id": "eb875e425cbab809bedad3bdd30278663965e673", "size"...
r"""Implementation of paradigms, mirroring and extending functionality in Thrax. This follows the treatment of morphology in chapter 2 of: Roark, B. and Sproat, R. 2007. Computational Approaches to Morphology and Syntax. Oxford University Press. Following that work, all affixation is treated via composition, since t...
{ "content_hash": "8065f8c37c9522da11b9fcadfea7c5f6", "timestamp": "", "source": "github", "line_count": 525, "max_line_length": 80, "avg_line_length": 34.55238095238095, "alnum_prop": 0.6807607497243661, "repo_name": "kylebgorman/pynini", "id": "d66b433caefaed18b57052060e077aac92b630c0", "size": "1...
from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_shalera.iff" result.attribute_template_id = 9 result.stfName("npc_name","hutt_base_female") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "d1271040ac5e40affa4d75b77f1a7b3c", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 53, "avg_line_length": 22.153846153846153, "alnum_prop": 0.6875, "repo_name": "anhstudios/swganh", "id": "bcc81afd457a242526124ae7bfb8894eac1e2cc2", "size": "433", "binar...
from django.contrib import admin from nested_inline.admin import NestedStackedInline, NestedModelAdmin from example.models import * class LevelThreeInline(NestedStackedInline): model = LevelThree extra = 1 fk_name = 'level' class LevelTwoInline(NestedStackedInline): model = LevelTwo extra = 1 ...
{ "content_hash": "c533896e8289d70882fb4d0449723b7d", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 69, "avg_line_length": 21.5, "alnum_prop": 0.7302325581395349, "repo_name": "Dmitri-Sintsov/django-nested-inline", "id": "0b3326a83fe93299c8b3a1caf2030ebc4d8345ad", "size":...
from core import perf_benchmark from benchmarks import silk_flags from measurements import power import page_sets from telemetry import benchmark @benchmark.Enabled('android') class PowerAndroidAcceptance(perf_benchmark.PerfBenchmark): """Android power acceptance test.""" test = power.Power page_set = page_set...
{ "content_hash": "2efbf53f9b782a14ec5a875a99b58895", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 78, "avg_line_length": 29.925531914893618, "alnum_prop": 0.7415570565232847, "repo_name": "danakj/chromium", "id": "e1632e57de12a34225cf8015df80bd82143365c7", "size": "578...
""" lantz_core.limits ~~~~~~~~~~~~~~~~~ Module defining the limits utilities used for int and float. :copyright: 2015 by Lantz Authors, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import (division, unicode_literals, print_function, ...
{ "content_hash": "df69397615629a77c1dd84bdf3022af3", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 79, "avg_line_length": 31.49236641221374, "alnum_prop": 0.5801721003514726, "repo_name": "LabPy/lantz_core", "id": "6e56c05d84fbb114c60fa81adb1e058f671807f6", "size": "827...
import sys import json import string import random POPULAR_NGRAM_COUNT = 10000 def preprocess_frequencies(frequencies, order): '''Compile simple mapping from N-grams to frequencies into data structures to help compute the probability of state transitions to complete an N-gram Arguments: frequenc...
{ "content_hash": "4bb2af539ab5fb96c5afae8d969b38f9", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 94, "avg_line_length": 39.59803921568628, "alnum_prop": 0.6432285219113641, "repo_name": "uogbuji/ibmdw", "id": "096b1386021632c904e66f3adee82583dea7589f", "size": "4039",...
import argparse from euca2ools.commands.monitoring import CloudWatchRequest from requestbuilder import Arg class DeleteAlarms(CloudWatchRequest): DESCRIPTION = 'Delete alarms' ARGS = [Arg('AlarmNames.member', metavar='ALARM', nargs='+', help='names of the alarms to delete'), Arg('-...
{ "content_hash": "a29664566fac7258b396f4f1df18ae5d", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 68, "avg_line_length": 39.36363636363637, "alnum_prop": 0.6720554272517321, "repo_name": "vasiliykochergin/euca2ools", "id": "ed0309af101c98f6570364b53ddf00586004fa92", "si...
import base64 import properties from .. import BaseModel class AttachmentData(BaseModel): data = properties.String( 'base64 encoded data.', ) @property def raw_data(self): """Raw (decoded) attachment data (possibly binary).""" return self.data and base64.b64decode(self.data)...
{ "content_hash": "48fd57885a592e74c7e813e8ef3a2cee", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 75, "avg_line_length": 24.258064516129032, "alnum_prop": 0.5784574468085106, "repo_name": "LasLabs/python-helpscout", "id": "5d4aeabdf4656a673bccb5146ba0c0dba3393827", "siz...
"""Tests for certbot._internal.plugins.webroot.""" from __future__ import print_function import argparse import errno import json import shutil import tempfile import unittest import josepy as jose try: import mock except ImportError: # pragma: no cover from unittest import mock from acme import challenges ...
{ "content_hash": "ef059aff3a2e8ce85d0d97735c5bee25", "timestamp": "", "source": "github", "line_count": 365, "max_line_length": 95, "avg_line_length": 43.23013698630137, "alnum_prop": 0.6504848215983269, "repo_name": "lmcro/letsencrypt", "id": "d7e96159658ea5a7e022bce72e2f4dfde8a1f9d7", "size": "15...
""" FILE: inno.py AUTHOR: Cody Preord @summary: Lexer configuration module for Inno Setup Scripts """ __author__ = "Cody Precord <cprecord@editra.org>" __svnid__ = "$Id: _inno.py 68798 2011-08-20 17:17:05Z CJP $" __revision__ = "$Revision: 68798 $" #-------------------------------------------------------------------...
{ "content_hash": "dfa4b9d4e06695887877672a94a0809e", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 80, "avg_line_length": 42.785714285714285, "alnum_prop": 0.6378686700055648, "repo_name": "DaniilLeksin/gc", "id": "45d93124db49a00808e6a83878e3ef946fe9a623", "size": "774...
"""Converts cubic bezier curves to quadratic splines. Conversion is performed such that the quadratic splines keep the same end-curve tangents as the original cubics. The approach is iterative, increasing the number of segments for a spline until the error gets below a bound. Respective curves from multiple fonts wil...
{ "content_hash": "b88c293ea66b893432e2c40145df07f8", "timestamp": "", "source": "github", "line_count": 309, "max_line_length": 80, "avg_line_length": 34.1294498381877, "alnum_prop": 0.650104304949744, "repo_name": "googlei18n/cu2qu", "id": "0b59187383d958bca19ab1c34559689813e3ba5c", "size": "11144...
import gzip import inspect import warnings from io import BytesIO from testfixtures import LogCapture from twisted.trial import unittest from scrapy import signals from scrapy.settings import Settings from scrapy.http import Request, Response, TextResponse, XmlResponse, HtmlResponse from scrapy.spiders.init import In...
{ "content_hash": "4b87cc86f8b527c20576d60d7fabfbc5", "timestamp": "", "source": "github", "line_count": 472, "max_line_length": 140, "avg_line_length": 38.02542372881356, "alnum_prop": 0.601181190104747, "repo_name": "Parlin-Galanodel/scrapy", "id": "929e0fea84e91fbe27ca5ae7b67833b60b29d98b", "size...
import ipaddress from typing import Mapping, NoReturn, Optional, Sequence, Type, TypeVar, Union, overload import types import logging import psycopg2 import unittest import unittest.mock import dataclasses as dc from . import db from .table import Table, TSchema from .common import OrderParam, ResultDict, ResultsDict...
{ "content_hash": "dc777bcf061f43a713388e2ebbf15b70", "timestamp": "", "source": "github", "line_count": 236, "max_line_length": 115, "avg_line_length": 33.601694915254235, "alnum_prop": 0.5723833543505674, "repo_name": "sharhalakis/vdns", "id": "ca50d19eea2f0e798416ce9bc4394b447154e4b4", "size": "9...
''' author: Ross Kinsella date: 2014/feb/11 ''' from django.db import models from django.forms import ModelForm from django.utils import timezone from django.contrib.auth.models import User from autoslug import AutoSlugField class Society(models.Model): ''' A master class which Accounts, Communication classes,...
{ "content_hash": "0169029587e26e6364b390095ca13197", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 76, "avg_line_length": 27.38235294117647, "alnum_prop": 0.748657357679914, "repo_name": "CS2014/USM", "id": "a994a37b20a19e3ad9a5024881ad3de670be6843", "size": "931", "bi...
"""Generate metrics for a Github org's pull request status hooks. Monitoring CI tools, by tracking latency of status on a pull request, and pending counts. cat requirements.txt click dateparser c7n requests """ import click import dateparser from collections import Counter from datetime import datetime from dateutil...
{ "content_hash": "89489f989fa83f86180981c74423b65c", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 77, "avg_line_length": 29.458536585365852, "alnum_prop": 0.5712866368604074, "repo_name": "taohungyang/cloud-custodian", "id": "3879abd3770c84a5eee80c1f689147355615036c", ...
from __future__ import absolute_import import flask_socketio from myapp.webserver.webapp import webapp socketio = flask_socketio.SocketIO(webapp) @socketio.on('connect', namespace='/') def on_connect(): print('SocketIO connect /') @socketio.on('disconnect', namespace='/') def on_disconnect(): print('Sock...
{ "content_hash": "df3a60cd0659478fa16f42ff114d5c8f", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 48, "avg_line_length": 21.72972972972973, "alnum_prop": 0.7126865671641791, "repo_name": "lukeyeager/flask-sqlalchemy-socketio-demo", "id": "6997383082218f58e1d63a8a24e52eeff...
import os # try/except added for compatibility with python < 3.8 try: from unittest import mock from unittest.mock import AsyncMock # pragma: NO COVER except ImportError: # pragma: NO COVER import mock from collections.abc import Iterable import json import math from google.api_core import ( future...
{ "content_hash": "4d9b16834e896097b6e2b0cfb437b0be", "timestamp": "", "source": "github", "line_count": 4667, "max_line_length": 123, "avg_line_length": 36.26226698092994, "alnum_prop": 0.6369094046184027, "repo_name": "googleapis/python-compute", "id": "313b38fe1deee0ed25fab5bf155fcc9533fcc115", "...
""" manage PyTables query interface via Expressions """ import ast from functools import partial from typing import Any, Dict, Optional, Tuple import numpy as np from pandas._libs.tslibs import Timedelta, Timestamp from pandas.compat.chainmap import DeepChainMap from pandas.core.dtypes.common import is_list_like i...
{ "content_hash": "83d19c625273d8332dd694baa64b24e8", "timestamp": "", "source": "github", "line_count": 637, "max_line_length": 88, "avg_line_length": 30.72056514913658, "alnum_prop": 0.5570034237825131, "repo_name": "jreback/pandas", "id": "b8198866878171c2b175bc527c77b36228150dac", "size": "19569...
setup_args = { "name": "whisper-backup", "version": "0.1.0", "platforms": ["any"], "description": "Backup whisper DB files into S3 or Swift", "long_description": """\ Whisper-backup stores compressed WSP files in Amazon S3 or OpenStack Swift from a Graphite setup. It can backup and restore selected...
{ "content_hash": "b21a2ebab8b9759ed58069677f80ed45", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 74, "avg_line_length": 33.3, "alnum_prop": 0.6381381381381381, "repo_name": "lv0/whisper-backup", "id": "83f53ec3a857e1a5947c5a0f84577adc741db97c", "size": "1987", "binar...
from typing import Optional, List import google.auth.transport.requests from google.cloud import bigquery class BackendBQClient: BUILD_DATETIMES_QUERY = """ SELECT DISTINCT dlb.dt_build_datetime FROM `etl_log.vw_data_lineage_build` AS dlb ORDER BY dlb.dt_build_datetime DESC """ DL_BUILD_ID_QUERY ...
{ "content_hash": "f85ef717a21b19f5e8013b7c97c6b94e", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 77, "avg_line_length": 33.72611464968153, "alnum_prop": 0.6381491973559962, "repo_name": "google/grizzly", "id": "6c06c519fd0648720692cec3a9322e78f8a92ecd", "size": "5871"...
import json import os.path import struct import typing.io import research.coding.varbyte import research.utils def raise_property_not_found(prop): raise KeyError("property '%s' not found" % prop) class Metadata: f_coding = "coding" f_path = "paths" f_type = "type" f_dir = "dir" f_name = "n...
{ "content_hash": "42b034a39188dc4bf12ad69cf39615f7", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 98, "avg_line_length": 29.496644295302012, "alnum_prop": 0.6368600682593857, "repo_name": "west-tandon/ReSearch", "id": "51a789b9d3d7b84a0eae071d51790a5dc13900c8", "size":...
from __future__ import absolute_import import logging import six from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from sentry.api.base import Endpoint logger = logging.getLogger("sentry.integrations.cloudflare") class CloudflareMetadataEndpoint(Endpoint): per...
{ "content_hash": "76c5c7c01a1218309c3b048d08a34b1f", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 78, "avg_line_length": 27.48148148148148, "alnum_prop": 0.6212938005390836, "repo_name": "beeftornado/sentry", "id": "788f2bfcee02bdd7a2b19807d85e3e2c53c99ee9", "size": "74...
DEPTH_LIMIT = 1 SPIDER_MODULES = ['url_lover.spiders'] ITEM_PIPELINES = { 'url_lover.pipelines.DuplicatesPipeline': 100 }
{ "content_hash": "d262f279d1012f3ae47e513658c4ddf4", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 49, "avg_line_length": 18.285714285714285, "alnum_prop": 0.703125, "repo_name": "m-vdb/url-lover", "id": "60fd9265da6339f408085f8f19cbb2af1bb268c4", "size": "128", "binary...
from emailoto.token_client import TokenClient from emailoto.authentication import EmailOtoAuthBackend import time from .test_base import EmailOtoTest from django.core.urlresolvers import reverse from emailoto.config import EmailOtoConfig, CONFIG class TokenClientTest(EmailOtoTest): def test_set_counter(self): ...
{ "content_hash": "913123e4d859573ac37511f1dce1abed", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 78, "avg_line_length": 38.226950354609926, "alnum_prop": 0.6428571428571429, "repo_name": "qdonnellan/django_emailoto", "id": "e8f98d5a66a1af8d1386f2f8ec3ca2a82997e0ad", "...
""" Sponge Knowledge Base Processors metadata """ from org.openksavi.sponge.examples import PowerEchoMetadataAction class UpperEchoAction(Action): def onConfigure(self): self.withFeatures({"visibility":False}) def onCall(self, text): return None def onLoad(): sponge.enableJava(...
{ "content_hash": "9d553e3b81f33674d79b3246fc247510", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 65, "avg_line_length": 23.066666666666666, "alnum_prop": 0.7109826589595376, "repo_name": "softelnet/sponge", "id": "e4263d633b4c11ad260103522ec90f003ccfd4e3", "size": "346...
import sys from utils import describe_data data_folder = sys.argv[1] describe_data(data_folder)
{ "content_hash": "ba32b7b00424cee2995a071161006617", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 31, "avg_line_length": 16.333333333333332, "alnum_prop": 0.7755102040816326, "repo_name": "hristo-vrigazov/behavioral-cloning", "id": "4c7dc10a822813667b78a0f3e774fd775f368a6f...
from .Child import Child from .Node import Node # noqa: I201 EXPR_NODES = [ # An inout expression. # &x Node('InOutExpr', kind='Expr', children=[ Child('Ampersand', kind='PrefixAmpersandToken'), Child('Expression', kind='Expr'), ]), # A #column expression. ...
{ "content_hash": "f788c26edf2d9afc9f8795575e4ec621", "timestamp": "", "source": "github", "line_count": 592, "max_line_length": 79, "avg_line_length": 35.445945945945944, "alnum_prop": 0.5273065192527641, "repo_name": "stephentyrone/swift", "id": "2d2295fec724c136e58ee77fcebb2fa8bcd66e44", "size": ...
from __future__ import absolute_import import datetime from django.conf import settings from django.http import HttpResponse from django.test import TestCase from mock import patch from zerver.lib.test_helpers import MockLDAP from confirmation.models import Confirmation from zilencer.models import Deployment from z...
{ "content_hash": "bf9187736f23108f33a3debb689a0d68", "timestamp": "", "source": "github", "line_count": 1181, "max_line_length": 114, "avg_line_length": 43.38865368331922, "alnum_prop": 0.5740213106436126, "repo_name": "niftynei/zulip", "id": "76b38b716420a0cf14a640f6a3603cfd2ac560cb", "size": "512...
from kid_readout.utils.time_tools import date_to_unix_time by_unix_time_table = [ dict(date='2017-04-14', description='Stanford SiNxonNb01-0404 SiNx on Nb CPW1 medley chip in holder H1 and lid L1 with mu-metal magnetic shield.', optical_state='dark', chip_id='SiNxonNb01-0404' ),...
{ "content_hash": "e9606d97ba1131510d56c10f3d99e21e", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 176, "avg_line_length": 44.65277777777778, "alnum_prop": 0.615552099533437, "repo_name": "ColumbiaCMB/kid_readout", "id": "50653babccec2a3b3fa0875f08cd0a3bed402c97", "size...
"""Contains the convolutional layer classes and their functional aliases. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import six from six.moves import xrange # pylint: disable=redefined-builtin import numpy as np from tensorflow.python.framework im...
{ "content_hash": "0d99b7a40ef5c5eb0598bd68a8c72abd", "timestamp": "", "source": "github", "line_count": 1541, "max_line_length": 80, "avg_line_length": 42.06878650227125, "alnum_prop": 0.6349725427284507, "repo_name": "jhaux/tensorflow", "id": "fdf1b134b9cd4b659d519725ed3d71f3f67245be", "size": "65...
from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations ...
{ "content_hash": "fa6de25e2aa1121f3807de93263bf18d", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 121, "avg_line_length": 28.93103448275862, "alnum_prop": 0.5816448152562574, "repo_name": "airportmarc/the416life", "id": "50e407e7b3962d65d0e5bad1a8469b9331aedb9a", "size"...
import logging from sqlalchemy.orm import sessionmaker logger = logging.getLogger('usesthis_crawler') console_handler = logging.StreamHandler() console_handler.setFormatter( logging.Formatter(u'%(message)s') ) logger.addHandler(console_handler) Session = sessionmaker()
{ "content_hash": "bdaa6035de10837b2e7ab0f139eecd34", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 46, "avg_line_length": 25.09090909090909, "alnum_prop": 0.7934782608695652, "repo_name": "gbrener/usesthis_crawler", "id": "cb37a89be65d96bc36ced877da7f3e728719c761", "size...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): # This flag is used to mark that a migration shouldn't be automatically run in # production. We set this to True for operations that we think are risky and want # someone from ops to run manual...
{ "content_hash": "6434331473f14accbe1796d90d17d43e", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 88, "avg_line_length": 39.526315789473685, "alnum_prop": 0.6671105193075899, "repo_name": "beeftornado/sentry", "id": "c5ae221bd4a9da07a021880642f66cf5ef278b83", "size": "1...
from tornado.concurrent import Future from tornado.httpclient import HTTPError, HTTPRequest from tornado.log import gen_log from tornado.testing import AsyncHTTPTestCase, gen_test, bind_unused_port, ExpectLog from tornado.test.util import unittest from tornado.web import Application, RequestHandler from tornado.websock...
{ "content_hash": "7323c5b912b7a3f80d70a392dcbb0f3d", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 105, "avg_line_length": 36.40506329113924, "alnum_prop": 0.6157858136300417, "repo_name": "bufferx/tornado", "id": "3c6e3a9a2cc06a4bb9b865cf59b60188cec133a9", "size": "575...
""" Created on Wed Feb 04 15:20:56 2015 @author: Scott """ import numpy as np from neurosrc.spectral.filter import scfilter import math import statsmodels.api as sm def scpac(x, flo_range, fhi_range, rate, pac_method, filt_method, **kwargs): ''' Calculate phase-amplitude coupling between the phase of a low-...
{ "content_hash": "0ff6de3c7d16c0239b9638e53d1e61a4", "timestamp": "", "source": "github", "line_count": 243, "max_line_length": 82, "avg_line_length": 26.292181069958847, "alnum_prop": 0.5772421349193927, "repo_name": "parenthetical-e/neurosrc", "id": "e54db843fa257fe5411f516c7b1978869832a1fd", "si...
def http_exception(response): raise HTTPException(response) class HTTPException(Exception): def __init__(self, response): self._response = response def __str__(self): return self._response.message @property def is_redirect(self): return self._response.is_redirect @p...
{ "content_hash": "c7ee43ff011dc9b42fc842d0484fc0a7", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 45, "avg_line_length": 21.608695652173914, "alnum_prop": 0.647887323943662, "repo_name": "XDrake99/IDTP", "id": "12eaf5a84942f1f3eaa499da95d5602ddb355a94", "size": "497", ...
from __future__ import division from __future__ import print_function import argparse import pandas import re import genhub def cli(): """Define the command-line interface of the program.""" desc = 'Summarize iLocus content of the specified genome(s)' parser = argparse.ArgumentParser(description=desc) ...
{ "content_hash": "caa09a07043757aba0d7e0e8fff4be72", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 79, "avg_line_length": 33.73626373626374, "alnum_prop": 0.5644951140065146, "repo_name": "standage/genhub", "id": "265df4b7d21d9b2f763ceb434203c279d1729256", "size": "3499"...
""" Command-line application controller for opc-diag """ from opcdiag.model import Package from opcdiag.presenter import DiffPresenter, ItemPresenter from opcdiag.view import OpcView _CONTENT_TYPES_URI = '[Content_Types].xml' class OpcController(object): """ Mediate between the command-line interface and t...
{ "content_hash": "fd73d8109144a82f7071b83ebd36b12a", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 78, "avg_line_length": 41.98876404494382, "alnum_prop": 0.6534653465346535, "repo_name": "python-openxml/opc-diag", "id": "40f4bd2933740975edbcf8144b7d8dca0c2ac274", "size"...
from luigi import Task, Parameter, LocalTarget, WrapperTask from tasks.base_tasks import (ColumnsTask, TableTask, TagsTask, GeoFile2TempTableTask, SimplifiedTempTableTask, RepoFile) from lib.timespan import get_timespan from tasks.util import shell, classpath, copyfile from tasks.tags im...
{ "content_hash": "aa0f7b910989c8c4d1182f73d77c1143", "timestamp": "", "source": "github", "line_count": 278, "max_line_length": 143, "avg_line_length": 33.66546762589928, "alnum_prop": 0.5650176300886847, "repo_name": "CartoDB/bigmetadata", "id": "55ecc3b53a176e9dfdfe81a77bab450f6292ac8d", "size": ...
from __future__ import division, print_function, absolute_import import os import sys import functools from textwrap import TextWrapper from collections import defaultdict from plumbum.lib import six, getdoc from plumbum.cli.terminal import get_terminal_size from plumbum.cli.switches import (SwitchError, UnknownSwitch...
{ "content_hash": "e8ccbb5c2f1155924701a20b881c30e5", "timestamp": "", "source": "github", "line_count": 687, "max_line_length": 136, "avg_line_length": 40.0844250363901, "alnum_prop": 0.5296317815382381, "repo_name": "henryiii/plumbum", "id": "858d3aff09ed26c59f590292ee1e70a38e0eafbf", "size": "275...
from __future__ import unicode_literals import frappe, json from frappe import _ from frappe.utils import cstr from frappe.model import default_fields @frappe.whitelist() def make_mapped_doc(method, source_name, selected_children=None): '''Returns the mapped document calling the given mapper method. Sets selected_ch...
{ "content_hash": "1fb649c7d6e6e0fa4037d87ae8578d34", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 159, "avg_line_length": 34.398009950248756, "alnum_prop": 0.7061035579982644, "repo_name": "bcornwellmott/frappe", "id": "72a9a77e3c825997349cde6b24f21eb925a998ad", "size"...
import base64 from asyncio import coroutine from .base import Base class Target(Base): unary = False @coroutine def __call__(self, text, encoding='utf-8'): return base64.b64decode(text).decode(encoding)
{ "content_hash": "1edc983fdbeba17dabacdccaf10288aa", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 54, "avg_line_length": 18.916666666666668, "alnum_prop": 0.6872246696035242, "repo_name": "Answeror/torabot", "id": "7625c59eedab9b897756abc2144685989529fe6e", "size": "227...
""" Low level deployment operations. """ from random import randint, Random from os import path, makedirs from spur import LocalShell from time import time from signal import SIGKILL class TimeoutError(Exception): """ Exception dealing with executed commands that timeout. """ pass def execute(cmd, t...
{ "content_hash": "8a16b0f7866264f30ac5433d8070ecc9", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 81, "avg_line_length": 25.492753623188406, "alnum_prop": 0.6378624218305856, "repo_name": "RitwikGupta/picoCTF-shell-manager", "id": "4b35a1f3d9f5c65e7cc950a73d5c158fb4bd064f...
""" Tests deploying the presto configuration """ from mock import patch from fabric.api import env from prestoadmin import deploy from tests.base_test_case import BaseTestCase from tests.unit import SudoResult class TestDeploy(BaseTestCase): def test_output_format_dict(self): conf = {'a': 'b', 'c': 'd'} ...
{ "content_hash": "e586a011c3e9cabd95efeffd7f315097", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 96, "avg_line_length": 40.48148148148148, "alnum_prop": 0.6221408966148216, "repo_name": "prestodb/presto-admin", "id": "30a87332a78f9fb2425c453ba766beee6eedfded", "size":...
from swgpy.object import * def create(kernel): result = Building() result.template = "object/building/poi/shared_corellia_beldonna_large2.iff" result.attribute_template_id = -1 result.stfName("poi_n","base_poi_building") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "4bd6037af78837d94959410cdd55c54e", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 76, "avg_line_length": 23.846153846153847, "alnum_prop": 0.6967741935483871, "repo_name": "obi-two/Rebelion", "id": "80f7d02bd37e65623ab37e4860fbd01974a8f486", "size": "455...
import json from django.urls import reverse from netaddr import IPNetwork from rest_framework import status from dcim.models import Device, DeviceRole, DeviceType, Interface, Manufacturer, Site from ipam.choices import * from ipam.models import * from tenancy.models import Tenant from utilities.testing import APITest...
{ "content_hash": "6430b89b5bfa55610f3f9770e2ed7db5", "timestamp": "", "source": "github", "line_count": 916, "max_line_length": 168, "avg_line_length": 36.6146288209607, "alnum_prop": 0.5649542323861773, "repo_name": "digitalocean/netbox", "id": "d99de6d207189fd00cc608aefbc281ad2f329d5e", "size": "...
"""Support for monitoring an SABnzbd NZB client.""" import logging from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity import Entity from . import DATA_SABNZBD, SENSOR_TYPES, SIGNAL_SABNZBD_UPDATED _LOGGER = logging.getLogger(__name__) async def async_setup_platf...
{ "content_hash": "334989acbdceb7a7c5f9c3d2c2c97aa1", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 86, "avg_line_length": 32.785714285714285, "alnum_prop": 0.6405228758169934, "repo_name": "fbradyirl/home-assistant", "id": "642dd27b1d82e383814b7bddf7d1d7dd0d1b15b1", "siz...
import copy from auto_gen import DBAbstraction as _DBAbstraction from auto_gen import DBAbstractionRef, DBModule from id_scope import IdScope class DBAbstraction(_DBAbstraction): def __init__(self, *args, **kwargs): _DBAbstraction.__init__(self, *args, **kwargs) self.idScope = IdScope(remap={DBAbstraction...
{ "content_hash": "7e3f38c5609c0acc9ec35a39e2b94890", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 80, "avg_line_length": 38.7, "alnum_prop": 0.6795865633074936, "repo_name": "CMUSV-VisTrails/WorkflowRecommendation", "id": "f625642ce6589439919c48428d1b2c85ad12ba1c", "siz...
from setuptools import setup, find_packages setup( name = "django_ajax", version = "0.2.0", description = 'Utility app to support AJAX development in Django', author = 'David Danier', author_email = 'david.danier@team23.de', url = 'https://github.com/ddanier/django_ajax', long_description=o...
{ "content_hash": "53d1d1cabbadb0136e7b9d77718d2ef9", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 70, "avg_line_length": 29.517241379310345, "alnum_prop": 0.5864485981308412, "repo_name": "ddanier/django_ajax", "id": "6eedd0cf1b1163d41ee82847d78d4e1c8ff3a7ad", "size": "...
""" Phil Adams http://philadams.net PNG file parser. """ import logging import struct SIGNATURE = ('\211PNG\r\n\032\n') class Chunk(object): """A PNG Chunk is composed of 4 fields: - a length (4 byte unsigned int) - a type (4 bytes, chars) - data (length bytes, various) - crc (...
{ "content_hash": "b35ecb5c84e20c124e6b1daf45f1a3ca", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 75, "avg_line_length": 30.658536585365855, "alnum_prop": 0.5302307080350039, "repo_name": "philadams/dimensions", "id": "90cb52e106e38bc68ea5004b8d0868989c12e0fb", "size": ...
import anyjson from urllib import urlencode from nose.tools import eq_ from allmychanges.models import Changelog, Preview from django.test import Client from django.core.urlresolvers import reverse from allmychanges.tasks import _task_log from .utils import (refresh, check_status_code, create_user, ...
{ "content_hash": "12eb97ad47feb19e768d24b74919ec50", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 95, "avg_line_length": 33.59615384615385, "alnum_prop": 0.6077084525853844, "repo_name": "AllMyChanges/allmychanges.com", "id": "2db130f5fa7b9d25f98278c24273da0d7f4e9891", ...
from typing import Dict, List, Optional, Union import numpy as np from ConfigSpace.configuration_space import ConfigurationSpace from autosklearn.constants import ( BINARY_CLASSIFICATION, MULTICLASS_CLASSIFICATION, MULTILABEL_CLASSIFICATION, MULTIOUTPUT_REGRESSION, REGRESSION_TASKS, ) from autoskl...
{ "content_hash": "d6afe08fdf456e04a4cd0e649425aa08", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 87, "avg_line_length": 32.89375, "alnum_prop": 0.6963708911267338, "repo_name": "automl/auto-sklearn", "id": "f0a66a2a86c0f3dcb051b1acf2f0994e412b600d", "size": "5289", ...
from drc_utils import *
{ "content_hash": "10006e3782a9699eaf76c83af1fed217", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 23, "avg_line_length": 24, "alnum_prop": 0.75, "repo_name": "openhumanoids/oh-distro", "id": "ff44f8a945114376d77a9bcfcbab7bb0b69aacd3", "size": "24", "binary": false, "...
import django.core.validators from django.db import migrations, models import django.db.models.deletion import django.utils.timezone import libya_elections.libya_bread import libya_elections.phone_numbers class Migration(migrations.Migration): initial = True dependencies = [ ('register', '0001_initi...
{ "content_hash": "3c48be351fcf9a405ae0c712ace9057f", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 204, "avg_line_length": 75.87931034482759, "alnum_prop": 0.6520109066121336, "repo_name": "SmartElect/SmartElect", "id": "9b17a86624286888651dd75e507dd199428596b8", "size"...
import os from setuptools import setup # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ... def read(fname): return open(os.path.join(...
{ "content_hash": "f8bd7a6d7d9cd07d3f74e5a60551839e", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 101, "avg_line_length": 34.7037037037037, "alnum_prop": 0.6307363927427961, "repo_name": "eruffaldi/pyxcal3d", "id": "9a556bbb2e260e8fb10c4ba99f59780c08825257", "size": "93...
from __future__ import nested_scopes from _pydev_imps._pydev_saved_modules import threading import os def set_trace_in_qt(): from _pydevd_bundle.pydevd_comm import get_global_debugger debugger = get_global_debugger() if debugger is not None: threading.current_thread() # Create the dummy thread fo...
{ "content_hash": "29c525d5af04ed5dc2bfb4353e2cf21e", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 109, "avg_line_length": 34.46153846153846, "alnum_prop": 0.5862165178571429, "repo_name": "zdary/intellij-community", "id": "f9e7e36aff7d59e3396a4237400597745a2e4c7b", "si...
from django.core.management.base import BaseCommand, CommandError from annotations.models import Corpus, Document, Language from annotations.exports import export_annotations_inline from core.utils import CSV, XLSX class Command(BaseCommand): help = 'Exports Annotations for the given Corpus and Languages (one fi...
{ "content_hash": "28d355065f4a980211ce2765e9ea1c7c", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 116, "avg_line_length": 50, "alnum_prop": 0.6464, "repo_name": "UUDigitalHumanitieslab/timealign", "id": "413fb4ebcc932a3060098cf2d5fd8f617358b14e", "size": "2525", "bina...
import unittest import reactivex from reactivex import operators as ops from reactivex.testing import ReactiveTest, TestScheduler on_next = ReactiveTest.on_next on_completed = ReactiveTest.on_completed on_error = ReactiveTest.on_error subscribe = ReactiveTest.subscribe subscribed = ReactiveTest.subscribed disposed = ...
{ "content_hash": "b8db4997896e8d0a0052aa4d786b175b", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 88, "avg_line_length": 32.134078212290504, "alnum_prop": 0.5916203059805285, "repo_name": "ReactiveX/RxPY", "id": "d672e9e02fca0fc3013710829457574388211dc5", "size": "5752...
import mox import shutil import sys import tempfile from nova import context from nova import db from nova.db.sqlalchemy import models from nova import exception from nova.network import linux_net from nova.network import manager as network_manager from nova.openstack.common import importutils from nova.openstack.comm...
{ "content_hash": "77aaa0632b7964228285ace8800c8e9f", "timestamp": "", "source": "github", "line_count": 1949, "max_line_length": 79, "avg_line_length": 42.670087224217546, "alnum_prop": 0.5494444711654081, "repo_name": "paulmathews/nova", "id": "f27a17658d3624dff607f973851e5f6efb13ce79", "size": "8...
""" Support for interfacing with the XBMC/Kodi JSON-RPC API. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/media_player.kodi/ """ import asyncio from collections import OrderedDict from functools import wraps import logging import re import socket impor...
{ "content_hash": "2f33f8e267b4881fc72671fab1b34a3f", "timestamp": "", "source": "github", "line_count": 970, "max_line_length": 79, "avg_line_length": 35.59484536082474, "alnum_prop": 0.5902916558056014, "repo_name": "PetePriority/home-assistant", "id": "f8d0cdc5a12cf2ba47bdef3d4500b17dc004d009", "...
import re import os.path from HTMLParser import HTMLParser class StudentHTMLParser(HTMLParser): def __init__(self, page_path): HTMLParser.__init__(self) self.content = "" self.page_path = page_path.replace("‾","~") self.page_title = "" self.page_size = os.path.getsize(page_p...
{ "content_hash": "8af4c08f410aa3bd8f111049936b1347", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 166, "avg_line_length": 34.95454545454545, "alnum_prop": 0.5695708712613784, "repo_name": "supertask/KSUHack", "id": "c173bc2ea1c7c16264ce5f097ce34212093404ea", "size": "15...
AUTHOR = 'Durham 2nd Ward' SITENAME = 'Scriptures of the Restoration' DESCRIPTION = '' SITEURL = '' PATH = 'content' TIMEZONE = 'America/New_York' DEFAULT_DATE_FORMAT = '%Y-%m-%d' DEFAULT_LANG = 'en' TYPOGRIFY = True # Nice typographic things TYPOGRIFY_IGNORE_TAGS = ['h1'] GOOGLE_ANALYTICS = '' # ---------------...
{ "content_hash": "20290a8e9fb9f44152112d530547d8a3", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 63, "avg_line_length": 20.471264367816094, "alnum_prop": 0.6047164514317799, "repo_name": "andrewheiss/scripturesrestoration", "id": "d9d76540e05ab41afd3f8671442c02f4311eaf27...
import argparse # pylint: disable=superfluous-parens # pylint: disable=broad-except import importlib import logging import sys from rdr_service.tools.tool_libs import GCPProcessContext from rdr_service.services.gcp_utils import gcp_get_app_access_token, gcp_get_app_host_name from rdr_service.services.system_utils imp...
{ "content_hash": "864a2160bdd4e97300b60d32bf629719", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 116, "avg_line_length": 34.698113207547166, "alnum_prop": 0.6076672104404568, "repo_name": "all-of-us/raw-data-repository", "id": "c7f0209504efc83468c0e2d23d44426bc2910bb2",...
from google.analytics import data_v1beta async def sample_get_metadata(): # Create a client client = data_v1beta.BetaAnalyticsDataAsyncClient() # Initialize request argument(s) request = data_v1beta.GetMetadataRequest( name="name_value", ) # Make the request response = await clie...
{ "content_hash": "1d81abbea31d45fb3fc0472f2b3bb2a9", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 74, "avg_line_length": 25.05263157894737, "alnum_prop": 0.7205882352941176, "repo_name": "googleapis/python-analytics-data", "id": "f450aed282b02988fc8dfd4bef7c19e213a56a38",...
import numpy as np from functools import reduce import scipy.ndimage as nd from lucid.misc.channel_reducer import ChannelReducer import lucid.optvis.param as param import lucid.optvis.objectives as objectives import lucid.optvis.render as render import lucid.optvis.transform as transform from .attribution import get_ac...
{ "content_hash": "96465271a60a6d50d74147db5e0b7190", "timestamp": "", "source": "github", "line_count": 302, "max_line_length": 88, "avg_line_length": 41.764900662251655, "alnum_prop": 0.5376991992388805, "repo_name": "tensorflow/lucid", "id": "0ff3459d13d0cb721e7600e091e62a663c800378", "size": "12...
import os import signal import subprocess from behave import given, when, then from test.behave_utils import utils def _run_sql(sql, opts=None): env = None if opts is not None: env = os.environ.copy() options = '' for key, value in opts.items(): options += "-c {}={} ".fo...
{ "content_hash": "5a72b25e91b83d64940daa71bca4f120", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 80, "avg_line_length": 27.554347826086957, "alnum_prop": 0.5692307692307692, "repo_name": "jmcatamney/gpdb", "id": "47627411dd25bfe5da8f4d149a9e4b5471aa12bb", "size": "2535...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('todo', '0007_auto_20170825_1748'), ] operations = [ migrations.RenameField( model_name='item', old_name='username', new_...
{ "content_hash": "4b328e399c6c54f161dfb2d8b936fc5b", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 44, "avg_line_length": 19.444444444444443, "alnum_prop": 0.5657142857142857, "repo_name": "noah-dev/todo_django", "id": "5d3665c2f66442537f021178dd09863d827a9ba3", "size": ...
"""Special argparse module that allows to bypass abbrev mode.""" from __future__ import absolute_import from argparse import * # noqa import sys if sys.version_info < (3, 5): class ArgumentParser(ArgumentParser): # noqa def __init__(self, *args, **kwargs): self.allow_abbrev = kwargs.pop("al...
{ "content_hash": "601b0f666e4e8ad1fc06eb3c9963518d", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 70, "avg_line_length": 34.5, "alnum_prop": 0.6038647342995169, "repo_name": "dtroyer/cliff", "id": "e48dc796e9e1624f9a928ec64adbefcb17898177", "size": "1176", "binary": f...
""" Created by: Lee Bergstrand Description: Contains an object for representing HMM hits and methods for parsing hmmsearch results into these objects. Also contains methods filtering these objects by their properties. Requirements: - This script requires HMMER 3.1 or later. """ # Imports & Setup: import re ...
{ "content_hash": "3fecef4253e3c4b21733ab03b9b30023", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 113, "avg_line_length": 33.27906976744186, "alnum_prop": 0.6257861635220126, "repo_name": "LeeBergstrand/HMMER-DB", "id": "4bc92a331b74b386d37bbd1e93fdba9141c82131", "size...
''' feature selection STRATEGY is implemented here inputs : X, y, feature ranking vector, indices of the features accroding to the ranking Author : Akhil P M ''' def select_features(X, importances, indices): #STRATEGY : select features having importance greater than some threshold need = (importances > 0.0004...
{ "content_hash": "ed26b446128843d6b0251d9459fd1176", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 87, "avg_line_length": 20.433333333333334, "alnum_prop": 0.7259380097879282, "repo_name": "akhilpm/Masters-Project", "id": "7c111800aea813217e68cbe3f70370dfb51aaa4e", "size...
import copy import datetime import mock from mistral.db.v2 import api as db_api from mistral.db.v2.sqlalchemy import models from mistral import exceptions as exc from mistral.tests.unit.api import base from mistral import utils WF_DEFINITION = """ --- version: '2.0' flow: type: direct input: - param1 task...
{ "content_hash": "482fa63f7b60cd7e04938566e08151a9", "timestamp": "", "source": "github", "line_count": 439, "max_line_length": 79, "avg_line_length": 27.624145785876994, "alnum_prop": 0.5982518347489074, "repo_name": "dennybaa/mistral", "id": "66fdd7fe32fab5e7aa1a3dbfc232b1084f37b937", "size": "12...
import array import zipfile import numpy as np import scipy.sparse as sp from binge.data import _common URL_100K = ('https://github.com/maciejkula/' 'lightfm_datasets/releases/' 'download/v0.1.0/movielens.zip') URL_1M = ('http://files.grouplens.org/datasets/movielens/ml-1m.zip') def _read...
{ "content_hash": "2967cfb77ee2da17851dd60c966ac845", "timestamp": "", "source": "github", "line_count": 203, "max_line_length": 89, "avg_line_length": 30.72906403940887, "alnum_prop": 0.5564283424174414, "repo_name": "maciejkula/binge", "id": "d95fea3d25f7d77fd7d6f2f12e0d204d593624e5", "size": "623...
''' @author: FangSun ''' import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.test_state as test_state import hot_plug_common import zstackwoodpecker.operations.vm_operations as vm_ops import time _config_ = { 'timeout': 1000, 'noparallel' : False } test_stub = test_lib.lib_get...
{ "content_hash": "92a9941634e28031eca21e59167f0acd", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 103, "avg_line_length": 35.642857142857146, "alnum_prop": 0.7120908483633934, "repo_name": "zstackio/zstack-woodpecker", "id": "ef0e7ad22279657cc382e4fa41f6c17f10867fff", "...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Event.registration_is_open' db.add_column(u'sked_event', 'registration_is_open', self.gf('djan...
{ "content_hash": "05cc9839217db3df1b11e152c380ec72", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 187, "avg_line_length": 71.56140350877193, "alnum_prop": 0.5519735229222849, "repo_name": "sunlightlabs/tcamp", "id": "1c59da304c69bebfc7e1f0fd3167da8ba738c8ce", "size": "...
"""Create accounts needed on this GCE instance. Creates accounts based on the contents of ACCOUNTS_URL, which should contain a newline-delimited file of accounts and SSH public keys. Each line represents a SSH public key which should be allowed to log in to that account. If the account does not already exist on the s...
{ "content_hash": "aa1fa9f2f1296e946c036474b46b9ef9", "timestamp": "", "source": "github", "line_count": 383, "max_line_length": 79, "avg_line_length": 32.59791122715405, "alnum_prop": 0.6470164197036443, "repo_name": "coreos/compute-image-packages", "id": "6f970c41e303ab3fdc8e1a336bc7a672a09662dc", ...
from mistral.api import app application = app.init_wsgi()
{ "content_hash": "ea5b1451071dba1a8dc6fa1c9b1a76ff", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 29, "avg_line_length": 19.666666666666668, "alnum_prop": 0.7627118644067796, "repo_name": "StackStorm/mistral", "id": "27866f0c1a82e0a2d2b9d50087c297ae5be8f37c", "size": "66...
from traitlets import default from .baseapp import NbGrader, nbgrader_aliases, nbgrader_flags from ..exchange import Exchange, ExchangeFetchAssignment, ExchangeError aliases = {} aliases.update(nbgrader_aliases) aliases.update({ "timezone": "Exchange.timezone", "course": "CourseDirectory.course_id", }) flag...
{ "content_hash": "7b62c3595b9adbdeb673a7f5c9c59097", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 112, "avg_line_length": 34.33653846153846, "alnum_prop": 0.6118734248109773, "repo_name": "jhamrick/nbgrader", "id": "a2edcbcccbbde7ea2ba84fb05c4e311b35ccfb77", "size": "3...
""" Platform for the Garadget cover component. For more details about this platform, please refer to the documentation https://home-assistant.io/components/garadget/ """ import logging import requests import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.components.cover im...
{ "content_hash": "fa3a9d005dc46dd9f9e250df58413e35", "timestamp": "", "source": "github", "line_count": 269, "max_line_length": 77, "avg_line_length": 33.405204460966544, "alnum_prop": 0.5835744491431115, "repo_name": "happyleavesaoc/home-assistant", "id": "457312c8a4a58271163b9cf4adb244852c58977e", ...