text
stringlengths
4
1.02M
meta
dict
# Requires admin role # If you want to do all three tasks at once, see migrateAccount or migrateAccounts functions from agoTools.admin import Admin agoAdmin = Admin(<username>) # Replace <username> with your admin username agoAdmin.reassignAllUser1ItemsToUser2(agoAdmin, <userFrom>, <userTo>) #Replace with y...
{ "content_hash": "86a669f9ca6b1f8f15006a0db1b46467", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 123, "avg_line_length": 49.2, "alnum_prop": 0.7886178861788617, "repo_name": "ecaldwell/ago-tools", "id": "57cef0edb5e527bba2b1760594d954cabf507e47", "size": "613", "bina...
""" Note: This tests doesn't do much any more as _determine space has become too complex and needs more environment information to get fully tested. """ from tiddlywebplugins.tiddlyspace.handler import determine_space config = { 'server_host': { 'scheme': 'http', 'host': '0.0.0.0', ...
{ "content_hash": "583b965ebf396c0d8e4c376b58fa8940", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 64, "avg_line_length": 25.5, "alnum_prop": 0.6062091503267973, "repo_name": "FND/tiddlyspace", "id": "3850ebeb0ff7c00a5f7cfe1015f299cf2e333b54", "size": "612", "binary": ...
import fetch_api import rospy def print_usage(): print 'Moves the torso to a certain height between [0.0, 0.4]' print 'Usage: rosrun applications torso_demo.py 0.4' def wait_for_time(): """Wait for simulated time to begin. """ while rospy.Time().now().to_sec() == 0: pass def main(): ...
{ "content_hash": "e2079a8c74268d794a1a98ce67bf15b1", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 66, "avg_line_length": 18.870967741935484, "alnum_prop": 0.582905982905983, "repo_name": "hcrlab/access_teleop", "id": "523c21e35b18af5cb2171c6ca81e529ede6f7a28", "size": "...
""" This module defines tensors with abstract index notation. The abstract index notation has been first formalized by Penrose. Tensor indices are formal objects, with a tensor type; there is no notion of index range, it is only possible to assign the dimension, used to trace the Kronecker delta; the dimension can be...
{ "content_hash": "8864d833f0b2cffe539e44ab456ab229", "timestamp": "", "source": "github", "line_count": 3740, "max_line_length": 137, "avg_line_length": 31.94946524064171, "alnum_prop": 0.5394297478471182, "repo_name": "diofant/diofant", "id": "aa1a74533f9827e64044c0ecd940eb6e5d2b846e", "size": "11...
""" Simulate Burgers' Equation Simple advection-diffusion equation. """ from phi.flow import * velocity = CenteredGrid(Noise(vector=2), extrapolation.PERIODIC, x=64, y=64, bounds=Box(x=200, y=100)) * 2 # @jit_compile # for PyTorch, TensorFlow and Jax def burgers_step(v, dt=1.): v = diffuse.explicit(v, 0.1, dt=...
{ "content_hash": "f95ad9652f2f9a2f68916d09753ad43a", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 106, "avg_line_length": 27.27777777777778, "alnum_prop": 0.6863543788187373, "repo_name": "tum-pbs/PhiFlow", "id": "a9f0a7e3ef6151f24c2cd7fa308c70c40e58fadd", "size": "491"...
from ..lexer import Token from ..model import TestCase, Keyword, For, If, Try, While class Parser: """Base class for parsers.""" def __init__(self, model): self.model = model def handles(self, statement): raise NotImplementedError def parse(self, statement): raise NotImpleme...
{ "content_hash": "791a0877773bf9247fe41ad624aa7159", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 76, "avg_line_length": 27.846153846153847, "alnum_prop": 0.612645794966237, "repo_name": "robotframework/robotframework", "id": "82a2fb85b4fa7827d676dcb174cafde12562a243", ...
import base64 import datetime import subprocess import sys import threading import time from pathlib import Path from xml.etree import ElementTree as ET import click import requests from prettytable import PrettyTable DATE = datetime.datetime.strftime(datetime.datetime.now(), '%Y-%m-%d-%H') TMP_PATH = Path('./tmp').r...
{ "content_hash": "2e09970fe3b30320b541e7d68edeb142", "timestamp": "", "source": "github", "line_count": 292, "max_line_length": 118, "avg_line_length": 35.26027397260274, "alnum_prop": 0.5618686868686869, "repo_name": "sin-tanaka/radipy", "id": "59f9bb1ecbc68a0d41286a7ce98de52d31268dd3", "size": "1...
from django.http import JsonResponse class JSONResponseMixin: """ A mixin that can be used to render a JSON response. """ def render_to_json_response(self, context, **response_kwargs): """ Returns a JSON response, transforming 'context' to make the payload. """ return J...
{ "content_hash": "3bed7702c8f04052cb73a3e6e076fb7c", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 76, "avg_line_length": 32.2, "alnum_prop": 0.6062111801242236, "repo_name": "razisayyed/django-ads", "id": "ebdbb36a6893fec6d498d971a85cdb124b27bf7b", "size": "805", "bin...
from artefact.connectors.adwords.api.reports import Reports from googleads.errors import AdWordsReportBadRequestError import click import colorama import json import copy import datetime import csv from os.path import join @click.command() @click.option('--report-fields', help='Report Fields to get', required=False...
{ "content_hash": "d749cc0cb7124350a8ef533b18c86436", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 121, "avg_line_length": 35.19178082191781, "alnum_prop": 0.6843129622421176, "repo_name": "sittingbull/artefact.connectors", "id": "e4f21544c9247e8b966bbcd9d6e519b6cc0a691e",...
from __future__ import absolute_import import copy import six from keystone.common import kvs from keystone import config from keystone import exception from keystone.i18n import _ from keystone.openstack.common import log from keystone.openstack.common import timeutils from keystone import token from keystone.token ...
{ "content_hash": "0194151c155ee828c69002876f039c7f", "timestamp": "", "source": "github", "line_count": 339, "max_line_length": 79, "avg_line_length": 42.008849557522126, "alnum_prop": 0.568639842707675, "repo_name": "reeshupatel/demo", "id": "b60c4c385b3144a3707878b90f02863e1400a5b2", "size": "148...
from openstack import exceptions from heat.common import exception from heat.common.i18n import _ from heat.engine.clients.os import openstacksdk as sdk_plugin from heat.engine import constraints CLIENT_NAME = 'senlin' class SenlinClientPlugin(sdk_plugin.OpenStackSDKPlugin): exceptions_module = exceptions ...
{ "content_hash": "f9bd74346743828600c9e05148763c89", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 76, "avg_line_length": 34.43181818181818, "alnum_prop": 0.622002200220022, "repo_name": "noironetworks/heat", "id": "408cabe296a2aef6afac6e43811b680115a3f238", "size": "51...
import ctypes class Z3Exception(Exception): def __init__(self, value): self.value = value def __str__(self): return str(self.value) class ContextObj(ctypes.c_void_p): def __init__(self, context): self._as_parameter_ = context def from_param(obj): return obj class ...
{ "content_hash": "38e2a903b43e6448a2d1ab750a9d5f38", "timestamp": "", "source": "github", "line_count": 233, "max_line_length": 46, "avg_line_length": 18.781115879828327, "alnum_prop": 0.5877513711151737, "repo_name": "HJLebbink/asm-dude", "id": "6c93c0beea2dfa612f3bb3af682634d0a366e3c3", "size": "...
import math import os import folium import sqlalchemy as sa import sqlalchemy.orm as orm import uszipcode class PopDensityFinder: """Returns zipcode population figures, as inhabitants per square mile.""" def __init__(self, db_fspec='/tmp/simple_db.sqlite'): # DB from uszipcode self.engine = sa.crea...
{ "content_hash": "fec2e00cb54062e1193d2c370efac299", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 78, "avg_line_length": 30.685714285714287, "alnum_prop": 0.5581936685288641, "repo_name": "jhanley634/testing-tools", "id": "3776ab0823313191388b3f22a3a16a3b568adfcd", "siz...
from setuptools import setup setup(name="modulo", version="0.0.1", install_requires=["quark==0.0.1"], py_modules=['modulo'], packages=['modulo', 'modulo_md'])
{ "content_hash": "1f285e91f46711f84e0f48780ed0ef38", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 40, "avg_line_length": 26.285714285714285, "alnum_prop": 0.5978260869565217, "repo_name": "bozzzzo/quark", "id": "574f1eec156a49047262b7a76497a8f82a13a67f", "size": "217", ...
from __future__ import unicode_literals import sys import os import re import mimetypes from copy import copy from importlib import import_module from io import BytesIO from django.apps import apps from django.conf import settings from django.core import urlresolvers from django.core.handlers.base import BaseHandler ...
{ "content_hash": "e2fb1829de978ad53aa902623e6dd972", "timestamp": "", "source": "github", "line_count": 635, "max_line_length": 112, "avg_line_length": 38.22834645669291, "alnum_prop": 0.5859526261585993, "repo_name": "lecaoquochung/ddnb.django", "id": "1952af27eb062e6276dd5e6e0f03b6536eab9b8f", "s...
from .model import ExtractionModel # noqa from .relation import Relation, merge_relations # noqa
{ "content_hash": "815918ae95eb3833781af2d07699971b", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 55, "avg_line_length": 49.5, "alnum_prop": 0.7878787878787878, "repo_name": "freewilll/abridger", "id": "813697f1ae9a398c69dc8d986d8a922c9f52ca82", "size": "99", "binary":...
from pyramid.traversal import find_root from snovault import ( calculated_property, collection, load_schema, ) from .base import ( ALLOW_SUBMITTER_ADD, Item, paths_filtered_by_status, SharedItem ) from .dataset import Dataset from .shared_calculated_properties import ( CalculatedBiosampl...
{ "content_hash": "2d01d40e06e12d76af07bfe5f32d9363", "timestamp": "", "source": "github", "line_count": 482, "max_line_length": 106, "avg_line_length": 41.553941908713696, "alnum_prop": 0.5102601228219082, "repo_name": "T2DREAM/t2dream-portal", "id": "64e4033a6abbf14d92557473973f1b6776d960e7", "siz...
"""Fairly basic set of tools for real-time data augmentation on image data. Can easily be extended to include new transformations, new preprocessing methods, etc... """ from __future__ import absolute_import from __future__ import print_function import numpy as np import re from scipy import linalg import scipy.ndimag...
{ "content_hash": "b20bbadfa938bf76f86ea716d1ad71eb", "timestamp": "", "source": "github", "line_count": 991, "max_line_length": 115, "avg_line_length": 41.50655903128153, "alnum_prop": 0.5536916830768482, "repo_name": "baojianzhou/DLReadingGroup", "id": "889827cb4b23f4c1ffed837c170419d752f3b20a", "...
import hashlib import json import logging import os import os.path import time import uuid import warnings from collections import deque from io import SEEK_END, BytesIO from typing import ( Callable, Dict, Iterable, List, MutableMapping, Optional, Tuple, Type, Union, ) from unittest...
{ "content_hash": "5b3bd749f7f52d9cb42b0c17efcd8a57", "timestamp": "", "source": "github", "line_count": 929, "max_line_length": 106, "avg_line_length": 31.293864370290635, "alnum_prop": 0.6170886075949367, "repo_name": "matrix-org/synapse", "id": "b1730fcc8dd5f398941487fba7debfec3cd4a9ab", "size": ...
import acos_client.errors as ae import base class Action(base.BaseV30): def write_memory(self, **kwargs): payload = { "memory": { "primary": True } } try: self._post("/write/memory/", payload, **kwargs) except ae.AxapiJsonFormat...
{ "content_hash": "0305d2db361251049e45cf6db6632c59", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 61, "avg_line_length": 25.142857142857142, "alnum_prop": 0.5435606060606061, "repo_name": "dougwig/acos-client", "id": "44fb7b4040e1003c01a66d7e2a3898d2a7e23b2f", "size": "...
""" System services =============== This module provides low-level tools for managing system services, using the ``service`` command. It supports both `upstart`_ services and traditional SysV-style ``/etc/init.d/`` scripts. .. _upstart: http://upstart.ubuntu.com/ """ from __future__ import with_statement from fabri...
{ "content_hash": "1967d43e5b95cb342abac856652c7b26", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 83, "avg_line_length": 19.778761061946902, "alnum_prop": 0.5834451901565996, "repo_name": "pahaz/fabtools", "id": "38165504baee2a4cce3575f0eea2909c5b8f3df5", "size": "2235...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf from tfbench import model_config from ray.experimental.sgd.model import Model import ray.experimental.tf_utils as ray_tf_utils class MockDataset(): name = "synthetic" class TFBe...
{ "content_hash": "7559f7d629df2c560c5a6d97eda09bb8", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 73, "avg_line_length": 28.71212121212121, "alnum_prop": 0.61688654353562, "repo_name": "atumanov/ray", "id": "99900c43bb051aad3424d6d8fb2be672d7efbfb7", "size": "1895", "...
import ast import os import shutil from typing import Any, Dict, List, Optional, Union from spython.main import Client from airflow.exceptions import AirflowException from airflow.models import BaseOperator class SingularityOperator(BaseOperator): """ Execute a command inside a Singularity container Si...
{ "content_hash": "77aa8d628c6cae6c9f2d76adb504aa72", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 92, "avg_line_length": 37.075581395348834, "alnum_prop": 0.6139250431237259, "repo_name": "sekikn/incubator-airflow", "id": "a3c8c9676f3febd1ff3ca49014cf3a69f404a0b8", "si...
import six from django.conf import settings from django.utils.module_loading import import_string from horizon import defaults def import_object(name_or_object): if isinstance(name_or_object, six.string_types): return import_string(name_or_object) return name_or_object def import_setting(name): ...
{ "content_hash": "41b858c0a1463d95625f65f6220150aa", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 75, "avg_line_length": 32.885714285714286, "alnum_prop": 0.7445699391833188, "repo_name": "NeCTAR-RC/horizon", "id": "6adffead1d94d3d27b10acbf64dcebdb70577451", "size": "16...
""" kaoru.commands.hello ~~~~~~~~ /hello command implementation :copyright: (c) 2015 by Alejandro Ricoveri :license: MIT, see LICENSE for more details. """ from telegram import Update from .. import utils from . import bot_command _greetings = [ # English 'Affirmative Dave, I read you', 'Hello world!',...
{ "content_hash": "2060d33b9a63b117f1b58b49e80bef8b", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 71, "avg_line_length": 16.140845070422536, "alnum_prop": 0.5942408376963351, "repo_name": "axltxl/kaoru", "id": "8b26a4624512e48f56f23e8d673c6a5c0fe15084", "size": "1196", ...
import os import pytest from bokeh.io import output_file from .screenshot import Screenshot def pytest_addoption(parser): parser.addoption( "--set-new-base-screenshot", dest="set_new_base_screenshot", action="store_true", default=False, help="Use to set a new screenshot for imagediff testing. Be sure to ...
{ "content_hash": "22f13e3c06923b7158555fee52b33263", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 256, "avg_line_length": 33.41379310344828, "alnum_prop": 0.6619195046439629, "repo_name": "msarahan/bokeh", "id": "d2fdb25c6c09688c648307bed052a84b4a468f3e", "size": "4845...
""" Module's constants for the modes of operation supported with AES: :var MODE_ECB: :ref:`Electronic Code Book (ECB) <ecb_mode>` :var MODE_CBC: :ref:`Cipher-Block Chaining (CBC) <cbc_mode>` :var MODE_CFB: :ref:`Cipher FeedBack (CFB) <cfb_mode>` :var MODE_OFB: :ref:`Output FeedBack (OFB) <ofb_mode>` :var MODE_CTR: :re...
{ "content_hash": "d1175a3bd546cd758c4870ff0294af3a", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 86, "avg_line_length": 37.37117903930131, "alnum_prop": 0.5758354755784062, "repo_name": "cloudera/hue", "id": "dd2671a694872e9bf8caad5221f3a0b89cf5afeb", "size": "9569", ...
"""Test script for the dbm.open function based on testdumbdbm.py""" import os import unittest import glob import test.support # Skip tests if dbm module doesn't exist. dbm = test.support.import_module('dbm') _fname = test.support.TESTFN # # Iterates over every database module supported by dbm currently available, #...
{ "content_hash": "210a5fc0aa674ea28d8cf75e7d3cf2cb", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 76, "avg_line_length": 28.976608187134502, "alnum_prop": 0.5459132189707366, "repo_name": "MalloyPower/parsing-python", "id": "35d12e43ba8b64a82998ef4b87586020a378a9aa", "...
import sys import os def encode_fib(n): # Return string with Fibonacci encoding for n (n >= 1). result = "" if n >= 1: a = 1 b = 1 c = a + b # next Fibonacci number fibs = [b] # list of Fibonacci numbers, starting with F(2), each <= n while n >= c: fib...
{ "content_hash": "4f14a7c0ac0d4fb21ffb83ad4287fa5e", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 82, "avg_line_length": 33.439189189189186, "alnum_prop": 0.6013336027480299, "repo_name": "ActiveState/code", "id": "f9e8903edde31aadd610c380111fcf37d7fb9a72", "size": "50...
""" The Django settings for TopicMaps in Production """ ########################################################################## ## Imports ########################################################################## import os from .base import * ######################################################################...
{ "content_hash": "c9b6a8a4a10d23a2bc000cd7ce0f0f53", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 84, "avg_line_length": 27.47826086956522, "alnum_prop": 0.370253164556962, "repo_name": "DistrictDataLabs/topicmaps", "id": "4d0f4ace066bba1fa4c1bc45043dda07ed5d3092", "siz...
import matplotlib as mpl import IPython from IPython.core.magic import register_line_magic @register_line_magic def mpl_setup(line): IPython.get_ipython().magic('pylab --no-import-all inline') try: import seaborn as sns sns.set(style="darkgrid") except ImportError: from warnings im...
{ "content_hash": "a9acd43fe3a5b361a80b377f0b0777da", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 106, "avg_line_length": 34.333333333333336, "alnum_prop": 0.674217907227616, "repo_name": "zakandrewking/mpl_recipes", "id": "bb5ceca714d56a7c501b1a270bd247d25b653f22", "si...
from flask import Blueprint from flask import render_template from ipydra import models from ipydra import BASE_URL bp = Blueprint('admin', __name__) @bp.route('/') def listing(): return render_template('admin.jinja.html', BASE_URL=BASE_URL, users=models.User...
{ "content_hash": "08efaa8edcec3b0dd80a29b03b76cba4", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 57, "avg_line_length": 25.692307692307693, "alnum_prop": 0.6167664670658682, "repo_name": "UnataInc/ipydra", "id": "a5900dbf9bd71f2359e0e2e506aba56fe6db7ab0", "size": "334"...
import os import re import shutil import subprocess import sys from bs4 import BeautifulSoup import requests def get_page(url): return BeautifulSoup(requests.get("https://github.com" + url).text) languages = [] languages_page = get_page("/languages") list_items = languages_page.find(class_="all_languages").find("...
{ "content_hash": "4638d4f1a522aa4d54efe8daba5e00e6", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 85, "avg_line_length": 24.048780487804876, "alnum_prop": 0.6683569979716024, "repo_name": "munificent/github-language-ranking", "id": "6aafaedb26a4225fd79bc35ecc5d1611965fa5d...
"""Import utilities.""" from __future__ import absolute_import def import_member(import_string): """Import one member of Python module by path. >>> import os.path >>> imported = import_member('os.path.supports_unicode_filenames') >>> os.path.supports_unicode_filenames is imported True """ ...
{ "content_hash": "5fadeeb7d78ab01e0f54c1d1506366ee", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 76, "avg_line_length": 31.375, "alnum_prop": 0.6633466135458167, "repo_name": "benoitbryon/django-confit", "id": "504da66117a6d08dd81c91829fe50dfaf49dd788", "size": "502", ...
from django.core.urlresolvers import reverse from model_mommy import mommy from lxml import html from apps.boards.models import Board from apps.boards.views import BoardListView from apps.core.tests.utils import LoggedTestCase from apps.issues.models import Issue from apps.teams.models import Team class BoardDetailVi...
{ "content_hash": "e40f50e1984c8e374b3652c82a03e715", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 101, "avg_line_length": 39.36538461538461, "alnum_prop": 0.6873473375671715, "repo_name": "petry/kanboard", "id": "121354b5e0d38cd07ebadce96f3c5f7210ce70f2", "size": "2047"...
"""Weak reference support for Python. This module is an implementation of PEP 205: http://python.sourceforge.net/peps/pep-0205.html """ # Naming convention: Variables named "wr" are weak reference objects; # they are called this instead of "ref" to avoid name collisions with # the module-global ref() function import...
{ "content_hash": "5d9c885e88b5c2ca1e97e85d09b3737c", "timestamp": "", "source": "github", "line_count": 355, "max_line_length": 76, "avg_line_length": 28.385915492957746, "alnum_prop": 0.5599880916939566, "repo_name": "babble/babble", "id": "4f6d757fe3bb4a8a2efa38f5d7170713ed4649da", "size": "10077...
"""Tests for Incremental PCA.""" import numpy as np import pytest from sklearn.utils._testing import assert_almost_equal from sklearn.utils._testing import assert_array_almost_equal from sklearn.utils._testing import assert_allclose_dense_sparse from sklearn import datasets from sklearn.decomposition import PCA, Incr...
{ "content_hash": "e0c64a5e013f41a75a5f9fdd84a4158c", "timestamp": "", "source": "github", "line_count": 423, "max_line_length": 87, "avg_line_length": 34.262411347517734, "alnum_prop": 0.6483819775063824, "repo_name": "amueller/scikit-learn", "id": "25096bbea5ad9b93eeb176874264c12064ed2c80", "size"...
import base64 import six from .. import utils class ConfigApiMixin(object): @utils.minimum_version('1.25') def create_config(self, name, data, labels=None): """ Create a config Args: name (string): Name of the config data (bytes): Config data ...
{ "content_hash": "105593ab774770ece0b0971581f87b3c", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 74, "avg_line_length": 27.197802197802197, "alnum_prop": 0.5111111111111111, "repo_name": "vpetersson/docker-py", "id": "b46b09c7c11a06ff92fa25b654f2ef511f13f57e", "size": ...
import logging import os import random import re import time from queue import Queue from functools import wraps from jinja2 import evalcontextfilter, Markup, escape from werkzeug.wrappers import Response from flask import Flask, redirect, request, render_template from flask_restful import reqparse, Resource, Api i...
{ "content_hash": "cd55999425877b60ee59678070bcf1c7", "timestamp": "", "source": "github", "line_count": 224, "max_line_length": 109, "avg_line_length": 30.669642857142858, "alnum_prop": 0.6, "repo_name": "pingiun/textshorten", "id": "10178edd2d2ffb603881655917e9e6fd542584b0", "size": "6870", "bin...
from __future__ import unicode_literals import boto import sure # noqa from moto import mock_ec2 @mock_ec2 def test_placement_groups(): pass
{ "content_hash": "846d8a0612fe6d28452e3212740453dc", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 39, "avg_line_length": 15.9, "alnum_prop": 0.6855345911949685, "repo_name": "william-richard/moto", "id": "bc389488b66b0abc258d7c87474401731696275d", "size": "159", "bina...
from __future__ import absolute_import from keras import backend as K import numpy as np from keras.utils.generic_utils import get_from_module from six.moves import zip from scipy.sparse import csr_matrix from theano import sparse import theano def clip_norm(g, c, n): if c > 0: g = K.switch(n >= c, g * c /...
{ "content_hash": "c8d32e9e26b2cd86b594262bba6834e5", "timestamp": "", "source": "github", "line_count": 471, "max_line_length": 90, "avg_line_length": 35.77070063694268, "alnum_prop": 0.5459995251661919, "repo_name": "KECB/learn", "id": "9e87b5e1ac1a7225a8144b06767b1837c0749d21", "size": "16848", ...
import transvoxel import noise from vector import * from euclid import * CHUNK_SIZE=8 SIZE = CHUNK_SIZE+3 SIZE_SQ = SIZE**2 SIZE_CB = SIZE**3 class PlanetChunk(transvoxel.Chunk): def __init__(self, offset, lod, parent=None): transvoxel.Chunk.__init__(self, offset, CHUNK_SIZE, lod) self.parent =...
{ "content_hash": "842cc211a2c5768eabff8179ce3ed30e", "timestamp": "", "source": "github", "line_count": 198, "max_line_length": 106, "avg_line_length": 26.358585858585858, "alnum_prop": 0.5407166123778502, "repo_name": "swiftcoder/aurae", "id": "08d681bdd4978c692217b9f33d557c1d6233e671", "size": "5...
import os from setuptools import setup with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-uecookie9', version='0.1', ...
{ "content_hash": "2c811881f7f9df6069513d146ca418ce", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 84, "avg_line_length": 31.583333333333332, "alnum_prop": 0.6218117854001759, "repo_name": "9dev/django-uecookie9", "id": "546bb33937bfdc6a08950fb04563bebe10dcfd14", "size":...
from copy import deepcopy from .curriculum import Curriculum from .fact import Fact, Competency __author__ = 'e.kolpakov' def get_available_facts(facts, known_facts): """ :param facts: frozenset[Fact] :param known_facts: frozenset[Fact] :rtype: frozenset[knowledge_representation.fact.Fact] """ ...
{ "content_hash": "93752de9f23867e19308be9428893aea", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 113, "avg_line_length": 32.035714285714285, "alnum_prop": 0.7045707915273133, "repo_name": "e-kolpakov/study-model", "id": "9580b1306ce750395d876dff32311c69b937b6e9", "size...
import sys import os import re import web from dbclient import Beansdb fs = Beansdb({"localhost:7900": range(16)}, 16) class File: def GET(self, path): data = fs.get(path) if data: sys.stdout.write(data) else: web.notfound() urls = ( "(/.*)", "File", ) def run...
{ "content_hash": "e4f810f09ab850b12fad01dddddc08a0", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 59, "avg_line_length": 21.514285714285716, "alnum_prop": 0.5843293492695883, "repo_name": "mashuai/beansdb", "id": "246bef8758977099ab2c46f92dc836b57f4af407", "size": "796"...
import inspect import urllib.request import json import contextlib import threading import time import pytest from gemstone.util import first_completed, as_completed from gemstone.core import MicroService, exposed_method from gemstone.client.remote_service import RemoteService from gemstone.client.structs import Resu...
{ "content_hash": "dc12172a98536c09ec704551a5616f67", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 98, "avg_line_length": 29.78980891719745, "alnum_prop": 0.6683771648492624, "repo_name": "vladcalin/gemstone", "id": "f3a870f732ff8fcd972acc971592245ecc141547", "size": "4...
'''Generate necessary dump files''' #options size = 100 regenerate_graph = False days = 1 force_layout = False default = str(size)+'.dat' ### import igraph, pickle, random, os import math from collections import OrderedDict def process(fout): output = os.path.join('data',fout) try: #load graph if...
{ "content_hash": "a08cb64d8cb9ef275a9f604c62211fd9", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 173, "avg_line_length": 27.96747967479675, "alnum_prop": 0.5415697674418605, "repo_name": "1orwell/yrs2013", "id": "50f03f56e439575fcd90bef8f3bde272ff46cb8b", "size": "344...
import json import random from StringIO import StringIO from urllib import urlopen from django.shortcuts import redirect from demo import get_demo_transactions from models import Portfolio from models import User from models import create_portfolio from models import create_user from transactions.models import clone...
{ "content_hash": "0d3fefacaf6b8fdfc7d668e4ae564681", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 104, "avg_line_length": 27.82882882882883, "alnum_prop": 0.6639689219812237, "repo_name": "fxdemolisher/frano", "id": "6ea35efca53e23a943c06e73f540f1bcce6d5c72", "size": "...
from oslo_policy import policy from keystone.common.policies import base registered_limit_policies = [ policy.DocumentedRuleDefault( name=base.IDENTITY % 'get_registered_limit', check_str='', scope_types=['system', 'domain', 'project'], description='Show registered limit details.',...
{ "content_hash": "b6768c6812b24bfa0e95cddc2cde2405", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 75, "avg_line_length": 40.204081632653065, "alnum_prop": 0.5796954314720812, "repo_name": "openstack/keystone", "id": "7dde90b3ef8e9a5b04e29a602270a5068b2ca512", "size": "2...
""" Utilities for retrieving revision information from a project's git repository. """ # Do not remove the following comment; it is used by # astropy_helpers.version_helpers to determine the beginning of the code in # this module # BEGIN import locale import os import subprocess import warnings def _decode_stdio(s...
{ "content_hash": "291ec37e32520a25ba5a721b5d49bead", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 79, "avg_line_length": 32.456989247311824, "alnum_prop": 0.5958257412622163, "repo_name": "Stargrazer82301/CAAPR", "id": "9878b7dd0212420390ff8fca0e513496f57766fa", "size"...
""" Read from the Senseval 2 Corpus. SENSEVAL [http://www.senseval.org/] Evaluation exercises for Word Sense Disambiguation. Organized by ACL-SIGLEX [http://www.siglex.org/] Prepared by Ted Pedersen <tpederse@umn.edu>, University of Minnesota, http://www.d.umn.edu/~tpederse/data.html Distributed with permission. The...
{ "content_hash": "cf90482a9d52ee4284c85f964b538b3f", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 78, "avg_line_length": 38.92746113989637, "alnum_prop": 0.5048582457074404, "repo_name": "syllog1sm/TextBlob", "id": "070f8299eb7d4fb7de84671c341ed689812f1932", "size": "7...
""" PyTest configuration """ import pytest def pytest_addoption(parser): # creates a command line option to run slow tests parser.addoption("--runslow", action="store_true", help="run slow tests")
{ "content_hash": "311839748aaaa7a0d22e2964b35e817d", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 77, "avg_line_length": 29.571428571428573, "alnum_prop": 0.7101449275362319, "repo_name": "DC23/cookiecutter-dcpypackage", "id": "f5d8c872e58191a10397955f356b0099753a19c8", ...
""" Defines various data containers for plotting a transect. :copyright: 2015 Agile Geoscience :license: Apache 2.0 """ import os import re from functools import partial import numpy as np import pyproj as pp from shapely.ops import transform def nearest_point(p, plist): """ Given a shapely Point, finds the ...
{ "content_hash": "5f0b992d29cde185dbb40d5fbe7a5e72", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 77, "avg_line_length": 27.126050420168067, "alnum_prop": 0.5845724907063197, "repo_name": "agile-geoscience/geotransect", "id": "37349486782544753016a6dd453c87a2ce062dd9", ...
from .mtrand import RandomState from ._philox import Philox from ._pcg64 import PCG64 from ._sfc64 import SFC64 from ._generator import Generator from ._mt19937 import MT19937 BitGenerators = {'MT19937': MT19937, 'PCG64': PCG64, 'Philox': Philox, 'SFC64': SFC64, ...
{ "content_hash": "6c6fa38e40131bc0ea210e85ec6938e7", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 74, "avg_line_length": 27.402439024390244, "alnum_prop": 0.6012461059190031, "repo_name": "jorisvandenbossche/numpy", "id": "29ff696448fee8383ec89b61793e7b478de9d111", "siz...
import os from time import sleep from selenium import webdriver DEMO_URL = "https://apostello-testing.herokuapp.com" PAGES = [ ("/accounts/signup/", "Signup"), ("/accounts/login/", "Login"), ("/accounts/logout/", "Logout"), ("/send/adhoc/", "SendtoIndividuals"), ("/send/group/", "SendtoGroup"), ...
{ "content_hash": "2cfe190e1df6cb7afb11c48ec5c96150", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 61, "avg_line_length": 24.652173913043477, "alnum_prop": 0.5896531452087007, "repo_name": "monty5811/apostello", "id": "4ce4add9c1afa1b2405cf9bf9c3f5f8ae6bac507", "size": "...
from flask import render_template, request, flash, redirect, url_for, make_response, session, g from wwag import app, database, forms from wwag.decorators import player_login_required, viewer_login_required from MySQLdb import IntegrityError from datetime import datetime @app.route("/videos") def videos(): videos = ...
{ "content_hash": "a6d3dc35d5f89fa29d4b66dd63a609ae", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 303, "avg_line_length": 55.535714285714285, "alnum_prop": 0.7093247588424437, "repo_name": "zhoutong/wwag", "id": "a996b1461477e035543677c76715ba1586cddde0", "size": "4665"...
from django.test import TestCase import iepy from django.test.runner import DiscoverRunner class ManagerTestCase(TestCase): """ TestCase class that clear the makes sure that the models created thru ORM are deleted between tests """ # We are doing something not very clever, but fast enou...
{ "content_hash": "1da36e1d93a00f2e5ed74b3ebc31ed10", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 81, "avg_line_length": 33.09375, "alnum_prop": 0.6732766761095373, "repo_name": "mrshu/iepy", "id": "e6115cd92d1f010a87beca85c9d4d8e5eeee608d", "size": "1059", "binary": ...
class Pipeline: def __init__(self, transformations): self.transformations = transformations def run(self, origin): destination = origin for transform in self.transformations: destination = transform.apply(destination) return destination
{ "content_hash": "b5c8a78800b560c342b652f681dac7a8", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 54, "avg_line_length": 32.22222222222222, "alnum_prop": 0.6620689655172414, "repo_name": "bhillmann/gingivere", "id": "f79a5703d5d6482208cc450c3935b47102c209de", "size": "29...
"""Updates generated docs from Python doc comments.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os.path import sys import tensorflow as tf from tensorflow.python.framework import docs from tensorflow.python.framework import framework_lib from...
{ "content_hash": "afe3bc5228d5fe67d68b966a6d39fe95", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 80, "avg_line_length": 43.261146496815286, "alnum_prop": 0.5665488810365136, "repo_name": "awni/tensorflow", "id": "736924afcaf94285f0d7989133acc24885318698", "size": "747...
""" babel.util ~~~~~~~~~~ Various utility classes and functions. :copyright: (c) 2013-2022 by the Babel Team. :license: BSD, see LICENSE for more details. """ import codecs import collections from datetime import timedelta, tzinfo import os import re import textwrap import pytz as _pytz from babe...
{ "content_hash": "75b3f14d8b3081c364645367781d30be", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 93, "avg_line_length": 28.599236641221374, "alnum_prop": 0.5631923128253036, "repo_name": "python-babel/babel", "id": "0436b9ee4938ed0b3515bc8f528d249deb5e0317", "size": "...
"""unit testing code for 3D stuff """ from rdkit import RDConfig import unittest,os from rdkit import Chem from rdkit.Chem import AllChem from rdkit.Chem import TorsionFingerprints class TestCase(unittest.TestCase): def testConformerRMS(self): m1 = Chem.MolFromSmiles('CNc(n2)nc(C)cc2Nc(cc34)ccc3[nH]nc4') c...
{ "content_hash": "05d238b4ef541cb67e2c52a0b2e15612", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 106, "avg_line_length": 45.23809523809524, "alnum_prop": 0.7341353383458646, "repo_name": "soerendip42/rdkit", "id": "745d3b91be79d55078d401cf59e918405b5f9e8d", "size": "6...
from django.contrib import admin from .models import * # Register your models here. class FullAdmin(admin.ModelAdmin): readonly_fields = ('date','id',) admin.site.register(Question, FullAdmin) admin.site.register(Reply) admin.site.register(ReplyVotedBy, FullAdmin) admin.site.register(Comment)
{ "content_hash": "385f430593d2cd6112a21892870749e3", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 44, "avg_line_length": 23.153846153846153, "alnum_prop": 0.7740863787375415, "repo_name": "sergiorb/askkit", "id": "ad334da512303e5322d7feeadfa95fcff13decad", "size": "348"...
from django.conf.urls import url from comments.views import ( CommentCreate, CommentList, CommentDetail, CommentDestroy, CommentUpdate, ) urlpatterns = [ url(r'^$', CommentList.as_view(), name = ...
{ "content_hash": "b6907460e24011eb4d8c714d11c1ed44", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 39, "alnum_prop": 0.5144230769230769, "repo_name": "bakowroc/newsfeed-system", "id": "196d86830def0f26a4e18d3dce5220efa2073801", "size": "624", "bi...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import print_function from django.db import connection from django.test import override_settings from sqlalchemy.sql import ( and_, select, column, table, ) from sqlalchemy.sql import compiler # type: ignore from zerver.models import...
{ "content_hash": "9417430d8347b7deb325e83ba5818c21", "timestamp": "", "source": "github", "line_count": 1509, "max_line_length": 914, "avg_line_length": 48.77070907886017, "alnum_prop": 0.5998369454446634, "repo_name": "vaidap/zulip", "id": "d7e8eee7e8ce89d015ecc871480fb14b593f7e4c", "size": "73765...
from __future__ import unicode_literals from moto.core.responses import BaseResponse from moto.core.utils import camelcase_to_underscores from .utils import parse_message_attributes from .models import sqs_backends from .exceptions import ( MessageAttributesInvalid, MessageNotInflight, ReceiptHandleIsInval...
{ "content_hash": "62852d5aad7d0e77af3ffaa0e1f178a5", "timestamp": "", "source": "github", "line_count": 404, "max_line_length": 151, "avg_line_length": 37.29207920792079, "alnum_prop": 0.6371963361210673, "repo_name": "jotes/moto", "id": "69b3f63df1d3c667c3b0371f529705c6e24e80af", "size": "15066", ...
"""This processor reshapes the data to match the fiscal schema.""" from datapackage_pipelines.wrapper import ingest from datapackage_pipelines.wrapper import spew from common.utilities import get_fiscal_field_names import logging def process_row(row, fiscal_fields): """Add and remove appropriate columns. """ ...
{ "content_hash": "543e0fb5cad23ec7e6b89771d33aaf07", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 66, "avg_line_length": 32.588235294117645, "alnum_prop": 0.6155234657039711, "repo_name": "Victordeleon/os-data-importers", "id": "a65b2212e72eb44db65ce491a76aad6aef93a992", ...
from django.contrib import admin from . import models class PhotoAdmin(admin.ModelAdmin): def save_model(self, request, obj, form, change): if not obj.id: obj.owner = request.user obj.save() class AlbumAdmin(admin.ModelAdmin): def save_model(self, request, obj, form, change): if n...
{ "content_hash": "d2d50526cb59e9b068b1ccc6d8a7c57b", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 53, "avg_line_length": 24.636363636363637, "alnum_prop": 0.7158671586715867, "repo_name": "ateoto/django-glair", "id": "84a4630e5b692bbb5b7c402fee5d7492fee2f8f5", "size": "...
""" Functional constructs for ORM configuration. See the SQLAlchemy object relational tutorial and mapper configuration documentation for an overview of how this module is used. """ from sqlalchemy.orm import exc from sqlalchemy.orm.mapper import ( Mapper, _mapper_registry, class_mapper, ) from s...
{ "content_hash": "29a0f6cff5045c26b0e208527970d95c", "timestamp": "", "source": "github", "line_count": 1289, "max_line_length": 95, "avg_line_length": 41.64313421256788, "alnum_prop": 0.6858303215470025, "repo_name": "igemsoftware/SYSU-Software2013", "id": "87f7568d852109c8c4aafa56aab0212bd5911773",...
from pycket import values from pycket.base import W_Object from pycket.cont import call_cont, continuation, BaseCont from pycket.error import SchemeException from rpython.rlib import jit # This is a Scheme_Parameterization in Racket class RootParameterization(object): def...
{ "content_hash": "c0ac21b4148cb25324b668c2cc27257f", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 90, "avg_line_length": 31.51875, "alnum_prop": 0.5984533016061868, "repo_name": "krono/pycket", "id": "286f7e29b3494263f570985990966cbcc0aedc85", "size": "5044", "binary...
import re from VerseTools import Verse from SyllableTools import isVowel from SyllableTools import isVisarga from SyllableTools import isAnusvara # since we only care about consonants for this figure, we need to get rid of vowels def getConsonants(line): consonants = [] for syllable in line: for i in xrange(...
{ "content_hash": "c36d7b6a50697601ffd03ecb003ff471", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 119, "avg_line_length": 24.727272727272727, "alnum_prop": 0.7218137254901961, "repo_name": "imurchie/citra", "id": "9b27fd9cfaffd7b15e5eea1667705f4f8b882376", "size": "922"...
print ("gg")
{ "content_hash": "62e69b20ba97638a746d08786b009e70", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 12, "avg_line_length": 12, "alnum_prop": 0.5833333333333334, "repo_name": "JaeGyu/PythonEx_1", "id": "d6e20f1db31a2aeef418a2a5a0a28ee4d538d711", "size": "37", "binary": fa...
"""Utilities for interacting with Amazon s3 service.""" import re import boto from pinball.config.pinball_config import PinballConfig from pinball.config.utils import get_log __author__ = 'Mao Ye, Changshu Liu' __copyright__ = 'Copyright 2015, Pinterest, Inc.' __credits__ = ['Mao Ye', 'Changshu Liu'] __license__ =...
{ "content_hash": "9d1f89e3d3b1ac7b71f72868f650cad9", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 78, "avg_line_length": 28.171875, "alnum_prop": 0.6389351081530782, "repo_name": "pinterest/pinball", "id": "57f6148080f7a3aaff44b22b3deb76277557c4a0", "size": "2384", "b...
from ethereum import tester from datetime import datetime, date import math import pytest slow = pytest.mark.slow from utilRelay import dblSha256Flip, disablePyethLogging disablePyethLogging() class TestBtcChain(object): CONTRACT_DEBUG = 'test/btcChain_debug.se' ETHER = 10 ** 18 ANC_DEPTHS = [1, 4, 1...
{ "content_hash": "f715ea820bf369198c8b5c6f23ca2264", "timestamp": "", "source": "github", "line_count": 261, "max_line_length": 97, "avg_line_length": 27.896551724137932, "alnum_prop": 0.5901661859634666, "repo_name": "ethers/btcrelay", "id": "c478154c221e335738eacf572460e844b7976800", "size": "728...
"""Converts an EFP potential to the corresponding Polarizable Embedding potential """ import sys import fileinput import numpy def labelize(label): """the goal here is to split the label into more sensible parts (count and atom label) """ idx = int(label[1:3]) symbol = label[3:] return (i...
{ "content_hash": "ec7a0d793a506e84f3bd88713f3c6db9", "timestamp": "", "source": "github", "line_count": 237, "max_line_length": 93, "avg_line_length": 27.848101265822784, "alnum_prop": 0.5642424242424242, "repo_name": "cstein/dalton-scripts", "id": "2332493972900b132559cfe0eb2433a99b7f7e17", "size"...
from csnAll import * from csnAPIPublic import GetAPI import os.path api = GetAPI("2.5.0") # define project dummyLib = api.CreateStandardModuleProject("DummyLib", "library") # dependencies # (four depends on three that should be also added implicitly) dummyLib.AddProjects([two, four]) # source folders dummyLib.AddLibra...
{ "content_hash": "1bf95522abee4dbac652f7dadc2201a9", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 68, "avg_line_length": 32.76, "alnum_prop": 0.7594627594627594, "repo_name": "msteghofer/CSnake", "id": "49e929d94f92f7e4f79821e8741571150f6b57d1", "size": "848", "binary...
import csv import os import pandas as pd import unittest from india.geo.states import IndiaStatesMapper class TestPreprocess(unittest.TestCase): def test_get_state_name_to_iso_code_mapping(self): self.assertEqual( IndiaStatesMapper.get_state_name_to_iso_code_mapping( "DADRA AN...
{ "content_hash": "eac28b6bcf1af4bbd7a84416816292e5", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 106, "avg_line_length": 44.72527472527472, "alnum_prop": 0.6191646191646192, "repo_name": "datacommonsorg/data", "id": "73a760d38c1bd8edc970f3e57aba00b71f1510c3", "size": "...
import unittest import os # Add parent dir to path to import utils import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from test_cases import utils class CRMBatch(unittest.TestCase): @utils.allow(apis=['crm'], capabilities=['can_crm_batch']) def test...
{ "content_hash": "42002d3ee06f9c7d5fec6ce071e83ba3", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 76, "avg_line_length": 27.515151515151516, "alnum_prop": 0.5627753303964758, "repo_name": "Kloudless/kloudless-python", "id": "ae06479d86144c4b372e3765d7e3e7bb3dff98ab", "s...
""" Copyright (c) 2015-2022 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from collections import namedtuple import json from pathlib import Path from typing import Any, Dict from atomic_reactor.plugins.fetch_d...
{ "content_hash": "b958b5635b35d7eb6e6fe0e7885dcc68", "timestamp": "", "source": "github", "line_count": 2470, "max_line_length": 100, "avg_line_length": 38.000404858299596, "alnum_prop": 0.5322977594528079, "repo_name": "fr34k8/atomic-reactor", "id": "8266363c345db8222b67464a05e23c1bbd252f0a", "siz...
import pika import sys connection = pika.BlockingConnection(pika.ConnectionParameters( host='localhost')) channel = connection.channel() channel.queue_declare(queue='task_queue', durable=True) message = ' '.join(sys.argv[1:]) or "Hello World!" channel.basic_publish(exchange='', routing_...
{ "content_hash": "06a2d63e792bfa327ee25544a2c2b302", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 69, "avg_line_length": 31.944444444444443, "alnum_prop": 0.591304347826087, "repo_name": "maxis1314/pyutils", "id": "2193d63a1c7ead0f4a34a4f5ae0b0beb60efdde4", "size": "597...
""" Scan picamera settings to see how they affect image and select prefered settings. """ import picamera scan_settings = {'sharpness': range(0, 125, 25), 'contrast': range(0, 125, 25), 'brightness': range(0, 125, 25) 'saturation': range(0, 125, 25)} for setting in ...
{ "content_hash": "174b1f85b3608483ee309f43a95223fc", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 81, "avg_line_length": 24.78787878787879, "alnum_prop": 0.6662591687041565, "repo_name": "kbsezginel/raspberry-pi", "id": "6f027d6081d954215ab5adb36870d81fd5c90296", "size"...
import json from flask import Flask from flask_track_usage import TrackUsage from flask_track_usage.storage.redis_db import RedisStorage from datetime import datetime app = Flask(__name__) redis = RedisStorage() track = TrackUsage(app, redis) @app.route('/') def index(): return "ok" @track.exclude @app.route(...
{ "content_hash": "12d919a3134b7fccfdc2d3ae1875e44b", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 72, "avg_line_length": 21.896551724137932, "alnum_prop": 0.7070866141732284, "repo_name": "ipinak/flask-track-usage", "id": "8eb99da8329c79eb1496bf800ec8ca6afbbf908f", "siz...
"""Controllers for task queue handlers.""" from __future__ import annotations import json from core.controllers import acl_decorators from core.controllers import base from core.domain import email_manager from core.domain import exp_fetchers from core.domain import exp_services from core.domain import feedback_serv...
{ "content_hash": "e28b6a99123088538ea250fb988b8ad6", "timestamp": "", "source": "github", "line_count": 246, "max_line_length": 80, "avg_line_length": 38.78455284552845, "alnum_prop": 0.6292841421234672, "repo_name": "oppia/oppia", "id": "2d027a76d9cf22e028ed0765e99ae489a479e3fc", "size": "10146", ...
from __future__ import unicode_literals from __future__ import absolute_import from django.contrib import admin from .models import Gallery, GalleryItem admin.site.register(Gallery) admin.site.register(GalleryItem)
{ "content_hash": "0d22ff70dc5d35a3ed96e772de26d4e6", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 40, "avg_line_length": 21.9, "alnum_prop": 0.7990867579908676, "repo_name": "DjenieLabs/django-magic-gallery", "id": "056fa3e0776d66bf9f6abbf03bf35ef9a7b3d98c", "size": "24...
''' Tests Plaid ''' import datetime from unittest import mock import pytest import authentication.plaid_wrapper as PlaidMiddleware import plaid from plaid.api.transactions import Transactions from plaid_test_decorators import mock_plaid_balance, \ mock_plaid_accounts, mock_plaid_transactions def setup_module(cls)...
{ "content_hash": "8bf09955a9ef2cf46f3723a06e29753a", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 89, "avg_line_length": 29.546875, "alnum_prop": 0.6213643574828134, "repo_name": "Neitsch/ASE4156", "id": "bba6645e19c7d4684af3a474b9f3f14cf119350a", "size": "3782", "bi...
import string import os import struct import e32 from audio import * def load_voice(vofilename): global voice, voicefile if voice.has_key(vofilename): tempfile=file(THIS_PATH+u'temp.wav','wb') voicefile.seek(voice[vofilename][0]) tempfile.seek(0) tempfile.write(voicefile.read(vo...
{ "content_hash": "7e512defa4ddf88d110d992bb127897b", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 60, "avg_line_length": 23.859649122807017, "alnum_prop": 0.6242647058823529, "repo_name": "flyher/pymo", "id": "232710db6bca5f7beaacc40a15b25f8ee1ec0da7", "size": "1987", ...
import random # shuffled_deck: will return a shuffled deck to the user # input: # output: a list representing a shuffled deck def shuffled_deck(): basic_deck = range(2, 15) * 4 random.shuffle(basic_deck) return basic_deck # player_turn: takes in a player name, player_name, and draws/removes a card from ...
{ "content_hash": "309d721757f823f4d155a79e23baeb85", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 103, "avg_line_length": 26.76, "alnum_prop": 0.6243148978574987, "repo_name": "bensk/CS9", "id": "e492e674b86dae23986a6d3162577835b8b65c3e", "size": "2007", "binary": fal...
from django.shortcuts import render from fossevents.events import services as event_services def homepage(request): ctx = { 'events': event_services.get_public_event_listings() } return render(request, 'pages/home.html', ctx)
{ "content_hash": "46f7c42aa18415e4cafdd7602af7f99e", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 60, "avg_line_length": 27.555555555555557, "alnum_prop": 0.7137096774193549, "repo_name": "vipul-sharma20/fossevents.in", "id": "dd8eb3d2ffdb0150765ea420dd95d93aa78a8292", "...
logprint ("Starting EVLA_pipe_fluxflag.py", logfileout='logs/fluxflag.log') #time_list=runtiming('fluxflag', 'start') default('plotcal') caltable='fluxgaincal.g' xaxis='time' yaxis='amp' subplot=111 iteration='' plotcal() logprint ("Finished EVLA_pipe_fluxflag.py", logfileout='logs/fluxflag.log') #time_list=runtimin...
{ "content_hash": "757c7d7c39027e0dd29ef663b30f2240", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 75, "avg_line_length": 22.375, "alnum_prop": 0.7402234636871509, "repo_name": "e-koch/VLA_Lband", "id": "fe0af85f92166356feca752fbdfa5566ea4df872", "size": "1863", "binar...
__author__ = 'jhala' import re import Helpers import logging import logging.config import json logging.config.fileConfig('logging.conf') logger = logging.getLogger(__name__) def ToDict(matlabFeatureOutputFile): isData=False imgDict = {} featureName='' stat=0 for line in open(matlabFeatureOutputFi...
{ "content_hash": "bf29b47f949ff26db4b68420e8b201a1", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 80, "avg_line_length": 23.233333333333334, "alnum_prop": 0.4878048780487805, "repo_name": "dbk138/ImageRegionRecognition-FrontEnd", "id": "d17341026f1f5b417c09836fa4024d38c4b...
from __future__ import annotations import unittest from unittest import mock import pytest from docker import APIClient, types from docker.constants import DEFAULT_TIMEOUT_SECONDS from parameterized import parameterized from airflow.exceptions import AirflowException from airflow.providers.docker.operators.docker_sw...
{ "content_hash": "4bc3c9d8aef4e216d0ba4cbe8980f1c4", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 109, "avg_line_length": 44.33516483516483, "alnum_prop": 0.6435741727599454, "repo_name": "cfei18/incubator-airflow", "id": "4751445f58493353c234553e36fb0eed486735bb", "si...
from django.conf.urls import patterns, url from pmsal.bid.views import EntryListView urlpatterns = patterns( 'pmsal.bid.views', url(r'^$', EntryListView.as_view(), name='home'), )
{ "content_hash": "56227955e1f51ea82eb19a94056b4b55", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 53, "avg_line_length": 21.22222222222222, "alnum_prop": 0.7015706806282722, "repo_name": "klebercode/pmsal", "id": "15d8bf16223a0ba8463a1885930678b4390108c3", "size": "207",...
from xml.auto_gen import XMLDAOListBase from sql.auto_gen import SQLDAOListBase from vistrails.core.system import get_elementtree_library from vistrails.db import VistrailsDBException from vistrails.db.versions.v0_9_3 import version as my_version from vistrails.db.versions.v0_9_3.domain import DBVistrail, DBWorkflow, ...
{ "content_hash": "3d14b1db351df340e549671e6e1e3805", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 80, "avg_line_length": 40.96470588235294, "alnum_prop": 0.4922458357265939, "repo_name": "Nikea/VisTrails", "id": "ce764d581d33bf57afe5262987370d92fce12e7a", "size": "8844...
import json import logging import StringIO import unittest from telemetry.internal.backends.remote import trybot_browser_finder from telemetry.internal.browser import browser_options from telemetry.testing import simple_mock from telemetry.testing import system_stub class TrybotBrowserFinderTest(unittest.TestCase): ...
{ "content_hash": "b1a1565d0a897b7e842b1bb34e38c2de", "timestamp": "", "source": "github", "line_count": 499, "max_line_length": 79, "avg_line_length": 41.589178356713425, "alnum_prop": 0.6090685683997494, "repo_name": "Workday/OpenFrame", "id": "faf2060c9e0152f1d010376e88a921d6438e3366", "size": "2...
from django.contrib.contenttypes import generic from mezzanine.pages.models import Page, RichText from hs_core.models import AbstractResource, resource_processor, ResourceFile from mezzanine.pages.page_processors import processor_for from django.db import models from django.contrib.contenttypes.models import ContentTyp...
{ "content_hash": "3bf5d211da9d44c7ce2355f3a5e3388b", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 102, "avg_line_length": 40.15151515151515, "alnum_prop": 0.7358490566037735, "repo_name": "hydroshare/hydroshare_temp", "id": "4a3361ded02f5c208ff4ebd7ae41942c1abd4f75", "s...
from __future__ import absolute_import from builtins import object from proteus import * from proteus.default_p import * from proteus.ctransportCoefficients import smoothedHeaviside from math import * try: from .multiphase import * except: from multiphase import * from proteus.mprans import CLSVOF LevelModelTy...
{ "content_hash": "4c4b9919d93517644a111e14374af18f", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 76, "avg_line_length": 32.73913043478261, "alnum_prop": 0.5916334661354582, "repo_name": "erdc/proteus", "id": "a0ed519a6face2dd5c771dfd7e5d2e650dffdc2c", "size": "1506", ...
import decimal import datetime import pandas as pd from pyspark import pandas as ps from pyspark.pandas.tests.data_type_ops.testing_utils import OpsTestBase class ComplexOpsTest(OpsTestBase): @property def pser(self): return pd.Series([[1, 2, 3]]) @property def psser(self): return p...
{ "content_hash": "3433c47c855f4e83a9667d38f10617a2", "timestamp": "", "source": "github", "line_count": 347, "max_line_length": 99, "avg_line_length": 35.77521613832853, "alnum_prop": 0.5749154180763654, "repo_name": "cloud-fan/spark", "id": "cc9a0bf4a7430c38449efcbe03fd96b01fa47a5b", "size": "1319...
"""Support for powering relays in a DoorBird video doorbell.""" import datetime import logging from homeassistant.components.switch import SwitchEntity import homeassistant.util.dt as dt_util from .const import DOMAIN, DOOR_STATION, DOOR_STATION_INFO from .entity import DoorBirdEntity _LOGGER = logging.getLogger(__n...
{ "content_hash": "443632cc5a6e7f58c791988b212c452c", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 83, "avg_line_length": 31.597826086956523, "alnum_prop": 0.6308909528723771, "repo_name": "tchellomello/home-assistant", "id": "1e4cb81a5eb67cf0023697807175ed4e0377a669", "...
import logging import os import sys from leapp.compat import string_types from leapp.dialogs import Dialog from leapp.exceptions import MissingActorAttributeError, WrongAttributeTypeError from leapp.models import Model from leapp.tags import Tag from leapp.utils.meta import get_flattened_subclasses from leapp.models....
{ "content_hash": "abf098ae5a8e9ef7c1eb94f7a4289b51", "timestamp": "", "source": "github", "line_count": 278, "max_line_length": 120, "avg_line_length": 38.881294964028775, "alnum_prop": 0.6345637894347304, "repo_name": "vinzenz/prototype", "id": "015b011dea9bca00f766dd72eff408c4a7967d46", "size": "...
import subprocess import json import requests from config import get_value, VALUE_HEROKU_TOKEN def is_toolbelt_installed( default_command=["heroku", "--version"], default_test_string="heroku-toolbelt" ): try: p = subprocess.Popen( default_command, stdout=subprocess.PIPE,...
{ "content_hash": "d9ee8d888b9749e6662ac6fa1e266842", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 64, "avg_line_length": 19.73469387755102, "alnum_prop": 0.6080661840744571, "repo_name": "wercker/wercker-cli", "id": "4bae68209b11308448139b76b811c0915fc3b9dc", "size": "9...
from setuptools import setup, find_packages from provy import __version__ setup( name='provy', version=__version__, description="provy is an easy-to-use server provisioning tool.", long_description="provy is an easy-to-use server provisioning tool.", keywords='provisioning devops infrastructure ser...
{ "content_hash": "9e0211e507506949515b3860f6c4f1c6", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 73, "avg_line_length": 28.441860465116278, "alnum_prop": 0.5911692559280458, "repo_name": "python-provy/provy", "id": "bce6fab84b564db95ece139e367389f9ecb0198e", "size": "1...