text stringlengths 4 1.02M | meta dict |
|---|---|
import logging
from django import http
from django.conf.urls.defaults import patterns, url
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext_lazy as _
from ella_imports.models import Server, ServerItem
logger = logging.getLogger("ella_imports")
try:
import newman
... | {
"content_hash": "3587b33b30caca0a27ea635d79603800",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 85,
"avg_line_length": 32.029411764705884,
"alnum_prop": 0.5661157024793388,
"repo_name": "ella/ella-imports",
"id": "3f139fbef2c332ce99cfc48b1b285da83028903f",
"size": "21... |
import urllib2
import codecs
from urllib2 import HTTPError
class HttpFileTransfer(object):
def __init__(self, domain, user, password, is_ssl=False):
protocol = 'http'
if is_ssl:
protocol = 'https'
self.__domain = protocol + '://' + domain
password_mgr = urllib2.HTTPPass... | {
"content_hash": "648269dcfac8c51ef38655e692faf793",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 82,
"avg_line_length": 37.37931034482759,
"alnum_prop": 0.6060885608856088,
"repo_name": "Akira-Taniguchi/transfer_lib",
"id": "b5d076e84dd0cb00eb186e0bef1553327d2c48ea",
"... |
from booster import app, db
class Picture(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(128))
description = db.Column(db.Text)
width = db.Column(db.Integer)
height = db.Column(db.Integer)
filename = db.Column(db.String(128))
| {
"content_hash": "1fb01834cc91701c3d79e51db66597b3",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 48,
"avg_line_length": 31.88888888888889,
"alnum_prop": 0.6759581881533101,
"repo_name": "zknight/booster",
"id": "708345d030340e99e0716418b5bf2dda544ba3d6",
"size": "287",
... |
from PyQt4 import QtCore, QtGui
from TaskTemplate import *
from acq4.devices.DAQGeneric.taskGUI import DAQGenericTaskGui
from acq4.devices.Device import TaskGui
#from acq4.pyqtgraph.WidgetGroup import WidgetGroup
import numpy as np
import acq4.pyqtgraph as pg
#from acq4.pyqtgraph.graphicsItems import InfiniteLine, VTic... | {
"content_hash": "a02f3547309a0c755a2d0dbb5a07fd69",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 154,
"avg_line_length": 38.104,
"alnum_prop": 0.6076002519420534,
"repo_name": "mgraupe/acq4",
"id": "4e2a0e4b5499ed5790307f68595255eabc77b4f6",
"size": "4787",
"binary"... |
import m5
from m5.objects import *
# both traffic generator and communication monitor are only available
# if we have protobuf support, so potentially skip this test
require_sim_object("TrafficGen")
require_sim_object("CommMonitor")
# even if this is only a traffic generator, call it cpu to make sure
# the scripts ar... | {
"content_hash": "3006c2d79870b153fa88cad239c25a6a",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 75,
"avg_line_length": 33.31578947368421,
"alnum_prop": 0.6595576619273301,
"repo_name": "Menooker/gem5_pcm",
"id": "c98b9265036b60e3e6aeb9557f6892054181a0f2",
"size": "336... |
from typing import Optional, Dict, Tuple
import os
import aiohttp
from hailtop.config import get_deploy_config, DeployConfig
from hailtop.utils import async_to_blocking, request_retry_transient_errors
from hailtop import httpx
from .tokens import get_tokens
def namespace_auth_headers(deploy_config: DeployConfig,
... | {
"content_hash": "8c1e83592374b8dcc5dc9ee5c184a143",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 156,
"avg_line_length": 40.24223602484472,
"alnum_prop": 0.6414570149714462,
"repo_name": "hail-is/hail",
"id": "1c4d59bff9257f789c1d7ca311a8b6dbebeef7a0",
"size": "6479",... |
"""From http://stackoverflow.com/a/12260597/400691."""
import sys
import dj_database_url
import django
from colour_runner.django_runner import ColourRunnerMixin
from django.conf import settings
from django.test.runner import DiscoverRunner
settings.configure(
DATABASES={'default': dj_database_url.config(
... | {
"content_hash": "e757c2276e509ffa84301a145b0e7b48",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 72,
"avg_line_length": 23.90909090909091,
"alnum_prop": 0.6901140684410646,
"repo_name": "incuna/django-model-logging",
"id": "ac7445bdd9f8f2c6e4898ff67ec19c839e27bf44",
"s... |
import argparse
import json
import requests
import xml.dom.minidom
def log(msg):
print(msg)
class Script:
def main(self):
name = self.__class__.__name__.lower()
parser = argparse.ArgumentParser(description = name)
parser.add_argument('--host',
help='[Host/IP... | {
"content_hash": "77594ed01fddf175d4f69529cb9dc270",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 96,
"avg_line_length": 30.015151515151516,
"alnum_prop": 0.5143866733972741,
"repo_name": "rfcode/zonemanager-api-examples",
"id": "7636e2e5a64d6b212364890b993e49990d07f9e6",... |
from tqdm import tqdm_notebook
import os
import glob
import natsort
import numpy as np
import scipy as sp
from scipy.optimize import leastsq, curve_fit
from scipy import interpolate, integrate
from scipy import spatial
# from scipy.interpolate import interp1d
from scipy.io import loadmat, savemat
# import scipy.misc
im... | {
"content_hash": "114ce198578c2c1deafab57d35edfd0f",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 85,
"avg_line_length": 32.049180327868854,
"alnum_prop": 0.7416879795396419,
"repo_name": "pcmagic/stokes_flow",
"id": "19434aa868e438ef0c0f36087391508239c73b69",
"size": "... |
from .base import Predicate
from .explanation import Explanation
from .to_pred import to_pred
class is_all(Predicate):
"""
Generates a predicate that will consider data valid if and only if all of
the given predicates considers the data valid.
"""
def __init__(self, *predicates):
self._pr... | {
"content_hash": "c61b70c4eff22ee4ab0b6727b9d77aa2",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 77,
"avg_line_length": 32.92307692307692,
"alnum_prop": 0.5965732087227414,
"repo_name": "Daanvdk/is_valid",
"id": "99374f95775c1af0237b66c857cc75fae362404e",
"size": "1284... |
import tarfile
import copy
import operator
import os
class TarFile(tarfile.TarFile):
def extractall(self, path=".", members=None):
"""Extract all members from the archive to the current working
directory and set owner, modification time and permissions on
directories afterwards. `path... | {
"content_hash": "0e32dd2bad4902395488ffd2c181f1b4",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 75,
"avg_line_length": 38.31578947368421,
"alnum_prop": 0.5686813186813187,
"repo_name": "mjmottram/snoing",
"id": "70119d94c59e76b26055431cfab99f6e46af6b9f",
"size": "1821... |
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.db.models import Count, Q
from django.shortcuts import get_object_or_404, render
from django.urls import reverse
from circuits.models import Circuit
from dcim.models import Site, Rack, Device
from ipam.models import IPAddress, Prefix, VLAN, VRF... | {
"content_hash": "c57d921c91bf7ef54df8b4c17b166912",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 99,
"avg_line_length": 32.03478260869565,
"alnum_prop": 0.7209554831704669,
"repo_name": "Alphalink/netbox",
"id": "97ed0eb019768edf6110e464423264c26582a514",
"size": "368... |
import glob
import optparse
import os
import re
import struct
import subprocess
import sys
import tempfile
import test_format
BUNDLE_SIZE = 32
def AssertEquals(actual, expected):
if actual != expected:
raise AssertionError('\nEXPECTED:\n"""\n%s"""\n\nACTUAL:\n"""\n%s"""'
% (expected,... | {
"content_hash": "50e17cf6ea42d1dfce24437cd1a27520",
"timestamp": "",
"source": "github",
"line_count": 372,
"max_line_length": 80,
"avg_line_length": 32.123655913978496,
"alnum_prop": 0.6563179916317992,
"repo_name": "Lind-Project/native_client",
"id": "01b8454bbef97cc2c6ecde5b0afe60a4ef33ed85",
"... |
"""Discover Netgear routers."""
from netdisco.util import urlparse
from . import SSDPDiscoverable
class Discoverable(SSDPDiscoverable):
"""Add support for discovering Netgear routers."""
def info_from_entry(self, entry):
"""Return the most important info from a uPnP entry."""
url = urlparse(e... | {
"content_hash": "8ffcec99b9fcbdcc9717ce9bc039858d",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 79,
"avg_line_length": 34.05,
"alnum_prop": 0.657856093979442,
"repo_name": "brburns/netdisco",
"id": "a0e955eded131c82dc13c8a97077be86490888db",
"size": "681",
"binary":... |
from pyparsing import OneOrMore, stringEnd, ParseException
from pyzebos.parsers.config.routemap import routeMap
from pyzebos.parsers.common import zebosComment
import os
routeMapParser = OneOrMore(routeMap ^ zebosComment) + stringEnd
config_path = os.path.join(os.getcwd(), 'tests', 'configurations', 'route-map')
def... | {
"content_hash": "7bb7d1f29225c21ce9aff3250ebaab19",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 89,
"avg_line_length": 43.285714285714285,
"alnum_prop": 0.6391639163916392,
"repo_name": "atopuzov/pyzebos",
"id": "8e91d7f96abb4ab7f85fdd94f1f47f0ae88bf76a",
"size": "909... |
from io import BytesIO
from pg8000.core import (
Context,
CoreConnection,
NULL_BYTE,
PASSWORD,
_create_message,
)
def test_handle_AUTHENTICATION_3(mocker):
"""Shouldn't send a FLUSH message, as FLUSH only used in extended-query"""
mocker.patch.object(CoreConnection, "__init__", lambda x:... | {
"content_hash": "ac3408b6467c72c6c7368af12cdcaf57",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 80,
"avg_line_length": 30.875,
"alnum_prop": 0.6704453441295547,
"repo_name": "tlocke/pg8000",
"id": "c44caa3a3f2cb6c9c9c7cc9354673db3a70b74b5",
"size": "1237",
"binary":... |
import unittest
import os
from EXOSIMS.Prototypes import TargetList
import numpy as np
from astropy import units as u
from astropy.time import Time
from tests.TestSupport.Info import resource_path
from tests.TestSupport.Utilities import RedirectStreams
import json
import copy
r"""TargetList module unit tests
Paul Nun... | {
"content_hash": "c95f3e14ed61a417c734cd32ef84e275",
"timestamp": "",
"source": "github",
"line_count": 348,
"max_line_length": 88,
"avg_line_length": 36.456896551724135,
"alnum_prop": 0.6274927090722787,
"repo_name": "dsavransky/EXOSIMS",
"id": "57657fc232dd0f2fb5462a042b5d6575421b98ee",
"size": "... |
from facefit import cascade
from facefit.pixel_extractor import PixelExtractorBuilder
from tree import RegressionTreeBuilder
from forest import RegressionForestBuilder
class ERTBuilder(cascade.CascadedShapeRegressorBuilder):
def __init__(self, n_landmarks=68, n_stages=10, n_trees=500, tree_depth=5, n_candidate_spl... | {
"content_hash": "710248d3c2088dbbee768155176a2845",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 114,
"avg_line_length": 57.68421052631579,
"alnum_prop": 0.666058394160584,
"repo_name": "AndrejMaris/facefit",
"id": "359cead55725c468be5eea7fdf4a247f8eab6fa5",
"size": "1... |
from __future__ import print_function
from datetime import datetime, time
import numpy as np
import pytest
from pandas.compat import product
import pandas as pd
from pandas import (
DataFrame, DatetimeIndex, Index, MultiIndex, Series, Timestamp, date_range,
period_range, to_datetime)
from pandas.tests.frame... | {
"content_hash": "ced1d854eb06df19f1cc06c3ac316a7f",
"timestamp": "",
"source": "github",
"line_count": 897,
"max_line_length": 79,
"avg_line_length": 35.74804905239688,
"alnum_prop": 0.531279236574565,
"repo_name": "GuessWhoSamFoo/pandas",
"id": "bc37317f72802d0868e2923c129f2327ca1512a1",
"size": ... |
import requests
STEPIC_URL = 'https://stepic.org/'
STEPIC_API_URL = STEPIC_URL + 'api/'
STEPIC_OAUTH_TOKEN_URL = STEPIC_URL + 'oauth2/token/'
STEPIC_API_ATTEMPTS_URL = STEPIC_API_URL + 'attempts'
STEPIC_API_ATTEMPT_URL = STEPIC_API_ATTEMPTS_URL + '/{id}'
class LoginError(Exception):
"""An exception raised when ... | {
"content_hash": "377b1c03eef71f1a522329e29f66b151",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 75,
"avg_line_length": 35.708333333333336,
"alnum_prop": 0.6190198366394399,
"repo_name": "rev112/playterminal",
"id": "0b0ac4118e8361ec97df45ebbc80e682bb88eb2a",
"size": "... |
import json
from typing import Any, Dict
from sqlalchemy.orm import Session
from superset.models.slice import Slice
def import_chart(
session: Session, config: Dict[str, Any], overwrite: bool = False
) -> Slice:
existing = session.query(Slice).filter_by(uuid=config["uuid"]).first()
if existing:
... | {
"content_hash": "da0298a6c94af04ec520fff4e0bcd06d",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 74,
"avg_line_length": 26.2,
"alnum_prop": 0.6717557251908397,
"repo_name": "mistercrunch/panoramix",
"id": "b3d4237f2b5daf3079b652279b84b64112fcde2e",
"size": "1441",
"b... |
"""Texture (ERB-spaced) stimulus generation functions."""
# adapted (with permission) from code by Hari Bharadwaj
import numpy as np
import warnings
from ._stimuli import rms, window_edges
from .._fixes import irfft
def _cams(f):
"""Compute cams."""
return 21.4 * np.log10(0.00437 * f + 1)
def _inv_cams(E... | {
"content_hash": "104e0b04931638424ed880413d129183",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 79,
"avg_line_length": 36.64375,
"alnum_prop": 0.5628517823639775,
"repo_name": "LABSN/expyfun",
"id": "bff7c1cda26a97478e38d9ebb770318ce23b03bb",
"size": "5910",
"binar... |
import quickfix
import copy
import uuid
import random
import datetime
import yaml
from twisted.internet import task
from sim import (FixSimError, FixSimApplication, create_fix_version,
instance_safe_call, create_logger, IncrementID, load_yaml)
class Subscription(object):
def __init__(self, symbo... | {
"content_hash": "4ed8cfb8a798a0804b9a4e35eb96209a",
"timestamp": "",
"source": "github",
"line_count": 295,
"max_line_length": 130,
"avg_line_length": 33.3728813559322,
"alnum_prop": 0.6419502285424074,
"repo_name": "gloryofrobots/fixsim",
"id": "470cfc4b924ded93b987b886c5b5086ea0255b22",
"size": ... |
"""Tests for tensorflow.ops.math_ops.matmul."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import operator
import numpy as np
from tensorflow.python import tf2
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import... | {
"content_hash": "97c5f8da10bfc99742ef8838d88cf14d",
"timestamp": "",
"source": "github",
"line_count": 259,
"max_line_length": 80,
"avg_line_length": 38.011583011583014,
"alnum_prop": 0.6052818689690198,
"repo_name": "ghchinoy/tensorflow",
"id": "a3dd7dbf2af3e9cecafc6a88dad7e916c8a51cfe",
"size": ... |
from django.conf import settings
from django.contrib.sites.models import SiteManager, Site, RequestSite
from django.contrib.sites.shortcuts import get_current_site
from django.utils.functional import SimpleLazyObject
from . import get_current_request, set_thread_variable
def get_site(request):
if not hasattr(requ... | {
"content_hash": "b2d13470faa80d83cf2ab20521d24e7e",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 83,
"avg_line_length": 35.46341463414634,
"alnum_prop": 0.6471801925722146,
"repo_name": "maxicecilia/simple_classroom",
"id": "e0e174e13ddcc8ced06c3146474594591639f07a",
"... |
"""Command for listing subnetworks."""
from googlecloudsdk.api_lib.compute import base_classes
class List(base_classes.RegionalLister):
"""List subnetworks."""
@staticmethod
def Args(parser):
base_classes.RegionalLister.Args(parser)
parser.add_argument(
'--network',
help='Only show sub... | {
"content_hash": "8ed165584fb2abed231ac8720ffa6346",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 79,
"avg_line_length": 24.6,
"alnum_prop": 0.7005420054200542,
"repo_name": "KaranToor/MA450",
"id": "cf91eaedc75475a89f2098bc8426f4147fac5abb",
"size": "1334",
"binary":... |
"""Copyright (C) 2021 Advanced Micro Devices, Inc. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use,... | {
"content_hash": "b0809ed043a271cc000eebf0ad08e19b",
"timestamp": "",
"source": "github",
"line_count": 328,
"max_line_length": 135,
"avg_line_length": 35.07012195121951,
"alnum_prop": 0.5406415717638877,
"repo_name": "amcamd/hipBLAS",
"id": "4651bc55634d37ddd5b7954f709d4957a8940768",
"size": "1152... |
from tailorscad.process import render_scad
| {
"content_hash": "6e2aeeaeeb0afd1ffef2c5cd90826357",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 42,
"avg_line_length": 43,
"alnum_prop": 0.8604651162790697,
"repo_name": "savorywatt/tailorSCAD",
"id": "6caa00cbbee90baa44c698915e3d50717c29ddf2",
"size": "43",
"binary"... |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Verify that we only scan generated .h files once.
This originated as a real-life bug report submitted by Scott Lystig
Fritchie. It's been left as-is, rather than stripped down to bare
minimum, partly because it wasn't completely clear what combination... | {
"content_hash": "9fc267dbd442a991ffdb0c33ec2b6efc",
"timestamp": "",
"source": "github",
"line_count": 417,
"max_line_length": 101,
"avg_line_length": 28.52757793764988,
"alnum_prop": 0.6369367854741089,
"repo_name": "andrewyoung1991/scons",
"id": "845111ce9f501599e7ee3e1a1418903cccd87236",
"size"... |
'''
Created on Jul 9, 2013
@author: nshearer
'''
from py_wizard.WizardUserInterface import WizardUserInterface
from ConsoleQuestionPresenter import ConsoleQuestionPresenter
from py_wizard.questions.SimpleQuestion import SimpleQuestion
from ConsoleSimpleQuestion import ConsoleSimpleQuestion
from py_wizar... | {
"content_hash": "dc19a7cd2205a28cc74fc99531d44321",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 78,
"avg_line_length": 35.28971962616822,
"alnum_prop": 0.6957097457627118,
"repo_name": "shearern/PyWizard",
"id": "2527d23930ade34cb0f82746f9fb205de3f9afe0",
"size": "37... |
from reporter.core import SqlReport, Schedule
from reporter.uhl_reports.civicrm import get_contact_link
from reporter.emailing import RECIPIENT_IT_DQ
class CivicrmPracticeDuplicateCode(SqlReport):
def __init__(self):
super().__init__(
introduction=("The following GP Practices do not ... | {
"content_hash": "f41e50d089e2e837a6ca5a47a23d8418",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 78,
"avg_line_length": 37.82222222222222,
"alnum_prop": 0.5264394829612221,
"repo_name": "LCBRU/reporter",
"id": "8307fdb74ea1fcdc565961c3319d2ab4a05398dc",
"size": "1726",... |
def title():
return ''
def content():
return 'This is a placeholder for plots displaying statistics for phase 1 proposals.'
| {
"content_hash": "53dd1a33cdb035a426557014a06ed5f3",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 89,
"avg_line_length": 22.333333333333332,
"alnum_prop": 0.7014925373134329,
"repo_name": "saltastro/salt-data-quality-site",
"id": "b1f96182958e1ee5c21ef78b01f53f5d5a1d00ae",... |
from __future__ import print_function
import numpy as np
import pytest
from pandas.compat import lrange, string_types
from pandas import DataFrame, Series
import pandas.util.testing as tm
@pytest.mark.parametrize('subset', ['a', ['a'], ['a', 'B']])
def test_duplicated_with_misspelled_column_name(subset):
# GH ... | {
"content_hash": "c193b1671f7a7b0445b4dd7538ed3cb6",
"timestamp": "",
"source": "github",
"line_count": 453,
"max_line_length": 79,
"avg_line_length": 31.6401766004415,
"alnum_prop": 0.5578734389171841,
"repo_name": "GuessWhoSamFoo/pandas",
"id": "f61dbbdb989e4b0a912f383417ee6726ba60657c",
"size": ... |
import os
basedir = os.path.abspath(os.path.dirname(__file__))
BCRYPT_LOG_ROUNDS = 12
# Form
SECRET_KEY = 'I cannot forget may eighth'
UPLOAD_FOLDER = 'hjlog/static/image/photo'
ALLOWED_EXTENSIONS = set(['gif', 'jpg', 'jpeg', 'png'])
# SQLAlchemy
if os.environ.get('DATABASE_URL') is None:
SQLALCHEMY_DATABASE_U... | {
"content_hash": "ce46ca3e7e6c9a59da088f5ca6909ca2",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 66,
"avg_line_length": 25.5,
"alnum_prop": 0.6636500754147813,
"repo_name": "heejongahn/hjlog",
"id": "08d38d458a1dba0b2680cc268d7c981548bb39c1",
"size": "663",
"binary":... |
"""
Classes for managing in-memory trajectories.
"""
import numpy as np
import pandas as pd
from sqlalchemy import create_engine
class Trajectory(pd.DataFrame):
"""
A single trajectory is a DF of points, attributes, and computed values.
Also a linked-list with next_traj to allow a series of computations ... | {
"content_hash": "009fb20db7b1ab169a45ea150e89ce9c",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 132,
"avg_line_length": 33.54679802955665,
"alnum_prop": 0.5737151248164464,
"repo_name": "Hezi-Resheff/trajectory-aa-move-ecol",
"id": "7f5676c0a3064aee5263736fb1baca477e18... |
"""
Small module for use with the wake on lan protocol.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import socket
import struct
BROADCAST_IP = '255.255.255.255'
DEFAULT_PORT = 9
def create_magic_packet(macaddress):
"""
Create a magic packet which can be used for wake... | {
"content_hash": "9c5d5b6b9ea96dc5af4f1ad1ac9f8360",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 99,
"avg_line_length": 27.930555555555557,
"alnum_prop": 0.634012928891099,
"repo_name": "ywangd/stash",
"id": "48c1a51a97dcdf2e6982889462ee001d9659dd58",
"size": "2037",
... |
"""this example illustrates how to replace SQLAlchemy's class descriptors with
a user-defined system.
This sort of thing is appropriate for integration with frameworks that
redefine class behaviors in their own way, such that SQLA's default
instrumentation is not compatible.
The example illustrates redefinition of in... | {
"content_hash": "cdfbd88a58b06eb5fc0895035c1c84ea",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 78,
"avg_line_length": 31.36231884057971,
"alnum_prop": 0.6115218730745533,
"repo_name": "ioram7/keystone-federado-pgid2013",
"id": "ebd18a6fa016627036a683df833541c3cc4e4e84... |
import io
import os
import unittest
from chainer import testing
class TestRunnable(unittest.TestCase):
def test_runnable(self):
cwd = os.path.dirname(__file__)
for dirpath, dirnames, filenames in os.walk(cwd):
for filename in filenames:
if not filename.endswith('.py')... | {
"content_hash": "45c0e05ad8c336f90d71f582a608e7ee",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 74,
"avg_line_length": 31.96,
"alnum_prop": 0.5369211514392991,
"repo_name": "tkerola/chainer",
"id": "2fe3ca5aaf9d31f81d7b31a1830c6647c578d1ed",
"size": "799",
"binary":... |
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import GenericRelation
from django.db import models
from django.urls import reverse
from django.utils.html import escape
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from tagging... | {
"content_hash": "75d0ee67e0e76a6a5ecf0923d108fc17",
"timestamp": "",
"source": "github",
"line_count": 265,
"max_line_length": 96,
"avg_line_length": 36.21132075471698,
"alnum_prop": 0.6281784076698624,
"repo_name": "brutasse/djangopeople",
"id": "ba2892c2e03cb512c76c798cd279151418ff5d5a",
"size":... |
"""
admin: modelos de administración del systema de establecimientos
@author Camilo Ramírez
@contact camilolinchis@gmail.com
camilortte@hotmail.com
@camilortte on Twitter
@copyright Copyright 2014-2015, RecomendadorUD
@license GPL
@date 201... | {
"content_hash": "7dd4641bfdf38491930cfdde91dbb136",
"timestamp": "",
"source": "github",
"line_count": 427,
"max_line_length": 157,
"avg_line_length": 41.23419203747073,
"alnum_prop": 0.5556880786051003,
"repo_name": "camilortte/RecomendadorUD",
"id": "3e13485672cb1ee4753e9998f462915620c9ade4",
"s... |
import Axon
import struct
import random
from Kamaelia.Util.Backplane import subscribeTo
from KPI.Crypto import xtea
class Authenticator(Axon.Component.component):
Inboxes = {"inbox" : "authentication and data packets"}
Outboxes = {"outbox" : "authentication",
"notifyuser" : "user not... | {
"content_hash": "92995be9697f6bcbd6bb66a295b26622",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 75,
"avg_line_length": 31.966666666666665,
"alnum_prop": 0.5735140771637122,
"repo_name": "sparkslabs/kamaelia",
"id": "aa66cad7dc2d4e12dca2d5926b7011b671aabf7c",
"size": "... |
__author__ = 'olav'
from aerial import * | {
"content_hash": "3697f10e66cc68fada473a154fa02b21",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 20,
"avg_line_length": 13.666666666666666,
"alnum_prop": 0.6341463414634146,
"repo_name": "olavvatne/CNN",
"id": "64fd4e5633f092ab8d932a46d4a2097968bd275f",
"size": "41",
... |
import os
from termcolor import colored
from launchpadlib import launchpad
from bugsquasher.utils import jsonutils
class LP(object):
local_file = ".launchpad.json"
@staticmethod
def lp(config, section):
cache = section.get("cache_dir",
"~/.bugsquasher/cache")
... | {
"content_hash": "ea8b71b7eeea2f0482f39ff4f7302639",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 75,
"avg_line_length": 32.435483870967744,
"alnum_prop": 0.4987568373943312,
"repo_name": "FlaPer87/bugsquasher",
"id": "d2218286b73c39b9fd6603352455b8cfd7e5e046",
"size": ... |
import logging
from abc import ABCMeta
from hvac.api.vault_api_base import VaultApiBase
logger = logging.getLogger(__name__)
class SystemBackendMixin(VaultApiBase):
"""Base class for System Backend API endpoints."""
__metaclass__ = ABCMeta
| {
"content_hash": "cc23ddaede2ba5ccd6734482f909e382",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 54,
"avg_line_length": 21.083333333333332,
"alnum_prop": 0.7430830039525692,
"repo_name": "ianunruh/hvac",
"id": "5ab06493d557e9bcbfce2e962b97fcb8adc63725",
"size": "299",
... |
from shortuuid.main import decode
from shortuuid.main import encode
from shortuuid.main import get_alphabet
from shortuuid.main import random
from shortuuid.main import set_alphabet
from shortuuid.main import ShortUUID
from shortuuid.main import uuid
__version__ = "1.0.11"
__all__ = [
"decode",
"encode",
"... | {
"content_hash": "4f154446b566e466f75e29505a4ea963",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 39,
"avg_line_length": 22.22222222222222,
"alnum_prop": 0.7025,
"repo_name": "skorokithakis/shortuuid",
"id": "58582eec9904769ec2555a20017a360e78013a35",
"size": "400",
"... |
from django.template import RequestContext
from django.http import HttpResponseNotFound, HttpResponse
def hash_link(request, key):
"""
all hash links go to this function.
"""
from models import HashLink
if key:
return_dict = {}
HashLink.verify_and_call_action_function(request,key, ... | {
"content_hash": "92ef9eeee1ce2086a2926f98b2fcdb93",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 147,
"avg_line_length": 38.97014925373134,
"alnum_prop": 0.6813481424741479,
"repo_name": "peiwei/django-hashphrase",
"id": "a8cc9b3c8cb61e08f3c0e1913bed7df7aa8ac627",
"siz... |
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
def plot_residuals(dataframe, predictions):
'''
Using the same methods that we used to plot a histogram of entries
per hour for our data, why don't you make a histogram of the residuals
(that is, the difference between the original... | {
"content_hash": "f7b1a597864fb5678322ab3a0fffdfee",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 113,
"avg_line_length": 31.659574468085108,
"alnum_prop": 0.6676747311827957,
"repo_name": "napjon/moocs_solution",
"id": "efb163b700d4875774512ed1aa596756056c68d8",
"size"... |
'''
largely adapts: https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/2_BasicModels/linear_regression.py
goal is to show linear dependency between number of variables in SELECT statement and execution time
'''
from __future__ import print_function
from bio_select_variables import *
import te... | {
"content_hash": "3ce51ca1d257a44243188fd464423dfe",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 124,
"avg_line_length": 27.189655172413794,
"alnum_prop": 0.6506024096385542,
"repo_name": "derdav3/tf-sparql",
"id": "f1ddf38a93344a8ca26c81f1cb356652a1d617cd",
"size": "... |
import datetime
import decimal
import warnings
from importlib import import_module
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.backends import utils
from django.utils import six, timezone
from django.utils.dateparse import parse_duration
from django.utils.dep... | {
"content_hash": "f1578a86187b8b6a7bdfd225c006262e",
"timestamp": "",
"source": "github",
"line_count": 621,
"max_line_length": 119,
"avg_line_length": 38.371980676328505,
"alnum_prop": 0.636787108145537,
"repo_name": "sgzsh269/django",
"id": "bf9af0149a0f0a762fe88e42c98038c77edf3d6d",
"size": "238... |
"""Lists all firewall rules for an IP address."""
from baseCmd import *
from baseResponse import *
class listFirewallRulesCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "false"
"""list resources by account. Must be used with the domainId parameter."""
self.account = N... | {
"content_hash": "4744aebac59ec034f84c08c13c84d206",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 178,
"avg_line_length": 37.97457627118644,
"alnum_prop": 0.5811202856505244,
"repo_name": "MissionCriticalCloud/marvin",
"id": "f1d0781f42e27c99a807b2b5dca3a5e7a5610329",
... |
import _plotly_utils.basevalidators
class DimensiondefaultsValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="dimensiondefaults", parent_name="splom", **kwargs):
super(DimensiondefaultsValidator, self).__init__(
plotly_name=plotly_name,
paren... | {
"content_hash": "22a247c9a404838b688dd6b1d858bfe3",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 87,
"avg_line_length": 34.0625,
"alnum_prop": 0.5779816513761468,
"repo_name": "plotly/plotly.py",
"id": "fa1e8792ab8bd12c7576a864277f85f7e534c8d4",
"size": "545",
"binar... |
'''
Created by auto_sdk on 2015.06.23
'''
from aliyun.api.base import RestApi
class Rds20140815DescribeRegionsRequest(RestApi):
def __init__(self,domain='rds.aliyuncs.com',port=80):
RestApi.__init__(self,domain, port)
def getapiname(self):
return 'rds.aliyuncs.com.DescribeRegions.2014-08-15'
| {
"content_hash": "4432065bd7131239103854d7cfc6410f",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 54,
"avg_line_length": 30,
"alnum_prop": 0.7433333333333333,
"repo_name": "francisar/rds_manager",
"id": "1d0063e37a23f85a67438d9ca672ac2496221004",
"size": "300",
"binar... |
'''
if you are using multicore machine (and i can bet that you do) this script demonstrates how to use all
cores, please beware to set line 127 to a number which divides number of columns without reminder
(for ex. if you have x step equal to 0.5 you will have 10/0.5 = 20 columns hence you can use 2, 4, 5, 10 or 20 par... | {
"content_hash": "9601e5e38e1aa603e33025b7d4930094",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 130,
"avg_line_length": 34.00581395348837,
"alnum_prop": 0.5681313044964952,
"repo_name": "autumn-lake/Facebook-V-Predicting-Check-Ins",
"id": "6dadb4b416e5aa984425b4fc070fb... |
from django.db import (
migrations,
models,
)
class Migration(migrations.Migration):
dependencies = [
('accelerator', '0103_migrate_old_user_interest'),
]
operations = [
migrations.AddField(
model_name='startupupdate',
name='acquired_valuation_usd',
... | {
"content_hash": "8e80a666af0bfbce352b677c3240b4b2",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 69,
"avg_line_length": 32.495327102803735,
"alnum_prop": 0.45930399769916597,
"repo_name": "masschallenge/django-accelerator",
"id": "18b83b8b77fa95d5b5357a1d35560b54fc13c3c... |
from joommf.energies.demag import Demag
def test_demag_mif():
demag = Demag()
mif_string = demag.get_mif()
assert 'Specify Oxs_Demag {}' in mif_string
assert demag.__repr__() == "This is the energy class of type Demag"
def test_demag_formatting():
demag = Demag()
mif_string = demag.get_mif()
... | {
"content_hash": "6ffa952b024ddcaf518dbedc23248bde",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 71,
"avg_line_length": 28,
"alnum_prop": 0.6190476190476191,
"repo_name": "fangohr/oommf-python",
"id": "d24e41bd43329d60a1bb273a068d177d8b908cf5",
"size": "420",
"binary... |
import json
import mock
from django.http import JsonResponse, HttpResponseRedirect
from django.test import TestCase, RequestFactory
from django.views.generic import View
from django.contrib.sessions.middleware import SessionMiddleware
from my_app.lib.ttam_api.ttam_api.django.views import AuthenticatedMixin
from my_ap... | {
"content_hash": "9bcaac1dd51fd45b91ebe77bcb92e18c",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 115,
"avg_line_length": 38.130434782608695,
"alnum_prop": 0.6804446978335233,
"repo_name": "ortutay/23andme-phenotypes-hackathon",
"id": "1409e0c08cec40d64acf59e860b0d1dd8105... |
from __future__ import unicode_literals
import logging
import os
import platform
import sys
from pkg_resources import resource_string
from rbtools.commands import Command
class SetupCompletion(Command):
"""Setup auto-completion for rbt.
By default, the command installs an auto-completion file for the user'... | {
"content_hash": "cbc9b64791ab82e7e8584c6cbac28ccc",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 78,
"avg_line_length": 33.70434782608696,
"alnum_prop": 0.5079979360165119,
"repo_name": "davidt/rbtools",
"id": "262613ea62288cc3c4b7afbe0ef3e960738d7705",
"size": "3876"... |
import json
from unittest import mock
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group, Permission
from django.core.files.base import ContentFile
from django.core.files.uploadedfile import SimpleUploadedFile
from django.test import TestCase
from django.test.utils import overr... | {
"content_hash": "54215d3a6f23ae85c8ecfc51940e8515",
"timestamp": "",
"source": "github",
"line_count": 1148,
"max_line_length": 137,
"avg_line_length": 39.98344947735192,
"alnum_prop": 0.6475240190845515,
"repo_name": "mikedingjan/wagtail",
"id": "07bc0854183f8fb39d86c7224abd6319a8a126dc",
"size":... |
from __future__ import absolute_import
import types as py_types
import re
import struct
import binascii
import decimal
import logging
import datetime
from weakref import WeakValueDictionary
from pyhdb.protocol.constants import type_codes
from pyhdb.exceptions import InterfaceError
from pyhdb.compat import PY26, PY2, ... | {
"content_hash": "90953531e6c7b224b4b4ebdab8941813",
"timestamp": "",
"source": "github",
"line_count": 570,
"max_line_length": 119,
"avg_line_length": 30.310526315789474,
"alnum_prop": 0.5862128841812815,
"repo_name": "SAP/PyHDB",
"id": "2903b118845227fde652bac845ecc43c826178c9",
"size": "17853",
... |
import pymysql #Python3
db = pymysql.connect("localhost","sips","root","zaijian" )
cursor = db.cursor()
cursor.execute("SELECT VERSION()")
data = cursor.fetchone()
print ("Database version : %s " % data)
db.close()
def create_table():
db = pymysql.connect("localhost","sips","root","zaijian" )
cursor = db.curso... | {
"content_hash": "8098854bad5b2f41e6569bc8800698a8",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 60,
"avg_line_length": 24.594594594594593,
"alnum_prop": 0.6021978021978022,
"repo_name": "Python-IoT/Smart-IoT-Planting-System",
"id": "d3e9f7de3f63d7f3de57a5c2272c7c0ae564d... |
import hashlib
import urllib
import hmac
import base64
import time
import urlparse
import calendar
import logging
from email.utils import formatdate
import google.protobuf.text_format as text_format
from ots2.error import *
from ots2.protobuf.encoder import OTSProtoBufferEncoder
from ots2.protobuf.decoder import OTSP... | {
"content_hash": "acf791edc2fdc5f57c9f955fb1662644",
"timestamp": "",
"source": "github",
"line_count": 273,
"max_line_length": 142,
"avg_line_length": 37.80952380952381,
"alnum_prop": 0.5840922301879481,
"repo_name": "wanghq/goots",
"id": "5ab9cc881e8380697848d9cbe83861e03cb46069",
"size": "10346"... |
from . import pyloggingconf
from .debugfile import DebugFile
from .librarylisteners import LibraryListeners
from .listeners import Listeners
from .logger import LOGGER
from .loggerhelper import AbstractLogger
from .xmllogger import XmlLogger
class Output(AbstractLogger):
def __init__(self, settings):
Abs... | {
"content_hash": "5927cc96c7cc5726f3590f10c9409fa9",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 77,
"avg_line_length": 30.214285714285715,
"alnum_prop": 0.6601654846335697,
"repo_name": "ldtri0209/robotframework",
"id": "b35bd36767b3315eb80669b65149f2f0feb89dc6",
"siz... |
"""Agent with uses A3C trained network"""
import random
import torch
import torch.nn.functional as F
from torch.autograd import Variable
from loveletter.env import LoveLetterEnv
from loveletter.agents.random import AgentRandom
from loveletter.agents.agent import Agent
from loveletter.trainers.a3c_model import Actor... | {
"content_hash": "f2c0ccb33d65fd0e95e892c34c2338dc",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 75,
"avg_line_length": 31.666666666666668,
"alnum_prop": 0.6052631578947368,
"repo_name": "user01/love-letter",
"id": "2834b4f891cd4151fd5fcdd55e17eb72d750250b",
"size": "1... |
"""HTTP Basic Authentication tool.
This module provides a CherryPy 3.x tool which implements
the server-side of HTTP Basic Access Authentication, as described in
:rfc:`2617`.
Example usage, using the built-in checkpassword_dict function which uses a dict
as the credentials store::
userpassdict = {'bird' : 'bebop... | {
"content_hash": "85fcf7394af003faa39957a38e305d96",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 79,
"avg_line_length": 36.69230769230769,
"alnum_prop": 0.6526904262753319,
"repo_name": "Safihre/cherrypy",
"id": "ad379a2601765fdee0809c4174b144d7331d71a2",
"size": "442... |
from grappelli.dashboard.dashboards import *
from grappelli.dashboard.registry import *
default_app_config = "grappelli.dashboard.apps.DashboardConfig"
| {
"content_hash": "74b889de9e61f08e5c6762a2652e7b89",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 63,
"avg_line_length": 38.25,
"alnum_prop": 0.8300653594771242,
"repo_name": "lz1988/django-web2015",
"id": "bb9f765438583ae7f5158568c496ba738fc645b4",
"size": "153",
"bin... |
"""
Base classes and utility functions to handle unit-testing.
"""
import unittest
import os
import sys
import datetime
from contextlib import contextmanager
from maya import cmds
import pymel.core as pymel
import libSerialization
def _get_holded_shapes():
"""
:return: The numbers of shapes connected to anm... | {
"content_hash": "c209b4c1f83f8a98b5b4ca105639e9a6",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 160,
"avg_line_length": 38.99551569506726,
"alnum_prop": 0.6062557497700092,
"repo_name": "SqueezeStudioAnimation/omtk",
"id": "9235790999347b44bd5e9ea94d2b3b501960fc2f",
... |
from syncer import Syncer
class Photo(object):
def __init__(self, dict):
self.__dict__.update(dict)
class Tests():
def test_date_path_zero_pads_months(self):
testee = Syncer("/storage")
photo = Photo({
"dateTakenYear" : "2014",
"dateTakenMonth" : "4",
"dateTakenDay" : "16",
"filenameOriginal" : ... | {
"content_hash": "1118678592a72100692768dcfeb20a7d",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 54,
"avg_line_length": 26.285714285714285,
"alnum_prop": 0.6480978260869565,
"repo_name": "FredrikWendt/trovebox-syncer",
"id": "89078cebd0500a2df77ded8f35762385a5a217ad",
... |
"""
Declarative.
..description: Database models.
..author: Arthur Moore <arthur.moore85@gmail.com>
..date: 07/03/2016
"""
from sqlalchemy import Column, ForeignKey, Integer, String, create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy.orm import ... | {
"content_hash": "f58abf5327bee4e644d812e96339c34d",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 79,
"avg_line_length": 25.535714285714285,
"alnum_prop": 0.6825174825174826,
"repo_name": "ArthurMoore85/rb5-slack-bot",
"id": "01c745853b529dc0e4505a92a4cca3583dbbb723",
"... |
import numpy as np
import sys
from .base import Prox
from .build.prox import ProxEqualityDouble as _ProxEqualityDouble
from .build.prox import ProxEqualityFloat as _ProxEqualityFloat
__author__ = 'Stephane Gaiffas'
dtype_map = {
np.dtype("float64"): _ProxEqualityDouble,
np.dtype("float32"): _ProxEqualityFloa... | {
"content_hash": "e9859a5d3732b35f606c95ff771d7d20",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 79,
"avg_line_length": 30.370786516853933,
"alnum_prop": 0.5985941546429893,
"repo_name": "X-DataInitiative/tick",
"id": "cd3ca441fed49b77f9c0546c260bed641b1cc4f8",
"size":... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import absltest
from spaces import multi_discrete_with_none
from gym.spaces import multi_discrete
class MultiDiscreteWithNoneTest(absltest.TestCase):
def test_space_contains_none(self):
... | {
"content_hash": "ca0436aa602f917463e5f3336c41dbf9",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 78,
"avg_line_length": 33.2972972972973,
"alnum_prop": 0.6793831168831169,
"repo_name": "google/ml-fairness-gym",
"id": "9934d3423c22deecc32cfd3175b8fec126bd0f50",
"size": ... |
import platform
import os
import stat
import logging
import json
import concurrent
from concurrent.futures import ThreadPoolExecutor
import requests
from requests.compat import urljoin, quote_plus
from .githash import calc_file_checksum
# TODO: Properly use mirrors and load them from a file (which is also synced)
mi... | {
"content_hash": "a3186b585b1c85629d5d48d1af50520e",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 110,
"avg_line_length": 33.75,
"alnum_prop": 0.5989159891598916,
"repo_name": "Spring-Chobby/ChobbyLauncher",
"id": "9bf324d0b12992081ad45e4b1c7357f2e65a100c",
"size": "55... |
from __future__ import absolute_import, unicode_literals
import datetime
from django.db.models import DateTimeField
from django.conf import settings
from django.utils.encoding import smart_text
from django.utils import six, timezone
from doj.db.backends import JDBCBaseDatabaseOperations as BaseDatabaseOperations
t... | {
"content_hash": "9e4c65f2b5ec605310f9e581daff3903",
"timestamp": "",
"source": "github",
"line_count": 418,
"max_line_length": 116,
"avg_line_length": 37.61244019138756,
"alnum_prop": 0.5713649662892761,
"repo_name": "beachmachine/django-jython",
"id": "4451cd40183701105604403e0f00b0dd203a2169",
"... |
"""
See:
https://packaging.python.org/guides/distributing-packages-using-setuptools/
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
from os import path
from setuptools import setup
def read(filename):
with open(path.join(path.dirname(__file__), filename), enco... | {
"content_hash": "d50e1ccd9168a7dfd4b45ee2d479b8ef",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 82,
"avg_line_length": 33.28888888888889,
"alnum_prop": 0.6528704939919893,
"repo_name": "olivertso/pde",
"id": "3f8cb5c1f2e62bf246b9c40e13256f9099fc70d4",
"size": "1498",
... |
import sys
import subprocess
import json
import math
# xref prow/Makefile get-build-cluster-credentials
# TODO: perhaps make these configurable
CLUSTER = 'prow'
ZONE = 'us-central1-f'
PROJECT = 'k8s-prow-builds'
def get_pool_sizes(project, zone, cluster):
"""returns a map of node pool name to size using the gclo... | {
"content_hash": "a8a82dd08b00ed9a020bcc8a0af90302",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 92,
"avg_line_length": 35.348387096774196,
"alnum_prop": 0.6054024457017704,
"repo_name": "brahmaroutu/test-infra",
"id": "0bc609e0d1e18530a86ca587c587cdbed959376a",
"size... |
"""new pm resource
Revision ID: 7aed6936ccee
Revises: 7aad615d6979
Create Date: 2020-01-29 08:51:35.381339
"""
from alembic import op
import sqlalchemy as sa
import model.utils
from sqlalchemy.dialects import mysql
from rdr_service.participant_enums import PhysicalMeasurementsStatus, QuestionnaireStatus, OrderStatus... | {
"content_hash": "ad99deaf26e580b7b0c5cdc605bb6e8f",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 125,
"avg_line_length": 38.40298507462686,
"alnum_prop": 0.7535950252623397,
"repo_name": "all-of-us/raw-data-repository",
"id": "5cb5e270fce49465aaac608a67c0826b7001f5dc",
... |
"""
Local settings
- Run in Debug mode
- Use console backend for emails
- Add Django Debug Toolbar
- Add django-extensions as app
"""
import socket
import os
from .common import * # noqa
# DEBUG
# ------------------------------------------------------------------------------
DEBUG = env.bool('DJANGO_DEBUG', defau... | {
"content_hash": "81635e2a95a7efd8d0d360f9d5279304",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 99,
"avg_line_length": 27.5,
"alnum_prop": 0.45454545454545453,
"repo_name": "bruecksen/notifhain",
"id": "27a5a28e697174b3f76800843aad5eaddb99a38b",
"size": "2420",
"bin... |
''' Bokeh is a Python interactive visualization library that targets modern
web browsers for presentation.
Its goal is to provide elegant, concise construction of versatile graphics,
and also deliver this capability with high-performance interactivity over large
or streaming datasets. Bokeh can help anyone who would l... | {
"content_hash": "325a22c59054b80f1f122b515d11002d",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 82,
"avg_line_length": 33.50526315789474,
"alnum_prop": 0.49198868991517436,
"repo_name": "stonebig/bokeh",
"id": "2aebe20114da30d711538d43c10facf4e54919c3",
"size": "3514"... |
import unittest
from sets import Set
from common import DtraceTestCase
from analyzer.darwin.lib.dtrace.ipconnections import *
class TestIpconnections(DtraceTestCase):
def test_ipconnections_udp(self):
# given
expected = ('127.0.0.1', # host
53, # port
'UDP') # protocol... | {
"content_hash": "1485f4b5d84b6d11e66c1241dfc234bd",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 68,
"avg_line_length": 26.42168674698795,
"alnum_prop": 0.6096671226630187,
"repo_name": "rodionovd/cuckoo-osx-analyzer",
"id": "29adbbad59b8b9dc589e4aeb66cc46f82953cd52",
... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^register$', views.register, name='register'),
url(r'^$', views.register, name='register'),
]
| {
"content_hash": "2e53e60d813108ff9be839d431c0dd00",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 56,
"avg_line_length": 20.444444444444443,
"alnum_prop": 0.6467391304347826,
"repo_name": "kunal-exuberant/search-directory",
"id": "140eb24d25e993bf743ecb550f5d6d3f9658adf0",... |
import sys
import csv
import cPickle
import argparse
import numpy as np
from utils import logger, TaskMode
parser = argparse.ArgumentParser(description="PaddlePaddle CTR example")
parser.add_argument(
'--data_path', type=str, required=True, help="path of the Avazu dataset")
parser.add_argument(
'--output_dir'... | {
"content_hash": "b4d0d99ee6611bc3b165a8048316efec",
"timestamp": "",
"source": "github",
"line_count": 411,
"max_line_length": 82,
"avg_line_length": 28.29440389294404,
"alnum_prop": 0.5740820362885889,
"repo_name": "xinghai-sun/models",
"id": "dd148adc244efc64021446b17488ec7f2b1c9bd9",
"size": "1... |
import os;
import sys;
import operator;
import subprocess;
from time import gmtime, strftime
SCRIPT_PATH = os.path.dirname(os.path.realpath(__file__));
TOOLS_PATH = '%s/../tools/' % (SCRIPT_PATH);
SAMSCRIPTS_PATH = '%s/../tools/samscripts/src' % (SCRIPT_PATH);
sys.path.append(SAMSCRIPTS_PATH);
import fastqparser;
im... | {
"content_hash": "8a69a75ed34474e6c17687aa88ab9266",
"timestamp": "",
"source": "github",
"line_count": 531,
"max_line_length": 263,
"avg_line_length": 43.11864406779661,
"alnum_prop": 0.6564028651292803,
"repo_name": "isovic/ra-consensus",
"id": "0f82cc24ee6cd2cb1a73543af2ed5b8cdac84fa3",
"size": ... |
import os
import struct
from litex.gen import *
from litex.soc.interconnect import wishbone
class MemoryMustHaveContents(Memory):
@staticmethod
def emit_verilog(memory, ns, add_data_file):
assert memory.init, "ROM contents not found! {}".format(memory.filename)
return Memory.emit_verilog(memo... | {
"content_hash": "0632397c149a0799c48e500f93dcb594",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 80,
"avg_line_length": 34.58974358974359,
"alnum_prop": 0.541882876204596,
"repo_name": "cr1901/HDMI2USB-litex-firmware",
"id": "f2a7b11c7e0a12d2b2a8819416a5e2db19e9af37",
... |
from datetime import datetime
from django.contrib.contenttypes.models import ContentType
import os
import json
from django.db import IntegrityError
from django.core.urlresolvers import reverse
from django.core.files.storage import default_storage, get_storage_class
from django.contrib.auth.decorators import login_requi... | {
"content_hash": "b28996b913ae00f0f01df5d2ac40eede",
"timestamp": "",
"source": "github",
"line_count": 1322,
"max_line_length": 79,
"avg_line_length": 39.54841149773071,
"alnum_prop": 0.558996232044833,
"repo_name": "wesley1001/formhub",
"id": "b818df50e0edadb3afe084a320139201fc3e808d",
"size": "5... |
import scrapy
class StackOverflowSpider(scrapy.Spider):
name = 'stackoverflow'
start_urls = ['http://stackoverflow.com/questions?sort=votes']
def parse(self, response):
for href in response.css('.question-summary h3 a::attr(href)'):
full_url = response.urljoin(href.extract())
... | {
"content_hash": "35e9cd6c3544a00d8a92e4a599c9acc8",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 83,
"avg_line_length": 40.78947368421053,
"alnum_prop": 0.6064516129032258,
"repo_name": "Akagi201/learning-python",
"id": "89bda90f74f1e8318fdf4625fb4999c0048a6576",
"size... |
from django.contrib import admin
from cms.models import Blog
from cms.models import Post
class BlogAdmin(admin.ModelAdmin):
list_display = (
'id',
"user",
"name",
'description',
'created_at',
'updated_at'
)
search_fields = ['^id', 'name', "description"]
... | {
"content_hash": "dea76f1e9e96b1038278b4964f01d303",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 50,
"avg_line_length": 18.771428571428572,
"alnum_prop": 0.5799086757990868,
"repo_name": "masaki-sato/django-sample",
"id": "5d8c5eb5db0634651b04de390bbec0b3ab2763dd",
"si... |
import os
import sys
import json
from random import randint
import StringIO
import socket
import uuid
import shutil
' Test command line usage: python genimporter_solver.py <modulename> <quakeml> <station> <user_conf>'
' scriptpath1="./resources/"+sys.argv[1]+".py '
from specfemGlobeCompiler import *
class GeneralImpo... | {
"content_hash": "8bf62c7db07c7671f7f73ea5b867e96a",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 148,
"avg_line_length": 33.705882352941174,
"alnum_prop": 0.6278359511343804,
"repo_name": "rafiqsaleh/VERCE",
"id": "57ba892dc50f5ff501efabdb448ff3a7ea2e02c5",
"size": "22... |
from ovirtcli.shell.cmdshell import CmdShell
class DisconnectCmdShell(CmdShell):
NAME = 'disconnect'
def __init__(self, context):
CmdShell.__init__(self, context)
def do_disconnect(self, args):
return self.context.execute_string(DisconnectCmdShell.NAME + ' ' + args + '\n')
| {
"content_hash": "59cc00f30d3522593246b8959b47ee8b",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 87,
"avg_line_length": 25.583333333333332,
"alnum_prop": 0.6677524429967426,
"repo_name": "oVirt/ovirt-engine-cli",
"id": "4f02b3be7267f948c8e830115b7ae1a47fda37e4",
"size"... |
import os
import json
from PyQt5 import QtCore
from PyQt5 import QtGui
from PyQt5 import QtWidgets
from .menubar import MenuBar
from .statusbar import StatusBar
from .centerwindow import CenterWindow
from gui.uiconfig import windowsoptions
from gui.uiutil import set_skin, changebg
import gui.dialogs as dialogs
from .gu... | {
"content_hash": "4043605930e35b9f666e66252ce25b28",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 149,
"avg_line_length": 34.328125,
"alnum_prop": 0.6115157032316796,
"repo_name": "dragondjf/CloudSetuper",
"id": "ce1d472901a68477750866a7d11c11f330100a72",
"size": "4573... |
"""Unit test cases for COT.edit_properties.COTEditProperties class."""
import logging
import os
import re
from COT.commands.tests.command_testcase import CommandTestCase
from COT.commands.edit_properties import COTEditProperties
from COT.data_validation import ValueUnsupportedError
class TestCOTEditProperties(Comma... | {
"content_hash": "2c4c3c2298a5cb43ec1058aa50a7d3ca",
"timestamp": "",
"source": "github",
"line_count": 551,
"max_line_length": 79,
"avg_line_length": 41.75317604355717,
"alnum_prop": 0.6076675649830479,
"repo_name": "glennmatthews/cot",
"id": "a73526a1e1d12b18ccef364a9f53791cb75b137a",
"size": "23... |
import six
import time
import sqlalchemy.exc
from sqlalchemy import create_engine, MetaData, Table, Column, String, Float, Text
from sqlalchemy.engine.url import make_url
from pyspider.libs import utils
from pyspider.database.base.projectdb import ProjectDB as BaseProjectDB
from .sqlalchemybase import result2dict
if ... | {
"content_hash": "2a0332515bea899ffc576a05a183644b",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 91,
"avg_line_length": 40.66019417475728,
"alnum_prop": 0.5267430754536772,
"repo_name": "jjyycchh/pyspider",
"id": "83e3e138d5267fb94e0ce1aac38cd159ff31bd93",
"size": "43... |
from sense_hat import SenseHat
sense = SenseHat()
def name():
pressure = sense.get_pressure()
return str(round(pressure, 1))
def temp():
temp = sense.get_temperature()
return str(round(temp, 1))
def hum():
hum = sense.get_humidity()
return str(round(hum, 1))
print(name())
print(temp())
print(hum())
| {
"content_hash": "82da3e1a86fd59eecc2959b5dd0b625d",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 32,
"avg_line_length": 16.36842105263158,
"alnum_prop": 0.6784565916398714,
"repo_name": "rbontekoe/raspi",
"id": "4146243a7570669f5130f5996adcee952fbfcdc4",
"size": "311",... |
"""Defines input readers for MapReduce."""
__all__ = [
"AbstractDatastoreInputReader",
"ALLOW_CHECKPOINT",
"BadReaderParamsError",
"BlobstoreLineInputReader",
"BlobstoreZipInputReader",
"BlobstoreZipLineInputReader",
"COUNTER_IO_READ_BYTES",
"COUNTER_IO_READ_MSEC",
"ConsistentKeyRe... | {
"content_hash": "0af9e3eb610b01de3db0ca350a1dd3f1",
"timestamp": "",
"source": "github",
"line_count": 2042,
"max_line_length": 80,
"avg_line_length": 32.67286973555338,
"alnum_prop": 0.644578674420696,
"repo_name": "undoware/neutron-drive",
"id": "d525818b385c1a7ff5ce7a127891cd43d015f2cb",
"size"... |
import remi.gui as gui
from remi import start, App
from remi_ext import TreeTable, SingleRowSelectionTable
class MyApp(App):
def __init__(self, *args):
super(MyApp, self).__init__(*args)
def main(self):
self.wid = gui.VBox(style={'margin':'5px auto', 'padding': '10px'})
table = [('', '... | {
"content_hash": "3094d4460c027a29475367944d4fe551",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 89,
"avg_line_length": 46.8125,
"alnum_prop": 0.5358811748998665,
"repo_name": "dddomodossola/gui",
"id": "1b8ab865f0f2b395dcdb102286dbe8e547771091",
"size": "5992",
"bi... |
from django.conf.urls import url
from . import views
#app_name = 'books'
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^books/$', views.book_list, name='books'),
url(r'^deals/$', views.deals, name='deals'),
url(r'^contact/$', views.contact, name='contact'),
url(r'^(?P<id>\d+)/(?P<sl... | {
"content_hash": "118bc61e00169780195265f6d45c3f7c",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 59,
"avg_line_length": 36.42857142857143,
"alnum_prop": 0.6,
"repo_name": "rambasnet/bookstore",
"id": "3dab5769d02a8f79d278684f61e4713c2a7ccd0f",
"size": "765",
"binary"... |
import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="size", parent_name="layout.yaxis.tickfont", **kwargs
):
super(SizeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pare... | {
"content_hash": "96c39cda6ece2eef437b7181ff17620b",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 79,
"avg_line_length": 33.333333333333336,
"alnum_prop": 0.578,
"repo_name": "plotly/python-api",
"id": "8565798a9d328286c8c0aa59a9c08b3ec8e015a3",
"size": "500",
"binary... |
import os
import subprocess
from ducktape.template import TemplateRenderer
from kafkatest.services.security.minikdc import MiniKdc
class Keytool(object):
@staticmethod
def generate_keystore_truststore(ssl_dir='.'):
"""
Generate JKS keystore and truststore and return
Kafka SSL propertie... | {
"content_hash": "5be545fb219dfe19871d4907805b1244",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 197,
"avg_line_length": 44.346820809248555,
"alnum_prop": 0.6458550573514077,
"repo_name": "samaitra/kafka",
"id": "b5efba81e4f803a65410e626d3b0e918decf0b48",
"size": "845... |
'''
Magnetic field lines
'''
import warnings
import traceback
msg, err = None, None
try:
import imas
except Exception as err:
if str(err) == 'imas not available':
msg = ""
msg += "\n\nIMAS python API issue\n"
msg += "imas could not be imported into tofu ('import imas' failed):\n"
... | {
"content_hash": "8e2e4b3bf12df4a818ec9bcf1ae8df14",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 79,
"avg_line_length": 25.761904761904763,
"alnum_prop": 0.6182994454713494,
"repo_name": "Didou09/tofu",
"id": "b2a41d44a4d42288e9fa5841932c350e2e36907b",
"size": "1160",
... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("promrep", "0054_rebuild_provinces_tree"),
]
operations = [
migrations.AddField(
model_name="person",
name="highest_office",
field=models.CharField(max_le... | {
"content_hash": "e6e525aa99dda0e1b71b96575ee5679c",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 75,
"avg_line_length": 25.761904761904763,
"alnum_prop": 0.5748613678373382,
"repo_name": "kingsdigitallab/dprr-django",
"id": "4a3f16de2648df942c3c9cd0911835780b6f6009",
"... |
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
from common import public
import re
class guizhou_zhongbiao():
need_check_ziduan = [u'bbd_dotime',
u'main',
u'title',
u'pubdate',
u'company_name_invite',
... | {
"content_hash": "da0672df172f580456838b6c7d6239f3",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 57,
"avg_line_length": 25.96969696969697,
"alnum_prop": 0.4719953325554259,
"repo_name": "mefly2012/platform",
"id": "c7e1977fc154bcb4f15bb3afda1bb2fbc76ffc3c",
"size": "18... |
from datetime import datetime
from flask import jsonify, Blueprint
from dto.semester import YearSemester
from scraping.handlers.course_results_page import get_course_results
course_blueprint = Blueprint('course', __name__)
@course_blueprint.route('/course/<parameter_course_code>')
def course(parameter_course_code):... | {
"content_hash": "cc5c1764592e5db1620305ba7e7bcca2",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 95,
"avg_line_length": 35.526315789473685,
"alnum_prop": 0.7748148148148148,
"repo_name": "Aqwis/karstat-wrapper",
"id": "80c13e66eafab4c7339f258ee8255825e5f81a7c",
"size":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.