text stringlengths 4 1.02M | meta dict |
|---|---|
"""Authentication components for single-signon via Underpants."""
import urllib
from django.contrib.auth.middleware import RemoteUserMiddleware
from django.contrib.auth.backends import RemoteUserBackend
class UnderpantsRemoteUserMiddleware(RemoteUserMiddleware):
header = "HTTP_UNDERPANTS_EMAIL"
class Underpan... | {
"content_hash": "34121054928da62c3c67e0e87d6a9443",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 65,
"avg_line_length": 29.333333333333332,
"alnum_prop": 0.8113636363636364,
"repo_name": "reddit/django-underpants",
"id": "d0b07e57ef3e4ec56a8b88a6857f9a58e0673492",
"siz... |
from datetime import datetime
import re
import numpy as np
import pytest
import pandas as pd
from pandas import (
Series,
_testing as tm,
)
# --------------------------------------------------------------------------------------
# str.contains
# ---------------------------------------------------------------... | {
"content_hash": "297bf210c66125118d639436892cf4dd",
"timestamp": "",
"source": "github",
"line_count": 925,
"max_line_length": 88,
"avg_line_length": 35.00432432432432,
"alnum_prop": 0.5825380647950832,
"repo_name": "jorisvandenbossche/pandas",
"id": "f390cbf492202b16d8cb4a091393cef2b864caa0",
"si... |
"""Scheduling learning rate."""
import logging
class LRScheduler(object):
"""Base class of a learning rate scheduler.
A scheduler returns a new learning rate based on the number of updates that have
been performed.
Parameters
----------
base_lr : float, optional
The initial learning r... | {
"content_hash": "7c6b37a9a6cd9de07ce8f7a2247a42c8",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 100,
"avg_line_length": 35.411764705882355,
"alnum_prop": 0.5782576596530085,
"repo_name": "TuSimple/mxnet",
"id": "963560d17853a54964439e937324da321c82bafb",
"size": "620... |
from __future__ import absolute_import
import mmap
import sys
import time
import Queue
import base64
import hashlib
import json
import os
import re
import tempfile
import threading
import urllib2
from Crypto import Random
from Crypto.Cipher import AES
#
# Author: Matthew Ingersoll <matth@mtingers.com>
#
# A class f... | {
"content_hash": "0efc6bd7283b344a00fed3ec18123cc0",
"timestamp": "",
"source": "github",
"line_count": 690,
"max_line_length": 125,
"avg_line_length": 41.85507246376812,
"alnum_prop": 0.5536703601108033,
"repo_name": "mtingers/backblaze-b2",
"id": "4da9862030af41b4bfb59814db7e5aa438765c55",
"size"... |
import os, multiprocessing, traceback
from pointcloud.QueriesParameters import QueriesParameters
from pointcloud import utils
class AbstractQuerier:
"""Abstract class for the queriers to be implemented for each different
solution for the benchmark."""
def __init__(self, configuration):
""" Create ... | {
"content_hash": "d4ba30bcafbb639eb1159383e3e94d1e",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 161,
"avg_line_length": 46.14093959731544,
"alnum_prop": 0.5898181818181818,
"repo_name": "NLeSC/pointcloud-benchmark",
"id": "ec27b7fcf700f80121d33135136272a4813febba",
"... |
from __future__ import unicode_literals
import re
from akamai.storage import AkamaiNetStorage
from akamai.utils import get_storage_class
from django.core.exceptions import ImproperlyConfigured
from django.core.files import storage as django_storage
from django.forms import fields
class AkamaiFilePathField(fields.Ch... | {
"content_hash": "6cda124a5fd2db2564181be3943274e2",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 125,
"avg_line_length": 38.38461538461539,
"alnum_prop": 0.6482965931863728,
"repo_name": "g3rd/django-akamai-storage",
"id": "5b3381b810e8a8d0cb5fd0a7f7400e2eec21882f",
"s... |
import uuid
import datetime
import bson
import mock
from tests import FunctionalTest
from st2common.util import date as date_utils
from st2common.models.db.auth import ApiKeyDB, TokenDB, UserDB
from st2common.persistence.auth import ApiKey, Token, User
from st2common.exceptions.auth import TokenNotFoundError
from st2... | {
"content_hash": "09af7fa814fa028d302e7b9eb17f1214",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 99,
"avg_line_length": 43.97080291970803,
"alnum_prop": 0.649070385126162,
"repo_name": "tonybaloney/st2",
"id": "9df727a644f05f4bf2959c901098bad82f42ba24",
"size": "6804"... |
"""Conformer utilities."""
import copy
from typing import List, Optional
from absl import logging
import numpy as np
import rdkit
from rdkit import Chem
from rdkit.Chem import AllChem
import tensorflow.compat.v2 as tf
def generate_conformers(
molecule: Chem.rdchem.Mol,
max_num_conformers: int,
*,
ran... | {
"content_hash": "d932f05768b82cf97735df1e0b644f47",
"timestamp": "",
"source": "github",
"line_count": 310,
"max_line_length": 80,
"avg_line_length": 31.803225806451614,
"alnum_prop": 0.6887108225986408,
"repo_name": "deepmind/deepmind-research",
"id": "3217a4b2a1083fa99371966e6de63b9e61dba3d1",
"... |
from wtforms import TextField, SelectMultipleField, SelectField
from wtforms.validators import DataRequired, NumberRange, Email
from ..datacenter import DatacenterCheckForm
class CheckForm(DatacenterCheckForm):
''' Monitor form for cloudflare traffic increase monitoring '''
title = "CloudFlare: Decrease in Tr... | {
"content_hash": "4a0d382e0bec29d86bf400480cba7ddb",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 364,
"avg_line_length": 43.824561403508774,
"alnum_prop": 0.6725380304243395,
"repo_name": "Runbook/runbook",
"id": "4dcc8084fbd478d1be5bf1c0e567e03184c537a9",
"size": "279... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('competitions', '0004_auto_20151024_1653'),
]
operations = [
migrations.AddField(
model_name='series',
name='results_note',
... | {
"content_hash": "25206f4e58c84ae30ac1d361d4bb52c8",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 106,
"avg_line_length": 25.157894736842106,
"alnum_prop": 0.6108786610878661,
"repo_name": "tbabej/roots",
"id": "cec4ce664b1e49fe1149486ba2d6faae262c8308",
"size": "502",
... |
import logging
import json
import requests
import time
from collections import namedtuple
try:
from urllib.parse import urlparse as parse_url
except ImportError:
from urlparse import urlparse as parse_url
from .exceptions import (
SocketIOError, ConnectionError, TimeoutError, PacketError)
from .symmetries ... | {
"content_hash": "6b2a4901ac7c4c69aa16a9b0cb2d354b",
"timestamp": "",
"source": "github",
"line_count": 523,
"max_line_length": 79,
"avg_line_length": 34.5717017208413,
"alnum_prop": 0.5864166804933355,
"repo_name": "drewhutchison/socketIO-client",
"id": "44b4444e165d2f74a9346b7f5529d2f01b13d936",
... |
"""Fashion-MNIST dataset.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gzip
import os
import numpy as np
from tensorflow.python.keras._impl.keras.utils.data_utils import get_file
def load_data():
"""Loads the Fashion-MNIST dataset.
Ret... | {
"content_hash": "f1f4e6c8e1577a01900bf3383a8ea1ac",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 76,
"avg_line_length": 29.217391304347824,
"alnum_prop": 0.6599702380952381,
"repo_name": "zasdfgbnm/tensorflow",
"id": "b9ae41a0d4d0e8d9df70e3fc1952e81c5f57e8d9",
"size": ... |
"""rawtranscation RPCs QA test.
# Tests the following RPCs:
# - createrawtransaction
# - signrawtransaction
# - sendrawtransaction
# - decoderawtransaction
# - getrawtransaction
"""
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
# Create one-input, one... | {
"content_hash": "79a0b402907dc6faa597ddd00e41ca3d",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 147,
"avg_line_length": 46.53225806451613,
"alnum_prop": 0.6376660889659157,
"repo_name": "dogecoin/dogecoin",
"id": "1eae751547c52a0a646a4fe23746c20cba07d53d",
"size": "8... |
from __future__ import unicode_literals
from datetime import datetime
from dateutil.parser import parse
from django.utils.six import string_types
from django.utils.timezone import pytz
def hex_timestamp_to_datetime(hex_timestamp):
"""Converts hex timestamp to a datetime object.
>>> hex_timestamp_to_datetim... | {
"content_hash": "ab8ae3ee0e59d7543c049504a7f7bef6",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 80,
"avg_line_length": 31.56497175141243,
"alnum_prop": 0.6472167531770181,
"repo_name": "InfoAgeTech/django-core",
"id": "1b87f3425a3eb12bf465573828f28872eccdcc3d",
"size... |
"""
jsongit.models
The meat of jsongit code, particularly the Repository, resides here.
"""
import pygit2
# import collections
# import functools
import shutil
import itertools
from .exceptions import (
NotJsonError, InvalidKeyError, DifferentRepoError, StagedDataError)
from .wrappers import Commit, Diff, Confli... | {
"content_hash": "c71f8956ca4b16b7d580fa4e539943b8",
"timestamp": "",
"source": "github",
"line_count": 724,
"max_line_length": 95,
"avg_line_length": 34.802486187845304,
"alnum_prop": 0.5561773226971465,
"repo_name": "talos/jsongit",
"id": "23a518322252513be9edb2afcd35d8b8ce9b1dae",
"size": "25222... |
import random
import sys
import os
if len(sys.argv) != 2:
print "you need to invoke this script with 1 parameter: the path to the offspring.csv file you want to analyze"
quit()
offspringFile = os.path.abspath(sys.argv[1])
if not os.path.isfile(offspringFile):
print "couldn't find file: " + offspringFile
... | {
"content_hash": "e97faee9ec3d96ab29b32e4173feaf47",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 115,
"avg_line_length": 26.71153846153846,
"alnum_prop": 0.5694744420446364,
"repo_name": "fgolemo/EC14-main",
"id": "d1194bd971ce3d1753163914a40fe2175546c0bc",
"size": "13... |
import unittest
from unittest.mock import Mock
class Mailer:
def send_email(self, email, message):
raise NotImplementedError("Not implemented yet")
class DB:
def insert_user(self, user):
raise NotImplementedError("Not implemented yet")
class User:
def __init__(self, email, name):
... | {
"content_hash": "b45389a45a30f61bb863470d22bc9af8",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 76,
"avg_line_length": 25.2972972972973,
"alnum_prop": 0.655982905982906,
"repo_name": "jordillull/unit-tests-uib-2015",
"id": "be6623d9ef988d30639a09a04770977e0b1ae6ae",
"... |
"""utilities for testing IPython kernels"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import atexit
from contextlib import contextmanager
from subprocess import PIPE, STDOUT
try:
from queue import Empty # Py 3
except ImportError:
from Queue import E... | {
"content_hash": "473170b236039ef20c5296811bd93c53",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 80,
"avg_line_length": 30.217391304347824,
"alnum_prop": 0.5749229188078109,
"repo_name": "wolfram74/numerical_methods_iserles_notes",
"id": "399f13e80b3bb129465dad10474aee7... |
import re
from functools import partial
from syn.five import STR, PY2, unicode, unichr
from .py import get_typename, hasmethod
#-------------------------------------------------------------------------------
# String-Quoting Utils
QUOTES_PATTERN = re.compile('^(\'\'\'|"""|\'|")')
def quote_string(obj):
ret_type ... | {
"content_hash": "c455e5a406a31e2b7592da99f884183a",
"timestamp": "",
"source": "github",
"line_count": 277,
"max_line_length": 80,
"avg_line_length": 24.617328519855597,
"alnum_prop": 0.45607860390086524,
"repo_name": "mbodenhamer/syn",
"id": "a927b1c80b94a2d3d1de6eee030c2ba8f5648a54",
"size": "68... |
from django.contrib import admin
from main.models import UserProfile, MetaData
class ProfAdmin(admin.ModelAdmin):
list_display = ('user', 'name', 'role')
admin.site.register(UserProfile, ProfAdmin)
class MDAdmin(admin.ModelAdmin):
list_display = ('xform', 'data_type', 'data_value', 'data_file_type')
admin.s... | {
"content_hash": "6e1e9c0bf3997e75c80c4b3b2570f8d9",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 73,
"avg_line_length": 29.333333333333332,
"alnum_prop": 0.7386363636363636,
"repo_name": "ehealthafrica-ci/formhub",
"id": "296c2933c121bb76665891f8d33ee2ad438774fc",
"siz... |
from datetime import datetime
import os
from azure.cli.testsdk.preparers import (
ResourceGroupPreparer,
VirtualNetworkPreparer,
RoleBasedServicePrincipalPreparer,
KEY_RESOURCE_GROUP,
KEY_VIRTUAL_NETWORK,
)
from azure.cli.testsdk.utilities import GraphClientPasswordReplacer
from azure.cli.command_m... | {
"content_hash": "133096d088e08e64da6a65d68cc15ef6",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 119,
"avg_line_length": 40.37614678899082,
"alnum_prop": 0.6181549647807316,
"repo_name": "yugangw-msft/azure-cli",
"id": "d42dfbfb8fb9dc65598d61c056756392c2e37348",
"size... |
u'''
Created on Nov 11, 2010
@author: Mark V Systems Limited
(c) Copyright 2010 Mark V Systems Limited, All rights reserved.
'''
import os
from arelle import XmlUtil
from arelle.ModelDocument import ModelDocument, Type
class ModelRssObject(ModelDocument):
u"""
.. class:: ModelRssObject(type=ModelD... | {
"content_hash": "165b8243a334dad9aab5377d6d4de268",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 105,
"avg_line_length": 35.5,
"alnum_prop": 0.6461267605633803,
"repo_name": "sternshus/arelle2.7",
"id": "49ff1465ebc87764c944ea399f0b1560a272cbac",
"size": "1136",
"bin... |
from .responses import LogsResponse
url_bases = ["https?://logs.(.+).amazonaws.com"]
url_paths = {"{0}/$": LogsResponse.dispatch}
| {
"content_hash": "7ffe896a4fb60313bc70e22c996d3556",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 48,
"avg_line_length": 26.4,
"alnum_prop": 0.6742424242424242,
"repo_name": "william-richard/moto",
"id": "e4e1f5a887b9072f460c4c74decc9ecb7ae48306",
"size": "132",
"binar... |
"""Pre-commit hook that checks files added/modified in a commit.
To install the hook manually simply execute this script from the oppia root dir
with the `--install` flag.
To bypass the validation upon `git commit` use the following command:
`git commit --no-verify --am "<Your Commit Message>"`
This hook works only o... | {
"content_hash": "795e9673f9125782380e4748a3e8536d",
"timestamp": "",
"source": "github",
"line_count": 230,
"max_line_length": 80,
"avg_line_length": 36.96086956521739,
"alnum_prop": 0.6532172685566404,
"repo_name": "oppia/oppia",
"id": "c84c34e7b340259d5a670ca6bf1faa27f42f5722",
"size": "9130",
... |
import unittest
import numpy as np
import pandas as pd
import scipy.sparse as sp
import smurff
import itertools
import collections
verbose = 0
class TestBPMF(unittest.TestCase):
# Python 2.7 @unittest.skip fix
__name__ = "TestSmurff"
def test_bpmf(self):
Y = sp.rand(10, 20, 0.2)
Y, Ytest... | {
"content_hash": "f798864c40676d0719f1631114d8b8d1",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 108,
"avg_line_length": 40.3394495412844,
"alnum_prop": 0.46565840345690246,
"repo_name": "ExaScience/smurff",
"id": "95474b99b9585c76eb4bdb0be1c51ecf5acb0599",
"size": "8... |
"""
Use lldb Python SBFrame API to get the argument values of the call stacks.
And other SBFrame API tests.
"""
from __future__ import print_function
import os
import time
import re
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class F... | {
"content_hash": "a28ff6b6216c6dd7004ac13eb4e728ad",
"timestamp": "",
"source": "github",
"line_count": 225,
"max_line_length": 98,
"avg_line_length": 38.94222222222222,
"alnum_prop": 0.567678612188998,
"repo_name": "youtube/cobalt",
"id": "85e915ad3a48ace3eb1b9ff87e326568351ea7a4",
"size": "8762",... |
"""Tests downloading and reading of the GO annotation file from NCBI Gene.
python test_NCBI_Entrez_annotations.py
"""
__copyright__ = "Copyright (C) 2016-2017, DV Klopfenstein, H Tang. All rights reserved."
__author__ = "DV Klopfenstein"
import sys
from collections import defaultdict
from goatools.associatio... | {
"content_hash": "190d96b6c6107fe6a4b55cf9872c5cc5",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 99,
"avg_line_length": 44.01204819277108,
"alnum_prop": 0.6454968519025458,
"repo_name": "lileiting/goatools",
"id": "731820711d7c5d5f3a8cf6ad514548ede058cf0c",
"size": "36... |
from time import time
from constants import *
import pygame
class Metronome:
def __init__(self, measure_len, beats = 8):
self.measure_len = measure_len
self.beats = beats
assert measure_len % beats == 0
self.visual_buffer_width = VISUAL_BUFFER_WIDTH
self.beat_len = measur... | {
"content_hash": "eebe60d7790f7b82fcf0cf3d130a0fa6",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 96,
"avg_line_length": 34.18987341772152,
"alnum_prop": 0.5805257312106628,
"repo_name": "kenanbit/loopsichord",
"id": "3b0fd13bebbab9a98673ad2984b922fd845f51c6",
"size": "... |
"""Model unit tests."""
import datetime as dt
import pytest
from ccflasktest.user.models import User, Role
from .factories import UserFactory
@pytest.mark.usefixtures('db')
class TestUser:
def test_get_by_id(self):
user = User('foo', 'foo@bar.com')
user.save()
retrieved = User.get_by_i... | {
"content_hash": "cc8aa213f03e450df29ae1da63ff5571",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 63,
"avg_line_length": 29.140350877192983,
"alnum_prop": 0.6152919927754364,
"repo_name": "chrcoe/ccflasktest",
"id": "5169593ca0637743b54fbdc46a662273ebe9d9fa",
"size": "1... |
__author__ = 'geebzter'
# Example of how to implement an RPS player within the framework
import Player
import Message
class RPSPlayerExample(Player.Player):
def __init__(self):
# Call super class constructor
Player.Player.__init__(self)
self.reset()
def play(self):
return R... | {
"content_hash": "a488a4575922e26f5dfaa88355e057b1",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 108,
"avg_line_length": 33.357142857142854,
"alnum_prop": 0.5971245029060875,
"repo_name": "PaulieC/sprint1_Council_b",
"id": "6be2b9cc4acedaca73f89ea22fd6e97f31fafdfc",
"s... |
"""File: usage_audit.py
Find all users and projects where their total usage (current file + deleted files) is >= the set limit
Projects or users can have their GUID whitelisted via `usage_audit whitelist [GUID ...]`
User usage is defined as the total usage of all projects they have > READ access on
Project usage is def... | {
"content_hash": "58ffb4e1d60e70e382d0f1d887b1b090",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 206,
"avg_line_length": 38.76229508196721,
"alnum_prop": 0.6770987523789385,
"repo_name": "crcresearch/osf.io",
"id": "8ec982a9cbc308090bc5b8c78110cbc1c2fd8e10",
"size": "... |
"""
Created on Fri Apr 27 13:08:16 2018
@author: gerar
"""
import os, datetime
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.dates as dates
#%%
def get_data(dataframe):
data = pd.read_table(dataframe,usecols=[0])
data['Date_MODIS'] = data['Date_MODIS'].astype('datetime64')
md... | {
"content_hash": "ab01d8abb3570cd9d8e977a11b5a3764",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 138,
"avg_line_length": 36.885714285714286,
"alnum_prop": 0.6524657887942164,
"repo_name": "DangoMelon0701/PyRemote-Sensing",
"id": "85c675e430d7ca083c00872ef8ef6a80c5ae0572... |
'''
Created by auto_sdk on 2015.11.10
'''
from top.api.base import RestApi
class TradeGetRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.fields = None
self.tid = None
def getapiname(self):
return 'taobao.trade.get'
| {
"content_hash": "a8b42834bbc71e39589aa73ddb791634",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 55,
"avg_line_length": 25.333333333333332,
"alnum_prop": 0.6710526315789473,
"repo_name": "colaftc/webtool",
"id": "a81affe32ad043d99ae9265c9f113ba22a8f0f19",
"size": "304"... |
class TestCloseTooManyArgumentsPlugin:
def __init__(self):
self.called = False
def close(self, cardinal, _):
"""This should never be hit due to wrong number of args."""
self.called = True
def setup():
return TestCloseTooManyArgumentsPlugin()
| {
"content_hash": "f8df3b3262e32eb507fedc81f6de85c1",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 67,
"avg_line_length": 25.545454545454547,
"alnum_prop": 0.6512455516014235,
"repo_name": "JohnMaguire/Cardinal",
"id": "eab6946a7c668c4a08fb3ec796823bf5b1930dca",
"size": ... |
from calvin.actor.actor import Actor, manage, condition, stateguard, calvinsys
from calvin.utilities.calvinlogger import get_actor_logger
_log = get_actor_logger(__name__)
class RuntimeName(Actor):
"""
Get name of current runtime
Input:
trigger: Any token will trigger a read
Output:
va... | {
"content_hash": "78e153b1981d724924a4552025d25e3c",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 78,
"avg_line_length": 29.8,
"alnum_prop": 0.5964765100671141,
"repo_name": "EricssonResearch/calvin-base",
"id": "68d58c58a762d4074b26a3436c1f19804e8241fc",
"size": "1797"... |
"""
channel.py
:copyright: (c) 2015 by Fulfil.IO Inc.
:license: see LICENSE for more details.
"""
from trytond.pool import PoolMeta
from trytond.model import fields
__all__ = ['Channel']
__metaclass__ = PoolMeta
def submit_to_google(url, data):
import requests
import json
return requests.po... | {
"content_hash": "93fd7be64b8dfe0da9206a8c0a62cd6b",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 122,
"avg_line_length": 22.085714285714285,
"alnum_prop": 0.6390685640362225,
"repo_name": "prakashpp/trytond-google-merchant",
"id": "d71e185ccd2c4b0683b4d002b008356bf22ae16... |
import itertools
import pytest
import numpy as np
from numpy.testing import assert_allclose
from astropy.convolution.utils import discretize_model
from astropy.modeling.functional_models import (
Gaussian1D, Box1D, RickerWavelet1D, Gaussian2D, Box2D, RickerWavelet2D)
from astropy.modeling.tests.example_models imp... | {
"content_hash": "78ef6fa3cd10a0e7498acdada1479e80",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 97,
"avg_line_length": 32.45622119815668,
"alnum_prop": 0.6021581712338492,
"repo_name": "MSeifert04/astropy",
"id": "b88b85fb5d0b45cb80f92ee08b2728561a7cb733",
"size": "7... |
from msrest.paging import Paged
class NamespaceResourcePaged(Paged):
"""
A paging container for iterating over a list of NamespaceResource object
"""
_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[NamespaceResource]'}
... | {
"content_hash": "522e5d709eecc892146b842afded94e7",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 76,
"avg_line_length": 27.25,
"alnum_prop": 0.6077981651376146,
"repo_name": "rjschwei/azure-sdk-for-python",
"id": "0ded738bc09c3a5b158f2714ae3dbeb3662736d3",
"size": "910... |
>>> cd_list = []
>>> cd_list
[]
>>> with open("C:\/Users\/advance\/Documents\/GitHub\/career_path_prediction\/Career_data.csv",'rb') as csvfile:
filereader = csv.reader(csvfile,delimiter=',')
for row in filereader:
cd_list.append(row)
#-----------------------------------------------------------
>>> for i in rang... | {
"content_hash": "04a613e8b922696b83d7ff9cfe70e0ee",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 112,
"avg_line_length": 33.55555555555556,
"alnum_prop": 0.5662251655629139,
"repo_name": "akshaynagpal/career_path_suggestion",
"id": "55ed374200e22329bcc06957890a83de48eaa4... |
import socket
import time
from mc_bin_client.mc_bin_client import MemcachedClient
from perfrunner.settings import ClusterSpec, TestConfig
SOCKET_RETRY_INTERVAL = 2
MAX_RETRY = 600
class MemcachedHelper:
def __init__(self, cluster_spec: ClusterSpec, test_config: TestConfig):
self.username, self.passwor... | {
"content_hash": "7a260b0c9bbc62392c203bff27f789db",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 84,
"avg_line_length": 32.17948717948718,
"alnum_prop": 0.5760956175298805,
"repo_name": "couchbase/perfrunner",
"id": "061125f2f52141d66b55707bfc409989d04a4bb3",
"size": "... |
from django import forms
from django.contrib.auth.models import User
#from captcha.fields import CaptchaField
class LoginForm(forms.Form):
username=forms.CharField()
password=forms.CharField()
def valid_user(self):
user_exists=User.objects.filter(username=username).count()
if user_exists==0:
... | {
"content_hash": "5742fd651ba49d31f1b67893100e1786",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 65,
"avg_line_length": 24.058823529411764,
"alnum_prop": 0.7359413202933985,
"repo_name": "Diksha-Rathi/Smart-Bin-GHC",
"id": "b7a084f4b9b9a2bb573c2bc1b13ff8715ee9c06a",
"s... |
""" The volume type & volume types extra specs extension"""
from webob import exc
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova.api.openstack import xmlutil
from nova import db
from nova import exception
from nova.volume import volume_types
authorize = extensions.extension_... | {
"content_hash": "cd4028b96787cef905e5cfb315430439",
"timestamp": "",
"source": "github",
"line_count": 232,
"max_line_length": 79,
"avg_line_length": 34.88793103448276,
"alnum_prop": 0.6088460588089943,
"repo_name": "rcbops/nova-buildpackage",
"id": "cbc205ea778c8c02011c2cd2681f76cda9c5f4fa",
"siz... |
'''
This Python package (serial_device2) creates a class named SerialDevice,
which inherits from serial.Serial and adds methods to it, like auto
discovery of available serial ports in Linux, Windows, and Mac OS X. The
SerialDevice class can be used by itself, but it is mostly intended to
be a base class for other seria... | {
"content_hash": "c97e7c1e1122c13dd72ead22b59e16a0",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 163,
"avg_line_length": 62,
"alnum_prop": 0.8048387096774193,
"repo_name": "JaneliaSciComp/serial_device_python",
"id": "ac007f68c79f6269352c61575afcb1e55a879de0",
"size": ... |
#############################################################################
#
# CServer:
# Handles all services with the Navi-Xtreme server.
#############################################################################
from string import *
import sys, os.path
import urllib
import urllib2
import re, rando... | {
"content_hash": "91bd86718d7e51f4ecfe6de74f80bbf6",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 135,
"avg_line_length": 38.40758293838863,
"alnum_prop": 0.42744323790720634,
"repo_name": "aplicatii-romanesti/allinclusive-kodi-pi",
"id": "a2c40e40c0dc133697d9f316b343517... |
from pygments.lexers import find_lexer_class
from framework import LinguistTestBase, main, ROOT_DIR
from libs.repository import Repository
from libs.language import Language
class TestRepository(LinguistTestBase):
def repo(self, base_path):
return Repository.from_directory(base_path)
def linguist_rep... | {
"content_hash": "c4712aa4f32ee4df9853cf3900d1c7a9",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 98,
"avg_line_length": 31,
"alnum_prop": 0.6970046082949308,
"repo_name": "douban/linguist",
"id": "1c0fcb979a475b5a0d773ffdb3cf868d99ded20c",
"size": "893",
"binary": fa... |
"""Two dimensional convolutional neural net layers."""
from absl import logging
import tensorflow as tf # pylint: disable=g-explicit-tensorflow-version-import
def weight_variable(shape, stddev=0.01):
"""Returns the weight variable."""
logging.vlog(1, 'weight init for shape %s', str(shape))
return tf.get_varia... | {
"content_hash": "bbd69b79e1f8d813405e8c26657467c7",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 80,
"avg_line_length": 32.45967741935484,
"alnum_prop": 0.5662111801242236,
"repo_name": "deepmind/deepmind-research",
"id": "94cd09246ac0dd9c8d99158a46380ff238fb3e96",
"s... |
from aiotg.bot import * # noqa
| {
"content_hash": "2c31fb66a5336b0e43faf55db523f240",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 31,
"avg_line_length": 32,
"alnum_prop": 0.6875,
"repo_name": "SijmenSchoon/aiotg",
"id": "d640cdcd379049a0929051fb7f9350b9d263d736",
"size": "32",
"binary": false,
"cop... |
from django.shortcuts import render
from pyvdp.paai.fundstransferattinq.cardattributes import fundstransferinquiry, FundsTransferInquiryModel
from demo.forms.paai.fundstransferattinq.cardattributes.fundstransferinquiry import FundsTransferInquiryPostForm
def funds_transfer_inquiry(request):
if request.method ==... | {
"content_hash": "cb83e19964f6cd7eb4772b22683a01ae",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 112,
"avg_line_length": 38,
"alnum_prop": 0.6701127819548872,
"repo_name": "ppokrovsky/pyvdp",
"id": "b3a5d206600bc3643b60f780dfed108b7e4cc3d2",
"size": "1064",
"binary":... |
import threading
# DJANGAE
from djangae.db import transaction
from djangae.contrib import sleuth
from djangae.test import TestCase
class TransactionTests(TestCase):
def test_repeated_usage_in_a_loop(self):
from .test_connector import TestUser
pk = TestUser.objects.create(username="foo").pk
... | {
"content_hash": "cf652025e1f73849ffc23b0d2f6f56d6",
"timestamp": "",
"source": "github",
"line_count": 233,
"max_line_length": 99,
"avg_line_length": 32.128755364806864,
"alnum_prop": 0.5797488645471547,
"repo_name": "kirberich/djangae",
"id": "84bb5c4e93f64120025cbc558c7cfed45da2218f",
"size": "7... |
import ast
from copy import deepcopy
import datetime
import tempfile
import time
from xml.dom import minidom
import mock
import requests
import six
from cinder import context
from cinder import exception
from cinder.objects import fields
from cinder.objects import group
from cinder.objects import group_snapshot
from ... | {
"content_hash": "a3d44f879b528cafb557bef161969f1c",
"timestamp": "",
"source": "github",
"line_count": 6237,
"max_line_length": 79,
"avg_line_length": 46.37341670675004,
"alnum_prop": 0.5865692128437131,
"repo_name": "eharney/cinder",
"id": "af4ac41b2ecd87e5db3fad0ec56d66f05e617a4d",
"size": "2898... |
"""Generic add-on view factories"""
# -*- coding: utf-8 -*-
import httplib as http
from flask import request
from framework.exceptions import HTTPError, PermissionsError
from framework.auth.decorators import must_be_logged_in
from website.oauth.models import ExternalAccount
from website.util import permissions, rub... | {
"content_hash": "01cdac5e045aa22c9b0e4919c7490a94",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 100,
"avg_line_length": 37.695035460992905,
"alnum_prop": 0.6314205079962371,
"repo_name": "alexschiller/osf.io",
"id": "2a44ba4d5a0acb68af9032f23a9ee59c4a71e3e3",
"size":... |
def client_query_w_positional_params() -> None:
# [START bigquery_query_params_positional]
from google.cloud import bigquery
# Construct a BigQuery client object.
client = bigquery.Client()
query = """
SELECT word, word_count
FROM `bigquery-public-data.samples.shakespeare`
... | {
"content_hash": "bb171e7d2e225a01e7bfbed8b2203413",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 82,
"avg_line_length": 34.57142857142857,
"alnum_prop": 0.6394628099173554,
"repo_name": "googleapis/python-bigquery",
"id": "b088b305ea2231e66c111f434fa9e80b812ae7ef",
"si... |
from flask import Flask, g, request, redirect, send_from_directory
from biblioteca import Biblioteca
from json import dumps
# VARIABILI GLOBALI
app = Flask(__name__)
biblioteca = Biblioteca(g, 'database.db', 'clorurodisodio')
# OPERAZIONI DI SESSIONE
@app.before_request
def apri_connessione():
if request.url.... | {
"content_hash": "8988e1ec4aa349e8c22d380bf08aedc9",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 107,
"avg_line_length": 33.860986547085204,
"alnum_prop": 0.6857369884783472,
"repo_name": "tomellericcardo/Biblioteca",
"id": "d78616ce4778a109c2a1c221fbf16b22c745a8e9",
... |
default_app_config = 'test.account.apps.AppConfig'
| {
"content_hash": "f22e890d634c85c4d02fefb503707c8a",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 50,
"avg_line_length": 51,
"alnum_prop": 0.7843137254901961,
"repo_name": "rishikumar/django_test_model",
"id": "23c64483920511d081ca7ee0102f0ff97b3784d7",
"size": "51",
"... |
import json, pprint
from pathlib import Path
from aiohttp import web
from web_chains_202105 import utils
# ======================================================================
sTablePage = """<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
{stylesheets}
{remote_scripts}
{inline_scripts}
... | {
"content_hash": "08d7b43e04c67e558e090c6f8163f86f",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 149,
"avg_line_length": 36,
"alnum_prop": 0.4945436507936508,
"repo_name": "acorg/acmacs-whocc",
"id": "2a1b92195779c80a04ebb80e31742f7821dfcd3e",
"size": "4032",
"binar... |
from oslo_log import log as logging
import sahara.context as context
import sahara.plugins.mapr.domain.configuration_file as bcf
import sahara.plugins.mapr.domain.node_process as np
import sahara.plugins.mapr.domain.service as s
import sahara.plugins.mapr.services.mysql.mysql as mysql
import sahara.plugins.mapr.util.g... | {
"content_hash": "a7baf8aa603a8900eae9a1d02fa6adee",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 78,
"avg_line_length": 39.470588235294116,
"alnum_prop": 0.6093889716840537,
"repo_name": "egafford/sahara",
"id": "5ed1e0dd8c6e5f2bea60376e892bb1891a12042b",
"size": "729... |
import subprocess, os, sys
# 'Darwin' or 'Linux'
uname = os.uname().sysname
def check_same(file_path, cmd, from_cmd, comments):
from_comments = "\n".join(comments)
if from_cmd != from_comments:
print("error in", file_path, "executing", cmd)
print("expected >>{}<<, len:{}".format(from_comments,... | {
"content_hash": "c926970c12f7661a789a476e2f243a3e",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 86,
"avg_line_length": 37.923809523809524,
"alnum_prop": 0.5198392767453541,
"repo_name": "philippkeller/apue-rust",
"id": "ba9b061be49c0f0137395d601ac4e8001b16e3e4",
"siz... |
"""
Deployment settings
All settings which are typically edited for a deployment should be done here
Deployers shouldn't typically need to edit any other files.
NOTE FOR DEVELOPERS:
/models/000_config.py is NOT in the Git repository, as this file will be changed
during deployments.
To for ch... | {
"content_hash": "594b7b70873340e9b1a03a6de8b4b842",
"timestamp": "",
"source": "github",
"line_count": 690,
"max_line_length": 153,
"avg_line_length": 42.59130434782609,
"alnum_prop": 0.6768408874370492,
"repo_name": "flavour/iscram",
"id": "2eaafa242da190bbc1085bdfab524c685b675bee",
"size": "2947... |
"""Modified input prompt for entering text with >>> or ... at the start.
We define a special input line filter to allow typing lines which begin with
'>>> ' or '... '. These two strings, if present at the start of the input
line, are stripped. This allows for direct pasting of code from examples such
as those availabl... | {
"content_hash": "cfc72aa547a037f8db26193d18879239",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 79,
"avg_line_length": 36.553719008264466,
"alnum_prop": 0.6520461225412616,
"repo_name": "santisiri/popego",
"id": "bcedda2483d0cb7c632cb708e6c5491112fd399a",
"size": "44... |
from peewee import Model, PrimaryKeyField
from model import database
class BaseEntity(Model):
id = PrimaryKeyField()
class Meta:
database = database
| {
"content_hash": "06ad4533ad41b6855a418cb4f3fc272b",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 41,
"avg_line_length": 17.3,
"alnum_prop": 0.6994219653179191,
"repo_name": "Djaler/ZloyBot",
"id": "de3e4d336558f06a30e00d84d66afcaf10747cd5",
"size": "173",
"binary": f... |
import inspect
import urllib.request
import json
import pytest
from gemstone.util import as_completed
from gemstone.client.remote_service import RemoteService
from gemstone.client.structs import Result, MethodCall, BatchResult, AsyncMethodCall
DUMMY_SERVICE_URL = "http://example.com/api"
def test_remote_service_in... | {
"content_hash": "a4986755ec414d27d07016bb3038c8a5",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 98,
"avg_line_length": 27.75,
"alnum_prop": 0.6597168597168597,
"repo_name": "vladcalin/gemstone",
"id": "cca0600d8c56024723b0e641b3dbdb1bf3a7a569",
"size": "3885",
"bin... |
'''
:codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import skipIf, TestCase
from salttesting.mock import (
NO_MOCK,
NO_MOCK_REASON,
MagicMock,
patch)
from salttesting.helpers imp... | {
"content_hash": "cac231ea556bf39b2a7e48959107dd92",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 77,
"avg_line_length": 34.84905660377358,
"alnum_prop": 0.531672983216026,
"repo_name": "stephane-martin/salt-debian-packaging",
"id": "bd5af7a438edcb202cfbd55ad151d96e7c1cd... |
import numpy as np
#import dtree
import dtw
import bagging
import randomforest
tree = dtw.dtree()
#tree = dtree.dtree()
bagger = bagging.bagger()
forest = randomforest.randomforest()
party,classes,features = tree.read_data('../6 Trees/party.data')
#w = np.random.rand((np.shape(party)[0]))/np.shape(party)[0]
w = np.on... | {
"content_hash": "b0695cae30e259e527c148a371387e11",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 66,
"avg_line_length": 25.147058823529413,
"alnum_prop": 0.7485380116959064,
"repo_name": "Anderson-Lab/anderson-lab.github.io",
"id": "dc3e74a2ac7adab3a29050d7d46bcc1552530d... |
from ecpy.fields.FractionField import FractionField, FractionFieldElement
from ecpy.rings.Integer import ZZ
from ecpy.utils import gcd
class RationalField(FractionField):
def __init__(s):
FractionField.__init__(s, ZZ)
s.element_class = RationalFieldElement
class RationalFieldElement(FractionFieldElement):
... | {
"content_hash": "cc84ad29cf821c572f753eaaf92e1715",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 73,
"avg_line_length": 27.772727272727273,
"alnum_prop": 0.6448445171849427,
"repo_name": "elliptic-shiho/ecpy",
"id": "0f0d160734badce6000592e7e3740e83de0a1192",
"size": "... |
"""
Provides an asynchronous, crypto and compression aware socket for connecting to
servers and processing incoming packet data.
Coordinates with the Timers plugin to honor wall-clock timers
"""
import logging
import select
import socket
import time
from cryptography.hazmat.backends import default_backend
from crypto... | {
"content_hash": "6760387f5edf7f24a830202fd9d486f7",
"timestamp": "",
"source": "github",
"line_count": 268,
"max_line_length": 79,
"avg_line_length": 34.42910447761194,
"alnum_prop": 0.5868646363931939,
"repo_name": "MrSwiss/SpockBot",
"id": "4e3e03e2c75e30ff6254abd6d1934a79cc182967",
"size": "922... |
from abc import ABC, abstractmethod
from .component import Component
class Session(ABC, Component):
"""A model session link a database with a lux application and models
"""
def __init__(self, app, request=None):
self.request = request
self.init_app(app)
@property
def models(self)... | {
"content_hash": "925206430b0cfb1d037bbbedf826dd09",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 73,
"avg_line_length": 23.246753246753247,
"alnum_prop": 0.5740223463687151,
"repo_name": "quantmind/lux",
"id": "fa5bb8408cbd1c1ecd05f437616a0e15f80e171e",
"size": "3580"... |
from __future__ import annotations
import json
import sys
import timeit
from collections import Counter
import iotbx.phil
from dials.util.options import ArgumentParser, flatten_experiments
from libtbx import easy_mp
from scitbx.array_family import flex
help_message = """
Examples::
xia2.overload (data_master.h5|... | {
"content_hash": "29603ac25bd8c0967c16cf214eedc915",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 87,
"avg_line_length": 29.193548387096776,
"alnum_prop": 0.5250828729281768,
"repo_name": "xia2/xia2",
"id": "ee8337285ef6bcaad53f2432ff3c24f9328677dc",
"size": "4525",
... |
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from .._common import strip_ansi_escape
from .._const import DefaultValue, ParamKey
from ..error import TypeConversionError
from ._interface import AbstractValueConverter
class IpAddressConverter(AbstractValueConverter):
def force_convert(se... | {
"content_hash": "2ca6b043861100501283ae445d11be3b",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 88,
"avg_line_length": 28.1,
"alnum_prop": 0.6465005931198102,
"repo_name": "thombashi/typepy",
"id": "5b8306b48560efd7cbd19f2d2abac50c3adb3c97",
"size": "843",
"binary":... |
from __future__ import unicode_literals
import swapper
from django.conf import settings
from django.db import models
from accelerator_abstract.models.accelerator_model import AcceleratorModel
class BasePartnerTeamMember(AcceleratorModel):
partner = models.ForeignKey(
swapper.get_model_name(AcceleratorMo... | {
"content_hash": "8fde73bbd0de2262c00c9b5fda1a3944",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 75,
"avg_line_length": 37.92857142857143,
"alnum_prop": 0.6666666666666666,
"repo_name": "masschallenge/django-accelerator",
"id": "d6c370c288dc960f0ecf9b1e6eadcb15fa704c8b",... |
"""
(C) Copyright [2014] Avery Rozar
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softwar... | {
"content_hash": "34cd7869250d226c9331d5137b59d227",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 72,
"avg_line_length": 34.8235294117647,
"alnum_prop": 0.7702702702702703,
"repo_name": "asrozar/Cisco_SNMPv3_tool",
"id": "3e35ad4be1622cb09431816ee98630c5a060fab5",
"size... |
"""Load a file resource and return the contents."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# pylint: disable=unused-import
# pylint: disable=g-import-not-at-top
# pylint: disable=wildcard-import
from . import control_imports
import tensorflow.python... | {
"content_hash": "d17c78958df76a4d716056e614f279e7",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 67,
"avg_line_length": 35.642857142857146,
"alnum_prop": 0.779559118236473,
"repo_name": "brodyh/tensorflow",
"id": "46f0ab654bbb46437551ae676c8ffdf6f0303d3f",
"size": "499... |
import numpy as np
from ..layers import Layer, ParamMixin
from .conv import conv_bc01, bprop_conv_bc01
from .pool import pool_bc01, bprop_pool_bc01
class Conv(Layer, ParamMixin):
def __init__(self, n_feats, filter_shape, strides, weight_scale,
weight_decay=0.0, padding_mode='same', border_mode='... | {
"content_hash": "b25e2b1468b39e04214f73fec08caf01",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 79,
"avg_line_length": 34.98076923076923,
"alnum_prop": 0.5882352941176471,
"repo_name": "andersbll/nnet",
"id": "c666de7de28f4395d6deed3fd154a4d41b44ed96",
"size": "3638"... |
"""Tools to help with mapping/geographic applications.
Currently this includes tools for working with CartoPy projections.
"""
import cartopy.crs as ccrs
from ..cbook import Registry
class CFProjection(object):
"""Handle parsing CF projection metadata."""
_default_attr_mapping = [('false_easting', 'false_... | {
"content_hash": "421a21c5213bbdd146ae35b57f243dca",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 89,
"avg_line_length": 38.61818181818182,
"alnum_prop": 0.6377903327055869,
"repo_name": "jrleeman/MetPy",
"id": "95ac1711947ecdbc6bf78b18c24b631782ea86dc",
"size": "6510"... |
"""
WSGI config for sheeshmohsin project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATI... | {
"content_hash": "f949e15a701770edc9d5fea286e371ca",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 79,
"avg_line_length": 44.90625,
"alnum_prop": 0.7954070981210856,
"repo_name": "sheeshmohsin/sheeshmohsin",
"id": "98ec794528dde31a72f93670c1b8cafdfc691ed3",
"size": "1437... |
from django.db import models, migrations
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('contenttypes', '0001_initial'),
]
operations = [
migrati... | {
"content_hash": "d6b7e2ef16fae5a3a50446040e9a6e6e",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 183,
"avg_line_length": 50.6,
"alnum_prop": 0.5990965556182948,
"repo_name": "kbussell/django-auditlog",
"id": "f7346ec6cfeb4caaf0a0c65e80a7451eea888dc3",
"size": "1795",
... |
from django.urls import reverse
from django.utils.translation import gettext_noop
from corehq.apps.locations.util import (
load_locs_json,
location_hierarchy_config,
)
from corehq.apps.reports.filters.base import BaseReportFilter
class AsyncLocationFilter(BaseReportFilter):
# todo: cleanup template
l... | {
"content_hash": "4df14c8e2288d4e638cf3788b5b3194a",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 106,
"avg_line_length": 36.93939393939394,
"alnum_prop": 0.6296144380639869,
"repo_name": "dimagi/commcare-hq",
"id": "b2bce9aa86952f942dc210d05c5c911193d82ede",
"size": "2... |
from django.views.generic import View, TemplateView
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.shortcuts import render_to_response
from django.conf import settings
from denguealert.forms import DengueCaseForm
class ReportView(TemplateView... | {
"content_hash": "28841aadeeac56e66ac2a261ee599f10",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 70,
"avg_line_length": 39.5,
"alnum_prop": 0.7077100115074798,
"repo_name": "ray-dino/DengueAlert",
"id": "ca3c94b65abc4cedfcbfc6f1f4f9194ba4c60be5",
"size": "869",
"bina... |
from contextlib import contextmanager
import warnings
import gossip
def test_deprecated_hook():
with python_warnings_recording() as recorded:
hook = gossip.define('hook', deprecated=True)
assert recorded == []
@hook.register
def handler(): # pylint: disable=unused-variable
... | {
"content_hash": "21b9a72ee5fa7831d40cb0398665a01b",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 58,
"avg_line_length": 21.884615384615383,
"alnum_prop": 0.6590509666080844,
"repo_name": "vmalloc/gossip",
"id": "95a9cb08eee59d444da99beca7f701b56ce93ab2",
"size": "569",... |
import os
# import sys
import openstackdocstheme
# 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.a... | {
"content_hash": "1a3a247246d88903eb48480e27a07a1e",
"timestamp": "",
"source": "github",
"line_count": 279,
"max_line_length": 93,
"avg_line_length": 33.272401433691755,
"alnum_prop": 0.6934180760530001,
"repo_name": "SauloAislan/ironic",
"id": "1ea0708b51d01d39911799c685cfd72dd501a5b2",
"size": "... |
from __future__ import print_function
"""
Copyright (c) 2012, Cody Schafer <cpschafer --- gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the ab... | {
"content_hash": "8fbb8de3c00ce2c5217bcfae55c81534",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 79,
"avg_line_length": 32.75,
"alnum_prop": 0.734171531207903,
"repo_name": "mkoval/FieldforceTCM",
"id": "ef74796ba74bccaad1902fc1bc404bd06ada4fe1",
"size": "2281",
"bin... |
"""
Configuration settings for the Flask application. Every variable in capital
letters is available inside the flask instance.
"""
DEBUG = True
| {
"content_hash": "1ef96ae39d0c0771593337ca13be4043",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 75,
"avg_line_length": 24.333333333333332,
"alnum_prop": 0.7808219178082192,
"repo_name": "infothrill/flask-socketio-dbus-demo",
"id": "07d16aee5ec12eb3e776f9cd5431257c7b4c381... |
from google.cloud import edgecontainer_v1
def sample_list_vpn_connections():
# Create a client
client = edgecontainer_v1.EdgeContainerClient()
# Initialize request argument(s)
request = edgecontainer_v1.ListVpnConnectionsRequest(
parent="parent_value",
)
# Make the request
page_r... | {
"content_hash": "217fa8208a2503fe04537dd7273fc429",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 72,
"avg_line_length": 26.55,
"alnum_prop": 0.7212806026365348,
"repo_name": "googleapis/python-edgecontainer",
"id": "49f255f0137ab6d9c0802250c62a7c1d3ef7635e",
"size": "1... |
from setuptools import setup
from setuptools import find_packages
setup(
name='cloudnsapi',
version='0.0.2',
description="ClouDNS API Wrapper",
author="R Franks",
author_email='git@rf152.co.uk',
license='MIT',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audie... | {
"content_hash": "fbb00124e8990b31b1ccd6b2706168e3",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 53,
"avg_line_length": 32.37931034482759,
"alnum_prop": 0.5910543130990416,
"repo_name": "rf152/python-cloudns",
"id": "647c3d66cdeaa17e014dcfd1e95d497b79ffe94f",
"size": "... |
"""
Docstrings are another source of information for functions and classes.
:mod:`jedi.evaluate.dynamic` tries to find all executions of functions, while
the docstring parsing is much easier. There are two different types of
docstrings that |jedi| understands:
- `Sphinx <http://sphinx-doc.org/markup/desc.html#info-fie... | {
"content_hash": "e6232341e933055455db2555c38ad327",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 102,
"avg_line_length": 34.588235294117645,
"alnum_prop": 0.6302437641723356,
"repo_name": "adammenges/atomconfig",
"id": "d2ab34ed10c672df18712b7b9df582dcd583a6cc",
"size... |
from netforce.model import Model, fields, get_model
import time
from netforce import database
from netforce.access import get_active_user, set_active_user
from netforce.access import get_active_company
class Move(Model):
_inherit= "stock.move"
_fields = {
"related_id": fields.Reference([["sale.order"... | {
"content_hash": "07bea98587b97e78352ac9df54cd1026",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 70,
"avg_line_length": 34.53125,
"alnum_prop": 0.5619909502262443,
"repo_name": "nfco/netforce",
"id": "4333d33096e13a5da1bc3f3b747d3208f3473124",
"size": "2207",
"binary... |
from __future__ import absolute_import
from __future__ import unicode_literals
import six
from acos_client.v30 import base
class SLBCommon(base.BaseV30):
url_prefix = "/slb/common"
def _underscore_to_dash(self, val):
rv = val.replace("_", "-")
return rv
def create(self, **kwargs):
... | {
"content_hash": "d5df7b14c080190fc9d145bf7634b77e",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 61,
"avg_line_length": 23.304347826086957,
"alnum_prop": 0.5988805970149254,
"repo_name": "mdurrant-b3/acos-client",
"id": "521157f2b40fba6c5c74d9c6f9cf7dcd554dd156",
"size... |
from __future__ import print_function
from __future__ import unicode_literals
try:
input = raw_input # Python 2.7
except NameError:
pass
import requests
import json
import time
try:
from ConfigParser import ConfigParser # Python 2.7
config = ConfigParser()
config.read("settings.i... | {
"content_hash": "b33c98ab8e5550f5844c7707af1b1566",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 122,
"avg_line_length": 33.225806451612904,
"alnum_prop": 0.5660194174757281,
"repo_name": "youngminz/zdesktop.py",
"id": "48ef3d0beb82c8303672409cd6dab8bc8b82f97a",
"size"... |
"""Create high-resolution head surfaces for coordinate alignment.
Examples
--------
.. code-block:: console
$ mne make_scalp_surfaces --overwrite --subject sample
"""
import os
import sys
import mne
from mne.bem import make_scalp_surfaces
def run():
"""Run command."""
from mne.commands.utils import ge... | {
"content_hash": "8c7153aafa1a8297adba29762c876610",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 74,
"avg_line_length": 33.351851851851855,
"alnum_prop": 0.6046640755136036,
"repo_name": "bloyl/mne-python",
"id": "1e0e4cbcd8a5e03d02e0dc9c6703a1e33c24f1b0",
"size": "203... |
from base import eigenvalue_decomposition, principal_component_decomposition
| {
"content_hash": "550a8dfe9664478d369096edf5475b1e",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 76,
"avg_line_length": 77,
"alnum_prop": 0.8831168831168831,
"repo_name": "jabooth/menpo-archive",
"id": "6c00970d9d2faa579e435ad05fee315af39790b6",
"size": "77",
"binary"... |
import sys
import os
import re
import OpenSSL.crypto as crypto
import json
from jsonpointer import resolve_pointer
from jsonpath_rw import jsonpath, parse
import argparse
from datetime import datetime
import ssltools.certificates as certificates
from ssltools.openssl import call_openssl
from ssltools.json import to_js... | {
"content_hash": "ab636341fce94012d14c89e888e8fa22",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 113,
"avg_line_length": 48.74074074074074,
"alnum_prop": 0.6223404255319149,
"repo_name": "nanobot248/ssltools",
"id": "64cbee6e9e431ce3e08537f642387fb260c5f26d",
"size": "... |
import re
import Gaffer
import GafferUI
from Qt import QtCore
from Qt import QtGui
class NameWidget( GafferUI.TextWidget ) :
def __init__( self, graphComponent, **kw ) :
GafferUI.TextWidget.__init__( self, **kw )
self._qtWidget().setValidator( _Validator( self._qtWidget() ) )
self.__graphComponent = None
... | {
"content_hash": "fb2b39b9722fb2eb5eb43d53d8fb68e9",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 138,
"avg_line_length": 31.40566037735849,
"alnum_prop": 0.707720036046861,
"repo_name": "lucienfostier/gaffer",
"id": "d0f99fe83999e132ca66d8458f60da117011b303",
"size": ... |
"""
Import from public cell data into a local dev environment.
Download from https://location.services.mozilla.com/downloads
This has been tested with a differential cell export (~400kB compressed).
A full cell export (~370,000kB) contains unexpected data that will
require code changes to handle gracefully, and may r... | {
"content_hash": "ef345486cad61695a6487c8f4a928696",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 79,
"avg_line_length": 30.696202531645568,
"alnum_prop": 0.6989690721649484,
"repo_name": "mozilla/ichnaea",
"id": "f15d6fdadaa96d4414742a7b8855eaf373f4195f",
"size": "2447... |
import sys
import yaml
import string
from yamllint.linter import LintProblem
if len(sys.argv) < 2:
print 'Missing file to lint'
sys.exit(1)
ID = 'trailing-spaces'
TYPE = 'line'
def check(conf, line):
if line.end == 0:
return
pos = line.end
while line.buffer[pos - 1] in string.whitespace a... | {
"content_hash": "5aca6903f9f4a929409f885625af3922",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 73,
"avg_line_length": 25.266666666666666,
"alnum_prop": 0.5897097625329816,
"repo_name": "open-switch/infra_project-config",
"id": "7cf878d497d371da1a283d4ee58b5d884107f91b"... |
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("""Error: Can't find the file 'settings.py' in the
directory containing %r. It appears you've customized things. You'll
have to run django-admin.py, ... | {
"content_hash": "472e03c748b274cc2e406fbccaf4c3ee",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 71,
"avg_line_length": 37.57142857142857,
"alnum_prop": 0.7186311787072244,
"repo_name": "MapofLife/MOL",
"id": "0b932dae01b91464e63babc16af38d1b0f182c93",
"size": "544",
... |
"""Generally useful utilities for AWS web services not specific to a service.
New things in this module should be of relevance to more than one of Amazon's
services.
"""
from base64 import b64encode
from hashlib import sha1, md5, sha256
import hmac
from urlparse import urlparse, urlunparse
import time
# Import XMLTr... | {
"content_hash": "6cd4f422a1c5329d1d93eb31b5822f3e",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 78,
"avg_line_length": 26.135922330097088,
"alnum_prop": 0.6341010401188707,
"repo_name": "daira/txaws",
"id": "333097542cede183b51711ecdd7a09d48dc1de9c",
"size": "2692",
... |
import subprocess
import tempfile
import os
import shutil
# Options
themes = ['default', 'AnnArbor', 'Antibes', 'Bergen', 'Berkeley', 'Berlin',
'Boadilla', 'CambridgeUS', 'Copenhagen', 'Darmstadt', 'Dresden',
'EastLansing', 'Frankfurt', 'Goettingen', 'Hannover', 'Ilmenau',
'JuanLesPins', 'Luebeck', 'Madrid... | {
"content_hash": "7af208a5fe85658460ae96b425dd0d69",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 79,
"avg_line_length": 34.87323943661972,
"alnum_prop": 0.60359450726979,
"repo_name": "mpetroff/beamer-theme-matrix",
"id": "9806c8fde41a618bfa5cd2b461cf3eb2edba44c4",
"s... |
import json
from passrotate.provider import Provider, ProviderOption, PromptType, register_provider
from passrotate.forms import get_form
from urllib.parse import urlparse
import requests
from bs4 import BeautifulSoup
class GitLab(Provider):
"""
[gitlab.com]
username=Your GitLab username
"""
name ... | {
"content_hash": "68859d2a75111ae8c42cc19d7dfa9db3",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 87,
"avg_line_length": 31.056818181818183,
"alnum_prop": 0.5934870106110501,
"repo_name": "SirCmpwn/pass-rotate",
"id": "9ed0dd246f609dd724dc3bd563fe2ee80717e499",
"size": ... |
"""variables checkers for Python code
"""
import os
import sys
from copy import copy
import astroid
from astroid import are_exclusive, builtin_lookup, AstroidBuildingException
from logilab.common.modutils import file_from_modpath
from pylint.interfaces import IAstroidChecker
from pylint.checkers import BaseChecker
f... | {
"content_hash": "ab03c4f34d8c69eef4c3b794f4b92ffa",
"timestamp": "",
"source": "github",
"line_count": 726,
"max_line_length": 131,
"avg_line_length": 44.544077134986225,
"alnum_prop": 0.5530164816475464,
"repo_name": "bdastur/pyvim",
"id": "dc8d11154747774aeb0c546bbb48765d46424e6d",
"size": "3315... |
"""Tests hal.help implementation"""
def test_main():
"""Tests hal.help.main method"""
pass # todo auto generated method stub
class TestBugReporter:
"""Tests BugReporter class"""
@staticmethod
def test_get_platform_info():
"""Tests hal.help.BugReporter.get_platform_info method"""
... | {
"content_hash": "afd22d01b4b526d8dc55e9981d2fb67d",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 65,
"avg_line_length": 24.04255319148936,
"alnum_prop": 0.6345132743362832,
"repo_name": "sirfoga/hal",
"id": "6053bc2fe2c329ededfea27cb8decec13172c36b",
"size": "1156",
... |
import json
from sahara.plugins import provisioning as p
from sahara.utils import files as f
CDH5_UBUNTU_REPO = ('deb [arch=amd64] http://archive.cloudera.com/cdh5'
'/ubuntu/precise/amd64/cdh precise-cdh5.0.0 contrib'
'\ndeb-src http://archive.cloudera.com/cdh5/ubuntu'
... | {
"content_hash": "626231d1b08dab7af262243ca49b64b3",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 79,
"avg_line_length": 40.945945945945944,
"alnum_prop": 0.6425742574257426,
"repo_name": "bigfootproject/sahara",
"id": "f50c7efdefb9744b7e403b61232f790419f39efe",
"size"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.