text stringlengths 4 1.02M | meta dict |
|---|---|
import web
from nailgun.extensions import get_all_extensions
from nailgun.api.v1.handlers.assignment import NodeAssignmentHandler
from nailgun.api.v1.handlers.assignment import NodeUnassignmentHandler
from nailgun.api.v1.handlers.capacity import CapacityLogCsvHandler
from nailgun.api.v1.handlers.capacity import Capa... | {
"content_hash": "4638a4594dfc637d9adc25bb774dde06",
"timestamp": "",
"source": "github",
"line_count": 354,
"max_line_length": 79,
"avg_line_length": 36.49152542372882,
"alnum_prop": 0.7243381328379006,
"repo_name": "SmartInfrastructures/fuel-web-dev",
"id": "61701af8fe81122250ff4feaad0d922683230ee6... |
"""Helper utilty function for customization."""
import sys
import os
import docutils
import subprocess
if os.environ.get('READTHEDOCS', None) == 'True':
subprocess.call('cd ..; rm -rf recommonmark;' +
'git clone https://github.com/tqchen/recommonmark', shell=True)
sys.path.insert(0, os.path.ab... | {
"content_hash": "85aa6ad5289df21e173ffed80841eb5e",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 83,
"avg_line_length": 31.466666666666665,
"alnum_prop": 0.7288135593220338,
"repo_name": "mlperf/training_results_v0.6",
"id": "f6a33ffa375dcd96164a20c32970fb4cf29a6c0a",
... |
"""
Copyright (c) 2017 SONATA-NFV and Paderborn University
ALL RIGHTS RESERVED.
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 ap... | {
"content_hash": "e1dc6c0f8ad4a9bcea62f6e466d38b2f",
"timestamp": "",
"source": "github",
"line_count": 948,
"max_line_length": 121,
"avg_line_length": 42.67299578059072,
"alnum_prop": 0.48573688634004053,
"repo_name": "stevenvanrossem/son-emu",
"id": "7495076e481c59236c8b7106cd2b64a8c8a3633b",
"si... |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def ProfileChangedEvent(vim, *args, **kwargs):
'''This event records that the profile has ... | {
"content_hash": "58454f65cf6e72954153929792383409",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 124,
"avg_line_length": 35.06060606060606,
"alnum_prop": 0.5972342264477096,
"repo_name": "xuru/pyvisdk",
"id": "095290ecefff761a98ce433a0da418d63405bdaa",
"size": "1158",
... |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_... | {
"content_hash": "0b02de028f61ad7a2fc7d2ecfda7c87b",
"timestamp": "",
"source": "github",
"line_count": 254,
"max_line_length": 561,
"avg_line_length": 31.614173228346456,
"alnum_prop": 0.712079701120797,
"repo_name": "benfinke/ns_python",
"id": "4f58dd9d5cb6df26ba9c00d10e2447999d512107",
"size": "... |
from conans.model.conan_file import ConanFile
from conans.model.options import Options
from conans.model.settings import Settings
from conans.client.cmake import CMake
from conans.client.gcc import GCC
from conans.client.configure_environment import ConfigureEnvironment
from conans.util.files import load
import os
# c... | {
"content_hash": "df69d86fb56e753f9b1f3cdd0b24ed95",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 71,
"avg_line_length": 34.333333333333336,
"alnum_prop": 0.8135922330097087,
"repo_name": "Xaltotun/conan",
"id": "8670f1b582d3f8a5fd6953e74ce01b9de2911a9b",
"size": "581",... |
"""Utility for reading / writing command-line flag files on device(s)."""
from __future__ import print_function
import argparse
import logging
import sys
import devil_chromium
from devil.android import device_errors
from devil.android import device_utils
from devil.android import flag_changer
from devil.android.too... | {
"content_hash": "a64b90eb62405e4623e5c3bf966940d4",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 80,
"avg_line_length": 34.096774193548384,
"alnum_prop": 0.6830652790917692,
"repo_name": "ric2b/Vivaldi-browser",
"id": "3fd16db83ed5b1fcd73d7142af68dc9c823352d3",
"size":... |
"""Test LayoutJson"""
# pylint: disable=R1710
# standard library
import json
import os
import shutil
from pathlib import Path
# third-party
from deepdiff import DeepDiff
# first-party
from tcex.app_config.install_json import InstallJson
from tcex.app_config.layout_json import LayoutJson
from tcex.app_config.models.la... | {
"content_hash": "1e305db17c319e1bc414a3baccf8de69",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 99,
"avg_line_length": 34.80487804878049,
"alnum_prop": 0.5828661527680449,
"repo_name": "ThreatConnect-Inc/tcex",
"id": "5298fae647ae94c0ade1198014c745be75c18109",
"size"... |
import sys
import csv
import datetime
from operator import itemgetter
from optparse import OptionParser, OptionGroup
VERSION = "0.0.3"
class MaskGen:
def __init__(self):
# Masks collections with meta data
self.masks = dict()
self.target_time = None
self.output_file = None
... | {
"content_hash": "7f5b9c0e671c497a2635ef660b0c87aa",
"timestamp": "",
"source": "github",
"line_count": 285,
"max_line_length": 148,
"avg_line_length": 47.03859649122807,
"alnum_prop": 0.6098761748470833,
"repo_name": "iphelix/pack",
"id": "30aef4dd5003a7579518b5efb693f0b745998f53",
"size": "13690"... |
"""
Image interface.
"""
from six.moves.urllib import parse
from novaclient import base
class Image(base.Resource):
"""
An image is a collection of files used to create or rebuild a server.
"""
HUMAN_ID = True
def __repr__(self):
return "<Image: %s>" % self.name
def delete(self):
... | {
"content_hash": "d85fa3af0d6d41d3fddf0868e056e453",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 78,
"avg_line_length": 27.619565217391305,
"alnum_prop": 0.5521448248720976,
"repo_name": "mat128/python-novaclient",
"id": "32001b465b43095414d6905b81822d08d642efde",
"siz... |
import httplib
import urllib
import socket
class ToolProtocolHTTP(object):
"""
HTTP/HTTPS client for TEMA MBT protocol. Discusses with the TEMA test engine.
"""
# is client connected to the server
isConnected = False
def __init__(self):
self.host = "localhost"
self.port ... | {
"content_hash": "c6a390602ab8ce8e1a6602548dbbdcb9",
"timestamp": "",
"source": "github",
"line_count": 240,
"max_line_length": 118,
"avg_line_length": 30.675,
"alnum_prop": 0.47324096712849767,
"repo_name": "tema-mbt/tema-adapterlib",
"id": "0bb8ab7a7e536f796cfe3d7e218e345017e9a8cb",
"size": "8508... |
from CIM15.IEC61970.OperationalLimits.OperationalLimit import OperationalLimit
class CurrentLimit(OperationalLimit):
"""Operational limit on current.Operational limit on current.
"""
def __init__(self, value=0.0, CurrentLimitSet=None, *args, **kw_args):
"""Initialises a new 'CurrentLimit' instance... | {
"content_hash": "43a7fa529965583064e7cbda24ddfe26",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 83,
"avg_line_length": 32.116279069767444,
"alnum_prop": 0.6422881969587255,
"repo_name": "rwl/PyCIM",
"id": "0e1248c2595d3afe98c2f8b5632dfc93285c49dd",
"size": "2481",
"... |
import os
import sys
import unittest
try:
sys.path.insert(0, os.path.abspath('..')) #Works for local
from sheetmaker import html_builder
from data import test_html_constants
except:
sys.path.insert(0, os.path.abspath('.')) #Works for Travis CI
from sheetmaker import html_builder
from data impo... | {
"content_hash": "f69baadccf542f40915c5cf82c448132",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 112,
"avg_line_length": 37.285714285714285,
"alnum_prop": 0.6331417624521073,
"repo_name": "cosme12/cheatsheet-maker",
"id": "15b9e4d15e60bf8d726b8a8005bf1269fb8964cc",
"si... |
from sklearn2sql_heroku.tests.classification import generic as class_gen
class_gen.test_model("SVC_poly" , "BinaryClass_100" , "mssql")
| {
"content_hash": "332b6b33443d10efcceff4d308f2547b",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 72,
"avg_line_length": 34.5,
"alnum_prop": 0.7681159420289855,
"repo_name": "antoinecarme/sklearn2sql_heroku",
"id": "e519b3be4097bf01b7f7f33318c4d16875af3ac6",
"size": "138... |
"""
pbm.views
"""
import logging
import json
import pytz
from datetime import datetime, timedelta
from django.db.models import Count, Sum
from django.shortcuts import render_to_response, render
from django.template import RequestContext, loader
from django.http import HttpResponse
from django.template.loader ... | {
"content_hash": "8b6d58d89887237ad6a2a0da60de975c",
"timestamp": "",
"source": "github",
"line_count": 554,
"max_line_length": 126,
"avg_line_length": 35.72924187725632,
"alnum_prop": 0.5939678690512277,
"repo_name": "SergeyPod/tmpCore",
"id": "9280ce71a484221588301ef4ea7b1dfe942f2136",
"size": "1... |
"""AR-specific Form helpers."""
from __future__ import unicode_literals
from django.forms import ValidationError
from django.forms.fields import CharField, RegexField, Select
from django.utils.translation import ugettext_lazy as _
from localflavor.compat import EmptyValueCompatMixin
from .ar_provinces import PROVIN... | {
"content_hash": "ac8e011f58d79609e13f5ea8f73fb582",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 101,
"avg_line_length": 36.7720207253886,
"alnum_prop": 0.5956037762434832,
"repo_name": "thor/django-localflavor",
"id": "f30cb9200d6435d127f844a260511591f478165d",
"size... |
"""
Kubernetes Job wrapper for Luigi.
From the Kubernetes website:
Kubernetes is an open-source system for automating deployment, scaling,
and management of containerized applications.
For more information about Kubernetes Jobs: http://kubernetes.io/docs/user-guide/jobs/
Requires:
- pykube: ``pip install p... | {
"content_hash": "857939ceccdb8a95ccec054e5648008d",
"timestamp": "",
"source": "github",
"line_count": 365,
"max_line_length": 122,
"avg_line_length": 35.224657534246575,
"alnum_prop": 0.5704285603173369,
"repo_name": "soxofaan/luigi",
"id": "1b8bd90fe658dad668231655b17b9035c76dd7ed",
"size": "134... |
"""
sphinx.pycode
~~~~~~~~~~~~~
Utilities parsing and analyzing Python code.
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
import re
import sys
from os import path
from six import iteritems, text... | {
"content_hash": "c186739c2964a3b4236e1bc1cec3476e",
"timestamp": "",
"source": "github",
"line_count": 364,
"max_line_length": 84,
"avg_line_length": 37.26648351648352,
"alnum_prop": 0.5643936601548102,
"repo_name": "neerajvashistha/pa-dude",
"id": "3da887d6cf2538610b5c2a137e70d5b6753be925",
"size... |
from __future__ import absolute_import, unicode_literals
from collections import namedtuple
import unittest
from six import string_types
from dockermap.functional import lazy, register_type, uses_type_registry, LazyOnceObject, resolve_value, resolve_deep
LOOKUP_DICT = {
'a': '/test/path_a',
'b': '/test/path_... | {
"content_hash": "7cd67e1b12f50f1944b1967b702e4036",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 117,
"avg_line_length": 33.64035087719298,
"alnum_prop": 0.5783572359843546,
"repo_name": "merll/docker-map",
"id": "ca18b7b33d8321e60fff577fd1d198fa2392bdf8",
"size": "38... |
from collections import defaultdict
from collections import OrderedDict
import copy
import logging
import types
import warnings
from django.conf import settings
from django.core import urlresolvers
from django import shortcuts
from django.template.loader import render_to_string # noqa
from django.utils.functional imp... | {
"content_hash": "b21275e583679f42c37007efe4b1c3be",
"timestamp": "",
"source": "github",
"line_count": 974,
"max_line_length": 79,
"avg_line_length": 39.43839835728953,
"alnum_prop": 0.6114075963866399,
"repo_name": "Mirantis/mos-horizon",
"id": "7d89cd53260b1a7e23d0b2681335f29273bee8f3",
"size": ... |
"""
Unified interfaces to minimization algorithms.
Functions
---------
- minimize : minimization of a function of several variables.
- minimize_scalar : minimization of a function of one variable.
"""
from __future__ import division, print_function, absolute_import
__all__ = ['minimize', 'minimize_scalar']
from wa... | {
"content_hash": "ff9a86322d01459c1ca372902ab8420c",
"timestamp": "",
"source": "github",
"line_count": 619,
"max_line_length": 89,
"avg_line_length": 42.7075928917609,
"alnum_prop": 0.6385988803147223,
"repo_name": "kalvdans/scipy",
"id": "7cb054466f522748bef751483052457165185925",
"size": "26436"... |
from time import sleep
from threading import Thread, Barrier
# parties - 1 = parties_to_wait_for = 1
b = Barrier(2)
def task1(b):
sleep(2)
print('first')
b.wait()
print('first done')
def task2(b):
b.wait()
print('second')
Thread(target=task1, args=(b,)).start()
task2(b)
print('finished!')
| {
"content_hash": "377d584d7e7ac690b9bd06fdb376d383",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 39,
"avg_line_length": 15.95,
"alnum_prop": 0.6269592476489029,
"repo_name": "sevaivanov/various",
"id": "c2a9757a3f7aff3640dc88e80f4600e0a7d275f4",
"size": "339",
"binar... |
""" This example demonstrates rendering a color volume.
This example demonstrates two render styles. Note that
all render styles are capable of rendering color data.
"""
import numpy as np
import visvis as vv
app = vv.use()
# Use vv.aVolume to create random bars for each color plane
N = 64
vol = np.empty((N,N,N,3), d... | {
"content_hash": "9129a24f6aa4b32c639bf28de51244be",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 59,
"avg_line_length": 23.566666666666666,
"alnum_prop": 0.6775106082036775,
"repo_name": "almarklein/visvis.dev",
"id": "0040c58b5dcbe5a978a2bb28652ac8b198772471",
"size":... |
import cherrypy
from cherrypy.lib import auth_digest
from cherrypy.test import helper
class DigestAuthTest(helper.CPWebCase):
def setup_server():
class Root:
def index(self):
return "This is public."
index.exposed = True
class DigestProtected:
... | {
"content_hash": "bb57ac395a10350b7dff35d1c54c2251",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 77,
"avg_line_length": 37.1044776119403,
"alnum_prop": 0.5104585679806919,
"repo_name": "clausqr/HTPC-Manager",
"id": "b46698d94ccd237b0c6a2007ebef40acf27df6d3",
"size": "... |
from __future__ import unicode_literals
from prompt_toolkit.contrib.regular_languages.lexer import GrammarLexer
from prompt_toolkit.lexers import PygmentsLexer, SimpleLexer
from pygments.lexers import BashLexer
from .grammar import COMMAND_GRAMMAR
__all__ = (
'create_command_lexer',
)
def create_command_lexer(... | {
"content_hash": "c4e20de17890ce390f1faa5c329f8a2b",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 71,
"avg_line_length": 28.136363636363637,
"alnum_prop": 0.7189014539579968,
"repo_name": "jonathanslenders/pyvim",
"id": "2dd780771dcdfdbdfc44537c348c50a0685f4a06",
"size"... |
"""
This is awesome. And needs more documentation.
To bring some light in the big number of classes in this file:
First there are:
* ``SuperForm``
* ``SuperModelForm``
They are the forms that you probably want to use in your own code. They are
direct base classes of ``django.forms.Form`` and ``django.forms.ModelFor... | {
"content_hash": "3d026e2d2ebdd0c59dbbf4d6745be8c2",
"timestamp": "",
"source": "github",
"line_count": 395,
"max_line_length": 79,
"avg_line_length": 34.86582278481013,
"alnum_prop": 0.6363636363636364,
"repo_name": "gregmuellegger/django-superform",
"id": "13fe99e026ac37434b98a9bf272bb0df646667d3",... |
"""
Plugin responsible for managing SSL options
"""
import os
from OpenSSL import crypto
from socket import gethostname
from packstack.installer import basedefs
from packstack.installer import utils
from packstack.installer import validators
from packstack.modules.documentation import update_params_usage
# --------... | {
"content_hash": "204c94461f7a298b3cc042dc65157107",
"timestamp": "",
"source": "github",
"line_count": 279,
"max_line_length": 88,
"avg_line_length": 39.40860215053763,
"alnum_prop": 0.5396089131423374,
"repo_name": "mahak/packstack",
"id": "31ce2e621a91c23b3596ac71577d2454a70b511f",
"size": "1156... |
from __future__ import absolute_import
import mock
from datetime import datetime
from bokeh.core.properties import field, value
from bokeh.core.validation import check_integrity
from bokeh.models.annotations import (
Legend, LegendItem, ColorBar, Arrow, BoxAnnotation, Span, LabelSet, Label,
Title, Band, Whiske... | {
"content_hash": "aedc194612f0f129194bc6fdac108d0c",
"timestamp": "",
"source": "github",
"line_count": 464,
"max_line_length": 101,
"avg_line_length": 30.28448275862069,
"alnum_prop": 0.5982066609735269,
"repo_name": "mindriot101/bokeh",
"id": "ab95e41c5fa31a2a2a760d5731785867be778c72",
"size": "1... |
import os
from setuptools import setup, find_packages
__version__ = "0.6.5"
NAME = 'tensorpac'
AUTHOR = "Etienne Combrisson"
MAINTAINER = "Etienne Combrisson"
EMAIL = 'e.combrisson@gmail.com'
KEYWORDS = "phase-amplitude coupling pac tensor oscillation meg eeg python"
DESCRIPTION = "Tensor-based Phase-Amplitude Couplin... | {
"content_hash": "42fb40acd3efc7f529b4f51e7e3b2b6e",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 75,
"avg_line_length": 30.574074074074073,
"alnum_prop": 0.6165960024227741,
"repo_name": "EtienneCmb/tensorpac",
"id": "10924be6163900534aa4a20480bfe2dfa5b2e538",
"size": ... |
import logging
from os import path
from typing import List, Optional
from dogebuild.dogefile_internals.dependencies import Dependency
from .common import DOGE_FILE
def resolve_dependency_tree(dependencies: List[Dependency], parents: List[str] = None) -> List[Dependency]:
if not parents:
parents = []
... | {
"content_hash": "3445b01fb9ff955c7690ba3124f9ae59",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 107,
"avg_line_length": 28.976190476190474,
"alnum_prop": 0.6425636811832375,
"repo_name": "dogebuild/dogebuild",
"id": "c26a4231b9f9fab2a3d5442529f2ff40432b8515",
"size": ... |
"""
Created on 25.02.2011
@author: vda
"""
import os
import datetime
import zipfile
from PyQt4 import QtCore, QtGui
from ui.gui.radiancebackupdialog import Ui_RBackupDialog
from settings import settings
from logic.misc.pyfs import recursive_glob
class RBackupDialog(QtGui.QDialog):
def __init__(self, parent=No... | {
"content_hash": "eb53c06484864856af72d5af1676c24b",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 90,
"avg_line_length": 36.026315789473685,
"alnum_prop": 0.5682980277574872,
"repo_name": "tetra5/radiance",
"id": "d589d598cae503872c85a8c91e118f9b20033d21",
"size": "2814... |
import matplotlib.pyplot as pp
import math, numpy as np
import roslib; roslib.load_manifest('hrl_lib')
import tf
import hrl_lib.util as ut
import hrl_lib.transforms as tr
import hrl_lib.matplotlib_util as mpu
from mpl_toolkits.mplot3d import Axes3D
def cody_stretch_to_angle(medium_stretch, full_stretch):
cody... | {
"content_hash": "dc7b90370943bef1ab0559aa2b11c0a9",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 63,
"avg_line_length": 24.023255813953487,
"alnum_prop": 0.6505324298160697,
"repo_name": "tapomayukh/projects_in_python",
"id": "c9bf1514584261c477f7930158825046a8e49b0e",
... |
"""AdaMatch
"""
import os
import sys
from typing import Callable
import jax
import jax.numpy as jn
import objax
from absl import app
from absl import flags
from absl.flags import FLAGS
from objax.functional import stop_gradient
from objax.typing import JaxArray
from domain_adaptation.lib.data import MixData, CTAData
... | {
"content_hash": "f80c3d2f53ea0a00138e05e6af8f0d45",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 115,
"avg_line_length": 52.22641509433962,
"alnum_prop": 0.6040462427745664,
"repo_name": "google-research/adamatch",
"id": "8f486ddd06b4173f89411bf15bdd73d8369130dc",
"si... |
import posixpath
import re
from telemetry.timeline import event as timeline_event
class MmapCategory(object):
_DEFAULT_CATEGORY = None
def __init__(self, name, file_pattern, children=None):
"""A (sub)category for classifying memory maps.
Args:
name: A string to identify the category.
file_p... | {
"content_hash": "87d8af35a7e513e252345ed5c79608a5",
"timestamp": "",
"source": "github",
"line_count": 335,
"max_line_length": 79,
"avg_line_length": 37.70746268656716,
"alnum_prop": 0.6451076630778974,
"repo_name": "SummerLW/Perf-Insight-Report",
"id": "4e416f3129335db7f62ca49b8e591e7ca99e88cf",
... |
from pycket import impersonators as imp
from pycket import values
from pycket import vector as values_vector
from pycket.cont import continuation, label, loop_label
from pycket.error import SchemeException
from pycket.prims.expose import unsafe, default, expose, subclass_unsafe
from rpython.rlib import jit
@expose("ve... | {
"content_hash": "f4f87efad6eb160f7a7be28f69e1e4e6",
"timestamp": "",
"source": "github",
"line_count": 212,
"max_line_length": 104,
"avg_line_length": 38.84905660377358,
"alnum_prop": 0.6741136474016513,
"repo_name": "vishesh/pycket",
"id": "d0bcab96830e15c26d17165a4d8dfce5d360de84",
"size": "8284... |
"""Implements natural language parsers.
This module provides two types of natural language parsers:
1. ConceptualParser, a conceptual, frame-based parser in the style of
Charles Martin's Direct Memory Access Parser.
2. IndexedConceptParser, a less strict parser based on the parser in
Will Fitzgerald's thesis 'Buildi... | {
"content_hash": "b1a0e0fd1d5c1e0d7b8164f89d8dcc3b",
"timestamp": "",
"source": "github",
"line_count": 1324,
"max_line_length": 79,
"avg_line_length": 33.840634441087616,
"alnum_prop": 0.6336569579288026,
"repo_name": "wiseman/energid_nlp",
"id": "4909ca1341b67eeb4a3189cabb97f212beaa8330",
"size":... |
"""
Rheostatic - A Static File Server with options.
MIT License
Copyright (c) 2016 Waylan Limberg
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 limitatio... | {
"content_hash": "8587b6782a6597622d57997ce8004226",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 78,
"avg_line_length": 30.317241379310346,
"alnum_prop": 0.46678798908098273,
"repo_name": "waylan/rheostatic",
"id": "1fdf7deaaf144143a52be4f6ae52678cc615eb69",
"size": "... |
"""
The collection of classes to describe the model's meta-parameters.
The *parameter* is the value that influences the whole model's behavior
in some way. Each parameter has a default value. Then you could
customize them per each experiment or change interactively using
``Bridge``.
There are two types of parameters ... | {
"content_hash": "490e96f679d58e452dc5be522efd1cea",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 75,
"avg_line_length": 31.337931034482757,
"alnum_prop": 0.6355633802816901,
"repo_name": "a5kin/hecate",
"id": "8a312e5ea3c73871eb40fc68fd97999776b90927",
"size": "4544",... |
import re
import datetime
import time
#niru's git commit
while True:
#open the file for reading
file = open("test.txt")
content = file.read()
#Get timestamp
ts = time.time()
ist = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S')
#open file for read and close it nea... | {
"content_hash": "1b67761a57581d07f4bcc831c752c513",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 75,
"avg_line_length": 26.79310344827586,
"alnum_prop": 0.6164736164736164,
"repo_name": "cloud-engineering/Torpid",
"id": "d2da865d8268b2d0dc8eb4e8b1ccafa7f8841c7c",
"size... |
FILE_TO_SORT = 'addresses.txt'
# ==========================
import sys
from pathlib import Path
file_to_sort = Path(__file__) / '..' / FILE_TO_SORT
file_to_sort = file_to_sort.resolve()
print('Gonna be sorting file', file_to_sort)
if not file_to_sort.exists():
sys.exit(f"ERROR! Can't find the file for sorting:... | {
"content_hash": "057907e2fbdd07d6481c841d6043386b",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 71,
"avg_line_length": 26.6,
"alnum_prop": 0.6827067669172933,
"repo_name": "butla/experiments",
"id": "c67611b93d0e39ee414d7be0055342c889b035b4",
"size": "665",
"binary"... |
from .resource import Resource
class RouteTable(Resource):
"""Route table resource.
Variables are only populated by the server, and will be ignored when
sending a request.
:param id: Resource Identifier.
:type id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource... | {
"content_hash": "897af7370e12ea60c392f9b028bdcdda",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 85,
"avg_line_length": 36.94444444444444,
"alnum_prop": 0.6025062656641604,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "2ef803a48d80a5fec6ffd9ca7517e4ba51e9a2fb",
"... |
from pythonwarrior.config import Config
import time
class UI(object):
@staticmethod
def puts(msg):
if Config.out_stream:
return Config.out_stream.write(msg + "\n")
@staticmethod
def puts_with_delay(msg):
result = UI.puts(msg)
if Config.delay:
time.sleep... | {
"content_hash": "984702b7eef285d2d1cf49f00ba8a674",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 74,
"avg_line_length": 25.833333333333332,
"alnum_prop": 0.5211469534050179,
"repo_name": "arbylee/python-warrior",
"id": "d65764c3dba7b7931d73c14cdfa1d573a9f78d26",
"size"... |
import factory
from factory.fuzzy import FuzzyInteger, FuzzyChoice
from pycroft.model.traffic import TrafficVolume
from tests.factories import IPFactory
from .base import BaseFactory
from .user import UserFactory
class TrafficDataFactory(BaseFactory):
class Meta:
abstract = True
amount = FuzzyIntege... | {
"content_hash": "e4d1c27e53220b98be3695a06fc5230f",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 84,
"avg_line_length": 27.24137931034483,
"alnum_prop": 0.740506329113924,
"repo_name": "agdsn/pycroft",
"id": "df0ce1c263b9993fcb79c66ea969091403bf1fae",
"size": "998",
... |
import logging
import os
_log = logging.getLogger("antd.plugin")
_plugins = []
class Plugin(object):
"""
A plugin receives notifications when new data
is available, it can consume the data or transform it.
TCX file generation, and garmin connect upload are
both implementations of plugin. You can i... | {
"content_hash": "948d4084b0054791b2bb4d4529b07c56",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 86,
"avg_line_length": 34.81443298969072,
"alnum_prop": 0.5928338762214984,
"repo_name": "matt-leach/python-ant-downloader",
"id": "439cc443fb4ff83d56a778327a7c8215c6efcc60",... |
from abc import abstractmethod, ABCMeta
import threading
import time
import six
from sifr.hll import HLLCounter
try:
from collections import Counter
except ImportError: # pragma: no cover
from .backports.counter import Counter # pragma: no cover
@six.add_metaclass(ABCMeta)
class Storage(object):
@abs... | {
"content_hash": "a53ffe1aec8e4b800d7f1ca27956e7ef",
"timestamp": "",
"source": "github",
"line_count": 286,
"max_line_length": 71,
"avg_line_length": 32.27972027972028,
"alnum_prop": 0.575498266897747,
"repo_name": "alisaifee/sifr",
"id": "d231c746955309f8ef8ba25901ecc03fc283b86f",
"size": "9232",... |
"""Tests for the private `_RestructuredDataset` transformation."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.data.experimental.ops import batching
from tensorflow.python.data.kernel_tests import test_base
from tensorflow.python.d... | {
"content_hash": "bf008c16d3062e97e6eb880f5bfbddb4",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 80,
"avg_line_length": 40.68852459016394,
"alnum_prop": 0.6434327155519742,
"repo_name": "ageron/tensorflow",
"id": "88c14f0a6ead8e4c07487264bc17af0b6f81cc7b",
"size": "317... |
from django.contrib import admin
from .models import Order, OrderItem
class OrderItemInline(admin.TabularInline):
model = OrderItem
raw_id_fields = ['product']
class OrderAdmin(admin.ModelAdmin):
list_display = ['id', 'first_name', 'last_name', 'email', 'address', 'postal_code', 'city', 'paid', 'created... | {
"content_hash": "417aebef1b92249c12f15cfd581813ed",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 125,
"avg_line_length": 30.6,
"alnum_prop": 0.6840958605664488,
"repo_name": "janusnic/dj-21v",
"id": "8ce1eb2c0ff843aee9e8462e08d79d0141b90fce",
"size": "459",
"binary":... |
from __future__ import print_function, unicode_literals
from werkzeug.utils import secure_filename
from flask import request, render_template, current_app
from weblab.core.wl import weblab_api
@weblab_api.route_webclient('/visir.html')
def visir():
return render_template("webclient/visir.html")
@weblab_api.rout... | {
"content_hash": "500056715f02771e1ed46f2fddb6e306",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 83,
"avg_line_length": 34.13333333333333,
"alnum_prop": 0.755859375,
"repo_name": "weblabdeusto/weblabdeusto",
"id": "601a64837efc003a280b96b5f300e3b64abe8f42",
"size": "51... |
import sys
import json
import re
import doekbase.data_api
from doekbase.data_api.annotation.genome_annotation.api import GenomeAnnotationAPI , GenomeAnnotationClientAPI
from doekbase.data_api.sequence.assembly.api import AssemblyAPI , AssemblyClientAPI
ga = GenomeAnnotationAPI({
'workspace_service_url' : sys.argv[1],... | {
"content_hash": "3857562cb73c5947229b032ab12ece64",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 110,
"avg_line_length": 28.30909090909091,
"alnum_prop": 0.654035538428602,
"repo_name": "mdejongh/MEModeling",
"id": "459085d272d3916e16b2c7932f8ef75bec3190b1",
"size": "... |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("app_rename_column", "0001_initial")]
operations = [
migrations.RenameField(model_name="a", old_name="field", new_name="renamed")
]
| {
"content_hash": "ef874833f188fdc8839311dc70558eb7",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 84,
"avg_line_length": 24.5,
"alnum_prop": 0.6775510204081633,
"repo_name": "3YOURMIND/django-migration-linter",
"id": "b7a0a4c9c60873eb9eb450726a8edf3771eb39f8",
"size": "... |
import smtplib
from email.mime.text import MIMEText
#
# A basic Mailtrap send_mail implementation.
#
def send_mail(from_email, to_emails, subject, plain_body, html_body):
"""
Feel free to override me!
:param from_email: The sender's email address. NOTE that this may
be flat-out incorrect, but it ... | {
"content_hash": "f3f08678179a9d3da9703bbdd0bd5025",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 70,
"avg_line_length": 34.916666666666664,
"alnum_prop": 0.6730310262529833,
"repo_name": "tannerntannern/docker-vaultier",
"id": "308c8dc23bfcdfcd70f40efc02b714763524ef02",
... |
import sys
sys.path.append("./")
# For JS
import getopt
import jsmin, mergejs
# For CSS
import re
# For file moves
import shutil
import os
def mergeCSS(inputFilenames, outputFilename):
output = ""
for inputFilename in inputFilenames:
output += file(inputFilename, "r").read()
file(outputFilename,... | {
"content_hash": "0c9821d9d00cdec33eaf5e8627a0b665",
"timestamp": "",
"source": "github",
"line_count": 442,
"max_line_length": 94,
"avg_line_length": 31.721719457013574,
"alnum_prop": 0.5753512588260467,
"repo_name": "flavour/ssf",
"id": "50d80ddb0cafa253224ee221bb75f4b25c84643e",
"size": "14144",... |
"""A class that performs TLS-SNI-01 challenges for Nginx"""
import itertools
import logging
import os
from certbot import errors
from certbot.plugins import common
from certbot_nginx import obj
from certbot_nginx import nginxparser
logger = logging.getLogger(__name__)
class NginxTlsSni01(common.TLSSNI01):
""... | {
"content_hash": "2828b7f9c8db7ccef189940cfda05e03",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 81,
"avg_line_length": 35.77987421383648,
"alnum_prop": 0.5814730181051151,
"repo_name": "jtl999/certbot",
"id": "0543000ea0e83494ed694110f0ae1d808824b348",
"size": "5689"... |
class WebKitFinder(object):
def __init__(self, filesystem):
self._filesystem = filesystem
self._webkit_base = None
def webkit_base(self):
"""Returns the absolute path to the top of the WebKit tree.
Raises an AssertionError if the top dir can't be determined."""
# Note: ... | {
"content_hash": "3c1031f9e51c1770d83697a775f359cc",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 102,
"avg_line_length": 50.333333333333336,
"alnum_prop": 0.6589403973509934,
"repo_name": "leighpauls/k2cro4",
"id": "3705ef37faf7cb048add2bd2c642b01356366b1c",
"size": "3... |
"""Support for Buienradar.nl weather service."""
from __future__ import annotations
import logging
from buienradar.constants import (
ATTRIBUTION,
CONDCODE,
CONDITION,
DETAILED,
EXACT,
EXACTNL,
FORECAST,
IMAGE,
MEASURED,
PRECIPITATION_FORECAST,
STATIONNAME,
TIMEFRAME,
... | {
"content_hash": "1b0e54a9835ac0d831d9d09245c6ab7b",
"timestamp": "",
"source": "github",
"line_count": 872,
"max_line_length": 87,
"avg_line_length": 31.128440366972477,
"alnum_prop": 0.6010167992926614,
"repo_name": "mezz64/home-assistant",
"id": "bf44c884147e87598a80b223a5e3fcc796bb00e1",
"size"... |
"""Tests for TPU outside compilation."""
import os
import tempfile
from absl.testing import parameterized
import numpy as np
from tensorboard.plugins.histogram import summary_v2 as histogram_summary_v2
from tensorboard.plugins.image import summary_v2 as image_summary_v2
from tensorboard.plugins.scalar import summary... | {
"content_hash": "7606e7c16c8e20b36527384d3baa89c7",
"timestamp": "",
"source": "github",
"line_count": 784,
"max_line_length": 94,
"avg_line_length": 31.375,
"alnum_prop": 0.6436295633791365,
"repo_name": "paolodedios/tensorflow",
"id": "697ff9ef7c55584b4e7686756564650800b72890",
"size": "25287",
... |
import argparse
import re
def main():
parser = argparse.ArgumentParser(
description="Extract selected stanzas from ncbitaxon.owl"
)
parser.add_argument("input", type=str, help="The input ncbitaxon.owl file")
parser.add_argument("taxa", type=str, help="The TSV file listing taxa to extract")
... | {
"content_hash": "576e9b9fc929c68eba9727b5c9d58f1f",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 86,
"avg_line_length": 33.53061224489796,
"alnum_prop": 0.4996956786366403,
"repo_name": "obophenotype/ncbitaxon",
"id": "dc58725c7156a3e2f52ebeda0d4bc6c29b2eaae0",
"size":... |
from unittest import main
from json import loads
from qiita_pet.test.tornado_test_base import TestHandlerBase
class TestNewPrepTemplateAjax(TestHandlerBase):
def test_get(self):
response = self.get('/study/new_prep_template/', {'study_id': '1'})
self.assertEqual(response.code, 200)
class TestPr... | {
"content_hash": "e0477d8c9e15c403b7cd4296e4d9a144",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 78,
"avg_line_length": 38.183673469387756,
"alnum_prop": 0.549973276322822,
"repo_name": "squirrelo/qiita",
"id": "dee37894820b6c8bde7365d0007cfecda66d80d5",
"size": "2221"... |
import urllib2
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.management.base import BaseCommand, CommandError
from django.core.urlresolvers import reverse
from django.utils import translation
from django.utils.html import escape
from optparse import make_option
from Be... | {
"content_hash": "20476cd7b35bbb0f40ac25a30252299b",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 105,
"avg_line_length": 35.55421686746988,
"alnum_prop": 0.5523551338529312,
"repo_name": "trapeze/haystack-static-pages",
"id": "9c53148f3c60d1c8cae01ef1a209f5c68646c0cb",
... |
from task import Task
from trello import Card
# from abc import ABCMeta #todo make this class abstract
class RemoteTask(Task):
@staticmethod
def from_task(existing_task, remote_source):
result = remote_source.add_task(existing_task)
task_id = result[0]
data = result[1]
new_ta... | {
"content_hash": "c85ecf92a7151a2679bb7967c2892c3d",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 114,
"avg_line_length": 28.86,
"alnum_prop": 0.6188496188496189,
"repo_name": "bhylak/trello_things3_sync",
"id": "e5ec0ba76e1fd87b4aa62969f74ef73e45bce2b2",
"size": "1443"... |
"""
Volume driver for NetApp iSCSI storage systems.
This driver requires NetApp Clustered Data ONTAP or 7-mode
storage systems with installed iSCSI licenses.
"""
import copy
import math
import sys
import time
import uuid
import six
from cinder import exception
from cinder.i18n import _
from cinder.openstack.common ... | {
"content_hash": "8576c5f68c55e3ba879c12f5b5c1987f",
"timestamp": "",
"source": "github",
"line_count": 1623,
"max_line_length": 79,
"avg_line_length": 41.96734442390635,
"alnum_prop": 0.5579992071998003,
"repo_name": "redhat-openstack/cinder",
"id": "d9bafbb18d7442cdf150ab751e209ec855ebb901",
"siz... |
"""Client-side fork interop tests as a unit test."""
import six
import subprocess
import sys
import threading
import unittest
from grpc._cython import cygrpc
from tests.fork import methods
# New instance of multiprocessing.Process using fork without exec can and will
# hang if the Python process has any other threads... | {
"content_hash": "8fbc615b038087965d34627fb27d3555",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 80,
"avg_line_length": 35.568345323741006,
"alnum_prop": 0.6490695792880259,
"repo_name": "sreecha/grpc",
"id": "602786c5e0d1e47d977aec5183adffec0c8ec580",
"size": "5521",... |
from chalice.extensions import db
from chalice import init_app
if __name__ == '__main__':
app = init_app()
with app.test_request_context():
db.drop_all()
print 'Dropped the db using the following connection string: %s' % app.config['SQLALCHEMY_DATABASE_URI']
| {
"content_hash": "0ded0afe141b2f98194afff8d1851696",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 108,
"avg_line_length": 31.22222222222222,
"alnum_prop": 0.6690391459074733,
"repo_name": "andrimarjonsson/chalice",
"id": "6cdb18d464592e0d48633d515eb682f6e42df2a6",
"size"... |
import collections.abc
import inspect
import warnings
from math import ceil
from django.utils.functional import cached_property
from django.utils.inspect import method_has_no_args
from django.utils.translation import gettext_lazy as _
class UnorderedObjectListWarning(RuntimeWarning):
pass
class InvalidPage(Exc... | {
"content_hash": "8940fdf1dabd82ebdaa9318d8f6b40ca",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 86,
"avg_line_length": 33.61538461538461,
"alnum_prop": 0.5856777493606138,
"repo_name": "django/django",
"id": "131ea0f81121c6f8aab0c7ebf2837b0413749467",
"size": "7439",... |
import datetime as dt
import logging
import os
import re
import traceback
from collections import defaultdict
from typing import List, Optional, Union
import aiohttp
import asyncpg
import discord
from discord.ext import commands
import cogs.utils.context
from cogs.utils import config
from cogs.utils import safe_delet... | {
"content_hash": "70aaa61b9e44714f92b3228dbed458ae",
"timestamp": "",
"source": "github",
"line_count": 356,
"max_line_length": 120,
"avg_line_length": 42.33988764044944,
"alnum_prop": 0.6043256153386851,
"repo_name": "Galarzaa90/NabBot",
"id": "51f98ecbb1fd40f5567b36bf0b29c6a9ccdce039",
"size": "1... |
"""
Some utility functions that can be used in this project.
Currently, we only provide one function:
- L{dice_coefficient}
"""
import re
def dice_coefficient(a, b, ignore_case=True):
"""
Calculate dice coefficient
Downloaded from
U{http://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Di... | {
"content_hash": "d1fb8c9e2b53224b3746a82d45cdbc60",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 95,
"avg_line_length": 28.115942028985508,
"alnum_prop": 0.6345360824742268,
"repo_name": "apelisse/subgetter",
"id": "ff974b1498c775848c5c2948cef7ecedba84fef7",
"size": "1... |
"Default tags used by the template system, available to all templates."
from django.template import Node, NodeList, Template, Context, resolve_variable
from django.template import TemplateSyntaxError, VariableDoesNotExist, BLOCK_TAG_START, BLOCK_TAG_END, VARIABLE_TAG_START, VARIABLE_TAG_END, SINGLE_BRACE_START, SINGLE... | {
"content_hash": "5f270e7c39ab79bc3f4a57719872780d",
"timestamp": "",
"source": "github",
"line_count": 1012,
"max_line_length": 213,
"avg_line_length": 34.705533596837945,
"alnum_prop": 0.5829394681396276,
"repo_name": "jonaustin/advisoryscan",
"id": "371b57e430b66658505d94f04482c17d15aca80a",
"si... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('game', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='user',
name='id',
field=models.AutoF... | {
"content_hash": "a4e2cad4a10e9694055e17ed872efd90",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 70,
"avg_line_length": 21,
"alnum_prop": 0.5873015873015873,
"repo_name": "sdu14SoftwareEngineering/GameOfLife_WEB",
"id": "bf5481d017bea153556b5d6341a2ec1cd3d35921",
"size... |
from oslo_log import log as logging
import oslo_messaging
from oslo_utils import excutils
from neutron.common import constants as n_const
from neutron.common import utils as n_utils
from neutron.i18n import _LE, _LI, _LW
from neutron.plugins.common import constants as p_const
from neutron.plugins.ml2.drivers.openvswit... | {
"content_hash": "d69ec5a138c9b050ceae28ffd4103ac4",
"timestamp": "",
"source": "github",
"line_count": 690,
"max_line_length": 79,
"avg_line_length": 42.54927536231884,
"alnum_prop": 0.5566606492046732,
"repo_name": "eonpatapon/neutron",
"id": "905c8a8e9e8868010b356c9d2504bbd4a7a9d12e",
"size": "3... |
"""Resources management functions
"""
import sys
import bigml.api
from bigmler.utils import (dated, get_url, log_message, check_resource,
check_resource_error, log_created_resources)
from bigmler.reports import report
from bigmler.resourcesapi.common import set_basic_batch_args, map_fie... | {
"content_hash": "53290837a5771ac91dc69833f015e3f0",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 75,
"avg_line_length": 36.84615384615385,
"alnum_prop": 0.607217417238294,
"repo_name": "jaor/bigmler",
"id": "c7651a092160c7d6f3f09be84d857ba0ef53fdf2",
"size": "3953",
... |
"""Support for the for Danfoss Air HRV binary sensors."""
from pydanfossair.commands import ReadCommand
from homeassistant.components.binary_sensor import (
BinarySensorDeviceClass,
BinarySensorEntity,
)
from . import DOMAIN as DANFOSS_AIR_DOMAIN
def setup_platform(hass, config, add_entities, discovery_info... | {
"content_hash": "3a7f73bf6ff25b5c5cae4fa0367d0e15",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 81,
"avg_line_length": 28.51063829787234,
"alnum_prop": 0.6470149253731343,
"repo_name": "home-assistant/home-assistant",
"id": "379d76ec4c8034a3307da8d4f2ab1c146ab1e2b4",
... |
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
"""
test_extractor
----------------------------------
Tests for `extractor` module.
"""
import unittest
from ncgocr import extractor as ex
class TestFunctions(unittest.TestCase):
... | {
"content_hash": "86c86f9e251744060c28861d2b2a44e3",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 87,
"avg_line_length": 27.256410256410255,
"alnum_prop": 0.5446848541862653,
"repo_name": "jeroyang/mcgocr",
"id": "492119cb8944a0c2f946d530e57bba428fe80515",
"size": "1110... |
import sys
if len(sys.argv) != 3:
print "Usage: spark-submit --files <file> %s <file> <result-destination>" % (sys.argv[0], )
print
print "Example:"
print " spark-submit --files query.sql %s query.sql s3://my-bucket/results/output.csv" % (sys.argv[0], )
print
sys.exit(1)
query_file = sys.argv... | {
"content_hash": "dd0c01d742c2fb1283880b38f0645579",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 109,
"avg_line_length": 23.903225806451612,
"alnum_prop": 0.6261808367071525,
"repo_name": "treasure-data/digdag",
"id": "03360a856a20a6e9490fa3b6f74affb550d9f62d",
"size":... |
from __future__ import division
from pylab import *
import random
# there already is a sample in the namespace from numpy
from random import sample as smpl
import itertools
import utils
utils.backup(__file__)
import synapses
class AbstractSource(object):
def __init__(self):
"""
Initialize all relev... | {
"content_hash": "141f364ba3b72ce45f46f65225e4557c",
"timestamp": "",
"source": "github",
"line_count": 576,
"max_line_length": 95,
"avg_line_length": 33.81597222222222,
"alnum_prop": 0.5202279494814662,
"repo_name": "Saran-nns/SORN",
"id": "224fc026ab91f28720bc1d49f1a4ccb09980f90b",
"size": "19478... |
import unittest
import sublime
from Vintageous.state import State
from Vintageous.vi.utils import modes
from Vintageous.vi.mappings import Mappings
from Vintageous.vi.mappings import _mappings
from Vintageous.vi.mappings import mapping_status
from Vintageous.tests import set_text
from Vintageous.tests import add_sel
... | {
"content_hash": "bb5d266058c49d3d85ffaf9c25f320a6",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 128,
"avg_line_length": 40.19277108433735,
"alnum_prop": 0.6064148681055156,
"repo_name": "xushuwei202/Vintageous",
"id": "a4839a80d39f6574c76baa2651080abfb50b9300",
"size"... |
from __future__ import print_function, unicode_literals
import win32com.client
import codecs
FILE = 1
DRAFT = 4
def login(user, password):
app = win32com.client.Dispatch('NovellGroupWareSession')
account = app.MultiLogin(user, None, password, 1)
# 0 - promptIfNeeded
# 1 - noverPrompt
... | {
"content_hash": "6d02013eab7ab7f2ef350247c2b8fb15",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 76,
"avg_line_length": 25.91111111111111,
"alnum_prop": 0.5969125214408233,
"repo_name": "ActiveState/code",
"id": "194bc9473880003affdf3b1763632087be9b103d",
"size": "2332... |
import sys
import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General conf... | {
"content_hash": "d59ec81c5204a84304c138dbd698cd0a",
"timestamp": "",
"source": "github",
"line_count": 246,
"max_line_length": 79,
"avg_line_length": 31.585365853658537,
"alnum_prop": 0.7021879021879022,
"repo_name": "Alkalit/silk",
"id": "30f4e4ac5246434efd82b1936b0848e56249f9a8",
"size": "8187",... |
"""distutils.ccompiler
Contains CCompiler, an abstract base class that defines the interface
for the Distutils compiler abstraction model."""
# created 1999/07/05, Greg Ward
__revision__ = "$Id: ccompiler.py,v 1.39 2001/02/27 19:13:15 akuchling Exp $"
import sys, os, re
from types import *
from copy import copy
fro... | {
"content_hash": "661c9fa735d7e83579de1e5f13770890",
"timestamp": "",
"source": "github",
"line_count": 1046,
"max_line_length": 79,
"avg_line_length": 41.14053537284895,
"alnum_prop": 0.592289638184649,
"repo_name": "MalloyPower/parsing-python",
"id": "703d9b9dfb45dc626ad305a5b9e5af9bfc4fcd0b",
"s... |
import base64
from urllib.parse import unquote, urlunparse
from urllib.request import getproxies, proxy_bypass, _parse_proxy
from scrapy.exceptions import NotConfigured
from scrapy.utils.httpobj import urlparse_cached
from scrapy.utils.python import to_bytes
class HttpProxyMiddleware:
def __init__(self, auth_en... | {
"content_hash": "3e25dd0bc6c99b818d683a12a87fb478",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 83,
"avg_line_length": 37.75,
"alnum_prop": 0.5771050141911069,
"repo_name": "pablohoffman/scrapy",
"id": "dd8a7e79778bac598802a934c27fef7a4659b858",
"size": "3171",
"bin... |
import unittest
''' O(1) para memória pois só utiliza variáveis
O(N²) para tempo porque utiliza dois whiles aninhados para percorrer a lista'''
def insertion_sort(seq):
if len(seq) <= 1:
return seq
else:
i_desordenada = 1
limite_ordenada = 0
while i_desordenada < len(seq):... | {
"content_hash": "153f4c9ba6bc5ac05a240c29a7f3c053",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 108,
"avg_line_length": 31.318181818181817,
"alnum_prop": 0.5435413642960812,
"repo_name": "Julianosantosb/dataStructure",
"id": "0425b001d4d7e7ecb1ac91d296039d35787911be",
... |
""" S3 Framework Extensions for web2py
This package is loaded in models/000_1st_run.py as "s3base",
this namespace can be used to access all S3 classes, e.g.::
s3base.S3Resource()
@see: U{B{I{S3 Developer Guidelines}} <http://eden.sahanafoundation.org/wiki/DeveloperGuidelinesS3>}
@requires: ... | {
"content_hash": "9477ef0dfb1bc9706ebf11cef109420f",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 104,
"avg_line_length": 29.11111111111111,
"alnum_prop": 0.7454198473282443,
"repo_name": "flavour/cert",
"id": "19ed8591aad12832600d3e5e74a96f47fa81c844",
"size": "2646",
... |
"""
Django test cases for this project.
.. autosummary::
:toctree:
test_ddh
test_notify
test_webindex
test_workflow
"""
| {
"content_hash": "af37400a198586e7d92d27b7b65be0a4",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 35,
"avg_line_length": 10.357142857142858,
"alnum_prop": 0.6068965517241379,
"repo_name": "khchine5/book",
"id": "394e86f9179baa91a3546e4bf7611f4441a1e256",
"size": "145",
... |
from runner.koan import *
class AboutIteration(Koan):
def test_iterators_are_a_type(self):
it = iter(range(1,6))
fib = 0
for num in it:
fib += num
self.assertEqual(__ , fib)
def test_iterating_with_next(self):
stages = iter(['alpha','beta','gamma'])
... | {
"content_hash": "3ecd54f3b92b8ea879fe397b6d7f3afd",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 77,
"avg_line_length": 28.313432835820894,
"alnum_prop": 0.5060622034791776,
"repo_name": "bordeltabernacle/python_koans",
"id": "93d64504a67ca697f23a6ff11e355bf4b2226cf5",
... |
from lldbsuite.test import lldbinline
from lldbsuite.test import decorators
lldbinline.MakeInlineTest(__file__, globals(), lldbinline.expectedFailureAll(oslist=["windows"]))
| {
"content_hash": "53de644e699cf605438b03eadf3ea904",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 97,
"avg_line_length": 43.75,
"alnum_prop": 0.8114285714285714,
"repo_name": "llvm-mirror/lldb",
"id": "b1b7e1744f1f8f9049a933b3f630696247d2f8ae",
"size": "175",
"binary":... |
from dnutils import ProgressBar
from .common import *
from ..grounding.default import DefaultGroundingFactory
from ..constants import HARD
from ..errors import SatisfiabilityException
class LL(AbstractLearner):
"""
Exact Log-Likelihood learner.
"""
def __init__(self, mrf, **params):
Abst... | {
"content_hash": "17bf98eaec6043feb606cad2fb5fe75f",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 129,
"avg_line_length": 32.61176470588235,
"alnum_prop": 0.5003607503607503,
"repo_name": "danielnyga/pracmln",
"id": "24557b5a7467b4beaee919196bff786b2b72c82f",
"size": "3... |
import os
import json
import logging
import sys
from django.db import transaction
from django.apps import apps
from scripts import utils as script_utils
from scripts.populate_preprint_providers import update_or_create
from osf.models import PreprintProvider, Subject
from website.app import init_app
from website impor... | {
"content_hash": "3a5860986474c433edc95e19f53bb508",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 116,
"avg_line_length": 31.232558139534884,
"alnum_prop": 0.7252419955323902,
"repo_name": "caseyrollins/osf.io",
"id": "f746b55b25b5e7164320c849c9023e69d705d48e",
"size": ... |
from __future__ import with_statement
import pipes
import fnmatch
import IECore
import Gaffer
import GafferUI
class ParameterisedHolderNodeUI( GafferUI.NodeUI ) :
def __init__( self, node, readOnly=False, **kw ) :
column = GafferUI.ListContainer( GafferUI.ListContainer.Orientation.Vertical, spacing = 4 )
... | {
"content_hash": "dff501e800652121cb5fefd65dcff445",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 152,
"avg_line_length": 36.2875,
"alnum_prop": 0.6879090595935239,
"repo_name": "davidsminor/gaffer",
"id": "5bd1f7b87b569d493392d497af92f9d2a86b5822",
"size": "7690",
"... |
"""Pre-configured remote application for enabling sign in/up with ORCID.
1. Edit your configuration and add:
.. code-block:: python
from invenio_oauthclient.contrib import orcid
OAUTHCLIENT_REMOTE_APPS = dict(
orcid=orcid.REMOTE_APP,
)
ORCID_APP_CREDENTIALS = dict(
... | {
"content_hash": "f5dcbd8a751fc4f77552a748a0998ecf",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 79,
"avg_line_length": 30.904306220095695,
"alnum_prop": 0.6426691438303143,
"repo_name": "tiborsimko/invenio-oauthclient",
"id": "3958cdeb7e2836ad53ccc0489598eca881f0cdfe",... |
from PIL import Image
from pylab import *
# read image to array
im = array(Image.open('img/landscape.jpg'))
# plot the image
imshow(im)
# some points
x = [100,100,400,400]
y = [200,400,200,400]
# plot the points with red star-markers
plot(x,y,'r*')
# line plot connecting the first two points
plot(x[:2],y[:2])
# add ti... | {
"content_hash": "03f2f5cb87c11d6b6702042300418621",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 43,
"avg_line_length": 21.94736842105263,
"alnum_prop": 0.7026378896882494,
"repo_name": "wasit7/cs634",
"id": "58f568023b35ac43ae0a809211582ed8b034ae62",
"size": "417",
... |
import unittest
from datetime import datetime as dt
from time import sleep
from hamcrest import assert_that, equal_to, contains_exactly
from freemap.map import Branch, Icons, Map
from helpers.matchers import between
class BranchTester(unittest.TestCase):
def setUp(self):
self.ts = 'CREATED="154125868945... | {
"content_hash": "8f5444d8b122ee0299b86c9eab39547b",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 126,
"avg_line_length": 41.75912408759124,
"alnum_prop": 0.6392239119035134,
"repo_name": "romilly/freemap",
"id": "0292d8d966b99554a5c87877d1ec49d2dcbe70bf",
"size": "572... |
from pandas import Timestamp, Timedelta
from pandas.tseries.tools import normalize_date
class FutureChain(object):
""" Allows users to look up future contracts.
Parameters
----------
asset_finder : AssetFinder
An AssetFinder for future contract lookups, in particular the
AssetFinder o... | {
"content_hash": "4e3237b8f56974350c5263d6c097fd00",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 79,
"avg_line_length": 28.18951612903226,
"alnum_prop": 0.5654412816478329,
"repo_name": "dmitriz/zipline",
"id": "12dcae525ead768a8d8566e940ee3219a26e6e67",
"size": "7574... |
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
import tcelery
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#s... | {
"content_hash": "72adad28a75959b7863d3982c20ed88a",
"timestamp": "",
"source": "github",
"line_count": 257,
"max_line_length": 79,
"avg_line_length": 32.18677042801556,
"alnum_prop": 0.7027321083172147,
"repo_name": "sangwonl/tornado-celery",
"id": "71ce7dfbdd82dc023041acb682a6d5dabff6253c",
"size... |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('builds', '0030_add_automation_rule_matches'),
]
operations = [
migrations.AddField(
model_name='build',
name='version_name',
... | {
"content_hash": "859a1092dcf1f365cd48d78ebc96e308",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 200,
"avg_line_length": 35.148148148148145,
"alnum_prop": 0.589041095890411,
"repo_name": "rtfd/readthedocs.org",
"id": "cb9a86db48840c87c5db6f50ec3e60af8396b45e",
"size": ... |
import requests
def image_search(query):
url = 'https://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=%s' % (query)
res = requests.get(url)
if res.status_code != 200:
return []
result = res.json()
return [r for r in result['responseData']['results']]
def first_image(query):
... | {
"content_hash": "a10a5e49407a1c7a7da89ebf95a87756",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 88,
"avg_line_length": 21.61904761904762,
"alnum_prop": 0.6035242290748899,
"repo_name": "davidyen1124/Google-Image",
"id": "7d1a5beaacdab2ea7bd9233a94c07d7f3069d551",
"siz... |
from itertools import combinations
from operator import mul
f = open("input.txt")
d = f.readlines()
total = 0
for p in d:
sides = [int(n) for n in p.split("x")]
combos = list(combinations(sides, 2))
areas = [ mul(*a) for a in combos]
areas.sort()
total += areas[0]
total += sum([2*a for a in are... | {
"content_hash": "ecd6e7bb6ab2ad5297ce781696eecd54",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 42,
"avg_line_length": 22.6,
"alnum_prop": 0.6224188790560472,
"repo_name": "pwicks86/adventofcode2015",
"id": "72cd1553d141e1833390719e0440a3dbb04861d0",
"size": "339",
... |
from __future__ import print_function
from bcc import BPF
from time import sleep
from threading import Event
import argparse
import json
import sys
import os
import signal
description = """
Monitor IO latency distribution of a block device
"""
epilog = """
When interval is infinite, biolatpcts will print out result o... | {
"content_hash": "5133e0cca86466ef89cd292c750d92a1",
"timestamp": "",
"source": "github",
"line_count": 296,
"max_line_length": 94,
"avg_line_length": 32.104729729729726,
"alnum_prop": 0.5743449437019889,
"repo_name": "brendangregg/bcc",
"id": "a2f595924ac1477cedca1955231fa00f5f68ba88",
"size": "10... |
import uuid
from sqlalchemy import types, sql, orm
from sqlalchemy.schema import Column, ForeignKey
from .base import Base, GUID
from .user import User
from midauth.utils.text import slugify
__all__ = ['Group']
class Group(Base):
__tablename__ = 'group'
pk = Column(GUID, primary_key=True, default=uuid.uui... | {
"content_hash": "913013befbf9e7d4b4fba711d97425e5",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 77,
"avg_line_length": 35.9,
"alnum_prop": 0.5938718662952647,
"repo_name": "smartstudy/midauth",
"id": "0fbb8e42c4f96d08871a8157223f9182bca43ad0",
"size": "1819",
"binar... |
from django.conf.urls.defaults import *
import views
urlpatterns = patterns('',
url('^openid/login/$', views.login, name="openid_login"),
url('^openid/callback/$', views.callback),
)
| {
"content_hash": "bbc7d30d2a019b3555710a510c6ffb88",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 80,
"avg_line_length": 31.75,
"alnum_prop": 0.515748031496063,
"repo_name": "uroslates/django-allauth",
"id": "5e34f2b81fc7b3a4d25ca78265cd181523e9c0eb",
"size": "254",
"b... |
import logging
from olympia.lib.settings_base import * # noqa
ENGAGE_ROBOTS = True
EMAIL_URL = env.email_url('EMAIL_URL')
EMAIL_HOST = EMAIL_URL['EMAIL_HOST']
EMAIL_PORT = EMAIL_URL['EMAIL_PORT']
EMAIL_BACKEND = EMAIL_URL['EMAIL_BACKEND']
EMAIL_HOST_USER = EMAIL_URL['EMAIL_HOST_USER']
EMAIL_HOST_PASSWORD = EMAIL_U... | {
"content_hash": "2ffeb6911771ba79992e1809082cca21",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 92,
"avg_line_length": 30.08730158730159,
"alnum_prop": 0.644684779741493,
"repo_name": "aviarypl/mozilla-l10n-addons-server",
"id": "8940cda188fb28be991746d65733da586e24fde... |
import grpc
from google.cloud.bigquery_storage_v1beta1.proto import (
storage_pb2 as google_dot_cloud_dot_bigquery_dot_storage__v1beta1_dot_proto_dot_storage__pb2,
)
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
class BigQueryStorageStub(object):
"""BigQuery storage API.
The ... | {
"content_hash": "7498d3f71f449988ce40e8d13128bd6a",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 166,
"avg_line_length": 55.32934131736527,
"alnum_prop": 0.7316017316017316,
"repo_name": "tseaver/google-cloud-python",
"id": "85b890f0e0cc2319de59b82612c812659e0ce24b",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.