text stringlengths 4 1.02M | meta dict |
|---|---|
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "radiotrack.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is ... | {
"content_hash": "f65bc19b9c3d9d16da77375ea55248a4",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 77,
"avg_line_length": 37.42857142857143,
"alnum_prop": 0.6221374045801527,
"repo_name": "clede/Radiotrack",
"id": "b75b2175bf995a3cb4e1e4a21fa6fea2d50c76ab",
"size": "808"... |
from django.contrib.auth.models import User
from profiles.models import Profile
from rest_framework import viewsets, response, permissions
from .serializers import UserSerializer, ProfileSerializer
from django.http import HttpResponse, HttpResponseRedirect
def home(request):
return HttpResponseRedirect("/api/"... | {
"content_hash": "3c8b3d849d5fda518aa2533bf170d17d",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 65,
"avg_line_length": 31.28125,
"alnum_prop": 0.7662337662337663,
"repo_name": "jparicka/django-react-auth",
"id": "e352abd1b404ccbdb9d22379e9b1928698b51ea3",
"size": "100... |
from typing import Any, Callable, Dict, Generic, Optional, TypeVar
import warnings
from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from .... | {
"content_hash": "fe1e6c60d5745538d020c1cf998d8a66",
"timestamp": "",
"source": "github",
"line_count": 531,
"max_line_length": 138,
"avg_line_length": 47.44632768361582,
"alnum_prop": 0.6496388028895769,
"repo_name": "Azure/azure-sdk-for-python",
"id": "624bc2ae298ff66ab1d917c2fa486b3be5454952",
"... |
BLENDS_DIR_NAME = 'blends'
EXPORT_DIRNAME = 'export_tmpdir'
# The environment variable names
ENV_PREVIZ_API_ROOT = 'PREVIZ_API_ROOT'
ENV_PREVIZ_TEAM_UUID = 'PREVIZ_TEAM_UUID'
ENV_PREVIZ_API_TOKEN = 'PREVIZ_API_TOKEN'
| {
"content_hash": "96448ae234325e17ac1e67d9ba801fad",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 41,
"avg_line_length": 31.142857142857142,
"alnum_prop": 0.7431192660550459,
"repo_name": "Previz-app/io_scene_previz",
"id": "3cd2964c6a98c39cd19f8ae7c57ff807268995ca",
"si... |
"""
Tests for epoll wrapper.
"""
import socket
import errno
import time
import select
import unittest
from test import support
if not hasattr(select, "epoll"):
raise unittest.SkipTest("test works only on Linux 2.6")
try:
select.epoll()
except IOError as e:
if e.errno == errno.ENOSYS:
raise unittes... | {
"content_hash": "2006b7e85624a8aa863b38b98e81c800",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 77,
"avg_line_length": 31.603960396039604,
"alnum_prop": 0.5834899749373433,
"repo_name": "wdv4758h/ZipPy",
"id": "083fd7f79d97643b64c1b2864635943c06e734a6",
"size": "7498... |
import uuid
import hashlib
from .. import constants
ROUND = constants.DEFAULT_PRECISION
def bit_mask(flags):
"""Generate a bit mask.
:type flags: dict
:return: int
"""
bit = 0
true = lambda x, y: (x | (1 << y))
false = lambda x, y: (x & (~(1 << y)))
for mask, position in constant... | {
"content_hash": "53df057615200637901effa5df1e07a5",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 79,
"avg_line_length": 19.876106194690266,
"alnum_prop": 0.6077471059661621,
"repo_name": "archilogic-com/three.js",
"id": "87e773cfaf7a2c3ad2a12fa96bcf30d309f50fa6",
"siz... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: cs_instance_facts
short_description: Gathering facts from the API of instances from Apache CloudStack based clouds.
description:
- Gath... | {
"content_hash": "906850d5c5dfd96d4574b61b52629920",
"timestamp": "",
"source": "github",
"line_count": 281,
"max_line_length": 126,
"avg_line_length": 31.209964412811388,
"alnum_prop": 0.6380843785632839,
"repo_name": "e-gob/plataforma-kioscos-autoatencion",
"id": "dde43d707745af8881b25561df2fab44ef... |
"""
:mod:`Crossovers` -- crossover methods module
=====================================================================
In this module we have the genetic operators of crossover (or recombination) for each chromosome representation.
"""
from random import randint as rand_randint, choice as rand_choice
from random i... | {
"content_hash": "979dae53451bff613e7e9ad8faf1c7d9",
"timestamp": "",
"source": "github",
"line_count": 858,
"max_line_length": 131,
"avg_line_length": 27.06177156177156,
"alnum_prop": 0.585727206167363,
"repo_name": "tapomayukh/projects_in_python",
"id": "b0da6ad06f0ec1e81e096734cc08054cd27d05a0",
... |
"""
Network.
Copyright 2014 Stanford 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 applicable law or agreed to in wri... | {
"content_hash": "5bcf80b17ae6b6749b437821f835e3ba",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 79,
"avg_line_length": 27.743589743589745,
"alnum_prop": 0.5566081330868762,
"repo_name": "skearnes/neural-network",
"id": "9bf1307d5ab2a9b13cfa630269d9dd5628d297d7",
"siz... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
"""Simple example of setting up a multi-agent policy mapping.
Control the number of agents and policies via --num-agents and --num-policies.
This works with hundreds of agents and policies, but note that initi... | {
"content_hash": "804d84611512d0a3cc90daad9c455f50",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 78,
"avg_line_length": 36.530434782608694,
"alnum_prop": 0.6308021899547727,
"repo_name": "atumanov/ray",
"id": "275c54390f9708ebd118009d9671b334f8f84dcb",
"size": "4201",... |
"""Wrappers for primitive Neural Net (NN) Operations."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import numbers
import os
import numpy as np
from tensorflow.python.eager import context
from tensorflow.python.framework import con... | {
"content_hash": "b95e769b4a8f97454bb2b71da1d58b35",
"timestamp": "",
"source": "github",
"line_count": 5221,
"max_line_length": 116,
"avg_line_length": 40.62363531890443,
"alnum_prop": 0.6533880884127942,
"repo_name": "gunan/tensorflow",
"id": "9a22f40f8a2b3104f0e25365b6f0dbaa3cab73e6",
"size": "2... |
from __future__ import print_function
from pylab import *
import matplotlib.cbook as cbook
# data are 256x256 16 bit integers
dfile = cbook.get_sample_data('s1045.ima.gz')
im = np.fromstring(dfile.read(), np.uint16).astype(float)
im.shape = 256, 256
#imshow(im, ColormapJet(256))
imshow(im, cmap=cm.gray)
axis('off')
s... | {
"content_hash": "e64e4ede89c9108d3d13bb4980beedb4",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 57,
"avg_line_length": 25.076923076923077,
"alnum_prop": 0.7300613496932515,
"repo_name": "lthurlow/Network-Grapher",
"id": "6fd45cf675ec5e7eb46bef463fdda6f3173ee63b",
"siz... |
from rdr_service.config import GENOME_TYPE_ARRAY, GENOME_TYPE_WGS
from rdr_service.genomic_enums import GenomicJob
from rdr_service.genomic.genomic_job_components import GenomicFileValidator
from tests.helpers.unittest_base import BaseTestCase
class GenomicFileValidatorTest(BaseTestCase):
def setUp(self):
... | {
"content_hash": "06e208ecf7a3ff0cc665762084a76202",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 89,
"avg_line_length": 33.44117647058823,
"alnum_prop": 0.6706244503078276,
"repo_name": "all-of-us/raw-data-repository",
"id": "9f3043569a14a619fcdd0e9cc681687eada9f2da",
... |
DEFAULT_REDIS_HOST = "127.0.0.1"
DEFAULT_REDIS_PORT = 6379
DEFAULT_REDIS_QUEUE = "thr:queue:default"
DEFAULT_TIMEOUT = 300
DEFAULT_BLOCKED_QUEUE_MAX_SIZE = 20
DEFAULT_HTTP_PORT = 8082
DEFAULT_MAXIMUM_LIFETIME = 300
DEFAULT_MAXIMUM_LOCAL_QUEUE_LIFETIME_MS = 1000
BRPOP_TIMEOUT = 5
REDIS_POOL_CLIENT_TIMEOUT = 60
| {
"content_hash": "b91ed0eaa4f65d950fda61a700a847b8",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 46,
"avg_line_length": 31.1,
"alnum_prop": 0.7652733118971061,
"repo_name": "thefab/thr",
"id": "710292d38c7431e216eb9712855e0a23faa1f301",
"size": "465",
"binary": false... |
u"""F5 Networks® LBaaSv2 plugin_rpc client for tempest tests."""
# Copyright 2016 F5 Networks 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... | {
"content_hash": "b341f7855fae0f10330af30525aeaf2a",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 76,
"avg_line_length": 35.87755102040816,
"alnum_prop": 0.6831626848691695,
"repo_name": "mattgreene/f5-openstack-lbaasv2-driver",
"id": "b4acb187f11179d0168c09e03d61791aa2bb... |
import os
from .utils import do, trace, data_from_mime
from .version import meta, tags_to_versions
FILES_COMMAND = 'hg locate -I .'
def _hg_tagdist_normalize_tagcommit(root, tag, dist, node):
dirty = node.endswith('+')
node = node.strip('+')
st = do('hg st --no-status --change %s' % str(node), root)
... | {
"content_hash": "dfa09ed21ac77893fa21027e4e936226",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 69,
"avg_line_length": 29.96825396825397,
"alnum_prop": 0.5810381355932204,
"repo_name": "esben/setuptools_scm",
"id": "e7a77e1c923af7a0705a1db2aab626e6cc35a218",
"size": "... |
"""
Netmiko SCP operations.
Supports file get and file put operations.
SCP requires a separate SSH connection for a control channel.
Currently only supports Cisco IOS and Cisco ASA.
"""
from __future__ import print_function
from __future__ import unicode_literals
import re
import os
import hashlib
import time
impor... | {
"content_hash": "41563f89016839a332b6db09bcac2c64",
"timestamp": "",
"source": "github",
"line_count": 407,
"max_line_length": 96,
"avg_line_length": 36.896805896805894,
"alnum_prop": 0.595658253978824,
"repo_name": "michaelrosejr/pyaos6",
"id": "6a2649812d8eabd037b62b552a871726a51f8059",
"size": ... |
"""Implements functions for testing for Commonly Targeted Genes (CTGs)."""
# pylint: disable=wildcard-import,redefined-builtin,unused-wildcard-import
from __future__ import absolute_import, division, print_function
from builtins import *
# pylint: enable=wildcard-import,redefined-builtin,unused-wildcard-import
from t... | {
"content_hash": "3381d6aa3703366e57810913e22ddc57",
"timestamp": "",
"source": "github",
"line_count": 484,
"max_line_length": 80,
"avg_line_length": 32.163223140495866,
"alnum_prop": 0.6339692940194,
"repo_name": "jrderuiter/im-fusion",
"id": "b833d19797d1484b5835be575c0ee6bc893cd54f",
"size": "1... |
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
from colors import green
def greet(greetee):
"""Given the name, return a greeting for a person of that name."""
return green('Hello, %s!' % greetee)
| {
"content_hash": "59eebb4e97919744fe1414846464948a",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 93,
"avg_line_length": 34.22222222222222,
"alnum_prop": 0.6753246753246753,
"repo_name": "Ervii/garage-time",
"id": "00aca5350487f3526e1221e9d128322914267a2f",
"size": "455"... |
import sys
from pathlib import Path
def check_if_available(prg, msg):
"""
Check if the given program is available.
If not, then die with the given error message.
"""
if not Path(prg).is_file():
print(msg, file=sys.stderr)
sys.exit(1)
| {
"content_hash": "08a80c03f60089bee32abe095e153f10",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 50,
"avg_line_length": 22.666666666666668,
"alnum_prop": 0.6286764705882353,
"repo_name": "jabbalaci/Bash-Utils",
"id": "00a4973502d65e24a2b2193e21fc6079af986df3",
"size": ... |
import os
import benchexec.tools.template
import benchexec.result as result
from benchexec.tools.template import ToolNotFoundException
class Tool(benchexec.tools.template.BaseTool2):
"""
This class serves as tool adaptor for Map2Check (https://github.com/hbgit/Map2Check)
"""
REQUIRED_PATHS_6 = [
... | {
"content_hash": "411d68707b32151d6c7204af16358ad9",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 88,
"avg_line_length": 33.35344827586207,
"alnum_prop": 0.543292840527268,
"repo_name": "sosy-lab/benchexec",
"id": "f0261c1e222a8af5e75192e1089d6b369d4dfb4c",
"size": "40... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "impulse.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is rea... | {
"content_hash": "6c63c1f396d217bfe135f21965518895",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 77,
"avg_line_length": 37.285714285714285,
"alnum_prop": 0.6206896551724138,
"repo_name": "akurihara/impulse",
"id": "60058c19e0700492f4cf066d7e50bed383caff37",
"size": "80... |
import fixtures
import constants
from authomatic.providers import oauth2
conf = fixtures.get_configuration('eventbrite')
CONFIG = {
'login_xpath': ('//*[@id="authentication-container"]'
'/div/form/div[3]/div[1]/input'),
'password_xpath': ('//*[@id="authentication-container"]'
... | {
"content_hash": "811ef0a68b8e8173f5e7224467ba53ef",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 77,
"avg_line_length": 29.77027027027027,
"alnum_prop": 0.5365410803449842,
"repo_name": "touilleMan/authomatic",
"id": "06aa840c4913a9f99506e7e2c0c142cfbf4ff98c",
"size": ... |
"""Defines the output class for the adapter layers' parameters."""
from dataclasses import dataclass
import torch
@dataclass
class SamplerOutput:
"""Base class for the base and weights of each adapter."""
weight: torch.FloatTensor = None
bias: torch.FloatTensor = None
@dataclass
class LayerNormOutput:
... | {
"content_hash": "5a8975ce681dbb93e315902a4c8d1ee1",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 66,
"avg_line_length": 24.13888888888889,
"alnum_prop": 0.7111622554660529,
"repo_name": "google-research/ruse",
"id": "629b982ec54905c8f8c7e4489c6f33d2d16009d0",
"size": "... |
import unittest
import unittest.mock
import os
import cachediff
class TestAssemblyInstruction(unittest.TestCase):
def test_simple(self):
line = '4005d6: 48 83 c4 08 add $0x8,%rsp'
ai = cachediff.AssemblyLine(line)
self.assertEqual(ai.get_virtual_address(), 0x4005d6)
... | {
"content_hash": "252f294b430cdc6ab4522ca8f8fe1cc0",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 79,
"avg_line_length": 43.27717391304348,
"alnum_prop": 0.5854577420570137,
"repo_name": "sahutd/cachediff",
"id": "67bae4d746d36835b86202036899d7605fb1955b",
"size": "796... |
def cycleSort(arr):
writes = 0
# Loop through the array to find cycles
for cycle in range(0, len(arr) - 1):
item = arr[cycle]
# Find the location to place the item
pos = cycle
for i in range(cycle + 1, len(arr)):
if arr[i] < item:
pos += 1
... | {
"content_hash": "2f60904d1436fc9eb31feff2a3baa12a",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 65,
"avg_line_length": 25.869565217391305,
"alnum_prop": 0.4773109243697479,
"repo_name": "Deepak345/al-go-rithms",
"id": "9a7a2dfc215577211b4d42ad0abf4633f22eb9f9",
"size"... |
from utils import request_xml, request_json
import requests
import xmltodict
TRACK_BY_ID = ('https://trkweb.dominos.com/orderstorage/GetTrackerData?'
'StoreID={storeId}&OrderKey={orderKey}')
TRACK_BY_PHONE = ('https://trkweb.dominos.com/orderstorage/GetTrackerData?'
'Phone={phone}')
d... | {
"content_hash": "53e2483bba38600319ddfe11e5a013ec",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 75,
"avg_line_length": 40.8125,
"alnum_prop": 0.7029096477794793,
"repo_name": "mpare002/HackTech_2017",
"id": "d09c92ce6ad2b0c7c9039f59e8c02934fc82dbfb",
"size": "653",
... |
# coding: utf-8
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#---------------------------------------------------------------------... | {
"content_hash": "93f84040c3feb6d4c24ab039d087ee00",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 108,
"avg_line_length": 41.025862068965516,
"alnum_prop": 0.6434124816137844,
"repo_name": "Azure/azure-sdk-for-python",
"id": "97bf153ae701d85bf20fa91bf21c142a590c92be",
... |
import brain
import time
import math
import random
class Bug(object):
def __init__(self, brain, energy, max_grid_edge, min_grid_edge):
random.seed(time.time())
self.brain = brain
self.energy = energy
self.max_grid = max_grid_edge
self.min_grid = min_grid_e... | {
"content_hash": "2277104655a3e8e4e8648ced22a817fa",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 126,
"avg_line_length": 34.3177570093458,
"alnum_prop": 0.528322440087146,
"repo_name": "Chippers255/bugs",
"id": "271d334b85acff27eb7fb2fd9109a5405f285db6",
"size": "3672... |
import os
import tkinter as tk
import tkinter.ttk as ttk
import tkinter.colorchooser as colorchooser
Spinbox = ttk.Spinbox if hasattr(ttk, "Spinbox") else tk.Spinbox
if __name__ == "__main__": # For stand-alone testing with parallel TkUtil
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(... | {
"content_hash": "66807bc6e38f3a70129a7caa1d6c8d1f",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 75,
"avg_line_length": 31.883333333333333,
"alnum_prop": 0.6092524830109776,
"repo_name": "johnobrien/PyPractice",
"id": "cfa9d5484049379b6907e49ee05daf832f809d98",
"size"... |
class Intermediate(object):
# Generates the null intermediate representation for the given problem.
@staticmethod
def from_problem(problem):
states = dict([(sid, [sid]) for sid in problem.sids])
return Intermediate(states)
# Generates an intermediate representation from a given patch.
... | {
"content_hash": "b010a4a467da847e735c6770d86ae730",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 98,
"avg_line_length": 37.557522123893804,
"alnum_prop": 0.6039114043355325,
"repo_name": "ChrisTimperley/EvoAnalyser.py",
"id": "fc4fdcea7e72c3e515fab7503f83262b227a36ed",
... |
from .base import BaseType
class SavedActionList(BaseType):
_soap_tag = 'saved_actions'
def __init__(self):
BaseType.__init__(
self,
simple_properties={},
complex_properties={'cache_info': CacheInfo},
list_properties={'saved_action': SavedAction},
... | {
"content_hash": "746d6e91bc0b0207cc96c46761d1cc7e",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 58,
"avg_line_length": 22.333333333333332,
"alnum_prop": 0.5863539445628998,
"repo_name": "tanium/pytan",
"id": "14930c22adc940e918aa1e3e8e4b893631a669a1",
"size": "558",
... |
"""Pretty-print tabular data."""
from __future__ import print_function
from __future__ import unicode_literals
from collections import namedtuple
from platform import python_version_tuple
import re
if python_version_tuple()[0] < "3":
from itertools import izip_longest
from functools import partial
_none_... | {
"content_hash": "1d3d2b378b96dfac480d16652cf2ff72",
"timestamp": "",
"source": "github",
"line_count": 847,
"max_line_length": 198,
"avg_line_length": 34.2668240850059,
"alnum_prop": 0.5356601433296582,
"repo_name": "NLeSC/pointcloud-benchmark",
"id": "24da5d80ee392e42064171c1894d5d2003b81385",
"s... |
def compute(x,y): # Initializing a function to compute average
average = sum / count # Average = total divide for number of counts
return ("The total is: %f , the count is: %d and the average is: %f") % (sum, count, average) # Return a value of total, count and average
count = 0 # Initialize count = 0
sum ... | {
"content_hash": "74e9f4d85db6bc0cead61113c91f7219",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 139,
"avg_line_length": 28.48148148148148,
"alnum_prop": 0.6540962288686606,
"repo_name": "ttruongdc/py-Learning",
"id": "f7218e83e666e75d1da32c3e9bc36cd435732561",
"size":... |
import io
from kivy.core.image import Image as CoreImageKivy
from PIL import Image
class CoreImage(CoreImageKivy):
def __init__(self, arg, **kwargs):
super(CoreImage, self).__init__(arg, **kwargs)
def resize(self, fname, fname_scaled, width, height):
"""
reduces the size of an image.
... | {
"content_hash": "0586bb1789820e77eb2321fb2fe7e54f",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 58,
"avg_line_length": 26.44,
"alnum_prop": 0.5537065052950075,
"repo_name": "alexismirandan/Edit-image-kivy-app",
"id": "50401bbd5ee721b3c8548e35c9f088f97888fd89",
"size":... |
import json
import time
from collections import defaultdict
from os.path import join
import numpy as np
from sklearn.metrics import average_precision_score
from .utils import make_relevance_matrix
from .settings import RESULTS_DIR
class Evaluator(object):
"""The ``Evaluator`` evaluates a retrieval method, colle... | {
"content_hash": "dfe4c5dca6f5a0a5775f333e858eb062",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 79,
"avg_line_length": 32.16556291390729,
"alnum_prop": 0.5688696726374305,
"repo_name": "dschwertfeger/cbar",
"id": "44d94253c58e5a173487f9b2076aaecb660066ab",
"size": "4... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0006_auto_20150707_0631'),
]
operations = [
migrations.AlterField(
model_name='user',
name='image',
fie... | {
"content_hash": "a924b0fdc43da1624c15c9650402f7d3",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 157,
"avg_line_length": 26.666666666666668,
"alnum_prop": 0.625,
"repo_name": "juliancantillo/iwgk",
"id": "afd3b85773b6afea254fb0c34f81adc741bfc181",
"size": "504",
"bin... |
import uuid
from datetime import datetime, timedelta
import time
import random
from networking import *
import re
import sys
import smtplib
from email.mime.text import MIMEText
import signal, os
def split_hostname(node):
m = re.match(r'^(.+?)(?::(\d+))?$', node)
return (m.group(1), int(m.group(2)))
class DARNode:
... | {
"content_hash": "7aa0924012016cffad91ae0e4e25ed9a",
"timestamp": "",
"source": "github",
"line_count": 441,
"max_line_length": 137,
"avg_line_length": 34.183673469387756,
"alnum_prop": 0.6796019900497512,
"repo_name": "Jille/darn",
"id": "15ad027f5bc7e7b59e913cb897880b29931c4f1d",
"size": "15075",... |
from ddt import ddt, data
from rest_framework import status, test
from waldur_core.core.tests.helpers import override_waldur_core_settings
from waldur_core.structure import models
from . import fixtures, factories
class ServiceSettingsListTest(test.APITransactionTestCase):
def setUp(self):
self.users = ... | {
"content_hash": "03573c79b637b8a932033db8327ecc00",
"timestamp": "",
"source": "github",
"line_count": 350,
"max_line_length": 112,
"avg_line_length": 43.934285714285714,
"alnum_prop": 0.6962996683358262,
"repo_name": "opennode/nodeconductor",
"id": "211ef909fb30b4d615278f581b86c8760250be11",
"siz... |
"""files placed in this module are ignored in VCS, you can use this location as a playground""" | {
"content_hash": "bd07dddce4407a84dd71378d761bcad9",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 95,
"avg_line_length": 95,
"alnum_prop": 0.7578947368421053,
"repo_name": "alviproject/alvi",
"id": "139f87e4a0c297a10517c1996a7c19e14ae6c489",
"size": "95",
"binary": fal... |
"""
Going Down!
This is the first level. Zort has been shot out of orbit and
crashlanded here. This level should be relatively straight forward and
take no more than 2 minutes to complete. There should be no monsters,
an obvious path, one door and one switch to go through.
"""
# import your game entities here
# imple... | {
"content_hash": "7c4bae2749207346a1240600d3840dac",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 75,
"avg_line_length": 28.2,
"alnum_prop": 0.6966115051221434,
"repo_name": "bitcraft/pyweek19",
"id": "729c9e73b117cdac7ae9ff4ea7359b0fcc8eb269",
"size": "1269",
"binary... |
import time
from requests import request, ConnectionError
from ..utils import SSLHttpAdapter, module_member, parse_qs, user_agent
from ..exceptions import AuthFailed
class BaseAuth(object):
"""A authentication backend that authenticates the user based on
the provider response"""
name = '' # provider na... | {
"content_hash": "c64634bb483e804bbb7f1158a57bf606",
"timestamp": "",
"source": "github",
"line_count": 242,
"max_line_length": 89,
"avg_line_length": 40.752066115702476,
"alnum_prop": 0.5886229973636179,
"repo_name": "LennonChin/Django-Practices",
"id": "9b34f2a3b9981bdefb8caeeabbea8218ca359727",
... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
url(r'^$', 'main.views.index', name='index'),
url(r'^oauth2/$', 'main.views.oauth2', name='oauth2'),
url(r'^about/$', 'main.views.about', name='about'),
url(r'^metadata/download/(?P<id>\d+)/$... | {
"content_hash": "e7b512a9d63473715409a5c4b20a4ed3",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 112,
"avg_line_length": 56.3125,
"alnum_prop": 0.6625971143174251,
"repo_name": "enikesha/box-demo",
"id": "e5d7dd953d5624fcbe069f3538860ec404c63ea8",
"size": "901",
"bin... |
"""
WSGI config for rotations 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.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
from whitenoise.django import Djang... | {
"content_hash": "769adb2e65f2d77709237b3679c2ed4f",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 78,
"avg_line_length": 27,
"alnum_prop": 0.7921810699588477,
"repo_name": "rlucioni/rotations",
"id": "4ec84ae1c4e436cf0c3408ee8b3c399bd20acdd9",
"size": "486",
"binary":... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shop', '0025_auto_20180716_1613'),
]
operations = [
migrations.AddField(
model_name='item',
name='new_flag_color',
... | {
"content_hash": "3a11d5e2d52e6fb9c279a738faf27715",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 113,
"avg_line_length": 28.73913043478261,
"alnum_prop": 0.594553706505295,
"repo_name": "Zex0n/django-simple-cms",
"id": "c57f6d0abaa923e4308b84724cc67c6495798ffc",
"size"... |
"""Utility functions for loading the automobile data set."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import numpy as np
import pandas as pd
import tensorflow as tf
URL = "https://archive.ics.uci.edu/ml/machine-learning-databases... | {
"content_hash": "f2186380e106ce812056589f54613f9f",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 87,
"avg_line_length": 28.97345132743363,
"alnum_prop": 0.6496640195479536,
"repo_name": "jiaphuan/models",
"id": "ceb331b49cf251b06b53445c6e1266ce0d3ab6d7",
"size": "3963... |
import envi.archs.i386 as e_i386
import vivisect.impemu.emulator as v_i_emulator
from envi.const import RMETA_NMASK
non_use_mnems = ('push', )
class i386WorkspaceEmulator(v_i_emulator.WorkspaceEmulator, e_i386.IntelEmulator):
__archemu__ = e_i386.IntelEmulator
taintregs = [
e_i386.REG_EAX, e_i386.R... | {
"content_hash": "80aa9fd8e7f6e0f7088b9c154e40747e",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 92,
"avg_line_length": 32.21917808219178,
"alnum_prop": 0.5973639455782312,
"repo_name": "vivisect/vivisect",
"id": "dd65584762aaa8a1f2d34bd9e01703dff7f9fd58",
"size": "235... |
from os import path
from django.conf import settings
from openstack_dashboard.test import helpers as test
class ErrorPageTests(test.TestCase):
"""Tests for error pages."""
urls = 'openstack_dashboard.test.error_pages_urls'
def test_500_error(self):
TEMPLATE_DIRS = (path.join(settings.ROOT_PATH,... | {
"content_hash": "6e838a885bd878f713a80bab1dbc0858",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 69,
"avg_line_length": 31.5625,
"alnum_prop": 0.689108910891089,
"repo_name": "rd37/horizon",
"id": "8a0732bfdcd80f3ac984f3c3d1ceba85c2f115e0",
"size": "1190",
"binary": ... |
import imp
import inspect
import os
def full_path(path_to_config):
if path_to_config.startswith(os.sep):
return path_to_config
else:
curframe = inspect.currentframe()
outerframes = inspect.getouterframes(curframe)
this_dir = os.path.dirname(__file__)
call_dir = None
... | {
"content_hash": "17bda38948387a6c81540398d2c8aeeb",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 66,
"avg_line_length": 25.375,
"alnum_prop": 0.6108374384236454,
"repo_name": "2gis/vmmaster",
"id": "8ba36587e850037848285322f5693701892232fd",
"size": "1421",
"binary":... |
import test
import warnings
from test import env
from test.asyncio_tests import AsyncIOTestCase, asyncio_test
import bson
from motor.motor_asyncio import AsyncIOMotorClientSession, AsyncIOMotorGridFSBucket
class TestAsyncIOAwait(AsyncIOTestCase):
@asyncio_test
async def test_to_list(self):
collectio... | {
"content_hash": "075822da5e677c7dc66e025b9b1c7243",
"timestamp": "",
"source": "github",
"line_count": 212,
"max_line_length": 92,
"avg_line_length": 33.10377358490566,
"alnum_prop": 0.5749501282416642,
"repo_name": "mongodb/motor",
"id": "fbe4d45a87fb9a87d03804012312a76d661e6393",
"size": "7592",... |
from typing import Optional, Union
import pandas as pd
from flask_babel import gettext as _
from superset.exceptions import InvalidPostProcessingError
from superset.utils.pandas_postprocessing.utils import RESAMPLE_METHOD
def resample(
df: pd.DataFrame,
rule: str,
method: str,
fill_value: Optional[U... | {
"content_hash": "0427ec6eaaaa8ab339eca869feb4ab41",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 88,
"avg_line_length": 33.794871794871796,
"alnum_prop": 0.6881638846737481,
"repo_name": "airbnb/caravel",
"id": "a82d7031e9c12615751e9717c84aa35df53e03d7",
"size": "2103"... |
import lacuna, lacuna.binutils.libbin, lacuna.types
import lacuna.exceptions as err
import argparse, datetime, os, re, sys
import lacuna.exceptions as err
class MailCompile(lacuna.binutils.libbin.Script):
def __init__(self):
self.version = '0.1'
self.now = datetime.datetime.now()
... | {
"content_hash": "3dba5e37ab065428c5d41a5f32ced7c2",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 197,
"avg_line_length": 41.84090909090909,
"alnum_prop": 0.5264801738185768,
"repo_name": "tmtowtdi/MontyLacuna",
"id": "e0d134ece99776babd8a62a289f9a09e74a30ada",
"size":... |
from setuptools import setup
import os
def read(*paths):
"""Build a file path from *paths* and return the contents."""
with open(os.path.join(*paths), 'r') as f:
return f.read()
setup(
name="sanji",
version="1.0.2",
description="Sanji Framework SDK",
long_description=read('README.rst... | {
"content_hash": "2af2924fecd45a799f9299700132a643",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 71,
"avg_line_length": 31.647058823529413,
"alnum_prop": 0.6096654275092936,
"repo_name": "imZack/sanji",
"id": "9e7b2c86bcdd08fefb6fdb97a89ce57fc324abf6",
"size": "1076",
... |
import python as LibPKMN
if __name__ == "__main__":
item_bag = LibPKMN.bag("Platinum")
# Add items directly to pocket
medicine_pocket = item_bag.get_pocket("Medicine")
medicine_pocket.add_item(LibPKMN.Items.POTION, 10) # TODO: fix str <-> LibPKMN.pokemon_text typemap
# Check item amount ... | {
"content_hash": "cf3fc127136f86ffb37fa4795fc60477",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 103,
"avg_line_length": 38.07692307692308,
"alnum_prop": 0.6828282828282828,
"repo_name": "codemonkey85/LibPKMN",
"id": "8d02cc7b698531098aa5340f08fd3c87a030e8cb",
"size": ... |
#!/usr/bin/python
#
# Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""Generates CSSStyleDeclaration template file from css property definitions
defined in... | {
"content_hash": "fc503fc03d741abb910a830bcfee04e0",
"timestamp": "",
"source": "github",
"line_count": 316,
"max_line_length": 81,
"avg_line_length": 31.658227848101266,
"alnum_prop": 0.6669332267093163,
"repo_name": "dart-archive/dart-sdk",
"id": "4bf4870f4646f9365b78a392717d7fcc9b0b15c8",
"size"... |
__all__ = ["InvalidCredentialsException"]
class InvalidCredentialsException(Exception):
pass
class NoHostsConnectedToException(Exception):
pass
| {
"content_hash": "c9aef7d97c3416375c5c0dbcff6da8fc",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 45,
"avg_line_length": 17.333333333333332,
"alnum_prop": 0.7692307692307693,
"repo_name": "StackStorm/st2",
"id": "7a4e1ee51654dd8c510eca426e68479a3a469174",
"size": "784",
... |
import os
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple
import pytest
import tomli_w
from pip._internal.build_env import BuildEnvironment
from pip._internal.req import InstallRequirement
from tests.lib import (
PipTestEnvironment,
TestData,
create_basic_wheel_for_package,
... | {
"content_hash": "a3b8f62814f1eac1ea517d3a9afe704c",
"timestamp": "",
"source": "github",
"line_count": 424,
"max_line_length": 88,
"avg_line_length": 32.219339622641506,
"alnum_prop": 0.6280652953663715,
"repo_name": "pypa/pip",
"id": "a642a3f8bfb4f93b3156d399622a304daa6a84d8",
"size": "13661",
... |
from typing import Dict, Union
from cbagent.collectors.libstats.remotestats import RemoteStats, parallel_task
class IOStat(RemoteStats):
METRICS_Centos = (
("rps", "r/s", 1),
("wps", "w/s", 1),
("rbps", "rkB/s", 1024), # kB -> B
("wbps", "wkB/s", 1024), # kB -> B
("avgq... | {
"content_hash": "1ce8eb2b4f1bb5369ad607b8a902f074",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 91,
"avg_line_length": 37.567796610169495,
"alnum_prop": 0.5519963907060681,
"repo_name": "couchbase/perfrunner",
"id": "62dbe5ace3d35349ad29c2ce577cbea41f176732",
"size":... |
__author__ = 'anthony'
import websocket
import os, sys, time
from tornado import template
from tornado import testing, httpserver, gen, websocket, httpclient
import json
SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
PROJECT_DIR = os.path.abspath(os.path.dirname(SCRIPT_DIR))
sys.path.append(SCRIPT_DIR)
sys.p... | {
"content_hash": "39b19e87006e4cec248bb49ff2742bb1",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 88,
"avg_line_length": 30,
"alnum_prop": 0.650314465408805,
"repo_name": "antsmc2/webrtc_app",
"id": "8b6a009daf286aa3c2c1e8217d7cfd77f6f7c243",
"size": "1590",
"binary":... |
"""1269. Number of Ways to Stay in the Same Place After Some Steps
https://leetcode.com/problems/number-of-ways-to-stay-in-the-same-place-after-some-steps/
You have a pointer at index 0 in an array of size arrLen. At each step, you
can move 1 position to the left, 1 position to the right in the array or stay
in the sa... | {
"content_hash": "eaf00393937034ac355c3fb9008a2736",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 88,
"avg_line_length": 27.580645161290324,
"alnum_prop": 0.5824561403508772,
"repo_name": "isudox/leetcode-solution",
"id": "b52ddb0a5d632101f45ae21f4ddc099ad4c5cb74",
"siz... |
import os
import mock
from st2tests.base import BaseActionAliasTestCase
from st2tests.fixturesloader import get_fixtures_base_path
from st2common.exceptions.content import ParseException
from st2common.models.db.actionalias import ActionAliasDB
__all__ = [
'PackActionAliasUnitTestUtils'
]
PACK_PATH_1 = os.path.... | {
"content_hash": "ad2cc51e986556869bd3ab50eea68e55",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 99,
"avg_line_length": 41.837606837606835,
"alnum_prop": 0.5775280898876405,
"repo_name": "tonybaloney/st2",
"id": "b5101fcca59c84fd4cdd3341c9de10968773109e",
"size": "567... |
from __future__ import absolute_import
from chaco.tools.better_zoom import *
| {
"content_hash": "563b4a504ba16dbb62416865551b3ef0",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 38,
"avg_line_length": 38.5,
"alnum_prop": 0.7792207792207793,
"repo_name": "enthought/etsproxy",
"id": "f05045dd2d19146ef67f11ca986da875f720544d",
"size": "92",
"binary":... |
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union
from msrest import Serializer
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import Pipelin... | {
"content_hash": "bbfb3072853b7c4a81f7e91aa33f3760",
"timestamp": "",
"source": "github",
"line_count": 467,
"max_line_length": 253,
"avg_line_length": 44.226980728051394,
"alnum_prop": 0.6519802459571996,
"repo_name": "Azure/azure-sdk-for-python",
"id": "46ed30daead5a6afa76f13b5f949ead834baf412",
... |
import subprocess
import os
import sys
from openerp import report
import tempfile
import time
import logging
from mako.template import Template
from mako.lookup import TemplateLookup
from mako import exceptions
from openerp import netsvc
from openerp import pooler
from report_helper import WebKitHelper
from openerp.r... | {
"content_hash": "190c019cb95368bee2382f2e26dc2de3",
"timestamp": "",
"source": "github",
"line_count": 320,
"max_line_length": 131,
"avg_line_length": 44.228125,
"alnum_prop": 0.5203843708047764,
"repo_name": "ntiufalara/openerp7",
"id": "c6a30f5e5791b1c53071ec681e315c20402927d6",
"size": "15593",... |
"""Provides device automations for Climate."""
from __future__ import annotations
from typing import Any
import voluptuous as vol
from homeassistant.components.automation import AutomationActionType
from homeassistant.components.device_automation import DEVICE_TRIGGER_BASE_SCHEMA
from homeassistant.components.homeas... | {
"content_hash": "1c222c13458784af67c757d76d0f7048",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 85,
"avg_line_length": 31.666666666666668,
"alnum_prop": 0.6108452950558214,
"repo_name": "FreekingDean/home-assistant",
"id": "4ff2e8fe47755b7c55fc5fbc7fce08688b796597",
... |
"""Tests for uitls.py"""
from amaranth import Signal, Module
from ..util import TestBase
from .utils import delay
import random
class DelayTest(TestBase):
"""Tests the delay function."""
def create_dut(self):
module = Module()
self.in_ = Signal(8)
self.outs_ = delay(module, self.in_,... | {
"content_hash": "36099821cdc5fac41b216181ce9ea02f",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 72,
"avg_line_length": 27.642857142857142,
"alnum_prop": 0.5555555555555556,
"repo_name": "google/CFU-Playground",
"id": "c11625a30a3b38ef3ee7e0eb5de020aa9d11d201",
"size":... |
"""
Example of a Cauchy distribution
--------------------------------
Figure 3.11.
This shows an example of a Cauchy distribution with various parameters.
We'll generate the distribution using::
dist = scipy.stats.cauchy(...)
Where ... should be filled in with the desired distribution parameters
Once we have def... | {
"content_hash": "f860cb98b2c1237d63fb65536fdf77c4",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 79,
"avg_line_length": 33.859154929577464,
"alnum_prop": 0.6518302828618968,
"repo_name": "eramirem/astroML",
"id": "80687df8b9cada1cb8c11328671a7cbfd4a0b4e6",
"size": "240... |
import numpy as np
def false_color(id_map):
""" Returns a numpy array of false color
Parameters
---------
id_map : 2D or 3D numpy array with id values
Returns
-------
false_color: array with the same shape than input with 3 values for each position
"""
ids = np.unique(id_map... | {
"content_hash": "6d915d064530789a094fb955af8d2585",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 85,
"avg_line_length": 27.68421052631579,
"alnum_prop": 0.5437262357414449,
"repo_name": "guillempalou/scikit-cv",
"id": "e57234c5aef29653e9eac87d42fb8ddeb20f6f9c",
"size":... |
import numpy as np
import scipy.io as sio
np.random.seed(0)
VGG_MEAN = [103.939, 116.779, 123.68]
def read_mat(path):
return np.load(path)
def write_mat(path, m):
np.save(path, m)
def read_ids(path):
return [line.rstrip('\n') for line in open(path)]
class Batch_Feeder:
def __init__(self, datas... | {
"content_hash": "b4333cfb0bd64dcd3136e68c8136b155",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 120,
"avg_line_length": 38.05161290322581,
"alnum_prop": 0.5066124109867752,
"repo_name": "min2209/dwt",
"id": "f9b35869d76ccfc31b6700a49bdd2d49b30f8076",
"size": "5898",
... |
"""A library for integrating pyOpenSSL with CherryPy.
The OpenSSL module must be importable for SSL functionality.
You can obtain it from http://pyopenssl.sourceforge.net/
To use this module, set CherryPyWSGIServer.ssl_adapter to an instance of
SSLAdapter. There are two ways to use SSL:
Method One:
ssl_adapter.c... | {
"content_hash": "ae366753c527988246b79c0e7e222358",
"timestamp": "",
"source": "github",
"line_count": 242,
"max_line_length": 86,
"avg_line_length": 38.925619834710744,
"alnum_prop": 0.560615711252654,
"repo_name": "splunk/splunk-webframework",
"id": "11c63c217a95fef2c81f3a81a53cae310f96f395",
"s... |
"""This example adds a user to a team by creating an association between them.
To determine which teams exists, run get_all_teams.py. To determine which
users exist, run get_all_users.py.
The LoadFromStorage method is pulling credentials and properties from a
"googleads.yaml" file. By default, it looks for this file ... | {
"content_hash": "f301549405609dd09f2092472c7f0840",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 80,
"avg_line_length": 33.05882352941177,
"alnum_prop": 0.6868327402135231,
"repo_name": "wubr2000/googleads-python-lib",
"id": "b19ee3e9e80b4eea5facaaa3591e34708566062a",
... |
import _plotly_utils.basevalidators
class SelectedValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="selected", parent_name="splom", **kwargs):
super(SelectedValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | {
"content_hash": "2c13cc1b540dddb13e30b1a508099e84",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 78,
"avg_line_length": 34,
"alnum_prop": 0.5485294117647059,
"repo_name": "plotly/python-api",
"id": "d518a7f9a8f1e877ea878e59f098271bb2327aad",
"size": "680",
"binary": ... |
import unittest
class CalcTest(unittest.TestCase):
def test_calc_subtest(self):
for i in [2, 3, 4, 5]:
import ipdb;ipdb.set_trace()
with self.subTest(i=i):
self.assertEqual(i % 2, 0)
| {
"content_hash": "4d7a10c6679271bc629470dcfff5900e",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 42,
"avg_line_length": 23.8,
"alnum_prop": 0.5546218487394958,
"repo_name": "altnight/individual-sandbox",
"id": "848ede0f1371b917346c959046b493cb5e705189",
"size": "238",
... |
'''
Copyright 2016, EMC, Inc.
Author(s):
George Paulos
This script initializes RackHD stack after install.
- loads SKU packs
- loads default SKU
- sets auth user
- restarts nodes for discovery
- discovers switches and/or PDUs if available
- checks node discovery
- assigns node OBM settings... | {
"content_hash": "5352d90efd696093aabf2f004431e1a0",
"timestamp": "",
"source": "github",
"line_count": 321,
"max_line_length": 122,
"avg_line_length": 49.109034267912776,
"alnum_prop": 0.5397107333164172,
"repo_name": "tldavies/RackHD",
"id": "6de0ac4a861f5881ad0eb4b3c636bc00a852f181",
"size": "15... |
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class StartedPage(page_module.Page):
def __init__(self, url, startup_url, page_set):
super(StartedPage, self).__init__(
url=url, page_set=page_set, startup_url=startup_url)
self.archive_data_file =... | {
"content_hash": "0e5e98d3c8fa79258350c8eb4ea76e26",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 80,
"avg_line_length": 35.39473684210526,
"alnum_prop": 0.7048327137546468,
"repo_name": "Jonekee/chromium.src",
"id": "d5b4633ba91ee24a4eb55c7a75b0a85384d73ea6",
"size": "... |
import socket
from datetime import timedelta, datetime
import psutil
import netifaces as nif
from pyspectator.monitoring import AbcMonitor
from pyspectator.collection import LimitedTimeTable
class NetworkInterface(AbcMonitor):
def __init__(self, monitoring_latency, stats_interval=None,
ip_addres... | {
"content_hash": "166ba9adb13ccce1a9a30f40cd2856eb",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 74,
"avg_line_length": 31.676923076923078,
"alnum_prop": 0.5599805730937348,
"repo_name": "uzumaxy/pyspectator",
"id": "7f95466486a432f0a6a469f0ec37dcb2f07af475",
"size": ... |
from __future__ import print_function, unicode_literals, division, absolute_import
import os
import sys
import subprocess
import tempfile
import shutil
import json
from .compat import open
from .exceptions import err_exit
from .utils import json_load_raise_on_duplicates
from .utils.resolver import is_container_id, re... | {
"content_hash": "8561c27af9b84c7b6b5d523478ef3539",
"timestamp": "",
"source": "github",
"line_count": 249,
"max_line_length": 113,
"avg_line_length": 40.11244979919679,
"alnum_prop": 0.5831998398077693,
"repo_name": "jhuttner/dx-toolkit",
"id": "ac003be72050638100aa830a3a059fde013b9619",
"size": ... |
"""
Note: we can NOT assume that a Gmail account and a Drive account for a user share the same Google
profile, because a person can connect his personal Gmail account and his company's Drive.
"""
from requests_oauthlib import OAuth2Session
from tokens.models import BearerToken, Provider
from ..models import GmailProfi... | {
"content_hash": "df4babff2e8e46cc6580d013166fc4e7",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 98,
"avg_line_length": 37.15625,
"alnum_prop": 0.6026072329688814,
"repo_name": "nimiq/moogle-project",
"id": "dcca40de46be5b72276d1684f91ad67ce7526df8",
"size": "2378",
... |
"""
ZFS Storage Appliance Cinder Volume Driver
"""
import ast
import base64
from oslo.utils import units
from oslo_config import cfg
from cinder import exception
from cinder.i18n import _, _LE, _LW
from cinder.openstack.common import log
from cinder.volume import driver
from cinder.volume.drivers.san import san
from ... | {
"content_hash": "eb18984b0ff688e6a8f24ca88cca401f",
"timestamp": "",
"source": "github",
"line_count": 449,
"max_line_length": 79,
"avg_line_length": 42.11358574610245,
"alnum_prop": 0.5274208049077159,
"repo_name": "hguemar/cinder",
"id": "48e6dbb99c4d618f339d7e11227e56510d347bfc",
"size": "19556... |
import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="size", parent_name="carpet.aaxis.tickfont", **kwargs
):
super(SizeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pare... | {
"content_hash": "9e796084786cc1d33a427a2afd0cf284",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 79,
"avg_line_length": 33.266666666666666,
"alnum_prop": 0.5771543086172345,
"repo_name": "plotly/python-api",
"id": "91ec8f102d725bb9617a26d4e3c1616601675e71",
"size": "49... |
import codecs
import yaml
from yaml.composer import Composer
from ansiblereview import Result, Error
def hunt_repeated_yaml_keys(data):
"""Parses yaml and returns a list of repeated variables and
the line on which they occur
"""
loader = yaml.Loader(data)
def compose_node(parent, index):
... | {
"content_hash": "e6b8937b6a0e51fa8674c90e2d3d218c",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 92,
"avg_line_length": 32.37777777777778,
"alnum_prop": 0.6046671242278655,
"repo_name": "willthames/ansible-review",
"id": "29946fbcfbf618ac8e6b03d926247c002615849a",
"siz... |
"""Shared utilities for container manipulation."""
import collections
import dataclasses
from typing import Any
import attr
from tensorflow_federated.python.common_libs import py_typecheck
def dataclass_to_odict(dataclass_obj: Any) -> collections.OrderedDict[str, Any]:
"""Shallow-copies a dataclass instance to a... | {
"content_hash": "d63acc2f7775093d821a0abeac3823b5",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 80,
"avg_line_length": 32.758620689655174,
"alnum_prop": 0.7547368421052632,
"repo_name": "tensorflow/federated",
"id": "732b3962585f89328c71d5f7555e2d9964a1558b",
"size": ... |
import functools
from django.core import mail
from django.http import JsonResponse, HttpResponseBadRequest
class ajax(object):
def __init__(self, login_required=False):
self.login_required = login_required
def __call__(self, fn):
@functools.wraps(fn)
def wrapped(request, *args, **kwar... | {
"content_hash": "26d50fa27e76de96343bc76e775cb774",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 79,
"avg_line_length": 38.43478260869565,
"alnum_prop": 0.6391402714932126,
"repo_name": "takeyourmeds/takeyourmeds-web",
"id": "40dc030d408b7525e412e766e4cfdf35a3aae72a",
... |
"""Tests for head."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.timeseries.python.timeseries import feature_keys
from tensorflow.contrib.timeseries.python.timeseries import model
from tensorflow.contrib.timeseries.python.timese... | {
"content_hash": "895da3f89ebc33a9d6348316bc2618ff",
"timestamp": "",
"source": "github",
"line_count": 253,
"max_line_length": 80,
"avg_line_length": 37.762845849802375,
"alnum_prop": 0.619635754657735,
"repo_name": "Mazecreator/tensorflow",
"id": "7ebcebfe1b156a6c0cc86fa1ded55e4a645d291f",
"size"... |
from .iq_picture import PictureIqProtocolEntity
from yowsup.structs import ProtocolTreeNode
import time
class SetPictureIqProtocolEntity(PictureIqProtocolEntity):
'''
<iq type="set" id="{{id}}" xmlns="w:profile:picture", to={{jid}}">
<picture type="image" id="{{another_id}}">
{{Binary bytes of t... | {
"content_hash": "57a29459e8a04f8e3c35bca2ded034e5",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 116,
"avg_line_length": 34.865671641791046,
"alnum_prop": 0.6630993150684932,
"repo_name": "biji/yowsup",
"id": "3ab1698843cb532c8038d3814d1a04605deacf9a",
"size": "2336",
... |
from django.urls import include, path, re_path
from .views import api_handler_404, api_root
app_name = "naovoce"
urlpatterns = [
path("", api_root, name="root"),
path("fruit/", include("naovoce.api.v1.fruit.urls")),
path("herbarium/", include("naovoce.api.v1.herbarium.urls")),
path("users/", include(... | {
"content_hash": "ae43bd2c654d258a4ec119e1f65e2f61",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 65,
"avg_line_length": 35.5625,
"alnum_prop": 0.6502636203866432,
"repo_name": "jsmesami/naovoce",
"id": "e32e5254e29ddac98edce77a303240960e027388",
"size": "569",
"binar... |
def noop():
"""
No Operation - zc.buildout requires an endpoint method
"""
pass
def _logging():
# Logging Configuration
import sys
import logging
logger = logging.getLogger('')
logger.setLevel(logging.DEBUG)
handler = logging.StreamHandler(sys.stderr)
handler.setLevel(logging.DEBUG)... | {
"content_hash": "03be22941384c7b8f233d692aa8996c7",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 64,
"avg_line_length": 25.522727272727273,
"alnum_prop": 0.5939447907390917,
"repo_name": "ekarulf/wsgi_googleauth",
"id": "081afa90d9f00d9329abd803cfa1b6f66b59eeef",
"size... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/deed/event_perk/shared_audience_seating_deed.iff"
result.attribute_template_id = 2
result.stfName("event_perk","audience_seating_name")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return... | {
"content_hash": "71020e7bee5bd8b2afa91ce81e9d504e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 85,
"avg_line_length": 25.153846153846153,
"alnum_prop": 0.709480122324159,
"repo_name": "obi-two/Rebelion",
"id": "40394741dfe69cfec3902f5903b01841418d84b1",
"size": "472"... |
from typing import Union
from andreas.models.post import Post
from andreas.models.server import Server
def get_post(server: Union[Server,str,int], path: str) -> Post:
"""
Returns a post with given `path` on given `server`.
:param server: The :class:`Server<andreas.models.core.Server>` object, or its... | {
"content_hash": "43ae2482ce122625c3b01e6fca10c86c",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 113,
"avg_line_length": 36.27272727272727,
"alnum_prop": 0.6754385964912281,
"repo_name": "maaaks/andreas",
"id": "604d1488bdf71d748e1afa5f14e0581c72b1ea58",
"size": "798",... |
"""
Copyright (c) 2017 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import unicode_literals, division
from collections import namedtuple
from copy import deepcopy
from multiprocessing.pool impo... | {
"content_hash": "5baee423d8280cd5d1e9c820c6f66bf7",
"timestamp": "",
"source": "github",
"line_count": 578,
"max_line_length": 99,
"avg_line_length": 38.30276816608997,
"alnum_prop": 0.6068024752698857,
"repo_name": "vrutkovs/atomic-reactor",
"id": "03764dfe7f66677f282f8432421ffa7dd0ee3dff",
"size... |
"""Kubeflow Covertype Pipeline."""
import os
from kfp import dsl
from training_lightweight_component import train_and_deploy
from tuning_lightweight_component import tune_hyperparameters
PIPELINE_ROOT = os.getenv("PIPELINE_ROOT")
PROJECT_ID = os.getenv("PROJECT_ID")
REGION = os.getenv("REGION")
TRAINING_CONTAINER_IM... | {
"content_hash": "b058a1ebe8bb7b6334f015a4ffc755dc",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 79,
"avg_line_length": 36.779411764705884,
"alnum_prop": 0.6757297081167533,
"repo_name": "GoogleCloudPlatform/asl-ml-immersion",
"id": "3395689942ac7ec2fa641a33c2ec0602fd3ee... |
from __future__ import absolute_import
import json
import os
import platform
import pokitdok
from requests_oauthlib import OAuth2Session, TokenUpdated
from oauthlib.oauth2 import BackendApplicationClient, TokenExpiredError
from warnings import warn
class PokitDokClient(object):
"""
PokitDok Platform API C... | {
"content_hash": "40acf89b5c42235905948d8a5ca0f953",
"timestamp": "",
"source": "github",
"line_count": 579,
"max_line_length": 121,
"avg_line_length": 45.86355785837651,
"alnum_prop": 0.6234983995481077,
"repo_name": "pokitdok/pokitdok-python",
"id": "e3f96b398a791f0f8338bc5d5bfe17e20819a862",
"si... |
import socket
from flask import render_template, request, json
from flask.ext import login
from .app import app
index_fields = ['name', 'group', 'status', 'comments', 'rate', 'burst', 'updatetime']
@app.route('/')
def index():
projectdb = app.config['projectdb']
return render_template("index.html", projects... | {
"content_hash": "d5a858e51ba36ac81b89cc7e628b4fa2",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 93,
"avg_line_length": 29.355371900826448,
"alnum_prop": 0.5723536036036037,
"repo_name": "willworks/pyspider",
"id": "e53c952d00a632d3efba6d72ed2c60986a2e30c2",
"size": "... |
from django.db import models
from django.contrib.auth import models as authmodels
from django.conf import settings
from signbank.video.fields import VideoUploadToFLVField
from signbank.dictionary.models import *
# models to represent the feedback from users in the site
import string
def t(message):
"""Replace $c... | {
"content_hash": "66eddc137b44cc9286caf4740c97de7d",
"timestamp": "",
"source": "github",
"line_count": 386,
"max_line_length": 221,
"avg_line_length": 42.91968911917098,
"alnum_prop": 0.49664996680147283,
"repo_name": "Signbank/BSL-signbank",
"id": "0ce25722fab3a5ee218c7edf7f4bbc5df6501ce3",
"size... |
"""
******
Tables
******
Synapse Tables enable storage of tabular data in Synapse in a form that can be queried using a SQL-like query language.
A table has a :py:class:`Schema` and holds a set of rows conforming to that schema.
A :py:class:`Schema` defines a series of :py:class:`Column` of the following types: STRI... | {
"content_hash": "372d2bf0b6c2dd965a7d9831676da120",
"timestamp": "",
"source": "github",
"line_count": 2351,
"max_line_length": 120,
"avg_line_length": 41.51127179923437,
"alnum_prop": 0.6041416904900966,
"repo_name": "thomasyu888/synapsePythonClient",
"id": "f9a2f539d8ff7fde8fead2663766400b0b068119... |
"""
Unofficial Python API for retrieving data from Delicious.com.
This module provides the following features plus some more:
* retrieving a URL's full public bookmarking history including
* users who bookmarked the URL including tags used for such bookmarks
and the creation time of the ... | {
"content_hash": "287d7e7dc8beeba84f4ba8c7611178f1",
"timestamp": "",
"source": "github",
"line_count": 1253,
"max_line_length": 225,
"avg_line_length": 40.2633679169992,
"alnum_prop": 0.5654509415262636,
"repo_name": "jorik041/stackprinter",
"id": "b183ee9f5cdc7c0f2a6a9a0c48ae1309c0de510b",
"size"... |
import csv
import math
# Define some constants that we'll want to have for our project.
FEATURES = 784
OUTPUTS = 10
def read_file(file_name):
# Start by reading in our CSV files.
with open(file_name) as file:
reader = csv.DictReader(file)
data = list(reader)
size = len(data)
re... | {
"content_hash": "4f5e77ae5a781512dc1347cc946afd05",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 78,
"avg_line_length": 30,
"alnum_prop": 0.5840909090909091,
"repo_name": "GEMISIS/machine-learning",
"id": "09dbb501868da69f53b189dcf4906da05a114253",
"size": "1370",
"b... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('human_resources', '0015_employee_second_phone'),
('patients', '0004_auto_20160827_1808'),
]
ope... | {
"content_hash": "f152a7bb17bdb2e417b3d93d82824a42",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 621,
"avg_line_length": 57.333333333333336,
"alnum_prop": 0.6038928210313448,
"repo_name": "kirillmakhonin/med",
"id": "71ac3b629617ae61332fba847da8b4b6216fa0ec",
"size": "... |
from qingcloud.cli.misc.utils import explode_array
from qingcloud.cli.iaas_client.actions.base import BaseAction
class DeleteVolumesAction(BaseAction):
action = 'DeleteVolumes'
command = 'delete-volumes'
usage = '%(prog)s -v "volume_id,..." [-f <conf_file>]'
@classmethod
def add_ext_arguments(cls... | {
"content_hash": "398313c3f6fc6a6328a32daea72e1ce8",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 78,
"avg_line_length": 33.52173913043478,
"alnum_prop": 0.6277561608300908,
"repo_name": "yunify/qingcloud-cli",
"id": "72f074bb82273465ba15dbe332155e2682b7f927",
"size": "... |
WSDL_FILE = "conf/evsapi41.wsdl"
# Root package for the resulting API
ROOT_PACKAGE = "cabig.evs"
# Mapping from Java to Python packages
# The ROOT_PACKAGE is prepended to each Python package
PACKAGE_MAPPING = {
'gov.nih.nci.evs.domain' : 'domain',
}
SERVICE_CLASS_NAME = "EVSApplicationService"
OUTPUT_DIR = "o... | {
"content_hash": "5226d4ee7c592051ee5a5046a3beff43",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 54,
"avg_line_length": 23.357142857142858,
"alnum_prop": 0.7247706422018348,
"repo_name": "NCIP/python-api",
"id": "69fd1a010ffcd0f9491f918afe46ffc50d981ce2",
"size": "577"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.