text
stringlengths
4
1.02M
meta
dict
import multiprocessing import numpy as np import xarray as xr import healpy as hp from astropy.cosmology import Planck15 as Cosmo from opstats.utils import MWA_FREQ_EOR_ALL_80KHZ as F from opstats.utils import F21 # Simulation parameters nf = F.size nside = 4096 cube_res = 1000 / 128 cube_size = 128 # Figure out ...
{ "content_hash": "2e97342561f4695732ca5790bf23af48", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 80, "avg_line_length": 29.065573770491802, "alnum_prop": 0.6661026508742245, "repo_name": "piyanatk/sim", "id": "cf389eb2d2df6da1263ab80a2fbf689cb781f7d5", "size": "1773", ...
import sys import re import os python_out_folder = sys.argv[1] filematch = re.compile(r"(\w+)_stemmer\.py$") imports = [] languages = [] for pyscript in os.listdir(python_out_folder): match = filematch.match(pyscript) if (match): langname = match.group(1) titlecase = langname.title() ...
{ "content_hash": "b9ef0d1fe482761f73ff87d56641de54", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 113, "avg_line_length": 24.5, "alnum_prop": 0.6263736263736264, "repo_name": "snowballstem/snowball", "id": "2346fbef8b40d6b13e53f24f9fb9f21b880ebf70", "size": "1297", "b...
"""Restrained Amber Minimization of a structure.""" import io import time from typing import Collection, Optional, Sequence from absl import logging from alphafold.common import protein from alphafold.common import residue_constants from alphafold.model import folding from alphafold.relax import cleanup from alphafol...
{ "content_hash": "d947d9d1fd7e2fd06bf5c860c2466c60", "timestamp": "", "source": "github", "line_count": 488, "max_line_length": 80, "avg_line_length": 37.549180327868854, "alnum_prop": 0.6886596812922943, "repo_name": "deepmind/alphafold", "id": "4694f440295278724b18574d5e8e1c6592b220f3", "size": "...
from pycket import values, values_parameter from pycket.arity import Arity from pycket.argument_parser import ArgParser, EndOfInput from pycket.prims.expose import default, expose, expose_val from rpython.rlib import jit DEBUG = values.W_Symbol.make("debug") w_default_logger = v...
{ "content_hash": "b62485592f87c01a7078ca3d16e412e1", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 99, "avg_line_length": 33.6078431372549, "alnum_prop": 0.6878646441073513, "repo_name": "magnusmorton/pycket", "id": "f1bbb1c99f9c7d86d333af563c951920673cbeff", "size": "17...
import os import shlex import six import sys from mock import MagicMock # 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. # path =...
{ "content_hash": "6825391f53e5db6a88dbb004a8b42175", "timestamp": "", "source": "github", "line_count": 353, "max_line_length": 96, "avg_line_length": 32.43909348441926, "alnum_prop": 0.6872762204174307, "repo_name": "ParadropLabs/Paradrop", "id": "b449cd448ed9fc41ca5cec1475de606755b46dd6", "size":...
from django import forms from teacher.models import Teacher_personal_detail class Teacher_personal_detailform(forms.ModelForm): """Upload files with this form""" dob = forms.DateField(widget=forms.DateInput(format = '%d/%m/%Y'), input_formats=('%d/%m/%Y',)) class Meta: model = Teacher_personal_d...
{ "content_hash": "1879f0af1e65ed3aa4282f4c1755632b", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 99, "avg_line_length": 27.166666666666668, "alnum_prop": 0.6728016359918201, "repo_name": "tnemisteam/cdf-steps", "id": "f570b99079670ccd01ac59731e0d33d0b505630b", "size": ...
'''OpenGL extension ARB.gpu_shader_fp64 This module customises the behaviour of the OpenGL.raw.GL.ARB.gpu_shader_fp64 to provide a more Python-friendly API Overview (from the spec) This extension allows GLSL shaders to use double-precision floating-point data types, including vectors and matrices of doubles. D...
{ "content_hash": "1364f7db59bbc38b00e92d861ea5811b", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 75, "avg_line_length": 41.88059701492537, "alnum_prop": 0.7890235210263721, "repo_name": "Universal-Model-Converter/UMC3.0a", "id": "f925fdf6a3db45d05c5945f1b0fe99fcee33dbc6"...
"""The tests for the notify yessssms platform.""" import unittest import requests_mock import homeassistant.components.yessssms.notify as yessssms class TestNotifyYesssSMS(unittest.TestCase): """Test the yessssms notify.""" def setUp(self): # pylint: disable=invalid-name """Set up things to be run w...
{ "content_hash": "c7e9e0a21b65af82e0f5b26bc31148b4", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 88, "avg_line_length": 34.89622641509434, "alnum_prop": 0.5884022708840227, "repo_name": "fbradyirl/home-assistant", "id": "3d11cdedc67bd71bcc32e1d5b5e25e55f7d11707", "siz...
from . import sysfs ## # @brief Simple containter class used for pass by reference. class Reference(object): def __init__(self, value=None): ## Read/write attribute holding the referrent. self.value = value def __str__(self): return "<%s@%x value=%s>" % (self.__class__.__name__, id(sel...
{ "content_hash": "daf5febc3e0a8fcd8d58bc2855850a52", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 89, "avg_line_length": 26.533333333333335, "alnum_prop": 0.5879396984924623, "repo_name": "EmbeddedRPC/erpc-imx-demos", "id": "3e5680dc1f4325aae1f7f251cdff14ded6e9a813", "s...
"""A script for dumping experiment results to csv files. This aims to make the data easy to consume via straight up python. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import csv import os import re import time from absl import app from absl impor...
{ "content_hash": "acb2e58f5b74fecf18ce4cd8d1add0a1", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 79, "avg_line_length": 29.69942196531792, "alnum_prop": 0.691124951342935, "repo_name": "google-research/google-research", "id": "3c1962a02991f94bba35156127356e83043c2837", ...
from setuptools import setup, find_packages with open('README.rst') as readme_file: readme = readme_file.read() requirements = [ 'marvinbot', 'bs4' ] setup( name='marvinbot_package_tracker_plugin', version='0.1.0', description="A plugin for marvinbot to track packages.", long_description...
{ "content_hash": "2666b32019d83fafabb8df2c8dcc597d", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 72, "avg_line_length": 31.25581395348837, "alnum_prop": 0.6302083333333334, "repo_name": "BotDevGroup/marvinbot_package_tracker_plugin", "id": "14f7e57282dd5549febad5763a43d6...
""" Collect icmp round trip times Only valid for ipv4 hosts currently #### Dependencies * ping #### Configuration Configuration is done by: Create a file named: PingCollector.conf in the collectors_config_path * enabled = true * interval = 60 * target_1 = example.org * target_fw = 192.168.0.1 * target_local...
{ "content_hash": "eeb9501f7de829e7b28342061991030e", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 80, "avg_line_length": 30.36111111111111, "alnum_prop": 0.5272949069838365, "repo_name": "tellapart/Diamond", "id": "d485711881dfec494443524376bf68832e1a4f7b", "size": "32...
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^/post/', views.post, name='post'), ]
{ "content_hash": "1e566044c5d215971fb3cf6d96556450", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 45, "avg_line_length": 20.125, "alnum_prop": 0.6273291925465838, "repo_name": "deniszgonjanin/docker12factor", "id": "6cb7136e2c0a5eb2d505e1d1a308226df7fe6104", "size": "161...
""" Utilities for working with collections. """ from collections import Iterable, Mapping import imp from functools import partial from revkom.data import BooleanData from revkom.mixins import PropMetaclass def deep_update(mapping, updated): """ Deep, non-destructive updating for dictionaries. """ fo...
{ "content_hash": "d5dcadbb6dce73faf115cb61e2043236", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 87, "avg_line_length": 31.23121387283237, "alnum_prop": 0.6277993707199704, "repo_name": "hipikat/django-revkom", "id": "e2f18ecfac2fd84239bd98d72edbdb65f0edf398", "size":...
"""Test case implementation""" import sys import difflib import pprint import re import unittest import warnings import six from unittest2 import result from unittest2.util import ( safe_repr, safe_str, strclass, unorderable_list_difference ) from unittest2.compatibility import wraps __unittest = True DI...
{ "content_hash": "8a0d31834094761f93377a9e2b49094b", "timestamp": "", "source": "github", "line_count": 1174, "max_line_length": 96, "avg_line_length": 38.11584327086882, "alnum_prop": 0.5679583445070171, "repo_name": "llvm-mirror/lldb", "id": "c567037ea8a41cd19716f0bef2cfac50f9ebaf81", "size": "44...
from django.shortcuts import render, render_to_response from django import template register = template.Library() def test_render_view(request): return render(request, 'test_render.html', {'content': 'data'}) def test_render_to_response_view(request): return render_to_response('test_render_to_response.html',...
{ "content_hash": "d3dc882ade0043d99c5b81bea7ed1bed", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 82, "avg_line_length": 22.52777777777778, "alnum_prop": 0.6831072749691739, "repo_name": "Microsoft/PTVS", "id": "13b70ceb63d43ac4fb9e95483bb093d60866b455", "size": "811", ...
import configparser import datetime import getopt import os import socket import sys import re import packagesimportutil PY_MAJOR_VERSION = 0 PY_MINOR_VERSION = 1 # append worker binary source path sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) packagesimportutil.add_all_packages_under_...
{ "content_hash": "dd2d496b3ee5ebe0cae14db993bfbbb2", "timestamp": "", "source": "github", "line_count": 452, "max_line_length": 167, "avg_line_length": 43.48893805309734, "alnum_prop": 0.6044666022282139, "repo_name": "MSFTOSSMgmt/WPSDSCLinux", "id": "1b80c9ac5a2308818012fdda705c3a23c5de6ffe", "siz...
""" This module defines filters for Container instances. """ from __future__ import print_function from tunacell.filters.main import FilterGeneral class FilterContainer(FilterGeneral): """General class to filter containers""" _type = 'CONTAINER' class FilterContainerAny(FilterContainer): """True for a...
{ "content_hash": "3167555e62b7e0ddfc48608ca8fc0fbc", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 70, "avg_line_length": 24.567164179104477, "alnum_prop": 0.5643985419198055, "repo_name": "LeBarbouze/tunacell", "id": "2772d3bef4a9270d78ea31711b22a69f7a486574", "size": "...
from .product import Product from .product_properties import ProductProperties from .operation_result import OperationResult from .paging_get_multiple_pages_options import PagingGetMultiplePagesOptions from .paging_get_odata_multiple_pages_options import PagingGetOdataMultiplePagesOptions from .paging_get_multiple_page...
{ "content_hash": "14d91b35dc703e64467cdfbe4ca2f9c4", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 98, "avg_line_length": 37.68421052631579, "alnum_prop": 0.8114525139664804, "repo_name": "xingwu1/autorest", "id": "c70a5991daebed12f776eee14a664045255e0c9f", "size": "1190...
"""The test for the NuHeat thermostat module.""" from homeassistant.components.nuheat.const import DOMAIN from homeassistant.setup import async_setup_component from .mocks import ( _get_mock_nuheat, _get_mock_thermostat_run, _get_mock_thermostat_schedule_hold_available, _get_mock_thermostat_schedule_ho...
{ "content_hash": "44a64ac166e1a16cdc675b7995bcf9ce", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 88, "avg_line_length": 38.31578947368421, "alnum_prop": 0.6573783359497645, "repo_name": "titilambert/home-assistant", "id": "b407461fa89fba0f6176d3be633dbbda87955866", "s...
import time, json from O365 import Schedule class Client: def __init__(self, username=None, password=None): config = {} execfile("credentials.txt", config) if username is None: self.username = config["username"] else: self.username = username if pass...
{ "content_hash": "ebeb6717186645a67caec7195a7c50e4", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 104, "avg_line_length": 34.96825396825397, "alnum_prop": 0.5229232864275988, "repo_name": "miek770/nanny", "id": "5ef3ab7a7ae8f4e7caa1e59728ac90088b511c8a", "size": "2250",...
"""Implementation of JSONEncoder """ import re import math try: from _json import encode_basestring_ascii as c_encode_basestring_ascii except ImportError: c_encode_basestring_ascii = None __all__ = ['JSONEncoder'] ESCAPE = re.compile(r'[\x00-\x1f\\"\b\f\n\r\t]') ESCAPE_ASCII = re.compile(r'([\...
{ "content_hash": "6b4b0fed9498e6fc6b86546a4ec3eeff", "timestamp": "", "source": "github", "line_count": 384, "max_line_length": 82, "avg_line_length": 35.994791666666664, "alnum_prop": 0.521198090001447, "repo_name": "babyliynfg/cross", "id": "621826d9c99c955e26825a7b593fb5ad66306127", "size": "138...
from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from __future__ import print_function from builtins import str as unicode from quark_runtime import * _lazyImport.plug("docs") import quark.reflect class Test(_QObject): """ hey, here are some docs ...
{ "content_hash": "e7a3ada054960eacc39e51a6c72444a2", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 83, "avg_line_length": 21.326923076923077, "alnum_prop": 0.6113615870153292, "repo_name": "datawire/quark", "id": "f82a81842732f71fd1f2cd6e41f18edb7d4d5b91", "size": "1109"...
""" Specify the NetworkNode with its action, context-menus """ # Copyright (C) 2009-2010, Ecole Polytechnique Federale de Lausanne (EPFL) and # University Hospital Center and University of Lausanne (UNIL-CHUV) # # Modified BSD License # Standard library imports import os # Enthought library imports from traits.api im...
{ "content_hash": "26d09f46d722151faec0caabc6259a0b", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 85, "avg_line_length": 32.84705882352941, "alnum_prop": 0.5351002865329513, "repo_name": "LTS5/connectomeviewer", "id": "899b4cf3b5df942f5b26b4c7db207817a2bd4e47", "size": ...
"""All the features specific to the file scheme.""" from pathlib import Path from functools import partial from urlpathlib.urlpath import PureUrlPath def _generic(self, _name, *args, **kwargs): func = getattr(Path(self.path), _name) return func(*args, **kwargs) stat = partial(_generic, _name='stat') chmod ...
{ "content_hash": "4186bec7d0428400e2cc4de68dcfd1e5", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 76, "avg_line_length": 30.97590361445783, "alnum_prop": 0.6830027226760016, "repo_name": "morgan-del/urlpathlib", "id": "92a874645704bf2eff94d78e8af619d1eb4d4949", "size": ...
from django.db.backends.creation import BaseDatabaseCreation from django.db.backends.util import truncate_name class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated PostgreSQL column # types, as strings. Column-type strings can contain format strings; they'll ...
{ "content_hash": "631671f791fa7dbd1585b68e8a247a4f", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 146, "avg_line_length": 48.65384615384615, "alnum_prop": 0.5486166007905139, "repo_name": "mitsuhiko/django", "id": "bdd817db4c9b22dfd585374de262f3b067646819", "size": "379...
from django.contrib.auth.models import User, Permission, Group from .models import Key class KeyAuthBackend(object): """ Authentication backend """ def authenticate(self, token=None): keys = Key.objects.filter(token=token).select_related('user') if keys and not keys[0].has_expired(): ...
{ "content_hash": "fcef98ceb303e695a07fc8bf084f02d3", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 69, "avg_line_length": 28.166666666666668, "alnum_prop": 0.6173570019723866, "repo_name": "laginha/django-key-auth", "id": "d8fa155554b1f0457102a0367166aad0ecc0d1a8", "size...
from blazar.tests import api class TestRoot(api.APITest): def setUp(self): super(TestRoot, self).setUp() self.versions = { "versions": [{"status": "DEPRECATED", "id": "v2.0", "links": [{"href": "http://localhost/v2", "rel": "self"}]}]} def t...
{ "content_hash": "111be56895e025c362543260e9d1ca09", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 74, "avg_line_length": 39.05882352941177, "alnum_prop": 0.5346385542168675, "repo_name": "stackforge/blazar", "id": "a5e1aee61940e0d90cf665dafc685f2be8f7d4f7", "size": "190...
from __future__ import unicode_literals from spacy.en import English import pytest @pytest.fixture def tagged(EN): string = u'Bananas in pyjamas are geese.' tokens = EN(string, tag=True, parse=False) return tokens @pytest.fixture def lemmas(tagged): return [t.lemma_ for t in tagged] @pytest.mark...
{ "content_hash": "23c42ed338d65768375ea80851e1244a", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 46, "avg_line_length": 20.375, "alnum_prop": 0.6411042944785276, "repo_name": "rebeling/spaCy", "id": "1895310cff93cfc1687b28cc2924d73ac476823e", "size": "652", "binary":...
""" Given array of integers, find the maximal possible sum of some of its k consecutive elements. Example For inputArray = [2, 3, 5, 1, 6] and k = 2, the output should be arrayMaxConsecutiveSum(inputArray, k) = 8. All possible sums of 2 consecutive elements are: 2 + 3 = 5; 3 + 5 = 8; 5 + 1 = 6; 1 + 6 = 7. Thus, the ...
{ "content_hash": "640a7f4974af15fe38a855448702d36f", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 113, "avg_line_length": 23.25, "alnum_prop": 0.6451612903225806, "repo_name": "coingraham/codefights", "id": "ce01ecdf2bc89f74a3ae40d074ef52376f66613c", "size": "1674", "...
''' Animations tests ================ ''' import unittest from time import time, sleep from kivy.animation import Animation, AnimationTransition from kivy.uix.widget import Widget from kivy.clock import Clock from kivy.graphics import Scale class AnimationTestCase(unittest.TestCase): def sleep(self, t): ...
{ "content_hash": "ac768ce4651b22f4e8c6453cf4b47ab8", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 75, "avg_line_length": 27.394957983193276, "alnum_prop": 0.593558282208589, "repo_name": "cbenhagen/kivy", "id": "c71c0a464b85ab648bec7dc901a3b148074d514a", "size": "3260"...
import crc16 import struct class PacketWriter(object): MAX_PAYLOAD = 1584 MIN_LEN = 6 MAX_LEN = 1590 SOF = 0x01 OFFSET_SOF = 0 OFFSET_LENGTH = 1 OFFSET_CMD = 3 OFFSET_PAYLOAD = 4 def __init__(self): self._packet = None def Clear(self): self._packet = None def NewSOF(self, v): self....
{ "content_hash": "666067e29db9b28eac2aa8deaa8fb93b", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 55, "avg_line_length": 19.918367346938776, "alnum_prop": 0.5952868852459017, "repo_name": "compbrain/dexcom_reader", "id": "6e033422ce1c43561a24328d13f1ff3d6efbe033", "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('.')) # -- General conf...
{ "content_hash": "c5e97c5c99dbd653fbf9f71defffa62f", "timestamp": "", "source": "github", "line_count": 350, "max_line_length": 80, "avg_line_length": 30.68857142857143, "alnum_prop": 0.6998417279582907, "repo_name": "osisoft/Qi-Docs", "id": "8bbda306dea648eb2077b2ab6dfab09cb77287dd", "size": "1107...
def omp_single_copyprivate(): result = 0 nr_iterations = 0 LOOPCOUNT = 1000 j = 0 if 'omp parallel private(j)': for i in range(LOOPCOUNT): if 'omp single copyprivate(j)': nr_iterations += 1 j = i if 'omp critical': resu...
{ "content_hash": "9e23bb93b505946f776aeb0bb73d4246", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 53, "avg_line_length": 25.8125, "alnum_prop": 0.4963680387409201, "repo_name": "serge-sans-paille/pythran", "id": "09c94f57f9e4ff0c7c833ce5c468bc0ae68d0902", "size": "413",...
"""Spellcorrection module, for custom word sets. Forked from https://github.com/phatpiglet/autocorrect and modified so it uses a fixed set of words. """ from itertools import chain ALPHABET = "abcdefghijklmnopqrstuvwxyz'," class SpellCorrection(object): """Corrects a word based on given set of words.""" d...
{ "content_hash": "4fcf6b58ea51e275a0009a8bcf8d6768", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 88, "avg_line_length": 28.290697674418606, "alnum_prop": 0.5511713933415536, "repo_name": "NMisko/monkalot", "id": "141787dfe3b4146720a899ce9b42333aa801486c", "size": "2433...
import unittest2 as unittest from keystone.middleware.url import NormalizingFilter class MockWsgiApp(object): def __init__(self): pass def __call__(self, env, start_response): pass def _start_response(): pass class NormalizingFilterTest(unittest.TestCase): def setUp(self): ...
{ "content_hash": "e8e8fc9b9feee989477d7e21575a4811", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 64, "avg_line_length": 30.951612903225808, "alnum_prop": 0.6128191766545076, "repo_name": "genius1611/Keystone", "id": "e83af7628510205df553651a4ccfd3e3f0af47d8", "size": "...
""" Filename: plot_optical_depth.py Author: Damien Irving, irving.damien@gmail.com Description: """ # Import general Python modules import sys, os, pdb import argparse import matplotlib.pyplot as plt import iris import iris.plot as iplt import seaborn seaborn.set_context('talk') # Import my modules cwd...
{ "content_hash": "b197523721b2302a38be25444f9d8079", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 94, "avg_line_length": 26.735849056603772, "alnum_prop": 0.6446718419195483, "repo_name": "DamienIrving/ocean-analysis", "id": "b3dd21c044f39420896dad0c56288c1455cb103a", ...
from oslo_log import log as logging from webob import exc from nova.api.openstack.api_version_request \ import MAX_PROXY_API_SUPPORT_VERSION from nova.api.openstack import wsgi import nova.conf from nova import context as nova_context from nova import exception from nova.i18n import _ from nova.network import neut...
{ "content_hash": "8c7303d1191a3dce7d2caa76ba51cf14", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 78, "avg_line_length": 33.726190476190474, "alnum_prop": 0.644546417225556, "repo_name": "rahulunair/nova", "id": "dee7212b50963ab4aeab5d8a7bb9a0a65d2b8faf", "size": "3469"...
from robot.utils import Utf8Reader NBSP = u'\xA0' class TsvReader(object): def read(self, tsvfile, populator): process = False for row in Utf8Reader(tsvfile).readlines(): row = self._process_row(row) cells = [self._process_cell(cell) for cell in self.split_row(row)] ...
{ "content_hash": "2760b2a7f55039ace0702805b35ed88d", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 79, "avg_line_length": 28.636363636363637, "alnum_prop": 0.5291005291005291, "repo_name": "joongh/robotframework", "id": "5f3217e18ecb951620903966a311dd74008478b5", "size":...
from django.contrib import admin from .models import Build @admin.register(Build) class BuildAdmin(admin.ModelAdmin): pass
{ "content_hash": "fffb4b6ca073ddaebefd42b5bdfcacb8", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 35, "avg_line_length": 20.666666666666668, "alnum_prop": 0.8145161290322581, "repo_name": "ajaybhatia/ypg-odm-project", "id": "2e74793c8764a9033ee2b1c2860b5707a58ae87f", "si...
""" Format localization for English (British) language """ DATE_FORMAT = "j F Y" DATETIME_FORMAT = "j F Y, g:i a" SHORT_DATE_FORMAT = "d/m/Y" SHORT_DATETIME_FORMAT = "d/m/Y, H:i" TIME_FORMAT = "g:i a" SHORT_TIME_FORMAT = "H:i"
{ "content_hash": "433fba2534c88d0b00f849559b9a171c", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 50, "avg_line_length": 22.8, "alnum_prop": 0.6491228070175439, "repo_name": "tovmeod/anaf", "id": "b9f8af16d0ca5cd61c6cd82c9453ed30c1238b09", "size": "228", "binary": fal...
import end class Class(object): def __init__(self): pass end # end is missing
{ "content_hash": "a92eba59ede788ac236ce14cf59a140a", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 23, "avg_line_length": 13.571428571428571, "alnum_prop": 0.5789473684210527, "repo_name": "nya3jp/end", "id": "b0fbc95e79129b7b4ff26ad91f4e5a5e1be98723", "size": "95", "bi...
import networkx as nx import random from examples.sollini.pm_bigram_sorted_042521 import freqsort_data as tamil_bigram from examples.sollini.pm_unigram_sorted_050621 import freqsort_data as tamil_unigram from tamil.utf8 import get_letters # Plan # 1. Build bi-gram trellis # 2. Run Viterbi algorithm def build_network...
{ "content_hash": "03dce6a645dd9f534140921c7725a823", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 97, "avg_line_length": 32.41509433962264, "alnum_prop": 0.639697322467986, "repo_name": "Ezhil-Language-Foundation/open-tamil", "id": "f80c8e28fa761d2912a26b14ef5f864ff03c7af...
import sphinx_rtd_theme from recommonmark.parser import CommonMarkParser from sphinx.highlighting import lexers from pygments.lexers.web import PhpLexer lexers['php'] = PhpLexer(startinline=True, linenos=1) lexers['php-annotations'] = PhpLexer(startinline=True, linenos=1) primary_domain = 'php' # -- General configurat...
{ "content_hash": "a9375c478282462f18862799f67e9df8", "timestamp": "", "source": "github", "line_count": 325, "max_line_length": 80, "avg_line_length": 29.092307692307692, "alnum_prop": 0.6925436277102063, "repo_name": "marvinosswald/instagram-php", "id": "f11ab56939214a2f1dc4032cce7c911a9647abf3", ...
""" An ipython profile for zope and plone. Some ideas stolen from http://www.tomster.org. Authors ------- - Stefan Eletzhofer <stefan.eletzhofer@inquant.de> """ # File: ipy_profile_zope.py # # Copyright (c) InQuant GmbH # # # Distributed under the terms of the BSD License. The full license is in # the file COPYI...
{ "content_hash": "b54798b5ada42db1665eecc5752900b0", "timestamp": "", "source": "github", "line_count": 319, "max_line_length": 119, "avg_line_length": 28.90282131661442, "alnum_prop": 0.5594360086767896, "repo_name": "yongshengwang/hue", "id": "172853c677298f0644f7729ddac38d4e2b43cff6", "size": "9...
from PyDictionary import PyDictionary import random def print_options(): print('a -> add word') print('l -> list all the words') print('s -> stop adding words and test me!') def get_defintions(d, word): print("getting definition") meaning = d.meaning(word) meaning_list = list() if meaning ...
{ "content_hash": "2bcb3d3a36169f650ca68d5ffb858b82", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 71, "avg_line_length": 28.794117647058822, "alnum_prop": 0.5827374872318692, "repo_name": "kevink97/Teaching-Materials", "id": "689ee6a7587ec56776830204b3b45cee65c817b8", "...
from unittest import TestCase, mock from data_vault import get_synced_params, VaultEnvironment from keepercommander.commands import register from keepercommander.proto import APIRequest_pb2, record_pb2 from keepercommander import utils vault_env = VaultEnvironment() class TestRegister(TestCase): expected_comman...
{ "content_hash": "e225bcd6943d2547a0ebefa1d21a1455", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 145, "avg_line_length": 41.122950819672134, "alnum_prop": 0.6169025313932629, "repo_name": "Keeper-Security/Commander", "id": "2e3817762fb5720969a1971140fe2a2045725d0a", "...
from f5_cccl.resource.ltm.pool import IcrPool from f5_cccl.resource.ltm.virtual import VirtualServer from f5_cccl.resource.ltm.node import Node from f5_cccl.resource.ltm.app_service import IcrApplicationService def test_bigip_refresh(bigip_proxy): """Test BIG-IP refresh function.""" big_ip = bigip_proxy.mgmt_...
{ "content_hash": "af5a1b17ec37b0dd3f05b6c6811590f8", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 77, "avg_line_length": 32.43, "alnum_prop": 0.6244218316373727, "repo_name": "richbrowne/f5-cccl", "id": "82c6a0c4194245551ec10e580cdf39eb0d09f377", "size": "3846", "bin...
#!/usr/bin/env python ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ##~ Copyright (C) 2002-2004 TechGame Networks, LLC. ##~ ##~ This library is free software; you can redistribute it and/or ##~ modify it under the terms of the BSD style License as found in the ##~ LICENSE file included with this distribution....
{ "content_hash": "ae9da4b875f541f6e230a54c0f0e1ffa", "timestamp": "", "source": "github", "line_count": 1194, "max_line_length": 137, "avg_line_length": 33.46566164154104, "alnum_prop": 0.5341858951899494, "repo_name": "zenx/xhtml2pdf", "id": "a3ff5bb91d1ceaff83b4a9f641d55d97bbe57946", "size": "399...
from suplemon.suplemon_module import Module class RStrip(Module): """Strips whitespace from end of line.""" def run(self, app, editor, args): line_nums = editor.get_lines_with_cursors() for n in line_nums: line = editor.lines[n] line.set_data(line.data.rstrip()) module...
{ "content_hash": "11e650c76c358a1bb41d8ea3dd4c0a8e", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 51, "avg_line_length": 24.666666666666668, "alnum_prop": 0.6, "repo_name": "severin31/suplemon", "id": "efef191f787ac7f2e30dc9eb995876f1f3dfcf59", "size": "393", "binary"...
from collections import Counter, OrderedDict from collections.abc import Mapping import contextlib from copy import deepcopy import datetime from io import BytesIO import operator from textwrap import shorten import string import numpy as np from .pick import (channel_type, _get_channel_types, get_...
{ "content_hash": "ecb33b2717c49b5918fbb14aa9217cb3", "timestamp": "", "source": "github", "line_count": 2916, "max_line_length": 79, "avg_line_length": 38.45644718792867, "alnum_prop": 0.5488902166061763, "repo_name": "wmvanvliet/mne-python", "id": "62b83f6d80897ddc34f4aaf8c3384efd3d178940", "size"...
from azure.identity import DefaultAzureCredential from azure.mgmt.rdbms import MySQLManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-rdbms # USAGE python recommended_action_session_result.py Before run the sample, please set the values of the client ID, tenant ID ...
{ "content_hash": "87dc40423675199396d0cbf4ba518c96", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 142, "avg_line_length": 34.705882352941174, "alnum_prop": 0.7364406779661017, "repo_name": "Azure/azure-sdk-for-python", "id": "e81360ba827f79b69485a268b0e8bdec27edd100", "...
from django.contrib import admin from trust.models import TrustItem class TrustItemAdmin(admin.ModelAdmin): raw_id_fields = ["user"] admin.site.register(TrustItem, TrustItemAdmin)
{ "content_hash": "5dc43b9324198f7c70a1a74c8fccfa76", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 46, "avg_line_length": 18.9, "alnum_prop": 0.7777777777777778, "repo_name": "eldarion/django-trust", "id": "4429759abad1e442ad68f8d89e9006425406a099", "size": "189", "bin...
""" Copyright (C) 2013-2018 Calliope contributors listed in AUTHORS. Licensed under the Apache 2.0 License (see LICENSE file). time.py ~~~~~~~ Functionality to add and process time varying parameters """ import warnings import xarray as xr import numpy as np import pandas as pd from calliope import exceptions from...
{ "content_hash": "edfdb46bed4daeec5745da1a6f679f7a", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 135, "avg_line_length": 38.385892116182575, "alnum_prop": 0.6495513998486651, "repo_name": "brynpickering/calliope", "id": "aec86f8625afebf5019cb05fd4ab89319b57c03c", "siz...
from msrest.serialization import Model class ExtendedErrorInfo(Model): """this is the extended error info. :param code: this is the error response code. Possible values include: 'NotFound', 'Conflict', 'BadRequest' :type code: str or ~azure.mgmt.managementpartner.models.enum :param message: this...
{ "content_hash": "7067eec3645a894197988bab773d03a7", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 74, "avg_line_length": 30.681818181818183, "alnum_prop": 0.6237037037037036, "repo_name": "lmazuel/azure-sdk-for-python", "id": "25cb3debb5525a8d273d114ac9eee54a0e28d776", ...
import sys def printProgress (iteration, total, prefix = '', suffix = '', decimals = 1, barLength = 100): """ Call in a loop to create terminal progress bar @params: iteration - Required : current iteration (Int) total - Required : total iterations (Int) prefix - Opti...
{ "content_hash": "83e967168b37976899ccb2c91e4489c9", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 94, "avg_line_length": 46.54545454545455, "alnum_prop": 0.580078125, "repo_name": "mirca/fsopy", "id": "8b3bb3b5bafb6297d3da1efb23000842d5b369fd", "size": "1026", "binary...
"""Tests for MirroredStrategy.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import sys from absl.testing import parameterized import numpy as np from tensorflow.core.protobuf import config_pb2 from tensorflow.python.autograph.core import...
{ "content_hash": "2ddc20c1fa2a4468f710fe50437c04c4", "timestamp": "", "source": "github", "line_count": 1384, "max_line_length": 113, "avg_line_length": 39.164739884393065, "alnum_prop": 0.6841008043686813, "repo_name": "jhseu/tensorflow", "id": "f31a7d17386531baa5db378d386b993fb404cff8", "size": "...
from collections import OrderedDict from typing import Dict, Type from .base import RecommenderTransport from .grpc import RecommenderGrpcTransport from .grpc_asyncio import RecommenderGrpcAsyncIOTransport # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[RecommenderTrans...
{ "content_hash": "8928f5bc3f2a308e80846ab3e3c72fd0", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 82, "avg_line_length": 33.294117647058826, "alnum_prop": 0.8003533568904594, "repo_name": "googleapis/python-recommender", "id": "d13734288c03f133c04ebd44bd001d4da736dd3e", ...
from http.server import BaseHTTPRequestHandler, HTTPServer import threading, pickle, re class MyHandler(BaseHTTPRequestHandler): def do_GET(self): f_type_map = {'.html': 'text/html', '.css': 'text/css', '.ico': 'image/x-icon', '.jpg': 'image/jpeg', '.png': 'image/png', '.gif': 'image/gif', '.js': 'text...
{ "content_hash": "f6c0f83c6ddde55089ac0863545a9739", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 177, "avg_line_length": 43.673469387755105, "alnum_prop": 0.5780373831775701, "repo_name": "jath03/projects", "id": "a91bd1fd431900de78cad8b364138a15b7a46188", "size": "214...
import argparse import matplotlib.pyplot as plt import matplotlib.dates as mdates import sqlite3, json, datetime import time, math, os, re def chat_renames(): """ Returns list of topics """ print("Getting topics...") renames = [] for sid, timestamp, service in c.execute("""SELECT id, ti...
{ "content_hash": "c188277ba1ec667581effc7f19aa1d0a", "timestamp": "", "source": "github", "line_count": 511, "max_line_length": 162, "avg_line_length": 33.19569471624266, "alnum_prop": 0.5672935211931852, "repo_name": "petrinm/tgstats", "id": "bb66d1809606a51d4b0420a79ed8e01bc9edaa90", "size": "169...
import traceback import cattr import attr import flask_transmute from flask import Flask, Blueprint from flask_transmute import ( route, annotate, Response, APIException ) from typing import ( Optional, Sequence, Callable, TypeVar, Mapping, Union, Dict, List ) # from falcon import HTTPInvalidParam, HTTPMissingP...
{ "content_hash": "e5580448e28fd2472e1cd7d512d9bd8e", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 69, "avg_line_length": 24.857142857142858, "alnum_prop": 0.6479885057471264, "repo_name": "semanticbits/survey_stats", "id": "722f9c527df557ecdefc12ffd139ba760cc755ed", "si...
import unittest from pyrfc import Connection from tests.config import PARAMS as params class TestTT: """ This test cases cover table types of variable and structure types """ def setup_method(self, test_method): self.conn = Connection(**params) assert self.conn.alive def teardow...
{ "content_hash": "792b54bcac19384917113e3b974abbf3", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 69, "avg_line_length": 26, "alnum_prop": 0.5659340659340659, "repo_name": "SAP/PyRFC", "id": "9346a9bcfe831383d63f3b365e91bc5075612bf2", "size": "1079", "binary": false, ...
import pytest @pytest.mark.xfail(reason="Blows up with a 500 no matter what") def test_200_success(petstore): pets = petstore.pet.findPetsByTags(tags=['string']).result() assert pets for pet in pets: assert type(pet).__name__ == 'Pet' assert pet.status == 'sold' @pytest.mark.xfail(reason...
{ "content_hash": "dbf4ad4aefdfc299f261e8526b848b73", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 64, "avg_line_length": 27.533333333333335, "alnum_prop": 0.6731234866828087, "repo_name": "vi4m/bravado", "id": "3d03971004dd9817b93a38315f8c625f3992942c", "size": "413", ...
from CsDatabag import CsDataBag from CsRedundant import * class CsStaticRoutes(CsDataBag): def process(self): logging.debug("Processing CsStaticRoutes file ==> %s" % self.dbag) for item in self.dbag: if item == "id": continue self.__update(self.dbag[item]) ...
{ "content_hash": "f6313428829e561ccd865f11896c3f0d", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 95, "avg_line_length": 35.869565217391305, "alnum_prop": 0.5575757575757576, "repo_name": "resmo/cloudstack", "id": "57b259aabc4ec2dbed0aa9e63c25fc2847b9f160", "size": "164...
from dask.compatibility import entry_points def test_entry_points(): assert "pytest" in [ep.name for ep in entry_points(group="console_scripts")]
{ "content_hash": "4b3c88c7f9b9cc75012b0ad4f84d0296", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 80, "avg_line_length": 30.4, "alnum_prop": 0.743421052631579, "repo_name": "dask/dask", "id": "175a94e71079df51a1649b4f6c67658bf90859c5", "size": "152", "binary": false, ...
from __future__ import print_function import argparse import os import subprocess import sys from json import dumps, loads DEFAULT_DATA_TABLE_NAME = "kallisto_indexes" def get_id_name( params, dbkey, fasta_description=None): # TODO: ensure sequence_id is unique and does not already appear in location file s...
{ "content_hash": "4ba450524beb652fb1c58aabd23919f7", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 126, "avg_line_length": 42.4625, "alnum_prop": 0.6803061524874889, "repo_name": "dpryan79/tools-iuc", "id": "50fd5482ea3014b1302fb9b90ee1bffc26ba71be", "size": "3498", "b...
import os import time import xml.etree.ElementTree as ET if __name__ == "__main__": baseURL = os.path.abspath(os.path.join(os.getcwd(),os.pardir)) + '\\MyProgram\\ExperimentConFile\\' tree = ET.parse(baseURL + 'Experiments_File.xml') root = tree.getroot() ListOfExperimentFiles = [] for child in root: if(chil...
{ "content_hash": "c5ece98b51e87b3dfc9b54b8368cd952", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 100, "avg_line_length": 25.428571428571427, "alnum_prop": 0.6797752808988764, "repo_name": "ucbtrans/sumo-project", "id": "d10b63f2af94f189cece75d157e8f53d03078bfd", "size"...
"""Host action implementations""" from osc_lib.command import command from osc_lib import utils from openstackclient.i18n import _ class ListHost(command.Lister): _description = _("List hosts") def get_parser(self, prog_name): parser = super(ListHost, self).get_parser(prog_name) parser.add_...
{ "content_hash": "52d4bd7882ae6d8913c2269e9a3f5065", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 64, "avg_line_length": 28.00862068965517, "alnum_prop": 0.5297014465989536, "repo_name": "dtroyer/python-openstackclient", "id": "07c92a8c16644d53f047569b6633cf7c05e99e2c", ...
from lacuna.building import MyBuilding class beach10(MyBuilding): path = 'beach10' def __init__( self, client, body_id:int = 0, building_id:int = 0 ): super().__init__( client, body_id, building_id )
{ "content_hash": "0b9e40ff43b47a6905b715903d9354e2", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 71, "avg_line_length": 31.142857142857142, "alnum_prop": 0.6376146788990825, "repo_name": "tmtowtdi/MontyLacuna", "id": "8945895f2a5b1ab939d46bd4bd4d1b2dc192db9c", "size": "...
"""Tests for SpeedTest integration.""" import speedtest from homeassistant import config_entries from homeassistant.components import speedtestdotnet from homeassistant.setup import async_setup_component from tests.async_mock import patch from tests.common import MockConfigEntry async def test_setup_with_config(has...
{ "content_hash": "e66cc5b1c0023cb2feba78758f675f84", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 82, "avg_line_length": 33.666666666666664, "alnum_prop": 0.7164716471647165, "repo_name": "pschmitt/home-assistant", "id": "7b7eed67c0c94cbb7ff42bdbf2032d8339df1f89", "size...
from builtins import str as text from future.utils import iterkeys from future.utils import itervalues from recipe_engine import recipe_test_api class RawIOTestApi(recipe_test_api.RecipeTestApi): # pragma: no cover @recipe_test_api.placeholder_step_data @staticmethod def output(data, retcode=None, name=None): ...
{ "content_hash": "188d65cf3a11ecb5c43fb0fb4418128c", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 79, "avg_line_length": 40.270833333333336, "alnum_prop": 0.6580444904293844, "repo_name": "luci/recipes-py", "id": "c62edff1866237a2608ffd8e7bfd77ddfa7af5e7", "size": "4040...
__author__ = 'yfauser' from tests.config import * from nsxramlclient.client import NsxClient def get_vdnscopes(session): scope_response = session.read('vdnScopes') session.view_response(scope_response) return scope_response['objectId'] def get_vdnscope(session, vdn_scope): scope_response = session....
{ "content_hash": "50e47504f1747659a72937ecda2cf0a7", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 117, "avg_line_length": 41.10588235294118, "alnum_prop": 0.6608471665712651, "repo_name": "vmware/nsxramlclient", "id": "1560171ca72deac023c97b02c72171228d8b759b", "size": ...
#imports from gopigo import * import time __author__ = 'Robert Hayek' servo(80) class Pigo: sweep = [None] * 160 #the list to hold scanning data MIN_DIST = 50 #distance used when plotting a clear direction... longer so we're planning farther ahead status = {'isMoving': False, 'servo': 90, ...
{ "content_hash": "937b241de70501f6776e9cdf7a3c7e01", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 107, "avg_line_length": 24.96153846153846, "alnum_prop": 0.536979969183359, "repo_name": "hayekr/GoPiGoButler", "id": "74b2a6eac824e5a9a01a8b6cbde0d8c7c2efffaa", "size": "1...
"""Build and install the windspharm package.""" # Copyright (c) 2012-2018 Andrew Dawson # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the...
{ "content_hash": "a9ede363b5445342c2288e9f3acfd1d3", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 79, "avg_line_length": 42.770833333333336, "alnum_prop": 0.7243058938139308, "repo_name": "ajdawson/windspharm", "id": "51fdec6c7fd3e9df98e6f690c7c83975a8515df7", "size": "...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/ship/attachment/weapon/shared_blacksun_light_weapon_s04.iff" result.attribute_template_id = 8 result.stfName("item_n","ship_attachment") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### retur...
{ "content_hash": "9e06dbf9bdc3bce82229fcf0fd004dce", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 96, "avg_line_length": 25.23076923076923, "alnum_prop": 0.7103658536585366, "repo_name": "anhstudios/swganh", "id": "30b9ec8c723037f1730aa56ae2ad135e230a766a", "size": "473...
from functools import wraps """ Helper decorators for handling context from skills. """ def adds_context(context, words=''): """Decorator adding context to the Adapt context manager. Args: context (str): context Keyword to insert words (str): optional string content of Keyword """ de...
{ "content_hash": "ffbb7472ffa401fc3b14bd87534ad197", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 65, "avg_line_length": 27.105263157894736, "alnum_prop": 0.6194174757281553, "repo_name": "MycroftAI/mycroft-core", "id": "1b795c171b906d16e472f0dbcca85ada3fbc6848", "size"...
""" Tests for models """ from django.core.exceptions import ValidationError from courses.factories import ProgramFactory from micromasters.factories import UserFactory from roles import roles from roles.models import Role from search.base import MockedESTestCase class MicroMastersRoleTest(MockedESTestCase): """ ...
{ "content_hash": "6417628bad7593639c0e9d5888c2f3e4", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 97, "avg_line_length": 30.258426966292134, "alnum_prop": 0.5941329372447085, "repo_name": "mitodl/micromasters", "id": "48362e19ab1f7bc33446ed3d81e945808c5530fe", "size": "...
import unittest from brew.constants import IMPERIAL_UNITS from fixtures import recipe from fixtures import recipe_dme from fixtures import recipe_lme class TestRecipeExtract(unittest.TestCase): def setUp(self): # Define Recipes self.recipe = recipe self.recipe_lme = recipe_lme sel...
{ "content_hash": "10640124bd242d01345444a798eb38e4", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 78, "avg_line_length": 40.16216216216216, "alnum_prop": 0.6339165545087483, "repo_name": "chrisgilmerproj/brewday", "id": "53b61833f375e7cad3a448c619a9da0acc94e276", "size"...
def main(request, response): referrer = request.headers.get(b"referer", b"") response_headers = [(b"Content-Type", b"text/javascript")] return (200, response_headers, b"window.referrer = '" + referrer + b"'")
{ "content_hash": "7f32c49d6d4e882bbb2467094bdff745", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 76, "avg_line_length": 55.25, "alnum_prop": 0.6606334841628959, "repo_name": "chromium/chromium", "id": "e36631479e60fab893de7e02d55a3f2ec2a32a15", "size": "221", "binary"...
from pyasn1.compat.octets import null from pyasn1.error import PyAsn1Error from pysnmp import debug from pysnmp import nextid from pysnmp.error import PySnmpError from pysnmp.proto import cache from pysnmp.proto import errind from pysnmp.proto import error from pysnmp.proto.api import verdec # XXX from pysnmp.smi imp...
{ "content_hash": "3bc86ab0462d97a20fef370e0799621b", "timestamp": "", "source": "github", "line_count": 580, "max_line_length": 95, "avg_line_length": 36.31896551724138, "alnum_prop": 0.5856159506290055, "repo_name": "etingof/pysnmp", "id": "4e0f401cf35ff5af69c8ebae892e72c505070e96", "size": "21222...
import _plotly_utils.basevalidators class TickwidthValidator(_plotly_utils.basevalidators.NumberValidator): def __init__(self, plotly_name="tickwidth", parent_name="cone.colorbar", **kwargs): super(TickwidthValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name...
{ "content_hash": "51dfd8ba5ffb1ec621ad1dac1eb799eb", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 87, "avg_line_length": 37.666666666666664, "alnum_prop": 0.6172566371681416, "repo_name": "plotly/plotly.py", "id": "01973200951e40754e944a2038f3aa48ad61d291", "size": "452...
"""Generate application_credentials data.""" from __future__ import annotations import json from .model import Config, Integration BASE = """ \"\"\"Automatically generated by hassfest. To update, run python3 -m script.hassfest \"\"\" # fmt: off APPLICATION_CREDENTIALS = {} """.strip() def generate_and_validate(...
{ "content_hash": "6b1b7e394eb66bb69b979dfef86b35e5", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 96, "avg_line_length": 29.53968253968254, "alnum_prop": 0.6792047286405158, "repo_name": "toddeye/home-assistant", "id": "48d812dba02940ec3dc821a38ae2900da73876cb", "size":...
from random import random from time import sleep from base10 import MetricHelper, MetricHandler from base10.dialects import InfluxDBDialect from base10.transports import UDPWriter if __name__ == '__main__': class MyMetric(MetricHelper): _name = 'metric' _fields = [ 'value', ]...
{ "content_hash": "7e824f413d0dfacc05800196bb9e366a", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 65, "avg_line_length": 21.93103448275862, "alnum_prop": 0.6053459119496856, "repo_name": "mattdavis90/base10", "id": "39eac653f934eaf4b07e035cda584d908ee676aa", "size": "65...
import unittest from tempfile import TemporaryDirectory from pandas_datareader.data import DataReader from pandas import to_datetime from numpy import dtype from lmk.utils import env from lmk.cache import Cache def date(s): return to_datetime(s).date() DS = "google" class CacheTestCase(unittest.TestCase): ...
{ "content_hash": "1e18f2fc969f5f0548fee71f810f3033", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 85, "avg_line_length": 38.58095238095238, "alnum_prop": 0.564798815107381, "repo_name": "dyno/LMK", "id": "62091a4975bcc1edde1c680a0400b4cefc1e2049", "size": "4051", "bi...
"""pyroven.tests Contains tests for the pyroven application """ from datetime import datetime, timedelta from base64 import b64encode from string import maketrans from django.test import TestCase from django.test.client import Client from django.core.urlresolvers import reverse from django.contrib.auth.models import...
{ "content_hash": "f385018198dca74d091159af3c33905c", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 79, "avg_line_length": 38.44255319148936, "alnum_prop": 0.6321673677219394, "repo_name": "pyroven/django-pyroven", "id": "82b005bb293d9482c6da6ca1d5c44e8a7eb7564c", "size"...
from oslo_serialization import jsonutils as json from six.moves.urllib import parse as urllib from tempest.api_schema.response.compute.v2_1 import hosts as schema from tempest.common import service_client class HostsClient(service_client.ServiceClient): def list_hosts(self, **params): """Lists all hosts...
{ "content_hash": "35d44ab3338a7d2adabefe0fd68453ab", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 69, "avg_line_length": 34.26865671641791, "alnum_prop": 0.625, "repo_name": "varunarya10/tempest", "id": "752af68178810226f453533921a8ca33f3554b49", "size": "2898", "bina...
from mangrove.errors.MangroveException import MangroveException class EditSurveyResponseForm(object): def __init__(self, dbm, survey_response, form_model, form_answers): assert dbm is not None assert survey_response is not None assert form_model is not None self.saved = False ...
{ "content_hash": "988cd6b085fb5c9fb8f7c3ce9b0645a5", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 106, "avg_line_length": 34.127272727272725, "alnum_prop": 0.6483750665956314, "repo_name": "ICT4H/dcs-mangrove", "id": "d35052c5f0a90bf4bd8791298ceec4c9ba72eb31", "size": "...
from django.contrib import admin from api.models import Answer, Question, User from django import forms class AnswerAdmin(admin.ModelAdmin): model = Answer class QuestionAdmin(admin.ModelAdmin): model = Question # class UserForm(forms.ModelForm): # password = forms.CharField(widget=forms.PasswordInput...
{ "content_hash": "e922ed8cb8f6055c4cb7f5a79d0f052e", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 60, "avg_line_length": 21.566666666666666, "alnum_prop": 0.7063369397217929, "repo_name": "Cookie-Monsters/uQu-Backend", "id": "334ae316e44a87d9de4896827430dd6a339557e7", "...
"""Group (Model) query functions. """ __authors__ = [ '"Sverre Rabbelier" <sverre@rabbelier.nl>', ] from soc.logic.models import base import soc.models.group class Logic(base.Logic): """Logic methods for the Group model. """ def __init__(self, model=soc.models.group.Group, base_model=Non...
{ "content_hash": "4abbe9c4f0f261cf94cbacab56047e19", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 77, "avg_line_length": 27.037974683544302, "alnum_prop": 0.6793071161048689, "repo_name": "SRabbelier/Melange", "id": "2308498c4c123f9d6fe973a9221d821321d3fd5d", "size": "2...
"""HTML utilities suitable for global use.""" import html import json import re from html.parser import HTMLParser from urllib.parse import ( parse_qsl, quote, unquote, urlencode, urlsplit, urlunsplit, ) from django.utils.encoding import punycode from django.utils.functional import Promise, keep_lazy, keep_lazy_t...
{ "content_hash": "7dc636446cf67cb2da248e66038d69be", "timestamp": "", "source": "github", "line_count": 375, "max_line_length": 110, "avg_line_length": 34.99733333333333, "alnum_prop": 0.5929594635781774, "repo_name": "mdworks2016/work_development", "id": "94aa0ff35e9929f40bdfe88931277d90346364d3", ...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import djorm_pgfulltext.fields class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Box', ...
{ "content_hash": "02da67f6f1bd02f823077e2a4b44e813", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 219, "avg_line_length": 58.8448275862069, "alnum_prop": 0.608555523000293, "repo_name": "Kungbib/CIPAC", "id": "a7827245120d3199d3055cb25b3097d3ba37f663", "size": "3505", ...
'''Functions for use by BUILD scripts''' __author__ = 'Jim Olsen (jim.olsen@tanium.com)' __version__ = '2.1.4' import sys sys.dont_write_bytecode = True import os import glob import string import json import StringIO import platform from random import randint def json_read(f): return json.loads(read_file(f)) ...
{ "content_hash": "001c426d59bb3e0d63d06a6f94710058", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 110, "avg_line_length": 30.451923076923077, "alnum_prop": 0.580991474581623, "repo_name": "tanium/pytan", "id": "eda4dcaf6cff51d70d0cfc26b88e0ef72df5c8db", "size": "6501",...
class Solution: # @param {Interval[]} intervals # @return {Interval[]} def merge(self, intervals): if not intervals: return intervals from operator import attrgetter intervals.sort(key=attrgetter('start', 'end')) newIntervals = [] pre = intervals[0] ...
{ "content_hash": "85d4a7c0ee3ec6c4c249d2caadc6ed5c", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 64, "avg_line_length": 31.653846153846153, "alnum_prop": 0.543134872417983, "repo_name": "abawchen/leetcode", "id": "4f8ab21beadf2576b96a0ff4b61aeff478af90bf", "size": "111...
# Copyright 2010 The JsonCpp Authors # Distributed under MIT license, or public domain if desired and # recognized in your jurisdiction. # See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE from __future__ import print_function import os.path import sys def fix_source_eol(path, is_dry_run =...
{ "content_hash": "63ff86fb3c726986fa7fe272f6239374", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 86, "avg_line_length": 31.47142857142857, "alnum_prop": 0.5683159328188834, "repo_name": "fanqiang001/HMI_SDK_LIB", "id": "e089f9f93e62c42272a23f141a6e4654ffe62b5e", "size"...
from kafkatest.services.trogdor.task_spec import TaskSpec class FilesUnreadableFaultSpec(TaskSpec): """ The specification for a fault which makes files unreadable. """ def __init__(self, start_ms, duration_ms, node_names, mount_path, prefix, error_code): """ Create a ...
{ "content_hash": "53575805646546ecada5ec01ba4bc47e", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 85, "avg_line_length": 35.53488372093023, "alnum_prop": 0.5818062827225131, "repo_name": "themarkypantz/kafka", "id": "4f0540a632b68c69b855b7236d7bf5efba019a8c", "size": "2...
"""setup.py file for a GRR API client library.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import os import shutil import subprocess import sys from distutils.command.build_py import build_py from setuptools import find_packages from setuptools im...
{ "content_hash": "066145cf0efb676d165c3f129b899fc4", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 79, "avg_line_length": 30.573529411764707, "alnum_prop": 0.68999518999519, "repo_name": "demonchild2112/travis-test", "id": "09fb93af5693abc8083318aa04ff66144681392a", "si...
from __future__ import absolute_import import sys import time from django.conf import settings from django.db import transaction, connection from django.db.utils import ConnectionHandler, DEFAULT_DB_ALIAS, DatabaseError from django.test import (TransactionTestCase, skipIfDBFeature, skipUnlessDBFeature) from djang...
{ "content_hash": "9e9d6a7c2862325654961ed2d15bc092", "timestamp": "", "source": "github", "line_count": 280, "max_line_length": 82, "avg_line_length": 38.59642857142857, "alnum_prop": 0.6252428981215878, "repo_name": "chrishas35/django-travis-ci", "id": "0587e11a3a1c9e4482336c85fc138daedd159a73", "...
from scrapy import Spider from scrapy.http import Request from firmware.items import FirmwareImage from firmware.loader import FirmwareLoader import urllib.request, urllib.parse, urllib.error import json class A360Spider(Spider): name = "360" #allowed_domains = ["luyou.360.cn"] json_url = "http://s7.qhre...
{ "content_hash": "8e0059f0b1c3773423a6978e6f8d3130", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 75, "avg_line_length": 35.464285714285715, "alnum_prop": 0.540785498489426, "repo_name": "firmadyne/scraper", "id": "b78dc18a6807590b471854a729af7612531c2058", "size": "200...
import _plotly_utils.basevalidators class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="color", parent_name="sunburst.marker.line", **kwargs ): super(ColorValidator, self).__init__( plotly_name=plotly_name, parent_name=par...
{ "content_hash": "94ac3667ad5827a8a26d05c6e2cd8fed", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 79, "avg_line_length": 34.266666666666666, "alnum_prop": 0.585603112840467, "repo_name": "plotly/python-api", "id": "d53ccd9a7411ee80dae06479124f48ec2fb2d904", "size": "514...
from devlib.utils.misc import list_to_mask, mask_to_list from lisa.analysis.base import TraceAnalysisBase from lisa.utils import memoized from lisa.trace import requires_events, CPU from lisa.datautils import df_refit_index, series_refit_index from lisa.notebook import plot_signal class ThermalAnalysis(TraceAnalysis...
{ "content_hash": "f969265654cd5af9391e57525da89f8b", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 79, "avg_line_length": 31.839195979899497, "alnum_prop": 0.5694444444444444, "repo_name": "ARM-software/lisa", "id": "beaa818cf7296e471a0c0348f2721ed9e02f2b92", "size": "6...