text stringlengths 4 1.02M | meta dict |
|---|---|
import sys
import pytest
import json
import xml.etree.ElementTree as ET
from azure.core.pipeline.transport import HttpRequest as PipelineTransportHttpRequest
from azure.core.rest import HttpRequest as RestHttpRequest
try:
import collections.abc as collections
except ImportError:
import collections
@pytest.fixt... | {
"content_hash": "0621bca36e0cc649bc6ea06b0423e78f",
"timestamp": "",
"source": "github",
"line_count": 392,
"max_line_length": 101,
"avg_line_length": 39.5,
"alnum_prop": 0.6500904159132007,
"repo_name": "Azure/azure-sdk-for-python",
"id": "e2d4f866f4703c3cecfbee0d95daa7524f415ce9",
"size": "15817... |
import boto3
class FileUpload:
def __init__(self):
aws_access_key_id = "ExampleAccessString" #insert your access id
aws_secret_access_key = "ExampleAccessKey" #insert your access key
s3_bucket_name = "your-s3-bucket-name" #inster your s3 bucket
#other_filenames should be a list of fil... | {
"content_hash": "dbc9d96b2cf7f0a77ae07c72afddf6e1",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 113,
"avg_line_length": 54.833333333333336,
"alnum_prop": 0.6702127659574468,
"repo_name": "corbinq27/priceTweeter",
"id": "6a41a85e63107d1f7bfce65f528d909d0ddb679e",
"size... |
import time
import unittest
import yaml
class timewith():
def __init__(self, name=''):
self.name = name
self.start = time.time()
@property
def elapsed(self):
return time.time() - self.start
def checkpoint(self, name=''):
print('{timer} {checkpoint} took {elapsed} ms'.... | {
"content_hash": "fa910dd01d10224d99fbb37b22b95c29",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 66,
"avg_line_length": 25.10958904109589,
"alnum_prop": 0.5330060010911075,
"repo_name": "optimuspaul/themis",
"id": "ef9198cb2cdaa496e6c00b3d641d59f8f14b88d0",
"size": "18... |
__doc__ = \
"""
Example of a script that perfoms histogram analysis of an activation
image, to estimate activation Z-score with various heuristics:
* Gamma-Gaussian model
* Gaussian mixture model
* Empirical normal null
This example is based on a (simplistic) simulated image.
Note : We do not want a 'zscore... | {
"content_hash": "62696b56ea939674d455fed639d4432c",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 80,
"avg_line_length": 30.326732673267326,
"alnum_prop": 0.6183480248122756,
"repo_name": "yarikoptic/NiPy-OLD",
"id": "26979856617da8963533bf893c16c38cb439cf50",
"size": ... |
class NeptunError(Exception):
pass
class IntergallacticError(NeptunError):
pass
f = 2
try:
f = 2
if f == 2:
raise NeptunError("why f")
h = 2
except IntergallacticError as e:
print(e)
except NeptunError as e:
print(e)
| {
"content_hash": "03270ac34bd2b4d09e9f48cd583e38a7",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 39,
"avg_line_length": 15.058823529411764,
"alnum_prop": 0.62890625,
"repo_name": "alehander42/pseudo-python",
"id": "b09500366c379e701d5fe6ed4095c35a087f5b8b",
"size": "25... |
import hashlib
from tempfile import TemporaryFile
from django.core.files import File
from django.utils.timezone import make_aware, utc
from PIL import Image
import requests
from .models import Like, Photo, Tag
from instagram.client import InstagramAPI as BaseInstagramAPI
from instagram.bind import bind_method
from in... | {
"content_hash": "52aea34d47620ae5faf921b3dc637ce9",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 90,
"avg_line_length": 29.130434782608695,
"alnum_prop": 0.5738805970149253,
"repo_name": "kmlebedev/mezzanine-instagram-quickphotos",
"id": "0f881ab57a0c1a1f3061822300f53885... |
from columns.lib.authorization.exceptions import *
from decorator import decorator
__all__ = ['retrieve_user','user_permission','user_id','SitePermissions'] #,'AuthorizeAction'
def retrieve_user(session):
if session.get('user_id',None) is None:
return None
from columns.model import User, meta
return meta.Session.... | {
"content_hash": "06788cdbd75afe064e6ad3221c776b36",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 93,
"avg_line_length": 28.666666666666668,
"alnum_prop": 0.7140591966173362,
"repo_name": "yoshrote/Columns",
"id": "4d678bc2623720f646c6872501bf21ce066387f7",
"size": "189... |
"""Utility for archiving files and directories.
An archive is simply a zip file containing the archived
targets plus an optional log file. The standard used for
the log file is a text file named `__archive_info__.txt`.
The log is always in the root directory of the archive.
By default, the archive filename will be pr... | {
"content_hash": "f855b7dc589101ab5298c24623b959e4",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 79,
"avg_line_length": 37.262135922330096,
"alnum_prop": 0.5284002084418968,
"repo_name": "jeffrimko/Archiver",
"id": "e29e178e35726c5d6596ecd63a882a89f883722e",
"size": "... |
import idaapi
import idautils
import idc
from ..core import fix_addresses
from .xref import Xref
from .instruction import Instruction
from ..ui import updates_ui
from .base import get_selection, get_offset_name, demangle
from .. import data
class Comments(object):
"""IDA Line Comments
Provides easy access to... | {
"content_hash": "aa8df64f865d9524fc1183259a3b5950",
"timestamp": "",
"source": "github",
"line_count": 354,
"max_line_length": 92,
"avg_line_length": 26.74576271186441,
"alnum_prop": 0.5700253485424588,
"repo_name": "tmr232/Sark",
"id": "159c4d548598806cd2b8981eba2e8a32b280ec77",
"size": "9468",
... |
import sys
import os
import os.path
import tempfile
import subprocess
import py_compile
import contextlib
import shutil
import zipfile
# Executing the interpreter in a subprocess
def _assert_python(expected_success, *args, **env_vars):
cmd_line = [sys.executable]
if not env_vars:
cmd_line.append('-E')
... | {
"content_hash": "1bb7d55d8d4f9a21eacda4780c6499e1",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 83,
"avg_line_length": 34.044585987261144,
"alnum_prop": 0.6314312441534145,
"repo_name": "xxd3vin/spp-sdk",
"id": "1b5b0bf315fb8123d914a557e10c2585a524edb9",
"size": "547... |
import conda
import yaml
import os
from subprocess import check_call
import shutil
with open('sources.yaml', 'r') as fh:
sources = yaml.safe_load(fh)
with open('env.specs/lts.yaml', 'r') as fh:
env_lts = yaml.safe_load(fh)
print sources
print env_lts
import conda.plan
import conda_build.config
import c... | {
"content_hash": "63df0f6e1d7ea3b82502e876a688578f",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 102,
"avg_line_length": 20.77777777777778,
"alnum_prop": 0.6455309396485867,
"repo_name": "marqh/conda-manifest",
"id": "ba55d3960c41aa8a17a42f212ec9fe69558921a6",
"size": ... |
from google.cloud import pubsublite_v1
def sample_create_topic():
# Create a client
client = pubsublite_v1.AdminServiceClient()
# Initialize request argument(s)
request = pubsublite_v1.CreateTopicRequest(
parent="parent_value",
topic_id="topic_id_value",
)
# Make the request
... | {
"content_hash": "9b2469292ffc54a83be3b7d789246c6d",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 72,
"avg_line_length": 24.65,
"alnum_prop": 0.6997971602434077,
"repo_name": "googleapis/python-pubsublite",
"id": "ea6881c1057ae5a580941baba3bd152f4db621b8",
"size": "1504... |
import requests
from requests import exceptions
import cStringIO
from oslo.config import cfg
from heat.common import urlfetch
from heat.tests.common import HeatTestCase
from heat.openstack.common.py3kcompat import urlutils
class Response:
def __init__(self, buf=''):
self.buf = buf
def iter_content... | {
"content_hash": "e7fa67dc08fcbc2a51996973feb624d0",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 79,
"avg_line_length": 30.65811965811966,
"alnum_prop": 0.6177864510733203,
"repo_name": "ntt-sic/heat",
"id": "20557fa45fba2547a6b85138cac99b25042e130d",
"size": "4207",
... |
"""Python library module for LIS3MDL magnetometer.
This module for the Raspberry Pi computer helps interface the LIS3MDL
magnetometer.The library makes it easy to read the raw magnetometer
through I²C interface.
The datasheet for the LSM6DS33 is available at
[https://www.pololu.com/file/download/LIS3MDL.pdf?file_id=0J... | {
"content_hash": "a2853cd151b9d6e155bdbfed495ca652",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 77,
"avg_line_length": 33.63855421686747,
"alnum_prop": 0.6378939828080229,
"repo_name": "SvetoslavKuzmanov/altimu10v5",
"id": "f359aeb80388c40a4268afd8e21d138dedc28c84",
"... |
from trakt.interfaces import auth
from trakt.interfaces import movies
from trakt.interfaces import oauth
from trakt.interfaces import scrobble
from trakt.interfaces import search
from trakt.interfaces import shows
from trakt.interfaces import sync
from trakt.interfaces import users
INTERFACES = [
# /
... | {
"content_hash": "5a0f53043171fbdd4cca39a3824272b8",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 57,
"avg_line_length": 21.223529411764705,
"alnum_prop": 0.5992239467849224,
"repo_name": "timbooo/traktforalfred",
"id": "3469e0ab99e063ead846170a906e32c07b7ff09d",
"size"... |
import unittest
import mock
def _make_credentials():
import google.auth.credentials
return mock.Mock(spec=google.auth.credentials.Credentials)
class TestClient(unittest.TestCase):
@staticmethod
def _get_target_class():
from google.cloud.runtimeconfig.client import Client
return Cl... | {
"content_hash": "ceb7e79f92fbc2c009b8937a30123f4a",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 87,
"avg_line_length": 32.965811965811966,
"alnum_prop": 0.619652579725175,
"repo_name": "googleapis/python-runtimeconfig",
"id": "a0fef69c4010e303c91d14026581da519f8e53e9",... |
import re
import sys
def parseData(main_file):
count = 1
reviews = list()
pterms = list()
rterms = list()
scores = list()
quote = '&' + 'quot' + ';'
replace_punctuation = re.compile('[%s]' % re.escape('!"#$%&\'()*+,-./:;<=>?@[\\]^`{|}~'))
for x in main_file:
if "product/productI... | {
"content_hash": "549d75cfae4e425ee22b13b4dcd29286",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 112,
"avg_line_length": 38.747368421052634,
"alnum_prop": 0.49144254278728605,
"repo_name": "k----n/InformationRetrievalSystem",
"id": "a76b889a3d16c6f3b753f065588f9763de5e44... |
"""
This module provides high level utility functions to encode and decode a terrain tile.
Reference
---------
"""
# Enable Shapely "speedups" if available
# http://toblerity.org/shapely/manual.html#performance
from shapely import speedups
from .terrain import TerrainTile
from .topology import TerrainTopology
if sp... | {
"content_hash": "02832d2b3419c80b5bd309a889e8a720",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 88,
"avg_line_length": 30.41592920353982,
"alnum_prop": 0.6569682862961885,
"repo_name": "loicgasser/quantized-mesh-tile",
"id": "d3ba8f306789c5b60e96c6ee163548fa4bd0ebcb",
... |
from p2ner.abstract.interface import Interface
# Copyright 2012 Loris Corazza, Sakis Christakidis
#
# 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/licen... | {
"content_hash": "d0223c74769cd76fcf2682df8ec42e78",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 76,
"avg_line_length": 37.15,
"alnum_prop": 0.7375504710632571,
"repo_name": "schristakidis/p2ner",
"id": "f3b2c17b1f30358115075e8a565ab9506a4a755a",
"size": "743",
"bina... |
import logging
import os
import quickremovedups.filesize
from tempfile import TemporaryDirectory
from unittest import main, TestCase
class TestFilesize(TestCase):
def create_file_of_size(self, filename, size):
logging.debug('Creating file: %s of size %d' % (filename, size))
with open(filename, 'w... | {
"content_hash": "f2764fa63badef4e46bb9dc3b2674650",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 85,
"avg_line_length": 35.018181818181816,
"alnum_prop": 0.5586708203530634,
"repo_name": "dwighthubbard/quickremovedups",
"id": "9c09fedc64e0ccaa0fc8b5c33090da845ba2d9a4",
... |
"""Python API for the Microsoft TerraServer.
Copyright (c) 2012 Howard Butler [email protected]
License:
See the Python 2.6 License (http://www.python.org/2.6/license.html)
"""
import datetime
wsdl = 'http://msrmaps.com/TerraService2.asmx?WSDL'
from suds.client import Client
client = Client(wsdl)
impor... | {
"content_hash": "ff7fe2fda35881dfa6ec10a3d912a9e7",
"timestamp": "",
"source": "github",
"line_count": 387,
"max_line_length": 102,
"avg_line_length": 26.935400516795866,
"alnum_prop": 0.611857252494244,
"repo_name": "hobu/pyTerra",
"id": "dd7cb94b600d82293a169c8e875c22c4b04f320f",
"size": "10424"... |
from django.test import Client, TestCase
from django.urls import reverse
c = Client()
class WebsiteStabilityTestCase(TestCase):
def test_frontpage_availability(self):
self.assertEqual(c.get('/').status_code, 200)
def test_about_us_availability(self):
self.assertEqual(c.get(reverse('about')).... | {
"content_hash": "621c9077e63fb2d5d00af94d5e8a8133",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 66,
"avg_line_length": 28.166666666666668,
"alnum_prop": 0.7189349112426036,
"repo_name": "martinlunde/RealBack",
"id": "8f66f13df691e12dc353b7406504d487b5744466",
"size": ... |
'''
This script stores the bitcoin value in bitcoin.txt
This script uses coindesk api.
CoinDesk provides a simple API to make its Bitcoin Price Index (BPI) data programmatically available to others.
You are free to use this API to include our data in any application or website as you see fit,
as long as each page or ... | {
"content_hash": "0560cddbba900f52115ac5e35cb56d0d",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 112,
"avg_line_length": 35.484848484848484,
"alnum_prop": 0.7284372331340735,
"repo_name": "munagekar/MJRDarkConky",
"id": "2c6657b391feedd743dea2ccc62610bc33865ce3",
"size... |
import torch
import argparse
import torch.optim as optim
import numpy as np
from os import makedirs
from os.path import join, exists
from torch.utils.data import DataLoader
from torch.autograd import Variable
from utils import *
use_cuda = torch.cuda.is_available()
# seed for replicability
SEED = 123
np.random.seed(S... | {
"content_hash": "f7c06ef3ca1d3719db1620dbd96115e5",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 79,
"avg_line_length": 42.684615384615384,
"alnum_prop": 0.5709136781402054,
"repo_name": "shariqiqbal2810/WGAN-GP-PyTorch",
"id": "b5d6ba62e14ac7b32a18be95ef1f459c4eacad35"... |
import tweepy
import time
from credentials import *
import urllib
from pyshorteners import Shortener
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
print("Bot started.")
shortener = Shortener("Tinyurl")
recent_id = 0
image = Fa... | {
"content_hash": "2a1a3794f689ef6bed4b59171a2232d8",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 138,
"avg_line_length": 27.678571428571427,
"alnum_prop": 0.6793548387096774,
"repo_name": "harrymt/boeing-hackathon",
"id": "95c0732494f876fd0a112bc3086ae2f9a6428fa2",
"si... |
import sys
import re
from orderedattrdict import AttrDict
from pysnmp.hlapi import *
from lib.utilities import *
SNMP_PORT = 161
PUBLIC = 'public'
BRIDGE_MIB = 'BRIDGE-MIB'
DOT_1D_TP_FDB_PORT = 'dot1dTpFdbPort'
class GetMgmtSwitchConfig(object):
def __init__(self, log):
self.log = log
def get_port_... | {
"content_hash": "1c351367719698c2e0734e74f4778c77",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 79,
"avg_line_length": 33.80357142857143,
"alnum_prop": 0.4400422609614369,
"repo_name": "open-power-ref-design-toolkit/cluster-genesis",
"id": "1dfae6742ad1448728c4f55107647... |
from __future__ import unicode_literals
import logging
logger = logging.getLogger(__name__)
from IoticAgent.Core.Validation import Validation
from .ResourceBase import ResourceBase
from .const import VALUE, VALUESHARE, VTYPE, LANG, DESCRIPTION, UNIT, SHARETIME, SHAREDATA, RECENT
class Point(ResourceBase):
__s... | {
"content_hash": "f495a1dfb3f25e12b2bf6eb79cfcedbb",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 115,
"avg_line_length": 35.403669724770644,
"alnum_prop": 0.55713915522156,
"repo_name": "Iotic-Labs/py-IoticBulkData",
"id": "3f4eefb8f298ad5c809d8a0ef97815187cd051c3",
"... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('thing', '0005_station_is_unknown'),
]
operations = [
migrations.AlterField(
model_name='station',
name='system',
... | {
"content_hash": "cd77f3b846a533392c5d1f74071d6c6f",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 78,
"avg_line_length": 23.157894736842106,
"alnum_prop": 0.5931818181818181,
"repo_name": "cmptrgeekken/evething",
"id": "cc5c901f134fcac0e19e7df8a43d98fbde75ee7f",
"size":... |
import sqlite3
from pprint import pprint
def columnar(cursor):
cols = [x[0] for x in cursor.description]
c = [list() for _ in cols]
for row in cursor:
for i,val in enumerate(row):
c[i] += [val]
return dict(zip(cols,c))
db = sqlite3.connect('data.sqlite')
if 1:
db.execute(''' drop table if exists link_em ''... | {
"content_hash": "d08bdfbbf6d31408658d2a62c3dc859d",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 96,
"avg_line_length": 37.95652173913044,
"alnum_prop": 0.6305841924398625,
"repo_name": "mobarski/sandbox",
"id": "11d8d2ed76837a4de2c519b5f8a92aea1b63a794",
"size": "1746... |
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.getcwd(), "..")))
from db.MysqlUtil import initMysql, execute, select, batchInsert, disconnect
from stock.StockTechStatus import StockTechStatus
from stock.GainIndexForecast import getGainForecast
from task.StockTechTask import saveStockTechForeca... | {
"content_hash": "dea6896f1bda9521920c4746b2b26cf3",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 82,
"avg_line_length": 33.31481481481482,
"alnum_prop": 0.6425792106725959,
"repo_name": "zwffff2015/stock",
"id": "209cf00502d2f8d636f13528fb78f61c9b5cc828",
"size": "1815... |
from oslo_policy import policy
from manila.policies import base
BASE_POLICY_NAME = 'share_snapshot_export_location:%s'
share_snapshot_export_location_policies = [
policy.DocumentedRuleDefault(
name=BASE_POLICY_NAME % 'index',
check_str=base.RULE_DEFAULT,
description="List export locatio... | {
"content_hash": "ba1dc85c298f13df64105cae6ab3f82f",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 70,
"avg_line_length": 28.305555555555557,
"alnum_prop": 0.5574092247301276,
"repo_name": "bswartz/manila",
"id": "dea0610e9d9de8f27abe31aee309a688d76a9ec9",
"size": "1592"... |
"a".encode('ascii')
| {
"content_hash": "a5822efc8db0e8f8edcd538355ebd409",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 19,
"avg_line_length": 10.5,
"alnum_prop": 0.5714285714285714,
"repo_name": "sburnett/seattle",
"id": "802e70692d1651385541568a9abb98383e3b2883",
"size": "50",
"binary": f... |
from typing import (
Any,
AsyncIterator,
Awaitable,
Callable,
Iterator,
Optional,
Sequence,
Tuple,
)
from google.cloud.contentwarehouse_v1.types import rule_engine, ruleset_service_request
class ListRuleSetsPager:
"""A pager for iterating through ``list_rule_sets`` requests.
... | {
"content_hash": "d96e6264bc556eceb1b8a7c593b2dd24",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 87,
"avg_line_length": 37.82394366197183,
"alnum_prop": 0.6469931111524856,
"repo_name": "googleapis/google-cloud-python",
"id": "74be3e28b5b156e07ec845fc98f112c437d949d8",
... |
'''
Created on July 30, 2014
@author: cmills
This contains client-side support for TASR, focusing on the Subject+Version
(S+V) API used by the Avro project's schema repository code. There is also
support for some TASR-exclusive methods (retrieving by digest-based ID, for
example). The older TASR API remains availab... | {
"content_hash": "e999991184be8caede9cc84f751e79cd",
"timestamp": "",
"source": "github",
"line_count": 458,
"max_line_length": 79,
"avg_line_length": 42.956331877729255,
"alnum_prop": 0.6258513774524753,
"repo_name": "ifwe/tasr",
"id": "c416008bc1ca320411c99a0b5dcec02d189bb901",
"size": "19674",
... |
from __future__ import unicode_literals
import datetime
import re
import django
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.serializers import json # FIXME: disambiguate name from JSON module
from django.utils import six
from django.utils.encoding import fo... | {
"content_hash": "cfd88f0221c9a2c679934cfcc6b2301c",
"timestamp": "",
"source": "github",
"line_count": 523,
"max_line_length": 186,
"avg_line_length": 38.07839388145315,
"alnum_prop": 0.5968365553602812,
"repo_name": "ericholscher/django-tastypie",
"id": "059f0916a9649bf366723d8965514826ae7558f5",
... |
from osgeo import gdal
import sys
import numpy
src_file = sys.argv[1]
dst_file = sys.argv[2]
out_bands = 1
# Open source file
# dataset
src_ds = gdal.Open( src_file )
cols = src_ds.RasterXSize
rows = src_ds.RasterYSize
bands = src_ds.RasterCount
driver = src_ds.GetDriver()
driver_short= src_ds.GetDriver().ShortName
d... | {
"content_hash": "3c2cf9fa4e5b76ef3c37bd47f8916abd",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 51,
"avg_line_length": 20.866666666666667,
"alnum_prop": 0.7348242811501597,
"repo_name": "BuddyVolly/OpenSARKit",
"id": "b85da6d92119f057490a260d00d9b4e42e1c0bd4",
"size":... |
import sys
import os
# If extensions (or modules to document with autodoc) are in another
# directory, add these directories to sys.path here. If the directory is
# relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# Get the proje... | {
"content_hash": "9cd8b4375da6481a1817fcc06a30a7fd",
"timestamp": "",
"source": "github",
"line_count": 280,
"max_line_length": 76,
"avg_line_length": 30.696428571428573,
"alnum_prop": 0.7052937754508435,
"repo_name": "wooyek/django-powerbank",
"id": "dcbbff0bdb92bb25656bf4c99c40a6a605bf0720",
"siz... |
import matplotlib.pyplot as plt
class FigureStyle:
def __init__(self, dpi=300, width=None,
height=None, width_per_subplot=None,
height_per_subplot=None,
share_x_axis=False, share_y_axis=False):
"""
:param figure_id:
:param dpi:
:... | {
"content_hash": "0f0b580b9cbe46fe6519bca16e20e9f9",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 81,
"avg_line_length": 36.885245901639344,
"alnum_prop": 0.5413333333333333,
"repo_name": "mahajrod/MACE",
"id": "cb7bfeb4595e436f580f6b4c657b4e1c8fa8190c",
"size": "2250",... |
"""
Copyright 2013 The Trustees of Princeton University
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 applicab... | {
"content_hash": "8f2dedc3cf103590ffbc47c848225825",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 95,
"avg_line_length": 24.350877192982455,
"alnum_prop": 0.5840537944284342,
"repo_name": "iychoi/syndicate-core",
"id": "29db1bec48c43d6ed6fee4625410f5df375008ff",
"size"... |
import numpy as np
import matplotlib.pyplot as plt
from scipy.io import wavfile
rate_h,hstrain=wavfile.read(r'H1_Strain.wav','rb')
rate_l,lstrain=wavfile.read(r'L1_Strain.wav',"rb")
reftime,ref_H1=np.genfromtxt('wf_template.txt').transpose()
htime_interval=1/rate_h
ltime_interval=1/rate_l
htime_len=hstrain.shape[0]/... | {
"content_hash": "13cac1bdac1abe990fdbb4f82a2e531e",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 59,
"avg_line_length": 25.095238095238095,
"alnum_prop": 0.7495256166982922,
"repo_name": "ds17/reptiles_gh",
"id": "5c53bd09f099478702fcda68a95f1dba367bae86",
"size": "105... |
"""Top-level display functions for displaying object in different formats."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
try:
from base64 import encodebytes as base64_encode
except ImportError:
from base64 import ... | {
"content_hash": "08931db8977875118b7ee9307335e3c0",
"timestamp": "",
"source": "github",
"line_count": 1003,
"max_line_length": 110,
"avg_line_length": 33.93818544366899,
"alnum_prop": 0.5918331374853114,
"repo_name": "lancezlin/ml_template_py",
"id": "4a943e4dbb4eca8d0724e54589e9c0b4751b8bdc",
"s... |
"""Service calling related helpers."""
import asyncio
from functools import partial, wraps
import logging
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
Iterable,
List,
Optional,
Set,
Tuple,
)
import voluptuous as vol
from homeassistant.auth.permissions.const import CAT_E... | {
"content_hash": "988143349e4a22670ac420f77a599322",
"timestamp": "",
"source": "github",
"line_count": 571,
"max_line_length": 147,
"avg_line_length": 30.833625218914186,
"alnum_prop": 0.6135976371691468,
"repo_name": "robbiet480/home-assistant",
"id": "2c4f02990bf6b7952c7423c0e27d1a4d2c6d620b",
"... |
""" Git Feed Views reports tests """
from django.test import TestCase
from django.test import Client
from django.conf import settings
from django.utils import timezone
from app.logic.gitrepo.models.GitProjectModel import GitProjectEntry
from app.logic.gitrepo.models.GitUserModel import GitUserEntry
from app.logic.gitr... | {
"content_hash": "d4518c57762757f2c2100b9f1e5527a4",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 123,
"avg_line_length": 36.85401459854015,
"alnum_prop": 0.6694394929689047,
"repo_name": "imvu/bluesteel",
"id": "82c2df4d6fd2c5d8d117c3e6884b613fc90a26fa",
"size": "5049... |
import errno
import json
import os
import random
import shlex
import shutil
import stat
import subprocess
import sys
import tempfile
import threading
import unittest
import uuid
from collections import Counter, OrderedDict
from contextlib import contextmanager
import bottle
import requests
import six
import time
from ... | {
"content_hash": "7d8ce392a82c94f16bc06d3a5b257331",
"timestamp": "",
"source": "github",
"line_count": 1193,
"max_line_length": 100,
"avg_line_length": 37.49790444258173,
"alnum_prop": 0.5932714876494914,
"repo_name": "memsharded/conan",
"id": "47064174af533f0d6c5904ec8b61834a982e9f9a",
"size": "4... |
import unittest
import numpy as np
from quant_dequant_test import QuantDequantTest
import paddle
import paddle.fluid as fluid
import paddle.fluid.core as core
from paddle.fluid.core import AnalysisConfig, PassVersionChecker
class TensorRTMatMulQuantDequantDims3Test(QuantDequantTest):
def setUp(self):
se... | {
"content_hash": "c9093aaf29a8afffb61de02fc89b8fe8",
"timestamp": "",
"source": "github",
"line_count": 311,
"max_line_length": 80,
"avg_line_length": 33.356913183279744,
"alnum_prop": 0.575187969924812,
"repo_name": "PaddlePaddle/Paddle",
"id": "b85f530cb06af7e68c646ea9c29cd04a6200efef",
"size": "... |
import os
import environ
p = environ.Path(__file__) - 2
env = environ.Env()
def root(*paths, **kwargs):
ensure = kwargs.pop('ensure', False)
path = p(*paths, **kwargs)
if ensure and not os.path.exists(path):
os.makedirs(path)
return path
def read_env():
env_file = root('../.env')
i... | {
"content_hash": "72afc0a240858149c95b104f3711534f",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 58,
"avg_line_length": 20.35,
"alnum_prop": 0.6093366093366094,
"repo_name": "xuchao666/msz",
"id": "695403a3e5599c92510e2ed990c4b69f58659715",
"size": "431",
"binary": f... |
import argparse
import os
import platform
import re
import sys
import xml.etree.ElementTree as ET
from collections import OrderedDict
from typing import List, Dict, TextIO, Tuple, Optional, Any, Union
# Import hardcoded version information from version.py
root_directory = os.path.join(os.path.dirname(os.path.abspath(_... | {
"content_hash": "6fee65e1439e662bf41a510e22ed7d50",
"timestamp": "",
"source": "github",
"line_count": 1856,
"max_line_length": 173,
"avg_line_length": 38.524245689655174,
"alnum_prop": 0.5028600998587432,
"repo_name": "akien-mga/godot",
"id": "519554e02606befff3129d82a6d7d00542279488",
"size": "7... |
from django.conf import settings
TAG_TYPES = ('function', 'comparison', 'filter', 'block')
LIBRARY = getattr(settings, 'NATIVE_LIBRARY', {})
TAGS = getattr(settings, 'NATIVE_TAGS', (
'native_tags.contrib.comparison',
'native_tags.contrib.generic_content',
'native_tags.contrib.generic_markup',
'native... | {
"content_hash": "736a48e974805f5dd5dd9c4c1befa1ef",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 79,
"avg_line_length": 31.1875,
"alnum_prop": 0.7114228456913828,
"repo_name": "justquick/django-native-tags",
"id": "01d931e44c3b2e3991d44af89b1e792f0936b7a7",
"size": "49... |
"""
A genetic algorithm to find optimal seating arrangements.
usage: seatingchart.py [-h] [--data-file DATA_FILE]
[--population-size POPULATION_SIZE]
[--iterations MAX_ITERATIONS]
[--mutation MUTATION_PROB] [--crossover CROSSOVER_PROB... | {
"content_hash": "114a1cebcc9cf08090f768d64278f5ee",
"timestamp": "",
"source": "github",
"line_count": 308,
"max_line_length": 82,
"avg_line_length": 32.66883116883117,
"alnum_prop": 0.5589346054462333,
"repo_name": "rawg/levis",
"id": "816451cf4213474e875532a9087eab9bbb10533b",
"size": "10062",
... |
from typing import Callable, List, Optional, Tuple
import numpy as np
import gdsfactory as gf
from gdsfactory.component import Component, ComponentReference
from gdsfactory.components.bend_euler import bend_euler
from gdsfactory.components.straight import straight as straight_function
from gdsfactory.components.taper... | {
"content_hash": "a4df70c7071c96fe07a2271b89caada9",
"timestamp": "",
"source": "github",
"line_count": 275,
"max_line_length": 95,
"avg_line_length": 35.30909090909091,
"alnum_prop": 0.6101956745623069,
"repo_name": "gdsfactory/gdsfactory",
"id": "3f5cf6a0524d74d6a4080721bd28c6f79f818586",
"size":... |
'''
Returns the date, e.g.
2022-05-08z
UTC aka gmt aka zulu (hence the z)
Almost iso 8601 http://www.cl.cam.ac.uk/~mgk25/iso-time.html
deviations:
I use lower case z instead of T between date and time
for readability and to designate UTC (zulu)
'''
#<\mod_doc>
#<copyright> Copyright (c) 2020-2022 Dinkum... | {
"content_hash": "7f3c9326f4551097dce7d0e44339ff83",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 75,
"avg_line_length": 25.554054054054053,
"alnum_prop": 0.6530936012691697,
"repo_name": "dinkumsoftware/dinkum",
"id": "4f265591dbff33e1f9441adc35ac7f5c985f96e0",
"size":... |
"""Diffie-Hellman elliptic curve key agreement scheme.
Implementation of the Diffie-Hellman key agreement scheme using
elliptic curve cryptography. A key agreement scheme is used
by two entities to establish shared keying data, which will be
later utilized e.g. in symmetric cryptographic scheme.
The two entities must... | {
"content_hash": "7a376499a1d1a9b57b0cf7ee947b8cfd",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 86,
"avg_line_length": 33.23529411764706,
"alnum_prop": 0.6712389380530973,
"repo_name": "fametrano/BitcoinBlockchainTechnology",
"id": "a571f1caa38b5b163e559637310572b7f54b9... |
"""Setuptools entry point."""
import codecs
import os
from setuptools import setup
import pytest_splinter
dirname = os.path.dirname(__file__)
long_description = (
codecs.open(os.path.join(dirname, 'README.rst'), encoding='utf-8').read() + '\n' +
codecs.open(os.path.join(dirname, 'AUTHORS.rst'), encoding='ut... | {
"content_hash": "5ed91d3dd775922e647cb9f75727219c",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 98,
"avg_line_length": 33.9,
"alnum_prop": 0.6200589970501474,
"repo_name": "pelme/pytest-splinter",
"id": "e22cc6bb122f13405ea989574756235e153ab933",
"size": "1695",
"bi... |
import unittest
import pinq
class queryable_join_tests(unittest.TestCase):
def setUp(self):
self.queryable1 = pinq.as_queryable(range(1, 11))
self.queryable2 = pinq.as_queryable(range(11, 21))
def test_join_all(self):
self.assertEqual(list(self.queryable1.join(
self.query... | {
"content_hash": "4a47f3d1aeaf107ce1a5f46f6b3063e4",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 78,
"avg_line_length": 41.111111111111114,
"alnum_prop": 0.5654054054054054,
"repo_name": "dlshriver/pinq",
"id": "48d1434263242abae817385cd100573608c18a68",
"size": "1850"... |
"""fMRI preprocessing workflow."""
from .. import config
def main():
"""Entry point."""
from os import EX_SOFTWARE
from pathlib import Path
import sys
import gc
from multiprocessing import Process, Manager
from .parser import parse_args
from ..utils.bids import write_derivative_descrip... | {
"content_hash": "a8cbd2235da9e844a3fcfa0c0f6acc1b",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 94,
"avg_line_length": 37.36363636363637,
"alnum_prop": 0.6155717761557178,
"repo_name": "poldracklab/preprocessing-workflow",
"id": "65adb70bd3c57f0bc682efe04e053a4b4704703... |
"""
Search postfix logs for emails by making a match on sender and recipient.
"""
__author__ = "Khosrow Ebrahimpour"
__version__ = "0.4.3"
__license__ = "MIT"
| {
"content_hash": "89b027c687407d9132ccf1e109f04219",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 73,
"avg_line_length": 26.5,
"alnum_prop": 0.6540880503144654,
"repo_name": "khosrow/track_msg",
"id": "7c46e165317b29eb0b2a63d2af28c63b9a8fe500",
"size": "159",
"binary":... |
import os
from django.db import migrations
from django.db.utils import DataError
def check_legacy_data(apps, schema_editor):
"""
Abort the migration if any legacy site fields still contain data.
"""
Site = apps.get_model('dcim', 'Site')
site_count = Site.objects.exclude(asn__isnull=True).count()... | {
"content_hash": "d601366b4b377ee5000ba21853df4637",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 105,
"avg_line_length": 35.644067796610166,
"alnum_prop": 0.6214931050879696,
"repo_name": "digitalocean/netbox",
"id": "86918447d7af542f5224df099242682c0a0e4787",
"size": ... |
"""Constructs for different kinds of queries and managers."""
import ast
import operator
from datetime import date
from functools import reduce
from itertools import chain
from django.db import models
from django.db.models import F, Q
from lark import Lark, Transformer, v_args
from studies.fields import CONDITIONS, ... | {
"content_hash": "096fb8b575b93bc2b1937b786ca52434",
"timestamp": "",
"source": "github",
"line_count": 340,
"max_line_length": 119,
"avg_line_length": 33.20294117647059,
"alnum_prop": 0.657631322526353,
"repo_name": "CenterForOpenScience/lookit-api",
"id": "684659aff0ec690ae963f8e0668489dbb9b51867",... |
import re
def test_phones_on_home_page(app):
contact_from_home_page = app.contact.get_contact_list()[1]
contact_from_edit_page = app.contact.get_contact_info_from_edit_page(1)
assert contact_from_home_page.all_phones_from_home_page == merge_phones_like_on_home_page(contact_from_edit_page)
# assert cont... | {
"content_hash": "869fee75f2fd7b2350ee9241c906c393",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 117,
"avg_line_length": 63.925925925925924,
"alnum_prop": 0.6952491309385863,
"repo_name": "elenagradovich/python_training",
"id": "eca0e9187143987aeffd3c45a11cdadeda8a04ab",... |
"""
Plot Settings class
"""
## MIT License
##
## Copyright (c) 2017, krishna bhogaonker
## 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 th... | {
"content_hash": "42a898a2bde85200f3ca9b1d14040c03",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 463,
"avg_line_length": 45.36923076923077,
"alnum_prop": 0.6490335707019329,
"repo_name": "university-gender-evolution/py-university-gender-dynamics-pkg",
"id": "00e8854854c7... |
from pylearn2.models.mlp import MLP, CompositeLayer
from pylearn2.space import CompositeSpace
from theano.compat.python2x import OrderedDict
class MLPWithSource(MLP):
def __init__(self, *args, **kwargs):
self.input_source = kwargs.pop('input_source', 'features')
self.target_source = kwargs.pop('ta... | {
"content_hash": "1efde4ab2427aef59d63f57115286d04",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 77,
"avg_line_length": 33.63414634146341,
"alnum_prop": 0.6526468455402465,
"repo_name": "vaudrypl/ift6266-speech-synth",
"id": "a19821051f61db942abd4584947b5bdbf04bc374",
... |
"""Do not auto-compute diffusion_level
Revision ID: ac08dcf3f27b
Revises: dfec5f64ac73
Create Date: 2022-02-10 12:45:05.472204
"""
from distutils.util import strtobool
from alembic import op, context
import sqlalchemy as sa
from utils_flask_sqla.migrations.utils import logger
# revision identifiers, used by Alemb... | {
"content_hash": "3bc2cf4623876339db3db149c7ba574a",
"timestamp": "",
"source": "github",
"line_count": 308,
"max_line_length": 159,
"avg_line_length": 36.922077922077925,
"alnum_prop": 0.5646324305311291,
"repo_name": "PnEcrins/GeoNature",
"id": "e6fbe7b21af083e3dfbffd044a4b520fadfc198c",
"size": ... |
from __future__ import absolute_import
from linode.objects import Base, Property
class Image(Base):
"""
An Image is something a Linode or Disk can be deployed from.
"""
api_endpoint = '/images/{id}'
properties = {
"id": Property(identifier=True),
"label": Property(mutable=True),... | {
"content_hash": "daed0cba27eb935e547897a72270ba19",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 64,
"avg_line_length": 25.48,
"alnum_prop": 0.5745682888540031,
"repo_name": "jo-tez/python-linode-api",
"id": "26b1b336a41ad22c66c7b3f4db7aaf7ba21bc003",
"size": "637",
... |
import json
from flask import url_for
from re import search
from bluepill.server import get_application
from bluepill.server.resource import HOMESERVER, users, get_error_message
from test_resource import OK, NOT_FOUND, BAD_REQUEST, UNPROCESSABLE_ENTITY, app # noqa
# Create a local copy of the @alice:example.com u... | {
"content_hash": "f3c4d4cd3faf05c186278aa70a9f29c0",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 87,
"avg_line_length": 31.20689655172414,
"alnum_prop": 0.6290055248618784,
"repo_name": "SShrike/bluepill",
"id": "7b6fdd842a5fdd4f1cab328e675d9a06f62fa112",
"size": "424... |
import __builtin__
import contextlib
import copy
import datetime
import errno
import glob
import os
import random
import re
import shutil
import threading
import time
import uuid
import eventlet
from eventlet import greenthread
import fixtures
from lxml import etree
import mock
from mox3 import mox
from oslo_concurren... | {
"content_hash": "afb6dad05bad7dffd99d067ec206dd99",
"timestamp": "",
"source": "github",
"line_count": 13712,
"max_line_length": 97,
"avg_line_length": 44.123322637106185,
"alnum_prop": 0.5402243565904542,
"repo_name": "tealover/nova",
"id": "86e5c74c32bdd62ef949f62c71fa0669748b9a31",
"size": "605... |
'''
Created on Mar 10, 2011
@author: tomchristie
'''
# http://ericholscher.com/blog/2009/jun/29/enable-setuppy-test-your-django-apps/
# http://www.travisswicegood.com/2010/01/17/django-virtualenv-pip-and-fabric/
# http://code.djangoproject.com/svn/django/trunk/tests/runtests.py
import os
import sys
os.environ['DJANGO_... | {
"content_hash": "9437377d2e4f9b909e0904352737f3a9",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 82,
"avg_line_length": 26.682926829268293,
"alnum_prop": 0.6709323583180987,
"repo_name": "seanfisk/buzzword-bingo-server",
"id": "9f5cc7aa69e3ab43db2a563c584245d371076da1",
... |
"""
A module contains an interface which represent a WAMP part of a config
"""
from zope.interface import Interface, Attribute
__author__ = 'dimd'
class IWamp(Interface):
"""
Interface that describe a wamp part of config
"""
user = Attribute('WAMP CRA User')
password = Attribute('WAMP CRA passw... | {
"content_hash": "b5784ec6a68e473afbe083b74e08fc55",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 103,
"avg_line_length": 26.789473684210527,
"alnum_prop": 0.6915520628683693,
"repo_name": "dimddev/NetCatKS",
"id": "2388d24bf5f9284d2a3debd0043c2626f4d130d6",
"size": "50... |
import os
import unittest
import random
import threading
import subprocess32 as subprocess
import imath
import IECore
import IECoreImage
import Gaffer
import GafferTest
import GafferDispatch
import GafferImage
import GafferImageTest
class DisplayTest( GafferImageTest.ImageTestCase ) :
# Utility class for sending i... | {
"content_hash": "31b804b6a2a5f62d854d36fc6a70654f",
"timestamp": "",
"source": "github",
"line_count": 338,
"max_line_length": 148,
"avg_line_length": 32.89349112426036,
"alnum_prop": 0.6942795466810577,
"repo_name": "hradec/gaffer",
"id": "a735d287dde54e4f28208ce37e73f6be8969a163",
"size": "12926... |
import numpy as np
def hashTable(patch,Qangle,Qstrenth,Qcoherence):
[gx,gy] = np.gradient(patch)
G = np.matrix((gx.ravel(),gy.ravel())).T
x = G.T*G
[eigenvalues,eigenvectors] = np.linalg.eig(x)
#For angle
angle = np.math.atan2(eigenvectors[0,1],eigenvectors[0,0])
if angle<0:
an... | {
"content_hash": "b4a820ac868a7b3098b5627c512fc32e",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 62,
"avg_line_length": 30.444444444444443,
"alnum_prop": 0.6362530413625304,
"repo_name": "MKFMIKU/RAISR",
"id": "071de355d4fb834fc3ae469a0e90d2279ba1c4ae",
"size": "847",
... |
from __future__ import unicode_literals
import datetime
import itertools
from django.test import TestCase
from django.db import IntegrityError
from django.db.models import Prefetch
from modelcluster.models import get_all_child_relations
from modelcluster.queryset import FakeQuerySet
from modelcluster.utils import Ma... | {
"content_hash": "b4932ed190626b7f687df36dcd4d65af",
"timestamp": "",
"source": "github",
"line_count": 1141,
"max_line_length": 146,
"avg_line_length": 44.61963190184049,
"alnum_prop": 0.6250319184459154,
"repo_name": "wagtail/django-modelcluster",
"id": "7abd3ad91f3bc714c5a33fda3a9211f7878efe87",
... |
"""Locators for all elements."""
# pylint: disable=too-few-public-methods
# pylint: disable=too-many-lines
from selenium.webdriver.common.by import By
from lib.constants import objects, url
class Common(object):
"""Common locators."""
# modal
MODAL_GENEATE = ".modal-selector"
MODAL_CREATE = ".modal-wide"
... | {
"content_hash": "0951f83e9a4aef2d5a4c8f06fffb73ea",
"timestamp": "",
"source": "github",
"line_count": 1049,
"max_line_length": 79,
"avg_line_length": 36.23069590085796,
"alnum_prop": 0.6374519812661159,
"repo_name": "VinnieJohns/ggrc-core",
"id": "42ac413ead13c0023f8cfc3637101401b1e56f38",
"size"... |
import json
from django.contrib.auth.decorators import login_required
from django.core import serializers
from django.core.serializers.json import DjangoJSONEncoder
from django.db.models import Q
from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseRedirect
from django.template import loader
from d... | {
"content_hash": "1b2d1123033c570ba53f417d51abf12c",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 116,
"avg_line_length": 34.83064516129032,
"alnum_prop": 0.6898587636026858,
"repo_name": "robotichead/NearBeach",
"id": "64afcaa9f7179534820e0e4e6d90debf9f9ff3ba",
"size"... |
from django.apps import AppConfig
class DkModelfields(AppConfig):
name = 'DkModelfields'.lower()
verbose_name = 'DkModelfields'
| {
"content_hash": "f468edc5c25dfaaa42a7fd25cdb652d9",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 34,
"avg_line_length": 23,
"alnum_prop": 0.7391304347826086,
"repo_name": "datakortet/dkmodelfields",
"id": "8cf1d785ae6e1abb5979a42127a411b4152f5324",
"size": "162",
"bin... |
import functools
class decorator_uiexpose(object):
"""
Use this decorator to expose instance method to the GUI.
"""
def __init__(self, flags=None):
if flags is None:
flags = []
self.flags = flags
def __call__(self, fn, *args, **kwargs):
def wrapped_f(*args, **... | {
"content_hash": "a61d32b3519efa7e7ccd4a6096c2e5fe",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 63,
"avg_line_length": 26.25,
"alnum_prop": 0.5369047619047619,
"repo_name": "SqueezeStudioAnimation/omtk",
"id": "fdabb2c15e41513f67776178700714b373ef301c",
"size": "840",... |
from pathlib import Path
from tempfile import TemporaryDirectory
from paralleldomain.utilities.any_path import AnyPath, S3Path
def test_resolving():
with TemporaryDirectory() as temp_dir:
path = AnyPath(temp_dir)
assert path.exists()
assert isinstance(path._backend, Path)
path = A... | {
"content_hash": "9607acffc5cb1fc30de05347b318dee8",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 63,
"avg_line_length": 31.428571428571427,
"alnum_prop": 0.6772727272727272,
"repo_name": "parallel-domain/pd-sdk",
"id": "1cc25770f995a67d559c8b661fda46a497d2ade6",
"size"... |
import sublime
import sublime_plugin
from .list_packages_command import ListPackagesThread
class ListUnmanagedPackagesCommand(sublime_plugin.WindowCommand):
"""
A command that shows a list of all packages that are not managed by
Package Control, i.e. that are installed, but not mentioned in
`install... | {
"content_hash": "c23b4f4b8b3b327dd60afd5cbc6da3aa",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 76,
"avg_line_length": 31,
"alnum_prop": 0.7083333333333334,
"repo_name": "herove/dotfiles",
"id": "ae1121c880161ab7155be1837dab643df0833f60",
"size": "744",
"binary": fa... |
"""distutils.command.build_ext
Implements the Distutils 'build_ext' command, for building extension
modules (currently limited to C extensions, should accommodate C++
extensions ASAP)."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id$"
import sys, os, string, re
from types import *
fr... | {
"content_hash": "1c32dc8afd5b9013e8427261bee161cf",
"timestamp": "",
"source": "github",
"line_count": 768,
"max_line_length": 86,
"avg_line_length": 41.98046875,
"alnum_prop": 0.5645916689928973,
"repo_name": "nmercier/linux-cross-gcc",
"id": "1c9496ce61a15acf527532cade0d44ab20e64b51",
"size": "3... |
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('..'))
# -- General configurat... | {
"content_hash": "3001284f4ea538e271f5b5d850fde9db",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 80,
"avg_line_length": 32.492063492063494,
"alnum_prop": 0.7103077674645824,
"repo_name": "Multiposting/mongoengine",
"id": "40c1f430b5e634d509aa7aadac8c13f46ddef709",
"si... |
"""
Copyright 2017-present Airbnb, Inc.
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, sof... | {
"content_hash": "d38928cc381c543c51ef41b841ed8d3a",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 72,
"avg_line_length": 35.833333333333336,
"alnum_prop": 0.7767441860465116,
"repo_name": "airbnb/streamalert",
"id": "d97a878cbc29236a11f1337ace0deb82bd706373",
"size": "6... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cargo', '0004_auto_20151118_2134'),
]
operations = [
migrations.AlterModelOptions(
name='emailingtransaction',
options={'ord... | {
"content_hash": "be360dfbaec7c252f710ac2e25667da7",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 139,
"avg_line_length": 26.58823529411765,
"alnum_prop": 0.6238938053097345,
"repo_name": "dalou/django-cargo",
"id": "a9df3d0addcc9bf21689fa23f1e6d1bef1f35d8b",
"size": "4... |
from __future__ import unicode_literals
import swapper
from django.db import models
from fluent_pages.models import UrlNode
from accelerator_abstract.models.accelerator_model import AcceleratorModel
class BaseNodePublishedFor(AcceleratorModel):
node = models.ForeignKey(UrlNode, on_delete=models.CASCADE)
pub... | {
"content_hash": "50cf9514fffb77c7f16d1c2e9ecdd37b",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 79,
"avg_line_length": 33.708333333333336,
"alnum_prop": 0.7119901112484549,
"repo_name": "masschallenge/django-accelerator",
"id": "8025b632f1655df4492eeed1efd4adaff358008b"... |
"""
WSGI config for transactions project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO... | {
"content_hash": "4d20fbb0203d23a41d873e53c7b6e89d",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 25.125,
"alnum_prop": 0.7761194029850746,
"repo_name": "akash-dev-github/Transactions",
"id": "1bb86d04a9ce982e0c3e7857fb6e90aa2fd183e8",
"size": "40... |
from robotide.lib.robot.utils import NormalizedDict
class Metadata(NormalizedDict):
def __init__(self, initial=None):
NormalizedDict.__init__(self, initial, ignore='_')
def __unicode__(self):
return u'{%s}' % ', '.join('%s: %s' % (k, self[k]) for k in self)
def __str__(self):
re... | {
"content_hash": "3d4e4a247037c2b8781d284806e20383",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 73,
"avg_line_length": 28.153846153846153,
"alnum_prop": 0.5956284153005464,
"repo_name": "fingeronthebutton/RIDE",
"id": "7b7653149cd500ecec7dd52d5972c059d7948f62",
"size"... |
from binary_heap import binHeap
import pytest
import random
def test_empty_heap():
blist = binHeap()
assert blist.heap == [0]
def test_push_pop():
blist = binHeap()
blist.push(123)
assert blist.pop() == 123
# def all_list(heap):
# value_input = []
# while True:
# try:
# ... | {
"content_hash": "1cc4982f453a5fe0b1f92a4499fd2a76",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 44,
"avg_line_length": 18.458333333333332,
"alnum_prop": 0.5801354401805869,
"repo_name": "jacquestardie/data-structures",
"id": "49eba3509f47a8f2b0431d9b82cb46f7171eb053",
... |
def install(job):
service = job.service
vdc = service.producers["vdc"][0]
g8client = vdc.producers["g8client"][0]
cl = j.clients.openvcloud.getFromService(g8client)
acc = cl.account_get(vdc.model.data.account)
# if space does not exist, it will create it
space = acc.space_get(vdc.model.dbobj... | {
"content_hash": "e2d324486472f7e00608e386e030a3d2",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 72,
"avg_line_length": 42.04761904761905,
"alnum_prop": 0.5526613816534541,
"repo_name": "Jumpscale/ays_jumpscale8",
"id": "27f63d77970a8553c6cb340386caeaaa3da6c9f2",
"size... |
'''
Testing class for database API's archive related functions.
Authors: Ari Kairala, Petteri Ponsimaa
Originally adopted from Ivan's exercise 1 test class.
'''
import unittest, hashlib
import re, base64, copy, json, server
from database_api_test_common import BaseTestCase, db
from flask import json, jsonif... | {
"content_hash": "d98a24510b8abdfa8b7862f9c7243bff",
"timestamp": "",
"source": "github",
"line_count": 321,
"max_line_length": 135,
"avg_line_length": 41.47352024922118,
"alnum_prop": 0.6084278524750244,
"repo_name": "petterip/exam-archive",
"id": "9f6de23ac9c63ca609b68ba64253870ef0c7c5af",
"size"... |
"""
Test suite for the UHPPOTE RFID controller board module.
.. moduleauthor:: Andrew Vaughan <[email protected]>
"""
| {
"content_hash": "22eaff3183a890ad290b72da0acd5b96",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 57,
"avg_line_length": 24.8,
"alnum_prop": 0.7419354838709677,
"repo_name": "andrewvaughan/uhppote-rfid",
"id": "86956220556042d53c596f419bd9a6c6168b6873",
"size": "148",
... |
import requests
if __name__ == '__main__':
payload = {
"st":'',
"year":''
}
payload['st'] = '466920';
payload['year'] = '2015';
#1. original web, no use at all!!!
#link1 = "http://www.cwb.gov.tw/V7/climate/dailyPrecipitation/dP.htm"
#2. get rainfall specific station and year
#link2 = "http://www.cwb... | {
"content_hash": "7aa9e6af07e168892e64b9f375dcac6f",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 84,
"avg_line_length": 26.435897435897434,
"alnum_prop": 0.6614936954413191,
"repo_name": "TaiwanStat/real.taiwanstat.com",
"id": "11d5916347599fa83ebcd35c09cbb827de91ce78",
... |
import os
import six
import contextlib
import shutil
try:
from unittest import mock
except ImportError:
import mock
from twisted.trial import unittest
from twisted.protocols.policies import WrappingFactory
from twisted.python.filepath import FilePath
from twisted.internet import reactor, defer, error
from twis... | {
"content_hash": "d4bcde5aa4523d530b7aeee618055045",
"timestamp": "",
"source": "github",
"line_count": 991,
"max_line_length": 111,
"avg_line_length": 39.05549949545913,
"alnum_prop": 0.642181686647375,
"repo_name": "taito/scrapy",
"id": "3efcf6e9ccc24da750a90764fdf3017e7eed16e1",
"size": "38704",... |
from typing import Any, Dict, Generator
from ...call_builder.base.base_call_builder import BaseCallBuilder as _BaseCallBuilder
from ...client.base_sync_client import BaseSyncClient
from ...client.response import Response
from ...exceptions import NotPageableError, raise_request_exception
from ...type_checked import ty... | {
"content_hash": "200c5b0718174e9d02230241c9f20a43",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 118,
"avg_line_length": 40.896907216494846,
"alnum_prop": 0.6359969750441139,
"repo_name": "StellarCN/py-stellar-base",
"id": "bb0daf5d2b241e9f57ed3ae4980f7057a1676cb3",
"s... |
try:
from genesis import make_project, make_project_scaffold
except ImportError:
from selenext.genesis import make_project, make_project_scaffold
| {
"content_hash": "d547dcc55685a8c45b04ee1ec5ec03ca",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 68,
"avg_line_length": 38.5,
"alnum_prop": 0.7922077922077922,
"repo_name": "Wykleph/selenext",
"id": "c9d3aea02a265e94742c571b20857cac1d957057",
"size": "154",
"binary": ... |
from mock import Mock
from django.test import TestCase
from celery_progress.backends import CeleryBackend
class CeleryBackendTest(TestCase):
"""
Tests for the CeleryBackend.
"""
def setUp(self):
self.backend = CeleryBackend()
self.mock_store_result = Mock(return_value=True)
... | {
"content_hash": "a36c413416c14ee97bcec2a390da2159",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 69,
"avg_line_length": 29.40909090909091,
"alnum_prop": 0.6877897990726429,
"repo_name": "robgolding63/django-celery-progress",
"id": "b02e662be5017789e13456c21aa847530946164... |
'''
requirements
Python version - 3
flask
Rot13 converter
'''
from string import ascii_lowercase as low
from string import ascii_uppercase as upp
from flask import Flask,request,render_template
app = Flask(__name__)
@app.route('/')
def home():
return render_template('rot13.html',output="")
@app... | {
"content_hash": "8156f706a4ad4f27ad3af1b4aeb06aa1",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 51,
"avg_line_length": 20.11764705882353,
"alnum_prop": 0.6140350877192983,
"repo_name": "guvi007/ROT13-convertor",
"id": "69ed0f6c674ccb2e02bddede3ec005d5dacd4018",
"size"... |
"""
This module holds the functions to crawl and format stuff from the website
"""
import requests
from apscheduler.schedulers.blocking import BlockingScheduler
from bot.logger import LOGGER
from bot.settings import RU_URL
from bs4 import BeautifulSoup
from crawler.db import REDIS
SCHED = BlockingScheduler()
def hi... | {
"content_hash": "1290a05b6509885c691aa8378b556ca0",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 76,
"avg_line_length": 26.68421052631579,
"alnum_prop": 0.6553254437869822,
"repo_name": "gabrielecker/ru-telegram-bot",
"id": "557e29e58424005c40e5539a65d59657fd4e329e",
"... |
import werkzeug
from openerp import SUPERUSER_ID
from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp.addons.website.models.website import slug, unslug
from openerp.addons.website_partner.controllers.main import WebsitePartnerPage
from openerp.tools.translate import _
class Web... | {
"content_hash": "11b8777342758fc7db0ffbf43a541adf",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 175,
"avg_line_length": 49.51219512195122,
"alnum_prop": 0.6032019704433498,
"repo_name": "vileopratama/vitech",
"id": "222d4f5de9503d5ff82df1a71cfe645cbc0d7a65",
"size": ... |
from fluent_contents.models import Placeholder
from fluent_contents.plugins.picture.models import PictureItem
from fluent_contents.plugins.text.models import TextItem
from fluent_contents.tests.testapp.models import RawHtmlTestItem, TestPage
from fluent_contents.tests.utils import AppTestCase
class SearchTest(AppTest... | {
"content_hash": "ad7f198f81bbb653f85c3eed8b022492",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 96,
"avg_line_length": 38.71111111111111,
"alnum_prop": 0.669345579793341,
"repo_name": "django-fluent/django-fluent-contents",
"id": "db2aaeb2166de136bcbff1cab9cee3dcb2ac2db... |
RESOURCE_MAPPING = {
# api
'api_test': {
'resource': 'api.test',
'docs': 'https://api.slack.com/methods/api.test'
},
# auth
'auth_test': {
'resource': 'auth.test',
'docs': 'https://api.slack.com/methods/auth.test'
},
# channels
'channels_archive': {
... | {
"content_hash": "71138318516d058c724354cbe1cdce60",
"timestamp": "",
"source": "github",
"line_count": 293,
"max_line_length": 67,
"avg_line_length": 29.051194539249146,
"alnum_prop": 0.5400610902255639,
"repo_name": "humrochagf/tapioca-slack",
"id": "deb0de75efc3e8cce1f72ea09cc9d4eb49753c3f",
"si... |
"""Init module for MCT examples."""
| {
"content_hash": "216efdb0deb9abd3b3ceabc46e632a1c",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 35,
"avg_line_length": 36,
"alnum_prop": 0.6666666666666666,
"repo_name": "tensorflow/model-card-toolkit",
"id": "0e805559f82348ec36d965d1e3ccb7f224f20825",
"size": "611",
... |
import json
import os
import time
from urllib.parse import parse_qs
from collections import OrderedDict
from datetime import datetime, timedelta
from unittest import mock
from django.conf import settings
from django.core import mail
from django.core.cache import cache
from django.core.files import temp
from django.co... | {
"content_hash": "47aa150d598cdb375de3c43fdd28ad13",
"timestamp": "",
"source": "github",
"line_count": 8318,
"max_line_length": 97,
"avg_line_length": 40.983649915845156,
"alnum_prop": 0.6069339575596506,
"repo_name": "eviljeff/olympia",
"id": "f27945683b14ca9892f3dc11e397881e4b4c7626",
"size": "3... |
from django.utils.unittest.case import TestCase
from stackclient.forms import UserRegistrationForm
class UserRegistrationFormTestCase(TestCase):
def test_that_username_is_required(self):
form = UserRegistrationForm(data={"password": "si", "username": "", "confirmPassword": "ads"})
self.assertFals... | {
"content_hash": "14bf10ee490e9bef7cfb6d6b5815b646",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 119,
"avg_line_length": 53.13953488372093,
"alnum_prop": 0.67527352297593,
"repo_name": "JamesMura/furry-meme-py",
"id": "bc5367dad7e2b278245c2d16b424f04b027da81f",
"size":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.