text
stringlengths
4
1.02M
meta
dict
import unittest class Test(unittest.TestCase): def test_load_serializer(self): from serialbox import Serializer def test_load_visualizer(self): from serialbox import Visualizer if __name__ == '__main__': unittest.main()
{ "content_hash": "7bcc70ccad003a4a1b3c85db7a459916", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 34, "avg_line_length": 19.25, "alnum_prop": 0.7316017316017316, "repo_name": "MeteoSwiss-APN/serialbox", "id": "957e4389b83ade56024add778a608fc30b446310", "size": "343", ...
"""Run tests. This will find all modules whose name match a given prefix in the test directory, and run them. Various command line options provide additional facilities. Command line options: -v verbose -- run tests in verbose mode with output to stdout -q quiet -- don't print anything except if a test fails ...
{ "content_hash": "552ffac3cd49caa20de13a23d4389344", "timestamp": "", "source": "github", "line_count": 1371, "max_line_length": 152, "avg_line_length": 37.42961342086068, "alnum_prop": 0.5714007327149427, "repo_name": "pronto/dotfiles", "id": "a35ad98cdd700d9577a5ab0b84519f0044b0b5bb", "size": "52...
#!/usr/bin/env python3 # Copyright 2021 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Builds an app that uses Material Web Components This script runs the tooling necessary to produce an output script that can be run ...
{ "content_hash": "7b132cebb5ff15f4062c6321ad8b842b", "timestamp": "", "source": "github", "line_count": 306, "max_line_length": 83, "avg_line_length": 38.57516339869281, "alnum_prop": 0.6005591324974585, "repo_name": "ric2b/Vivaldi-browser", "id": "5ca45bb5f4cdd812deeee25e018ccbb01a6d5736", "size":...
"""Tests for core.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import os import pickle import threading import numpy as np from tensorflow.core.protobuf import config_pb2 from tensorflow.python import pywrap_tfe from tensorflow.p...
{ "content_hash": "28d59e505d3661d4533f76a53ba176de", "timestamp": "", "source": "github", "line_count": 1102, "max_line_length": 108, "avg_line_length": 34.39201451905626, "alnum_prop": 0.6237994722955145, "repo_name": "gunan/tensorflow", "id": "47b3966827fd9e18eb9adebd1c2808adb7c6b981", "size": "3...
""" This module is for Differential Phase Contrast (DPC) imaging based on Fourier shift fitting """ from __future__ import absolute_import, division, print_function import numpy as np from scipy.optimize import minimize from collections import namedtuple import warnings import logging logger = logging.getLogger(__name_...
{ "content_hash": "aecae0ac96349e3fa5d38f7faad6493d", "timestamp": "", "source": "github", "line_count": 478, "max_line_length": 83, "avg_line_length": 33.09414225941423, "alnum_prop": 0.5908085213983185, "repo_name": "Nikea/scikit-xray", "id": "4d603a33f2c774f79eba310fad4a9da5c37ed87f", "size": "18...
""" This module implements an interface to enumlib, Gus Hart"s excellent Fortran code for enumerating derivative structures. This module depends on a compiled enumlib with the executables enum.x and makestr.x available in the path. Please download the library at http://enum.sourceforge.net/ and follow the instructions...
{ "content_hash": "784a072dca036efe74dede0b8f88e752", "timestamp": "", "source": "github", "line_count": 413, "max_line_length": 102, "avg_line_length": 42.83050847457627, "alnum_prop": 0.5709197806546441, "repo_name": "mbkumar/pymatgen", "id": "f95fb1d70aceed314c54026ff450df29215eb42d", "size": "17...
import unittest import os import uuid from studio.gcloud_worker import GCloudWorkerManager from studio.ec2cloud_worker import EC2WorkerManager from local_worker_test import stubtest_worker from timeout_decorator import timeout from studio.extra_util import has_aws_credentials from env_detect import on_gcp, on_aws #9...
{ "content_hash": "03543aae3b6ce0744e2cff82dbd9683a", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 78, "avg_line_length": 32.72560975609756, "alnum_prop": 0.5667970933482392, "repo_name": "studioml/studio", "id": "73ec549199d67ec4644523a2ceb490dbc004cb90", "size": "5367...
import os import sys import subprocess import re import time from collections import namedtuple from conans import tools from conans.model.version import Version from conans.model.ref import ConanFileReference from cpt import __version__ as package_tools_version, get_client_version from cpt.config import ConfigManage...
{ "content_hash": "378b9bc786c0f403d339f4555b3a5bfa", "timestamp": "", "source": "github", "line_count": 435, "max_line_length": 123, "avg_line_length": 50.99080459770115, "alnum_prop": 0.4956043460619449, "repo_name": "conan-io/conan-package-tools", "id": "eefb4873bd168cb2ea9e470ce54e63e6b1738dff", ...
"""A script to generate a cloudbuild yaml.""" import os import yaml import util # Add directories for new tests here. TEST_DIRS = [ 'destination_test', 'metadata_test', 'lock_test', 'empty_descriptor_test', 'no_descriptor_test', 'no_deps_test', 'additional_directory' ] _ST_IMAGE = ('gcr.io/gcp-runtimes/...
{ "content_hash": "dda31387e6380d6fc5c6aaf86ae47c8d", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 79, "avg_line_length": 32.35087719298246, "alnum_prop": 0.6019522776572668, "repo_name": "priyawadhwa/runtimes-common", "id": "53341d3752f5d0d0fb37f878862bc0a75870d7e6", "s...
try: from setuptools import setup except ImportError: from distutils.core import setup config = { 'description': 'rsfmodel', 'author': 'John R. Leeman, Ryan May', 'url': 'http://github.com/jrleeman/rsfmodel', 'download_url': 'http://github.com/jrleeman/rsfmodel', 'author_email': 'kd5wxb@gma...
{ "content_hash": "c1e05e548d366a40e8cb934079bfa1ae", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 58, "avg_line_length": 25.05263157894737, "alnum_prop": 0.615546218487395, "repo_name": "jrleeman/rsfmodel", "id": "1cd402142d25d9564690a6a658a5e6e2f64ddfb0", "size": "476"...
""" The :class:`DXObject` class is the abstract base class for all remote object handlers, and its subclass :class:`DXDataObject` is the abstract base class for all remote data object handlers. """ from __future__ import print_function, unicode_literals, division, absolute_import import time, copy, re import dxpy.ap...
{ "content_hash": "0f437d6e775b19642108a047840c6c02", "timestamp": "", "source": "github", "line_count": 653, "max_line_length": 209, "avg_line_length": 36.64931087289433, "alnum_prop": 0.6088082901554405, "repo_name": "jhuttner/dx-toolkit", "id": "6884eeb6a769784f209dab12b97bdf8c0dc5aaf9", "size": ...
"""Support for UK Met Office weather service.""" from datetime import timedelta import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( ATTR_ATTRIBUTION, CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE, CONF_MONITORED_CONDITIONS, CONF_N...
{ "content_hash": "c5250183235bb24d42a6587e6293b0f2", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 79, "avg_line_length": 31.710526315789473, "alnum_prop": 0.6144398340248962, "repo_name": "jnewland/home-assistant", "id": "ff334823ec6f84970729f463461eeee09928b4f8", "siz...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('webirc', '0010_enterexitevent_message'), ] operations = [ migrations.RemoveField( model_name='message', name='screen', ), ...
{ "content_hash": "736a2d808a82e2f3e9558f9665edd22d", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 50, "avg_line_length": 19.058823529411764, "alnum_prop": 0.5925925925925926, "repo_name": "jawsper/webirc", "id": "3761748f2bedff340f05d4477b2b712c19048b81", "size": "397",...
from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin from django.core.urlresolvers import reverse_lazy, reverse from django.shortcuts import redirect, render from django.views import generic from groups.models import Group, GroupMember from .forms import P...
{ "content_hash": "0ad01172fa049232b096f509ec7e5339", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 184, "avg_line_length": 42.4390243902439, "alnum_prop": 0.6948275862068966, "repo_name": "MilyMilo/sci-organizer", "id": "51456e3fa941739ecd43c6d44b7e79931e448975", "size"...
fish_tuple = ('blowfish', 'clownfish', 'catfish', 'octopus') # make a list of all fish with a for loop fish_list = [] for fish in fish_tuple: if fish != 'octopus': fish_list.append(fish) # print(fish_list) # make a list of all fish using a list comp fish_list = [fish for fish in fish_tuple if fish != 'oct...
{ "content_hash": "7d959d85b3780b1166f3f58b09995f4e", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 65, "avg_line_length": 26.545454545454547, "alnum_prop": 0.6541095890410958, "repo_name": "developerQuinnZ/this_will_work", "id": "a7db104efd0acedd6ae9849b4fe276e5e5f22a5e", ...
from __future__ import absolute_import, unicode_literals import os import re from django.core.serializers.base import DeserializationError from django.core import management from django.core.management.base import CommandError from django.core.management.commands.dumpdata import sort_dependencies from django.db impor...
{ "content_hash": "c16c391cdf5e97f7def051898951b44f", "timestamp": "", "source": "github", "line_count": 681, "max_line_length": 435, "avg_line_length": 34.177679882525695, "alnum_prop": 0.5539419978517723, "repo_name": "chrisfranzen/django", "id": "55363bc5b76c0ee88d6b3c6dbbf01fad308ac970", "size":...
from datetime import datetime from flask import url_for from sqlalchemy import * from sqlalchemy.ext.hybrid import hybrid_property, hybrid_method from sqlalchemy.orm import relationship, backref, exc from sqlalchemy.sql.expression import between from sqlalchemy.dialects.mysql import INTEGER as Integer import rfk.dat...
{ "content_hash": "1b021b8225afe20db7f38b6c6eb8702b", "timestamp": "", "source": "github", "line_count": 294, "max_line_length": 119, "avg_line_length": 35.697278911564624, "alnum_prop": 0.5541686517389233, "repo_name": "buckket/weltklang", "id": "9debf5b6255fc0e8eeebcc62f8a2426c8076ca82", "size": "...
class Credentials(object): def __init__(self, authurl, user, password, tenant_name, region, endpoint_type, auth_version, domain_id, domain_name, tenant_id, user_id, user_domain_id, user_domain_name, project_id, project_name, project_domain_id, project_domain_name): self.a...
{ "content_hash": "09f633640bb5e6157b22db6075b9b1ba", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 75, "avg_line_length": 43.86363636363637, "alnum_prop": 0.6269430051813472, "repo_name": "wal-e/wal-e", "id": "9c84d6ce993c7ac5440fd80d41de3097a6cc3fed", "size": "965", "...
"""The Generalized Normal (Generalized Gaussian) distribution class.""" # Dependency imports import numpy as np import tensorflow.compat.v2 as tf from tensorflow_probability.python import random as tfp_random from tensorflow_probability.python.bijectors import identity as identity_bijector from tensorflow_probability...
{ "content_hash": "e1e125f84bc51d44c26fb12b70969275", "timestamp": "", "source": "github", "line_count": 275, "max_line_length": 92, "avg_line_length": 39.57090909090909, "alnum_prop": 0.666421613673957, "repo_name": "tensorflow/probability", "id": "79c245a24f3e757503ba7ce20641daccf1c4d0d7", "size":...
""" These meta-datasources operate on :class:`revscoring.Datasource`'s that returns a list of strings (i.e. "tokens") and produces a list of ngram/skipgram sequences. .. autoclass:: revscoring.datasources.meta.gramming.gram """ from ..datasource import Datasource class gram(Datasource): """ Converts a seque...
{ "content_hash": "8ec4b42795c64d1ecefc0f0246c450e9", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 79, "avg_line_length": 32.05, "alnum_prop": 0.6006240249609984, "repo_name": "yafeunteun/wikipedia-spam-classifier", "id": "84a2bb1b8185dbf6ba1717b5133a29d64473cdc4", "size...
from .models_BioCyc_io import models_BioCyc_io from .models_BioCyc_dependencies import models_BioCyc_dependencies from .models_COBRA_query import models_COBRA_query from .models_BioCyc_dependencies import models_BioCyc_dependencies import copy class models_BioCyc_execute(models_BioCyc_io): def execute_convertA...
{ "content_hash": "7df009150c0f0f369ec826b3d1209f5b", "timestamp": "", "source": "github", "line_count": 885, "max_line_length": 129, "avg_line_length": 48.3683615819209, "alnum_prop": 0.4999766387889548, "repo_name": "dmccloskey/SBaaS_models", "id": "842da436f731b8f66109b22d0bbcf85f595621d5", "size...
class SimdType(object): """Base class for all SIMD Types.""" def codegen(self, indent=0): from ctree.simd.codegen import SimdCodeGen return SimdCodeGen().visit(self) class m256d(SimdType): pass class m256(SimdType): pass class m512(SimdType): pass
{ "content_hash": "9e22243222fc5f2e9d998f03f7a6af07", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 50, "avg_line_length": 17.058823529411764, "alnum_prop": 0.6586206896551724, "repo_name": "ucb-sejits/ctree", "id": "88f36c93c810011fab505e5a05cb5b1037644790", "size": "290...
import os import json import re import time import datetime import base64 import decimal import operator import logging import copy import uuid import urllib import functools from logging import handlers as logging_handlers from gevent import wsgi from geventhttpclient import HTTPClient from geventhttpclient.url impor...
{ "content_hash": "cc7e928078d2f23d6c0bc4ad0b36b14a", "timestamp": "", "source": "github", "line_count": 1649, "max_line_length": 199, "avg_line_length": 49.40933899332929, "alnum_prop": 0.5728312631940694, "repo_name": "patricklodder/dogeblockd", "id": "561f59a5e3b5bc0200a6691d1b33bfe8b2c5da8a", "s...
from __future__ import absolute_import from __future__ import division from __future__ import print_function # don't add anythin after each version major = 0 minor = 0 patch = 1 # define custom only if you want to add something after M.N.P<-custom> # (note: no delimiter character will be added automatically) cus...
{ "content_hash": "d85df78c8b4d89bd87cefbf7becde1d2", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 70, "avg_line_length": 19.8, "alnum_prop": 0.6893939393939394, "repo_name": "Stibbons/python-project-bootstrap", "id": "0c10863bf83113b5111d9676cd19256c5e0835cc", "size": "...
import sys from setuptools import setup import moflow if sys.version_info[0:2] < (2, 6): sys.exit('Requires Python 2.6 or later') setup_data = { 'name': 'moflow', 'description': 'A Python package for MODFLOW and related programs', 'version': moflow.__version__, 'author': moflow.__author__, '...
{ "content_hash": "197540a17aea1fa7dbf396e218113c15", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 71, "avg_line_length": 22.695652173913043, "alnum_prop": 0.6130268199233716, "repo_name": "mwtoews/moflow", "id": "aebef0331c98bb2fa5afed747dcc3c8f3fc0851f", "size": "545",...
import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy from ._version import VERSION if sys.version_info >= (3, 8): from typing import ...
{ "content_hash": "99493ce93ed2dcf05e9f049d2c1b9c98", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 107, "avg_line_length": 49.53731343283582, "alnum_prop": 0.7095510695992769, "repo_name": "Azure/azure-sdk-for-python", "id": "ff713bd00fcd140175a95b9c1d259c1b8bf6fccc", "s...
import subprocess import os from contextlib import contextmanager import click import cpuinfo import requests BASE_REPO_URL = 'https://github.com/lumol-org/lumol.git' INDIVIDUAL_BENCH_TEMPLATE = """ <details><summary>{sha} {title}</summary> <p>\n\n \n\n ```bash\n {body}\n\n ```\n\n </p></details> """ COMPARISON_...
{ "content_hash": "f90c80723a09e1cb0b3aaf72fb48bbb8", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 110, "avg_line_length": 32.28502415458937, "alnum_prop": 0.6160407002843035, "repo_name": "g-bauer/lumol", "id": "91060177ed66f5e08e7f9f41d8f63898fea0e630", "size": "6721"...
"""Tests for `odroid_fan_controller` package.""" import pytest from click.testing import CliRunner from odroid_fan_controller import odroid_fan_controller from odroid_fan_controller import cli @pytest.fixture def response(): """Sample pytest fixture. See more at: http://doc.pytest.org/en/latest/fixture.ht...
{ "content_hash": "e25331d6b928dfd41a65b9b51b8ea29f", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 78, "avg_line_length": 29.314285714285713, "alnum_prop": 0.7076023391812866, "repo_name": "tr0yspradling/odroid-fan-controller", "id": "3b1f87044a33f49666c2a3fce3fce3e8127653...
""" ================= Threading Classes ================= :Author: Moritz Emanuel Beber :Date: 2011-02-26 :Copyright: Copyright(c) 2011 Jacobs University of Bremen. All rights reserved. :File: threaded.py Notes ----- Most classes (unless they inherit from old-style classes) are new-style classes. Attr...
{ "content_hash": "12d0c4dc038ebea54a771b486da935f5", "timestamp": "", "source": "github", "line_count": 378, "max_line_length": 82, "avg_line_length": 31.746031746031747, "alnum_prop": 0.5305833333333333, "repo_name": "Midnighter/Everyday-Utilities", "id": "4b4b2f2a5cc5a21e823ed6ddc192cc2b1fb5bf1c", ...
from AlgorithmImports import * ### <summary> ### Demonstration algorthm for the Warm Up feature with basic indicators. ### </summary> ### <meta name="tag" content="indicators" /> ### <meta name="tag" content="warm up" /> ### <meta name="tag" content="history and warm up" /> ### <meta name="tag" content="using data" />...
{ "content_hash": "7c5f85479cd71c774715ccc3d5592b71", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 151, "avg_line_length": 37.390243902439025, "alnum_prop": 0.6262230919765166, "repo_name": "StefanoRaggi/Lean", "id": "d3ef7d9cc7f545bd6f3b3d68dcf9301fa4bc9052", "size": "2...
""" Observer pattern "events" implemented as a decorator. Based on: http://stackoverflow.com/a/1926336 Example usage:: # producer class MyJob(object): @event def progress(pct): '''Called when progress is made. pct is the percent complete.''' def run(self): n ...
{ "content_hash": "e0a78177510f5d900c83ff02df66138b", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 76, "avg_line_length": 22.933333333333334, "alnum_prop": 0.5254360465116279, "repo_name": "riggsd/davies", "id": "06db486f6b772ad5eb0e923635de60ccb2a7df2b", "size": "1376",...
""" Trading environment class data: 12/10/2017 author: Tau """ from ..datafeed import * from ..spaces import * from .utils import * from ..utils import * from ..core import Env import os import smtplib from socket import gaierror from datetime import datetime, timedelta, timezone from decimal import localcontext, ROUN...
{ "content_hash": "8d2d0b37f6a57461e098b4253fd4b636", "timestamp": "", "source": "github", "line_count": 2391, "max_line_length": 163, "avg_line_length": 39.624843161856965, "alnum_prop": 0.5191623655573498, "repo_name": "naripok/cryptotrader", "id": "cc1b7dd3a27949622f40671183c99abc4f8bd4e8", "size...
''' A donut chart populated with browser market share percentages. This example demonstrates the low-level |bokeh.models| API. .. bokeh-example-metadata:: :apis: bokeh.models.AnnularWedge, bokeh.models.Legend :refs: :ref:`ug_topics_pie` :keywords: pandas, donut, wedge ''' from math import pi from bokeh.i...
{ "content_hash": "f9c78bbc5f646b7aa89862d8ef6ca82e", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 79, "avg_line_length": 30.982142857142858, "alnum_prop": 0.6720461095100865, "repo_name": "bokeh/bokeh", "id": "9e0d58889e4687589ed9ad2d32fb6920da7deebd", "size": "1735", ...
import pytest from async_generator import async_generator, yield_ from geopy.exc import ConfigurationError, GeocoderQueryError from geopy.geocoders import IGNFrance from test.geocoders.util import BaseTestGeocoder, env from test.proxy_server import ProxyServerThread class TestUnitIGNFrance: def test_user_agent_...
{ "content_hash": "258cdb4f71886996dc513e2fbd5f5aa7", "timestamp": "", "source": "github", "line_count": 277, "max_line_length": 84, "avg_line_length": 32.17689530685921, "alnum_prop": 0.5619881072590598, "repo_name": "jmb/geopy", "id": "ca4cd9d2a716abf66dcdfae47cce75b12a249f56", "size": "8916", "...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0008_board_private'), ] operations = [ migrations.AlterField( model_name='pin', name='referer', field=models.CharField(blank=True, max_length=512...
{ "content_hash": "f168d1d9d1dee532ae5a1703a6b47d13", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 74, "avg_line_length": 24.857142857142858, "alnum_prop": 0.553639846743295, "repo_name": "pinry/pinry", "id": "c31bbe43853f17d253c2fdc9f5cdb0e754bd6c88", "size": "572", "...
import re import os from fxpt.qt.pyside import QtCore, QtGui from com import * from fxpt.fx_refsystem.ref_handle import ATTR_REF_FILENAME from fxpt.fx_utils.utils_maya import getParent class NodeInfo(object): def __init__(self): self.selectionString = None self.fullPathName = None self....
{ "content_hash": "3785164e92cc83f8775b2bc4c4d5e19a", "timestamp": "", "source": "github", "line_count": 417, "max_line_length": 89, "avg_line_length": 29.28537170263789, "alnum_prop": 0.5968719292499182, "repo_name": "theetcher/fxpt", "id": "fff0762428ad9466b63e16fa3012a4bcc770553c", "size": "12212...
import numpy, code from .utility_functions import expand_indexes, index_to_zyx, \ find_halo, calc_distance from .load_config import c nx = c.nx ny = c.ny nz = c.nz def calc_com(mask): pts = index_to_zyx(mask) z = pts[0][:].astype(float).mean() # Correct Center of Mass for ...
{ "content_hash": "d4f8d975726bdebf20a3920cd322f5cb", "timestamp": "", "source": "github", "line_count": 279, "max_line_length": 98, "avg_line_length": 32.261648745519715, "alnum_prop": 0.5070547716920342, "repo_name": "lorenghoh/loh_tracker", "id": "8f7e5e950d4f4173d7a8805e1994127202f871f4", "size"...
from datetime import date, time, datetime class CellMode(object): raw = 0x01 cooked = 0x02 class Cell(object): def __init__(self, value=None, note=None): self.value = value self.note = note def copy(self): return Cell(self.value, self.note) def __str__(self): return "Cell(value={0}, note...
{ "content_hash": "75d2876cd26f5e065ae1c062259661a6", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 107, "avg_line_length": 29.990654205607477, "alnum_prop": 0.6410096603303209, "repo_name": "treycucco/py-utils", "id": "37aad9396cee08b855c09d176757e03213750858", "size": ...
import asyncio from pypeman import channels from pypeman.channels import BaseChannel from pypeman import nodes from pypeman.test import TearDownProjectTestCase as TestCase from pypeman.tests.common import generate_msg class TestNode(nodes.BaseNode): def __init__(self, *args, **kwargs): super().__init__(*...
{ "content_hash": "f292b878bbf7ad95c1de988078fa77f0", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 96, "avg_line_length": 33.35245901639344, "alnum_prop": 0.6230031948881789, "repo_name": "Zluurk/pypeman", "id": "2105ca3916744f6ff40ba48ac92afc3369004444", "size": "4069"...
"""Add exclusion constraint to membership Revision ID: 6815546f681c Revises: 20234ac06668 Create Date: 2021-11-14 00:38:58.192514 """ from alembic import op # revision identifiers, used by Alembic. revision = '6815546f681c' down_revision = '20234ac06668' branch_labels = None depends_on = None def upgrade(): op...
{ "content_hash": "53ac29a107e1818580247384a4a97d69", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 84, "avg_line_length": 27.096774193548388, "alnum_prop": 0.7011904761904761, "repo_name": "agdsn/pycroft", "id": "2f19569b198695ee490a879a227d89552e7c25e2", "size": "840", ...
"""Command implementation.""" from copy import deepcopy class Command(object): """The object for coap commands.""" def __init__( self, method, path, data=None, *, parse_json=True, observe=False, observe_duration=0, process_result=None, ...
{ "content_hash": "6581a86fec350c09854858edffabe91f", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 71, "avg_line_length": 25.04, "alnum_prop": 0.5146964856230032, "repo_name": "ggravlingen/pytradfri", "id": "25d4400e9b9e495848acb05a88b30ea5aee5e125", "size": "3130", "...
from mixbox import entities from mixbox import fields import cybox.bindings.network_route_object as network_route_binding from cybox.common import Duration, ObjectProperties, StructuredText from cybox.objects.network_route_entry_object import NetworkRouteEntry class NetworkRouteEntries(entities.EntityList): _bin...
{ "content_hash": "da53e403ae5b7b1c63b2c5750ce6365c", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 100, "avg_line_length": 43.970588235294116, "alnum_prop": 0.7665551839464882, "repo_name": "CybOXProject/python-cybox", "id": "2168db04538233a66bb74499a3e27def0fa6e20a", "s...
import math import numpy as np import tensorflow as tf try: from tensorflow.contrib.rnn import RNNCell except ImportError: RNNCell = tf.nn.rnn_cell.RNNCel class LSTMCell(RNNCell): """Vanilla LSTM implemented with same initializations as BN-LSTM""" def __init__(self, num_units): self.num_units = n...
{ "content_hash": "c37b68f44cab2d2555583fc02224d279", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 98, "avg_line_length": 34.59477124183007, "alnum_prop": 0.5639523899489892, "repo_name": "ematvey/deep-text-classifier", "id": "36a5502c30dff42b4cf27c519e849379e55ed566", ...
from django.core.management import setup_environ import os import sys sys.path.append(os.path.dirname(__file__)) import settings setup_environ(settings) #===================================# from django.contrib.gis.utils import LayerMapping from arp.models import Watershed a = Watershed.objects.all() for i in a: ...
{ "content_hash": "e904c80d3bc9f5352d1a730e9e36a0f5", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 76, "avg_line_length": 22.766666666666666, "alnum_prop": 0.6251830161054173, "repo_name": "tectronics/watershed-priorities", "id": "37474095d43d62f1271f733e9cbe6a1d0625b373",...
""" stock.py """ from decimal import Decimal import base64 from lxml import etree from logbook import Logger from ups.shipping_package import ShipmentConfirm, ShipmentAccept from ups.base import PyUPSException from ups.worldship_api import WorldShip from trytond.model import fields, ModelView from trytond.wizard ...
{ "content_hash": "8896f75de3910d3d8cd2299708b471d8", "timestamp": "", "source": "github", "line_count": 550, "max_line_length": 79, "avg_line_length": 33.77272727272727, "alnum_prop": 0.5795423956931359, "repo_name": "priyankarani/trytond-shipping-ups", "id": "176c3bf66f5456fcaf1283c2ea51068633a3152f...
""" SleekXMPP: The Sleek XMPP Library Copyright (C) 2010 Nathanael C. Fritz, Lance J.T. Stout This file is part of SleekXMPP. See the file LICENSE for copying permission. """ import socket try: import queue except ImportError: import Queue as queue class TestSocket(object): """ A du...
{ "content_hash": "56fc70ef51b40f76280aded118534b5f", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 77, "avg_line_length": 27.34285714285714, "alnum_prop": 0.518025078369906, "repo_name": "skinkie/SleekXMPP--XEP-0080-", "id": "e3ddd70058bb422225b806071f6d14e0fd3fc839", "...
"""Test configuration for Shelly.""" from unittest.mock import AsyncMock, Mock, patch import pytest from homeassistant.components.shelly.const import ( EVENT_SHELLY_CLICK, REST_SENSORS_UPDATE_INTERVAL, ) from tests.common import async_capture_events, async_mock_service, mock_device_registry MOCK_SETTINGS = ...
{ "content_hash": "97d72d71f63b6a4507e26a56554efc2a", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 87, "avg_line_length": 25.69683257918552, "alnum_prop": 0.5567881669307977, "repo_name": "nkgilley/home-assistant", "id": "cca4aebb9ead37774c785931ceb683980839b593", "size...
from rest_framework.permissions import BasePermission from django.shortcuts import get_object_or_404 class IsNewsManager(BasePermission): message = 'Permissions denied' safe_method = ['PUT', 'POST', 'DELETE'] def has_permission(self, request, view): group = request.user.groups.get() if 'N...
{ "content_hash": "83cb06df7520ee0b9e1f0494b761a718", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 59, "avg_line_length": 31.692307692307693, "alnum_prop": 0.6844660194174758, "repo_name": "bakowroc/newsfeed-system", "id": "ef0c2fafc293bcfbc4a5462a951e1700bf319131", "siz...
import base64 import json import urllib, urllib2 from get_credentials import get_api_keys API_KEY = get_api_keys()['pushbullet'] USER_DATA_URL = 'https://api.pushbullet.com/v2/users/me' DEVICE_URL = 'https://api.pushbullet.com/v2/devices' PUSH_URL = 'https://api.pushbullet.com/v2/pushes' def send_request(url, post_da...
{ "content_hash": "85c5a4195c3124c0b9124b13f3271670", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 86, "avg_line_length": 36.25757575757576, "alnum_prop": 0.6234851650647723, "repo_name": "Serpens/pywebapis", "id": "1682b08af925643ba862fb9bd9ecc9edb1be8d78", "size": "241...
""" Daily cleanup job. Can be run as a cronjob to clean out old data from the database (only expired sessions at the moment). """ import datetime from django.db import transaction from django.contrib.sessions.models import Session def clean_up(): """Clean up expired sessions.""" Session.objects.filter(expire...
{ "content_hash": "fe7885631eb842c2207cc22bf1ea639f", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 77, "avg_line_length": 24.833333333333332, "alnum_prop": 0.7114093959731543, "repo_name": "diofeher/django-nfa", "id": "c87be1e4c39ae705669e13bf8f4abfac50e10c4c", "size": "...
"""Process the ImageNet Challenge bounding boxes for TensorFlow model training. Associate the ImageNet 2012 Challenge validation data set with labels. The raw ImageNet validation data set is expected to reside in JPEG files located in the following directory structure. data_dir/ILSVRC2012_val_00000001.JPEG data_di...
{ "content_hash": "43f252f8162b376bf48dfa87440e72d6", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 79, "avg_line_length": 33.78378378378378, "alnum_prop": 0.7296, "repo_name": "derekjchow/models", "id": "da85f8f14c8d0fc84980a2611d6bc7522668aa62", "size": "3195", "binar...
import time from envirophat import light, weather from beebotte import * ### Replace CHANNEL_TOKEN with that of your channel bbt = BBT(token = 'CHANNEL_TOKEN') period = 300 ## Sensor data reporting period (5 minutes) ### Change channel name as suits you - in this instance, it is called Enviro_pHAT temp_resource = ...
{ "content_hash": "b57c5ff778df434fc945d5fb739522c5", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 114, "avg_line_length": 37.4054054054054, "alnum_prop": 0.666907514450867, "repo_name": "raspberrycoulis/beebotte-envirophat", "id": "c2b60c2e44e462c44df4ee93ebec69ab90f65194...
from boomslang import Line, Plot from ImageComparisonTestCase import ImageComparisonTestCase import unittest class TickStylesTest(ImageComparisonTestCase, unittest.TestCase): def __init__(self, testCaseName): super(TickStylesTest, self).__init__(testCaseName) self.imageName = "tickstyles.png" ...
{ "content_hash": "f4c8d200f1418a3dd5ffc3cde51b5617", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 71, "avg_line_length": 31.37878787878788, "alnum_prop": 0.5789473684210527, "repo_name": "alexras/boomslang", "id": "e00a2d994a8b66bf56817bcd49b7a328f6a67e4d", "size": "209...
""" :Author Patrik Valkovic :Created 04.07.2017 20:02 :Licence MIT Part of grammpy """ from unittest import TestCase, main from grammpy.old_api import Terminal class TempClass: pass class TerminalCreationTest(TestCase): def test_createWithSymbol(self): ter = Terminal('a') self.assertEqual(...
{ "content_hash": "4efe295422a0e6be5d70e2dc5471535a", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 86, "avg_line_length": 24.944444444444443, "alnum_prop": 0.6692650334075724, "repo_name": "PatrikValkovic/grammpy", "id": "c77ade0fa0dba2faa2072cdd189390451134d026", "size"...
from __future__ import annotations import apache.thrift.metadata.thrift_types as _fbthrift_metadata import facebook.thrift.annotation.thrift.thrift_metadata # TODO (ffrancet): This general pattern can be optimized by using tuples and dicts # instead of re-generating thrift structs def _fbthrift_gen_metadata_excepti...
{ "content_hash": "c1554f62a70e7d7408c83b92e49077bc", "timestamp": "", "source": "github", "line_count": 272, "max_line_length": 226, "avg_line_length": 53.3235294117647, "alnum_prop": 0.7345559845559846, "repo_name": "facebook/fbthrift", "id": "886e4a973ce585ec52c534746419a9d8239ac5c4", "size": "14...
from __future__ import absolute_import import logging import unittest from nba.scrapers.nbacom import NBAComScraper class NBAComScraper_test(unittest.TestCase): def setUp(self): logging.getLogger(__name__).addHandler(logging.NullHandler()) self.nbs = NBAComScraper() def test_boxscore(self)...
{ "content_hash": "8d278c04c9d390262935c36f00feef14", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 76, "avg_line_length": 36.80530973451327, "alnum_prop": 0.6333253185861986, "repo_name": "sansbacon/nba", "id": "c97e3e3ede1f116ac9d9c3a1d485b9893d4e62e3", "size": "4159",...
import sys import collections import itertools import unicodedata import bisect PY_LEGACY = sys.version_info < (3, ) if PY_LEGACY: chr = unichr # noqa range = xrange # noqa map = itertools.imap # noqa class RangeGroup(tuple): ''' Immutable iterable representing a list of unicode code point ra...
{ "content_hash": "8293f4e61f73cd1949085d396a87378d", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 79, "avg_line_length": 31.453416149068325, "alnum_prop": 0.6070300157977883, "repo_name": "ergoithz/unicategories", "id": "67e5cb468ee4d4f38365b3ae13a625bdbb0b2594", "size...
import good as G from memsql_framework.util.attr_dict import AttrDict class Flavor(AttrDict): schema = G.Schema({ "flavor_id": basestring, "memory": int, "cpu": int, "disk": int }) def __init__(self, **params): sanitized_data = Flavor.schema(params) super(Fl...
{ "content_hash": "3954d0e0c19c6c1c4bef2eb5f61581f7", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 73, "avg_line_length": 27.685714285714287, "alnum_prop": 0.5975232198142415, "repo_name": "memsql/memsql-mesos", "id": "c9ac5b85eeea8a475cff936985caf11ed099d4e8", "size": "...
"""Tests for the file entry implementation using pybde.""" import unittest from dfvfs.lib import definitions from dfvfs.path import factory as path_spec_factory from dfvfs.resolver import context from dfvfs.resolver import resolver from dfvfs.vfs import bde_file_entry from dfvfs.vfs import bde_file_system from tests...
{ "content_hash": "8b7055ad8108e150c28eb626cf6c3442", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 78, "avg_line_length": 32.72682926829268, "alnum_prop": 0.7138172603964823, "repo_name": "joachimmetz/dfvfs", "id": "4c438df01cb0c0f19521a022a697669460672a72", "size": "67...
import translator from .. import utils from collections import OrderedDict import numpy as np class PolishCrossTranslator(translator.Translator): """Polish cross, Ch optional as argument, input: q1 -> A, c3 -> Z""" key = dict(zip(list('qweasdzxc'), range(9))) def __init__(self, using_ch=True): self.setUsingCh(us...
{ "content_hash": "6d56f2a0a680084b70ad6b5438bbe21c", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 113, "avg_line_length": 27.164383561643834, "alnum_prop": 0.5940494200706001, "repo_name": "PrehistoricTeam/pycrypt", "id": "ce4658c22c5ec8be77f4b7996d3fc6038526d603", "siz...
"""Module for application exceptions.""" class TermiusException(Exception): """Base exception class.""" class DoesNotExistException(TermiusException): """Raise it when model can not be found in storage.""" class TooManyEntriesException(TermiusException): """Raise it when there are more models then you...
{ "content_hash": "01fd8665e554ba92d4e5f55bba730de6", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 65, "avg_line_length": 25.216216216216218, "alnum_prop": 0.7320471596998929, "repo_name": "Crystalnix/serverauditor-sshconfig", "id": "388f837a9de934e89111cf02b5330e2e13fa829...
from .sysvinit import InitdStatus class RcdStatus(InitdStatus): """ Same as ``initd_status`` but for BSD (/etc/rc.d) systems. Unlike Linux/init.d, BSD init scripts are well behaved and as such their output can be trusted. """ command = """ for SERVICE in `find /etc/rc.d /usr/local/etc/rc....
{ "content_hash": "23af5056546cdd5226316b7cb46cf109", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 82, "avg_line_length": 28.823529411764707, "alnum_prop": 0.6, "repo_name": "Fizzadar/pyinfra", "id": "0ebeb5aabfa7e3140dff5a333e75f7bbd2d5e728", "size": "490", "binary": ...
from pyjamas.builder.XMLFile import XMLFile from pyjamas import Factory from pyjamas import ui from pyjamas.ui.MultiListener import MultiListener from pyjamas.HTTPRequest import HTTPRequest from pyjamas.ui.Tooltip import TooltipListener from pyjamas.ui.CSS import StyleSheetCssFile # All event listeners with a tuple t...
{ "content_hash": "5367c1e32c6a1e266c6f4979b6d8a532", "timestamp": "", "source": "github", "line_count": 227, "max_line_length": 76, "avg_line_length": 38.10132158590309, "alnum_prop": 0.5545149728292288, "repo_name": "minghuascode/pyj", "id": "19d796d8b39ba9b006111742f6c4a5480ce941e1", "size": "877...
import operator import argparse import json import sys def find_name(p): ret = p.get('n') if ret is None: ret = p.get('nm') return ret def main(args): parser = argparse.ArgumentParser() parser.add_argument( '-o', '--outfile', metavar='FILE', type=argparse.FileType('wb'), de...
{ "content_hash": "c45f7808e4edf0473764eae3aa5f1a0a", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 63, "avg_line_length": 25.814814814814813, "alnum_prop": 0.6284074605451937, "repo_name": "geoffrosen/vaginal-microbiome", "id": "5100cf75fa1f8299d6351c2c7726ef2b304fb16d", ...
''' All the consts and hardcode are here ''' RESPONSES = { 'empty_add_command': 'There should be at least one Username to add. For example "/add @username" or "/add username".', 'empty_remove_command': 'There is nobody to remove, your following list is empty', 'remove_keyboard_message': 'Choose someone to ...
{ "content_hash": "dc048e1c7617554f0b6de648616f6cef", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 150, "avg_line_length": 40.208333333333336, "alnum_prop": 0.6652849740932643, "repo_name": "vz10/secretBot", "id": "22ddb44a6f812f3a68b4bfd79ec520d4b6487f49", "size": "965"...
from pyranges.statistics import *
{ "content_hash": "bcd3b708c7114a76dee3cc0d5e7bf72f", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 33, "avg_line_length": 34, "alnum_prop": 0.8235294117647058, "repo_name": "biocore-ntnu/pyranges", "id": "3676e13e26bbbd178db563b73361cd2ed8e564c7", "size": "34", "binary"...
''' New Integration Test for License. @Antony Weijiang ''' import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.operations.resource_operations as res_ops import os import time import datetime import uuid import json import urllib2 test_stub = test_lib.l...
{ "content_hash": "46339dbc4b1a89b5a794f4d8e30e31f6", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 187, "avg_line_length": 40.71134020618557, "alnum_prop": 0.6664978475563433, "repo_name": "zstackio/zstack-woodpecker", "id": "946d0945c21c558479c1848e4228488df33af936", "s...
from __future__ import unicode_literals import frappe import frappe.utils from frappe.utils.oauth import get_oauth2_authorize_url, get_oauth_keys, login_via_oauth2, login_via_oauth2_id_token, login_oauth_user as _login_oauth_user, redirect_post_login import json from frappe import _ from frappe.auth import LoginManager...
{ "content_hash": "2b0861bf36ff53386be2354410042124", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 176, "avg_line_length": 38.01904761904762, "alnum_prop": 0.7254509018036072, "repo_name": "saurabh6790/frappe", "id": "1ce25a81d93766b9fb8e7f3ac0845ba79dfd8d18", "size": "...
import re from django.utils.safestring import mark_safe import oembed from oembed.constants import URL_RE, STANDALONE_URL_RE from oembed.exceptions import OEmbedException from oembed.parsers.base import BaseParser class TextBlockParser(BaseParser): def parse_data(self, text, maxwidth, maxheight, template_dir, c...
{ "content_hash": "7ed64c1e623d88a222fb6728f6d6727c", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 99, "avg_line_length": 39.36036036036036, "alnum_prop": 0.5296406500343328, "repo_name": "akvo/djangoembed", "id": "9f054283d907905b5efb6d7d4dad7b4eb7c7c1bd", "size": "436...
from goscale.cms_plugins import GoscaleCMSPluginBase from cms.plugin_pool import plugin_pool from django.utils.translation import ugettext_lazy as _ from django.conf import settings import models GOSCALE_FORMS_PLUGIN_TEMPLATES = getattr(settings, 'GOSCALE_FORMS_PLUGIN_TEMPLATES', ( ('form.html', _('Form')), ('...
{ "content_hash": "0cdff88a308ac833ceffd520ec6e1156", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 86, "avg_line_length": 30.814814814814813, "alnum_prop": 0.6778846153846154, "repo_name": "sternoru/goscalecms", "id": "5f341796571b22a1dd2fb1493e1b5c7822d3abc1", "size": "...
import multiprocessing from .baseparallel import BaseParallelRunner class MultiprocessingRunner(BaseParallelRunner): """ Task runner class based on :class:`multiprocessing.Pool`. """ def __init__(self, num_proc=2): self.num_proc = num_proc self.pool = multiprocessing.Pool(num_proc) ...
{ "content_hash": "a2aec1fcf3a1139ff5e7fad76a9acf84", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 78, "avg_line_length": 34.02564102564103, "alnum_prop": 0.5855312735493594, "repo_name": "tkf/buildlet", "id": "e3e9f4cb2ba274602ae095a47f116f8613aa71b7", "size": "1327", ...
import os, re import commands from time import time from TimerCommand import TimerCommand import SiteMover from futil import * from PilotErrors import PilotErrors from pUtil import tolog, readpar, getSiteInformation, extractFilePaths, getExperiment from FileStateClient import updateFileState from SiteInformation impo...
{ "content_hash": "9c333306c9d72ddb504d5ac5fd2a351f", "timestamp": "", "source": "github", "line_count": 1007, "max_line_length": 203, "avg_line_length": 44.01191658391261, "alnum_prop": 0.5717734657039711, "repo_name": "PanDAWMS/pilot", "id": "a98ed312e9c5735971013be1cc6a2ad8b0e100ee", "size": "446...
from webob.exc import HTTPPreconditionFailed, HTTPNotFound, HTTPConflict, \ HTTPBadRequest from webob import Response from lunr.api.controller.base import BaseController from lunr.db import NoResultFound from lunr.db.models import Node, VolumeType from lunr.db.helpers import filter_update_params class NodeContro...
{ "content_hash": "87486e28c390e6682c048962d6247bcf", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 79, "avg_line_length": 35.982300884955755, "alnum_prop": 0.5607476635514018, "repo_name": "audip/lunr", "id": "ddc6d375ad0316f1b4ef9b5e6b4b7a01e210767d", "size": "4660", ...
import collections import datetime import mongomock # Used for utcnow - please see https://github.com/mongomock/mongomock#utcnow import six import six.moves import threading lock = threading.RLock() class ServerStore(object): """Object holding the data for a whole server (many databases).""" def __init__(s...
{ "content_hash": "f3db55150bea1f15dfb169ad01d3d734", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 94, "avg_line_length": 28.7, "alnum_prop": 0.6035617499032133, "repo_name": "vmalloc/mongomock", "id": "f2dc448d69bcc810af4468323524e6cfda52cf51", "size": "5166", "binar...
""" This module implements classes and methods for processing LAMMPS output files (log and dump). """ import glob import re from io import StringIO import numpy as np import pandas as pd from monty.io import zopen from monty.json import MSONable from pymatgen.io.lammps.data import LammpsBox __author__ = "Kiran Mat...
{ "content_hash": "9bb5162572a52832828ca377a5c1594b", "timestamp": "", "source": "github", "line_count": 189, "max_line_length": 98, "avg_line_length": 30.93121693121693, "alnum_prop": 0.5427642832706124, "repo_name": "vorwerkc/pymatgen", "id": "038f1244535f866139f1ace4d27e672079cdb127", "size": "59...
from django.db import models # Create your models here. class Event(models.Model): first_date = models.DateField(verbose_name='Primer Dia', blank=True, null=True) second_date = models.DateField(verbose_name='Segundo Dia', blank=True, null=True) third_date = models.DateField(verbose_name='Tercer Dia', blan...
{ "content_hash": "b5bb2f53720a23b16eb106c55634f2f2", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 103, "avg_line_length": 28.23170731707317, "alnum_prop": 0.6781857451403888, "repo_name": "elpargo/startupweekenddo", "id": "3dc2ee9b41de58b32547ee32e020bc501170119b", "siz...
""" Copyright 2018-03-02 Alberto Hata 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 ...
{ "content_hash": "999e6a20e1fa4ef1550d49189d2344fb", "timestamp": "", "source": "github", "line_count": 510, "max_line_length": 246, "avg_line_length": 50.476470588235294, "alnum_prop": 0.5545196752515247, "repo_name": "EricssonResearch/scott-eu", "id": "eb170f2a0efc341ffd2932e5c15d66a88474d913", "...
class Region: # parent city capital = None # name name = "No Man's Land" name_de = "Niemandland" # tiles tiles = [] def __init__(self, capital, radius=3, name=None): self.capital = capital if name: self.name = name else: self.name = self.get_default_name() def get_default_name(self): capital_...
{ "content_hash": "5f38f1f47deda530f97e69b85e3c35b1", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 50, "avg_line_length": 18.333333333333332, "alnum_prop": 0.6467532467532467, "repo_name": "herrschr/prey-game", "id": "fa37f5e38741402b6a592ea930932d202e6b8ce3", "size": "3...
import uuid from Firefly import aliases, logging from Firefly.automation.triggers import Triggers from Firefly.const import COMMAND_NOTIFY, SERVICE_NOTIFICATION, TYPE_AUTOMATION, API_ALEXA_VIEW, API_FIREBASE_VIEW, API_INFO_REQUEST from Firefly.helpers.action import Action from Firefly.helpers.conditions import Conditi...
{ "content_hash": "de49262202e9582c5f971867928e7c36", "timestamp": "", "source": "github", "line_count": 306, "max_line_length": 135, "avg_line_length": 35.25816993464052, "alnum_prop": 0.6762443229214942, "repo_name": "Firefly-Automation/Firefly", "id": "2c16b7ebe1649fb4529272899a0eebb21a17ef60", "...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('SessionManagement', '0001_initial'), ] operations = [ migrations.AlterField( model_name='shift', ...
{ "content_hash": "96826f933054f981de905903de7339fb", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 112, "avg_line_length": 24.736842105263158, "alnum_prop": 0.6425531914893617, "repo_name": "SkillSmart/ConferenceManagementSystem", "id": "921e0b8cae9571dc5befdaacdb1c903caa3...
import os, sys import httplib, urllib, json, requests # Replace or verify the region. # # You must use the same region in your REST API call as you used to obtain your subscription keys. # For example, if you obtained your subscription keys from the westus region, replace # "westcentralus" in the URI below with "west...
{ "content_hash": "0b248b0fa14a22d355d025f3a2c67474", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 99, "avg_line_length": 30.821428571428573, "alnum_prop": 0.5165121668597914, "repo_name": "itsuncheng/pharmacist", "id": "0accea7ae74c11df36d86c204d96b584f7a4cc46", "size"...
import os import pytest from optimus.exceptions import ServerConfigurationError, InvalidHostname from optimus.interfaces.runserver import server_interface def test_server_interface_success(tmpdir, fixtures_settings, starter_basic_settings): """ Interface should return cherrypy pre-configured and with correc...
{ "content_hash": "24f0fa52641b1739a506fda61174c6cf", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 85, "avg_line_length": 28.743589743589745, "alnum_prop": 0.6935771632471008, "repo_name": "sveetch/Optimus", "id": "224c28b324fc4c004e6a7a4f8adc7a682444e176", "size": "2266...
import mock from django.core.urlresolvers import reverse from django.test import tag from django.utils import timezone from taggit.models import Tag from .models import Flag from .tests import BaseAdminTestCase from submissions.tests import SubmissionsViewsBaseTestCase from usermgmt import models as usermodels clas...
{ "content_hash": "78073795e9f8e30f69eb2850702eefd4", "timestamp": "", "source": "github", "line_count": 760, "max_line_length": 79, "avg_line_length": 41.05263157894737, "alnum_prop": 0.6023397435897436, "repo_name": "OpenFurry/honeycomb", "id": "d97c7255248a303e7fd42f605a8f9879f1b64b4e", "size": "...
import json import logging import ochopod import pykka import time import uuid from flask import Flask, request from kazoo.exceptions import ConnectionClosedError, NodeExistsError from kazoo.client import KazooClient, KazooState from kazoo.recipe.lock import LockTimeout from ochopod.core.fsm import shutdown, spin_lock...
{ "content_hash": "7503bc86ff7e9141bd119ec4803a2f65", "timestamp": "", "source": "github", "line_count": 291, "max_line_length": 117, "avg_line_length": 33.597938144329895, "alnum_prop": 0.5839214482970236, "repo_name": "titilambert/ochopod", "id": "314759555e77ee63a8ab0bdd072500ab1ae9ad79", "size":...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 30, transform = "None", sigma = 0.0, exog_count = 100, ar_order = 12);
{ "content_hash": "523b78a4e88485872501e29841a0fe8e", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 165, "avg_line_length": 37.857142857142854, "alnum_prop": 0.7056603773584905, "repo_name": "antoinecarme/pyaf", "id": "22b47c5d6b0ca1af9d4ae88d101084a6d27e28cd", "size": "26...
import os import sys import os.path as op from pathlib import Path from glob import glob import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt from scipy.io import loadmat, savemat from scipy import stats, signal # from scipy.stats import distributions as dist # from scipy i...
{ "content_hash": "a27a9325b1313d93ccdb3fc02dabec67", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 47, "avg_line_length": 18.76923076923077, "alnum_prop": 0.7807377049180327, "repo_name": "mmagnuski/mypy", "id": "17ab5c4b2fc01a93d2400c54a1322ca1ad894510", "size": "590", ...
from django.conf.urls import patterns # noqa from django.conf.urls import url # noqa from openstack_dashboard.dashboards.project.databases import views urlpatterns = patterns( '', url(r'^$', views.IndexView.as_view(), name='index'), url(r'^launch$', views.LaunchInstanceView.as_view(), name='launch'), ...
{ "content_hash": "2dd795082177cd67c98ac25162beda60", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 72, "avg_line_length": 31.615384615384617, "alnum_prop": 0.6642335766423357, "repo_name": "spandanb/horizon", "id": "d5d51ce6766137eee534fdfb2f531da428380179", "size": "102...
from test_assets.public import TestAsset from ..cloud_management import CloudManager, CloudProvider from .test_profitbricks import TestProfitbricksAdapter class TestCloudManager(TestProfitbricksAdapter): def setUp(self): self.adapter = CloudManager(TestAsset.MIGRATION_PLAN_MOCK['target_cloud']) def...
{ "content_hash": "85ba2dfa9cb27b6a22f70374255a32e2", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 82, "avg_line_length": 35.611111111111114, "alnum_prop": 0.7519500780031201, "repo_name": "jdepoix/goto_cloud", "id": "eef59e75615d66735d4f617a613d7e66784495ff", "size": "6...
import sqlite3 from blaze.sources.descriptors.byteprovider import ByteProvider from blaze.byteproto import CONTIGUOUS, CHUNKED, STREAM, ACCESS_READ #from blaze.datadescriptor import SqlDataDescriptor from blaze.layouts.categorical import Simple class SqliteSource(ByteProvider): read_capabilities = STREAM w...
{ "content_hash": "4697e2ee1924b6dc6c3e5d8f7efdc99b", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 68, "avg_line_length": 31.486486486486488, "alnum_prop": 0.6746781115879829, "repo_name": "cornsea/blaze", "id": "bd329f379cb87f71f8ee140dd589bd188efe6a83", "size": "1165",...
from rest_framework import serializers from polls.models import Questionary, Question, Choice, Answer class QuestionarySerializer(serializers.ModelSerializer): class Meta: model = Questionary class QuestionSerializer(serializers.ModelSerializer): class Meta: model = Question class ChoiceSe...
{ "content_hash": "2d06f2354118cd05dc713f9c4ad52131", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 62, "avg_line_length": 22.363636363636363, "alnum_prop": 0.7479674796747967, "repo_name": "ewokcillo/django_workshop", "id": "8971be22fe4cb7765964a533dad4cf7c8c1c9909", "si...
import datetime as dt from flask.ext.login import UserMixin from fpage.database import db, CRUDMixin from fpage.extensions import bcrypt class User(UserMixin, CRUDMixin, db.Model): __tablename__ = 'users' username = db.Column(db.String(80), unique=True, nullable=False) email = db.Column(db.String(80), un...
{ "content_hash": "cb4e575b66389966f0305005ce76aee8", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 74, "avg_line_length": 35, "alnum_prop": 0.6517857142857143, "repo_name": "Nikola-K/fpage", "id": "f327d38e097d11e6f8e419cf5b579c77400d089a", "size": "1704", "binary": fa...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "istarrt.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "4ca7ec4872092f10d7f1153d070777c3", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 71, "avg_line_length": 25.333333333333332, "alnum_prop": 0.7105263157894737, "repo_name": "torablien/istarrt", "id": "edf215e4ae70e755cfb04cd0ce4546b20594290d", "size": "250...
import os import re import sys import imp import argparse #------------------------------------------------------------------------------# from .core import _version_numbers from .config import config_types, load_mount_source_config, _existing_repo_names from .components import shared_component_names #-----------------...
{ "content_hash": "464b22193b75deb6743c294d86ad8e6f", "timestamp": "", "source": "github", "line_count": 469, "max_line_length": 82, "avg_line_length": 36.57995735607676, "alnum_prop": 0.4371648402891117, "repo_name": "matus-chochlik/various", "id": "9231a8c4678f8545ff109c36ea387ce5fcde8ae3", "size"...
import pyglet, math from pyglet.window import key import bullet, physicalobject, resources class Player(physicalobject.PhysicalObject): """Physical object that responds to user input""" def __init__(self, *args, **kwargs): super(Player, self).__init__(img=resources.player_image, *args, **kwargs) ...
{ "content_hash": "e638313580ab9e77214c103b2dbc745a", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 94, "avg_line_length": 37.9277108433735, "alnum_prop": 0.6216645489199492, "repo_name": "Akagi201/learning-python", "id": "3252b512e6726193d6380a2fd2268c318ce0fa63", "size"...
''' Shared helpers for tests ''' import os import uuid def setup_tmp_dir(): ''' Create temporary directory for tests ''' tmp_dir = '/tmp/tmp-%s' % (uuid.uuid4().hex) source_dir = os.path.join(tmp_dir, 'source') destination_dir = os.path.join(tmp_dir, 'destination') os.makedirs(source_dir) os.m...
{ "content_hash": "c595ac2c229968dbe787a440d86449e7", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 59, "avg_line_length": 29.833333333333332, "alnum_prop": 0.6424581005586593, "repo_name": "praveenram/sync_folders", "id": "6f392ce64e00d4071b26b8ce7bc3ec2f04f4070d", "size...
from __future__ import absolute_import import pprint import avro.schema from avro.schema import Schema import sys import re import logging import six from six.moves import urllib from six.moves import range from typing import Any, List, Set, Union, Text from .sourceline import SourceLine, lineno_re, bullets, indent ...
{ "content_hash": "4fb0706637753e35703525b5e135793a", "timestamp": "", "source": "github", "line_count": 335, "max_line_length": 158, "avg_line_length": 39.02089552238806, "alnum_prop": 0.477203182374541, "repo_name": "mr-c/common-workflow-language", "id": "2fab415960f31b3b936a0e0942cdfbb1e1bf31f9", ...
from PySide import QtCore, QtGui from tools.modified.androguard.session import Session from tools.modified.androguard.core import androconf from tools.modified.androguard.gui.fileloading import FileLoadingThread from tools.modified.androguard.gui.treewindow import TreeWindow from tools.modified.androguard.gui.sourcewi...
{ "content_hash": "92aaf6035667d642f71d2a705f947219", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 117, "avg_line_length": 35.988188976377955, "alnum_prop": 0.6138278087736572, "repo_name": "CreatorB/hackerdroid", "id": "1bf75ed234f883ec87a41a885015da39ae162321", "size"...
from lxml.html.clean import Cleaner TAGS = ['br', 'p', 'hr', 'b', 'strong', 'em', 'i', 'a', 'blockquote', 'ul', 'li'] ATTRS = ['href', 'target'] cleaner = Cleaner(style=False, links=True, add_nofollow=False, page_structure=False, safe_attrs_only=True, remove_unknown_tags=Fa...
{ "content_hash": "971bce283db8bc5bb07b7ced969f3b90", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 62, "avg_line_length": 32.3125, "alnum_prop": 0.5783365570599613, "repo_name": "pudo/storyweb", "id": "6d658e37ffe597ae94f65e687abf321c4aceb92e", "size": "517", "binary":...
from helper import * import collect import draw import pygame import update def start(game, inputs_record): pygame.init() screen = pygame.display.set_mode( (draw.screen_w, draw.screen_h) ) pygame.display.set_caption("ice-hall") clock = pygame.time.Clock() millis = 1 exit = False ...
{ "content_hash": "52ec5fa5bc150db41f5de36a0f64e871", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 71, "avg_line_length": 22.029411764705884, "alnum_prop": 0.6261682242990654, "repo_name": "ivokosir/icy-hall", "id": "1ea9e716fb61af886a75b1f10335f858a2f1453a", "size": "77...
import pytest def test_idea_installed(host): assert host.run('which idea').rc == 0 @pytest.mark.parametrize('file_path,expected_text', [ ('disabled_plugins.txt', 'org.jetbrains.plugins.gradle'), ('options/jdk.table.xml', '/usr/lib64/jvm/java-11-openjdk'), ('options/jdk.table.xml', '/usr/lib64/jvm/ja...
{ "content_hash": "46b37dcee3bf67c8d99b2797ae2144c5", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 75, "avg_line_length": 39.85507246376812, "alnum_prop": 0.5912727272727273, "repo_name": "gantsign/ansible-role-intellij", "id": "379a845cb5865248e4b20113ca0ed4ee14c49504", ...