text
stringlengths
4
1.02M
meta
dict
from setuptools import setup import elifedbtools with open('README.rst') as fp: readme = fp.read() with open('requirements.txt') as f: install_requires = f.read().splitlines() setup(name='elifedbtools', version=elifedbtools.__version__, description='Tools for article and production data storage', ...
{ "content_hash": "1ad30563a57eebd3e0aa32f8ba5d4b73", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 64, "avg_line_length": 31.482758620689655, "alnum_prop": 0.6506024096385542, "repo_name": "elifesciences/elife-db-tools", "id": "fd992bb118deacf004d70e87da1694b37155fc5c", ...
import re import copy import sys import spec_tables import sackgrp def name_to_index(string, name_table): i = 0 for name in name_table: if string == name: return [1, i] i += 1 return [0, 0] def name_to_index_or_die(string, name_table): [found, idx] = name_to_index(string, ...
{ "content_hash": "375b59c7cfaf65a228e087478dde9f11", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 117, "avg_line_length": 26.238095238095237, "alnum_prop": 0.5269963702359347, "repo_name": "johnkerl/sack", "id": "8e570ca3704fd601b42231d03cdcabc7e8cf5e0f", "size": "4678...
import scrapy from locations.items import GeojsonPointItem import json class MerrillLynchSpider(scrapy.Spider): name = 'merrilllynch' allowed_domains = ['ml.com'] start_urls = ('https://fa.ml.com/',) def parse_branch(self, response): data = json.loads(response.body_as_unicode()) for...
{ "content_hash": "1d6a7e5d0831d22894af0dc2ddd774fc", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 100, "avg_line_length": 35.88235294117647, "alnum_prop": 0.48688524590163934, "repo_name": "iandees/all-the-places", "id": "5c716f9606f2d61dee2c38655c64700041d068ce", "size...
from __future__ import print_function from ... import core from ... import layers from ... import framework def append_cast_op(i, o, prog): """ Append a cast op in a given Program to cast input `i` to data type `o.dtype`. Args: i (Variable): The input Variable. o (Variable): The output V...
{ "content_hash": "36a43053ad0e8ebf5ceb6d4284ab2589", "timestamp": "", "source": "github", "line_count": 336, "max_line_length": 81, "avg_line_length": 41.270833333333336, "alnum_prop": 0.5210211292997764, "repo_name": "tensor-tang/Paddle", "id": "05dfe27303505903533d6404de0e6ffe51a661ad", "size": "...
""" test_make_webpage_rdf.py -- given a uri and optional attributes, make RDF for a webpage entity Version 0.1 MC 2013-12-121 -- Initial version. """ __author__ = "Michael Conlon" __copyright__ = "Copyright 2013, University of Florida" __license__ = "BSD 3-Clause license" __version__ =...
{ "content_hash": "0e0f618a344c600b14fdaac4ac643977", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 68, "avg_line_length": 31.107142857142858, "alnum_prop": 0.6796785304247991, "repo_name": "mconlon17/vivo-1.6-upgrade", "id": "b6ee8496e882c73e0d9f1ca687b1c6fdfb89f83e", "s...
from __future__ import absolute_import, division, print_function import settings import argparse import sys import hashlib import os import logging from source import HttpSource from source import FileSource if sys.version_info[0] < 3: from ConfigParser import SafeConfigParser else: from configparser import ...
{ "content_hash": "452bb8b21d30313021a0c55e89cc98dd", "timestamp": "", "source": "github", "line_count": 258, "max_line_length": 124, "avg_line_length": 39.93798449612403, "alnum_prop": 0.5987965838509317, "repo_name": "bseeger/fcrepo-sample-dataset-tests", "id": "8ed01def389cef817c14ad59c886d43efc7b3...
""" Tests For Goodness Weigher. """ from jacket.storage.scheduler.weights import goodness from jacket.storage import test from jacket.tests.storage.unit.scheduler import fakes class GoodnessWeigherTestCase(test.TestCase): def setUp(self): super(GoodnessWeigherTestCase, self).setUp() def test_goodnes...
{ "content_hash": "3fbf0a9016001906fd8fd2167b60133d", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 71, "avg_line_length": 32.71891891891892, "alnum_prop": 0.541714852139435, "repo_name": "HybridF5/jacket", "id": "928da51f4f7f06539465dcea79972e3d89c3adc7", "size": "6663"...
"""The main URLconf for the project.""" # We'll use Django's tools for parsing URLs/Routes. from django.conf.urls import include, url # Define the URLs/Routes for the project. urlpatterns = [ # This pulls in the URLs for the ``health`` app. # It will prefix all URLs from that app with ``/health``. url(r'...
{ "content_hash": "31502e17894cd52a04388ba4fd3f976a", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 61, "avg_line_length": 27.923076923076923, "alnum_prop": 0.6804407713498623, "repo_name": "0xadada/dockdj", "id": "473c5d31eb768ed2159a0db1197afbc42d3afa77", "size": "387",...
"""Localize route predicate.""" def language(field): """Create language predicate for given url match field.""" def predicate(info, request): """Check whether language is one of the defaults.""" if field in info["match"] and info["match"][field] in request.registry["localize"]["locales"]["ava...
{ "content_hash": "8cb82cdc69b8a1a8f63c49ae9794cfe6", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 115, "avg_line_length": 30.0625, "alnum_prop": 0.6611226611226612, "repo_name": "fizyk/pyramid_localize", "id": "9230881e6592725ea5f1d462309626b6508b73e1", "size": "697", ...
from django.http import HttpResponse from django.http import HttpResponseRedirect from django.template import RequestContext from django.shortcuts import render_to_response from models import Region,Egroups,ZoneAllowedResourceType,TopLevelAllocationByZone,TopLevelAllocation from forms import RegionForm from django.db.m...
{ "content_hash": "c1771e1ba52657435ae7b4a1da3798ff", "timestamp": "", "source": "github", "line_count": 478, "max_line_length": 338, "avg_line_length": 47.50209205020921, "alnum_prop": 0.7395842508588039, "repo_name": "cernops/CloudMan", "id": "2847ad67479f1347e4e6b44fb667b1fd944e2efd", "size": "22...
from dal import autocomplete from django.urls import re_path as url from .models import TModel class LinkedDataView(autocomplete.Select2QuerySetView): def get_queryset(self): qs = super(LinkedDataView, self).get_queryset() possessor = self.forwarded.get('possessor', None) secret = self....
{ "content_hash": "e8c0905166bc998eeaafd8d72e78a4ca", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 57, "avg_line_length": 21.133333333333333, "alnum_prop": 0.6214511041009464, "repo_name": "yourlabs/django-autocomplete-light", "id": "8b839af10f4b074aadd6a8052a2fc5ab7954867...
''' @author: xiaowing @license: Apache Lincese 2.0 ''' import psycopg2 import sys sys.path.append('...') import settings class DbUtil(): def __init__(self): self.conn = None self.config = settings.TinyssoSettings() def OpenDbConnection(self): try: se...
{ "content_hash": "73bb58b4f5dbbb463824356d23107dc4", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 160, "avg_line_length": 38.53448275862069, "alnum_prop": 0.516331096196868, "repo_name": "xiaowing/tinysso", "id": "ccc7724cb43549f5c1a1c2aa8ffe8b68784672e0", "size": "2235...
import os import signal import subprocess import logging import socket import time import redis logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s %(message)s') redis_ver = '2.6.13' redis_bdir = '/tmp/cache-' + os.environ['USER'] + '-systemless_test' redis_url = redis_bdir +...
{ "content_hash": "5084cf0efe5d5c137528da1749702732", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 101, "avg_line_length": 34.18012422360248, "alnum_prop": 0.5636925313465383, "repo_name": "sajuptpm/contrail-controller", "id": "d05604c0d8217774936fbddca02197567df2bc32", ...
from google.cloud import dialogflowcx_v3beta1 async def sample_validate_flow(): # Create a client client = dialogflowcx_v3beta1.FlowsAsyncClient() # Initialize request argument(s) request = dialogflowcx_v3beta1.ValidateFlowRequest( name="name_value", ) # Make the request response...
{ "content_hash": "ed25723c88c0c2a89b30e7cb289d3573", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 61, "avg_line_length": 25.105263157894736, "alnum_prop": 0.7211740041928721, "repo_name": "googleapis/python-dialogflow-cx", "id": "7948018f4e09a8d3d1b28231299f2283d91c615b",...
"""The multinic extension.""" import webob from webob import exc from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova import compute from nova import exception from nova import log as logging LOG = logging.getLogger(__name__) authorize = extensions.extension_authorizer('compute', ...
{ "content_hash": "7b33a9a8f1d5ef716e42ed8a630c821f", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 79, "avg_line_length": 34.51851851851852, "alnum_prop": 0.6570100143061517, "repo_name": "eneabio/nova", "id": "74f3d3bf2b3eb36bc0ad370a4a38aa0aca77f8b0", "size": "3426", ...
"""Support for Rheem EcoNet thermostats.""" from pyeconet.equipment import EquipmentType from pyeconet.equipment.thermostat import ThermostatFanMode, ThermostatOperationMode from homeassistant.components.climate import ClimateEntity from homeassistant.components.climate.const import ( ATTR_TARGET_TEMP_HIGH, AT...
{ "content_hash": "eedbba2fb26593a68673cd2b3bd0bd5c", "timestamp": "", "source": "github", "line_count": 237, "max_line_length": 86, "avg_line_length": 32.43037974683544, "alnum_prop": 0.6307572209211554, "repo_name": "lukas-hetzenecker/home-assistant", "id": "24bac5164667f99a69bbc6accd6e4565f21c7b94"...
import mock import time import logging from oslo_config import cfg from networking_vsphere.agent import ovsvapp_agent from networking_vsphere.common import constants as ovsvapp_const from networking_vsphere.common import error from networking_vsphere.tests import base from networking_vsphere.tests.unit.drivers impor...
{ "content_hash": "e536f9f8f992532ed45e179a277d3da8", "timestamp": "", "source": "github", "line_count": 1957, "max_line_length": 96, "avg_line_length": 52.59018906489525, "alnum_prop": 0.5454192131676366, "repo_name": "VTabolin/networking-vsphere", "id": "4ffe6117a0061c7fbfd21e7071edd86f3be78ea7", ...
"""SSD Keras-based MobilenetV1 FPN Feature Extractor.""" import tensorflow as tf from object_detection.meta_architectures import ssd_meta_arch from object_detection.models import feature_map_generators from object_detection.models.keras_models import mobilenet_v1 from object_detection.models.keras_models import model...
{ "content_hash": "fd8697aa4f12f9b2e4787a92b2129413", "timestamp": "", "source": "github", "line_count": 224, "max_line_length": 80, "avg_line_length": 44.455357142857146, "alnum_prop": 0.6700140590480016, "repo_name": "alexgorban/models", "id": "d2d276060018e5f64f1616c18cf7fd971965bf5e", "size": "1...
from swift3.controllers.base import Controller, bucket_operation from swift3.etree import Element, tostring from swift3.response import HTTPOk, S3NotImplemented class VersioningController(Controller): """ Handles the following APIs: - GET Bucket versioning - PUT Bucket versioning Those APIs ar...
{ "content_hash": "0a7934b673767c651b29892f492f2609", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 72, "avg_line_length": 26.96969696969697, "alnum_prop": 0.6550561797752809, "repo_name": "tumf/swift3", "id": "c5da917afae6e145ea93c9f2709b4f254b0a081a", "size": "1486", ...
import WebIDL def WebIDLTest(parser, harness): try: parser.parse(""" enum TestEnumDuplicateValue { "", "" }; """) harness.ok(False, "Should have thrown!") except: harness.ok(True, "Enum TestEnumDuplicateValue should throw")
{ "content_hash": "26681c121ee92aba0653ba3947f97956", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 68, "avg_line_length": 24.384615384615383, "alnum_prop": 0.5173501577287066, "repo_name": "sergecodd/FireFox-OS", "id": "51205d209e731e1f30a40877bccfd027724716cd", "size": ...
## # Import Modules # from __future__ import print_function import xml.dom.minidom import codecs from Common.LongFilePathSupport import OpenLongFilePath as open ## Create a element of XML # # @param Name # @param String # @param NodeList # @param AttributeList # # @revel Element # def CreateXmlEleme...
{ "content_hash": "800707194b57e70a83286141c4bea283", "timestamp": "", "source": "github", "line_count": 218, "max_line_length": 99, "avg_line_length": 31.862385321100916, "alnum_prop": 0.5858047797293406, "repo_name": "google/google-ctf", "id": "00cbc4e55e529fef51e4141a5266a494b948b5bf", "size": "7...
from webob import exc from nova.api.openstack import common from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova import compute from nova import exception from nova.openstack.common.gettextutils import _ class ServerMetadataController(wsgi.Controller): """The server metadata AP...
{ "content_hash": "dec211294d09555232fc51729748004c", "timestamp": "", "source": "github", "line_count": 187, "max_line_length": 78, "avg_line_length": 40.11764705882353, "alnum_prop": 0.5598507064782725, "repo_name": "plumgrid/plumgrid-nova", "id": "85556acd60b2a221c504fd32f5a2cdf31667f7d5", "size"...
import copy import json import six from jinja2 import Template, Environment, StrictUndefined, meta, exceptions from st2common import log as logging from st2common.constants.action import ACTION_KV_PREFIX from st2common.constants.system import SYSTEM_KV_PREFIX from st2common.exceptions import actionrunner from st2comm...
{ "content_hash": "93c2b9eb0be99d1db70a87546a626c1b", "timestamp": "", "source": "github", "line_count": 324, "max_line_length": 99, "avg_line_length": 43.351851851851855, "alnum_prop": 0.6403958422326641, "repo_name": "grengojbo/st2", "id": "fe3871d220c09bbfb453f8ea7cba3a0e07f96a19", "size": "14826...
""" Single Channel Noise Reduction ============================== Collection of single channel noise reduction (SCNR) algorithms for speech: - :doc:`Spectral Subtraction <pyroomacoustics.denoise.spectral_subtraction>` [1]_ - :doc:`Subspace Approach <pyroomacoustics.denoise.subspace>` [2]_ - :doc:`Iterative Wiener Fil...
{ "content_hash": "89d75b72db4e9cdcee57597f8b33c168", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 109, "avg_line_length": 40.172413793103445, "alnum_prop": 0.7124463519313304, "repo_name": "LCAV/pyroomacoustics", "id": "842bdbd2bed8f7cd92001b2b2ab8096e7f0b57c0", "size":...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Template.default_archive_template' db.add_column(u'main_template', 'default_archive_template', ...
{ "content_hash": "3ceec58cc1d3ba009fda4d7bbc4616ed", "timestamp": "", "source": "github", "line_count": 302, "max_line_length": 209, "avg_line_length": 83.93377483443709, "alnum_prop": 0.5486823418021146, "repo_name": "anu7495/airmozilla", "id": "ec356f4dbb6cb25b0421d36f98b3ab1e8dccb9bf", "size": "...
""" Note that it been proved that the Kepler-Heisenberg is not fully integrable: Andrzej Maciejewski, Tomasz Stachowiak - 2021 Feb https://www.researchsquare.com/article/rs-272845/v1 """ import copy import numpy as np import sympy as sp import sympy.core.symbol import vorpy.manifold import vorpy.symbolic import vorpy....
{ "content_hash": "7de298a467b798350000042ba90feebd", "timestamp": "", "source": "github", "line_count": 819, "max_line_length": 238, "avg_line_length": 40.66788766788767, "alnum_prop": 0.5919176149157834, "repo_name": "vdods/heisenberg", "id": "3f94479be45c50ce3e3568b75f96d02442c0fb27", "size": "33...
import eventlet import os import socket import sys from oslo.config import cfg from ceilometer.openstack.common import gettextutils from ceilometer.openstack.common import log from ceilometer.openstack.common import rpc cfg.CONF.register_opts([ cfg.StrOpt('host', default=socket.gethostname(), ...
{ "content_hash": "e13918bd7355d97775cff6ea4bef1db3", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 78, "avg_line_length": 42.0921052631579, "alnum_prop": 0.5573616755236012, "repo_name": "citrix-openstack-build/ceilometer", "id": "43754760e101773a98a9851e5e91feb5dd5c3d3c",...
""" Mirror all web pages. Useful if you are living down under. """ from mitmproxy import http def response(flow: http.HTTPFlow) -> None: reflector = b"<style>body {transform: scaleX(-1);}</style></head>" flow.response.content = flow.response.content.replace(b"</head>", reflector)
{ "content_hash": "f388818d39ee276713bfdbb0115637a3", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 80, "avg_line_length": 26.545454545454547, "alnum_prop": 0.6952054794520548, "repo_name": "vhaupert/mitmproxy", "id": "7ee1821d195e12cd28f4c780ce677bf269e17309", "size": "2...
''' Copyright (C) 2016 Turi All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. ''' import unittest import pandas import array from .. import SFrame from pandas.util.testing import assert_frame_equal from sys import version_info clas...
{ "content_hash": "1c2b8fd66c99634c5f2111fd3b77a2c5", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 101, "avg_line_length": 42.26190476190476, "alnum_prop": 0.6214084507042253, "repo_name": "TobyRoseman/SFrame", "id": "2c63162caa430e82431a391568580121818bc4cf", "size": "1...
from praw.exceptions import ClientException, PRAWException from praw.models import Comment, Submission from prawcore import BadRequest import mock import pytest from ... import IntegrationTest class TestComment(IntegrationTest): def test_attributes(self): with self.recorder.use_cassette("TestComment.test...
{ "content_hash": "1419690b69b845a28d88823d38e63fae", "timestamp": "", "source": "github", "line_count": 317, "max_line_length": 79, "avg_line_length": 39.186119873817034, "alnum_prop": 0.611737240379971, "repo_name": "leviroth/praw", "id": "22dcc3bdae79c1429d7a491435054f5b5dbac0c4", "size": "12422"...
"""Learned pooling module.""" from typing import Callable from flax import linen as nn import jax from jax import lax from jax import numpy as jnp def gaussian(M: int, std: float, sym: bool = True) -> jnp.ndarray: # pylint: disable=invalid-name """Returns a Gaussian window. Port of scipy.signal.windows.gaussia...
{ "content_hash": "2f1c84352dd4fade281c3fb785b3fd65", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 98, "avg_line_length": 36.611570247933884, "alnum_prop": 0.6670428893905191, "repo_name": "google-research/chirp", "id": "dc3e0341b6d9283c16cebb1d2f84d9eb606ec7bc", "size"...
import django from django.db.models import signals def create_perm(*func_args, **func_kwargs): """ Creates a fake content type and permission to be able to check for permissions """ from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType ...
{ "content_hash": "5eb861d6f352ed5424588839652c0308", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 83, "avg_line_length": 31.6875, "alnum_prop": 0.6568047337278107, "repo_name": "trbs/django-constance-trbs", "id": "abbc9c58f17864b5fc3de150efcb572db32b5e6c", "size": "1014...
import os from sqlalchemy import Column, ForeignKey, Integer, String, create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship, sessionmaker if os.path.exists('test.db'): os.remove('test.db') # tworzymy instancję klasy Engine do obsługi bazy baza = create_engine...
{ "content_hash": "e1c68965d77eba180d4635fac82d5104", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 73, "avg_line_length": 29.82857142857143, "alnum_prop": 0.7164750957854407, "repo_name": "koduj-z-klasa/python101", "id": "96cebd619aba7705fc02dc39e45d5e2c0775a248", "size"...
import battle import unittest import json FOURUP_HOOK = """{ "href": "https://battleofbits.com/games/four-up/matches/1", "players": { "https://battleofbits.com/players/deepblue": "R", "https://battleofbits.com/players/garry": "B" }, "turn": "https://battleofbits.com/players/deepblue", "loser": "", ...
{ "content_hash": "b1fbebba2604033dbd395c6a29a70e44", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 78, "avg_line_length": 32.160714285714285, "alnum_prop": 0.5452526374236535, "repo_name": "battleofbits/vizzini.py", "id": "e5708ccc6949f389a30cf3806d5c412bcb8132a9", "size...
from collections import OrderedDict class OrderFieldsMixin(object): def order_fields(self): new_fields = OrderedDict() for field_name in self.fields_order: new_fields[field_name] = self.fields[field_name] self.fields = new_fields
{ "content_hash": "5285f6b47b37a6b4b102f40aba196137", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 60, "avg_line_length": 27.3, "alnum_prop": 0.6666666666666666, "repo_name": "muraliselva10/cloudkitty-dashboard", "id": "824996366468d5bbf3fee26f14a21915b3612276", "size": ...
import random import time import docker import pytest from ..helpers import ( force_leave_swarm, requires_api_version, requires_experimental ) from .base import BaseAPIIntegrationTest, TEST_IMG class ServiceTest(BaseAPIIntegrationTest): @classmethod def setup_class(cls): client = cls.get_client_...
{ "content_hash": "cfa2ee7b6f180d4bc77c69226de9344b", "timestamp": "", "source": "github", "line_count": 1441, "max_line_length": 79, "avg_line_length": 42.86814712005552, "alnum_prop": 0.596377057937934, "repo_name": "docker/docker-py", "id": "8ce7c9d57e2f792994329b7b3d788e133af73bbd", "size": "617...
import os from pants.backend.jvm.targets.jar_library import JarLibrary from pants.backend.jvm.targets.java_library import JavaLibrary from pants.backend.jvm.targets.jvm_app import JvmApp from pants.backend.jvm.targets.jvm_binary import JvmBinary from pants.backend.jvm.tasks.bundle_create import BundleCreate from pants...
{ "content_hash": "a5c9814933013ea451192483dde9afb6", "timestamp": "", "source": "github", "line_count": 257, "max_line_length": 100, "avg_line_length": 44.24124513618677, "alnum_prop": 0.6163588390501319, "repo_name": "wisechengyi/pants", "id": "9d57073601884163e98ef52845882634a9777c54", "size": "1...
"""Veridu Python SDK See: https://github.com/veridu/veridu-python """ from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.rst'), encoding='utf-8') as f:...
{ "content_hash": "cbc5fd70d08d1617a6372303fb70d62b", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 90, "avg_line_length": 24.25, "alnum_prop": 0.6310751104565537, "repo_name": "veridu/veridu-python", "id": "f7b951aedc708cdf0adf63953dcc0489926295d9", "size": "1358", "bi...
import logging import arrow import emission.core.get_database as edb import emission.core.wrapper.entry as ecwe def convert_wrapper_to_entry(key, wrapper): logging.debug("found user_id in wrapper %s" % wrapper["user_id"]) wrapper_entry = ecwe.Entry.create_entry(wrapper["user_id"], key, wrapper) wrapper_en...
{ "content_hash": "67e38686313620f0e66d03fc2afb1727", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 93, "avg_line_length": 40.92156862745098, "alnum_prop": 0.6530905606133206, "repo_name": "yw374cornell/e-mission-server", "id": "b56721dc00448943af4a54f0044319e83ec0b7a7", ...
""" This module contains the functions for iterating the social and climate coupled model (SoCCo)""" import numpy as np import pandas as pd from scipy import stats from . import social as sl from . import climate as cl #### randomUniformF ############################################################ def randomU...
{ "content_hash": "48c69ed2725bc959296a2bbe83444111", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 112, "avg_line_length": 35.36842105263158, "alnum_prop": 0.6029265873015873, "repo_name": "OpenClimate/climate_change_model", "id": "4a6b82c453a29051f91dfba86466d878ca0107a4...
import time from kid_readout.interactive import * #setup = hardware.Hardware() ri = Roach2Baseband() ri.set_modulation_output('high') ncycle = 0 while True: print "cycle",ncycle print " " for dac_atten in [0]: ri.set_dac_atten(dac_atten) df = acquire.new_nc_file(suffix='vna_dac_atten_...
{ "content_hash": "2368c759bb6d5e98540a6af3df48f18f", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 114, "avg_line_length": 25.818181818181817, "alnum_prop": 0.5704225352112676, "repo_name": "ColumbiaCMB/kid_readout", "id": "8975ec75f3ee73a9600e12c713ef890e118d9d94", "siz...
"""Test the python-manta MantaClient.""" from __future__ import absolute_import from __future__ import print_function import re from posixpath import dirname as udirname, basename as ubasename, join as ujoin from common import * import manta #---- globals TDIR = "tmp/test_mantaclient" #---- internal support stuff...
{ "content_hash": "6d907fb60c4d5c611230b184c8543146", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 79, "avg_line_length": 34.564935064935064, "alnum_prop": 0.5962802930678189, "repo_name": "joyent/python-manta", "id": "9a5c079a990c4b5823747ec1d4fd30f89b88aeef", "size": ...
"""Example configurations using the PPO algorithm.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function # pylint: disable=unused-variable import tensorflow as tf from agents import algorithms from agents.scripts import networks def default(): """Default...
{ "content_hash": "51ba4b4b920f96c2444ba3a51b560f5a", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 62, "avg_line_length": 21.10958904109589, "alnum_prop": 0.663854639844257, "repo_name": "google-research/batch-ppo", "id": "4833137db15b8d18e73739f5bb9de52990b7b6e3", "siz...
import logging from pajbot.managers.handler import HandlerManager from pajbot.modules import BaseModule from pajbot.modules import ModuleSetting log = logging.getLogger(__name__) class EmoteLimitModule(BaseModule): ID = __name__.split(".")[-1] NAME = "Emote Limit" DESCRIPTION = "Times out users who post...
{ "content_hash": "238a7ee11f79504516511c9e417d52ff", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 119, "avg_line_length": 35.43478260869565, "alnum_prop": 0.5556237218813906, "repo_name": "pajlada/pajbot", "id": "01fbb68fdd7f923b0d4a8e8ac55b4d7e903b6062", "size": "4890...
"""Tools for data conversion and presentation.""" import numpy as np def get_wind_components(speed, wdir): r"""Calculate the U, V wind vector components from the speed and direction. Parameters ---------- speed : array_like The wind speed (magnitude) wdir : array_like The wind di...
{ "content_hash": "4cb7fecfd1ca7a29ca04fc26d858dcd3", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 79, "avg_line_length": 25.384615384615383, "alnum_prop": 0.6166666666666667, "repo_name": "dopplershift/siphon", "id": "50e8c1449b809db1c5535369c1383bdd8aae685c", "size": "...
""" Unit tests for landlab.components.radiation.radiation """ from nose.tools import assert_equal, assert_true, assert_raises, with_setup from numpy.testing import assert_array_almost_equal try: from nose.tools import assert_is_instance except ImportError: from landlab.testing.tools import assert_is_instance im...
{ "content_hash": "46466f40d62f867a943d862c54397388", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 78, "avg_line_length": 30.807692307692307, "alnum_prop": 0.6320224719101124, "repo_name": "csherwood-usgs/landlab", "id": "588d44d8becb372ada6c4441aa9709f7df60145d", "size...
import aquests import route_guide_pb2 def test_grpc_404 (): stub = aquests.grpc ("http://127.0.0.1:5000/routeguide.RouteGuide_") point = route_guide_pb2.Point (latitude=409146138, longitude=-746188906) for i in range (3): stub.GetFeature (point) aquests.fetchall ()
{ "content_hash": "f10fe4f6fb95e103372d3cd40d7e1b0a", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 73, "avg_line_length": 30.333333333333332, "alnum_prop": 0.7289377289377289, "repo_name": "hansroh/aquests", "id": "f99f649a7f88b12758abd38a41c354052d287f56", "size": "273",...
from PySide6.QtCore import * # type: ignore from PySide6.QtGui import * # type: ignore from PySide6.QtWidgets import * # type: ignore from .gitview import GitView class Ui_MainWindow(object): def setupUi(self, MainWindow): if not MainWindow.objectName(): MainWindow.setObjectName(u"MainWind...
{ "content_hash": "3689a4caffdb16b9be6da3616ed705ce", "timestamp": "", "source": "github", "line_count": 281, "max_line_length": 142, "avg_line_length": 49.39857651245551, "alnum_prop": 0.6941862978171601, "repo_name": "timxx/gitc", "id": "12eae09bb42e2959be0b2200784c5c852d25465a", "size": "14267", ...
from __future__ import absolute_import from sentry.utils.rust import merge_rust_info_frames, starts_with, strip_symbol STACKTRACE = """ stacktrace: stack backtrace: 0: 0x111e51cf4 - backtrace::backtrace::trace::h38e3b1de9f341e04 at /.cargo/registry/src/github.com-1ecc6299db9ec823/ba...
{ "content_hash": "3dd8893a6a1884cbf99f3a7cdc0ad986", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 115, "avg_line_length": 38.53448275862069, "alnum_prop": 0.5873228933631618, "repo_name": "mvaled/sentry", "id": "028072f50917bd9874ed4fba3706dd812719bd58", "size": "6705"...
from .codec import PolylineCodec __version__ = '1.4.0' def decode(expression, precision=5, geojson=False): """ Decode a polyline string into a set of coordinates. :param expression: Polyline string, e.g. 'u{~vFvyys@fS]'. :param precision: Precision of the encoded coordinates. Google Maps uses 5, Ope...
{ "content_hash": "6abea67695c76911605085ecdc41c639", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 114, "avg_line_length": 38.666666666666664, "alnum_prop": 0.6857366771159875, "repo_name": "frederickjansen/polyline", "id": "99bd7b692532a1da1931d61104919686d42ca9a9", "si...
from limbo.breadcrumbs.breadcrumbs import Breadcrumbs,BreadcrumbsNotSet from django.contrib.flatpages.models import FlatPage from django.http import Http404 def breadcrumbs_for_flatpages(request,flatpage): """ given request and flatpage instance create breadcrumbs for all flat pages """ if not hasattr(requ...
{ "content_hash": "c73c6888c48134fe7c57bf6c64b7af78", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 80, "avg_line_length": 39.24, "alnum_prop": 0.5978593272171254, "repo_name": "gdoermann/django-limbo", "id": "f5cdb7186736eb29aaaaefaa8e28142f1c1b80e5", "size": "1986", "...
import time class Log: """This class handles the server log.""" def __init__(self, world): self.__time_started = int(time.time()) self.__world = world def write(self, message): if self.__world.config["log"]["enable"]: print("[{0}] {1}".format(int(time.time())-self.__time_started, message)) def debug(s...
{ "content_hash": "fbed20c4954c063c62805d6685a83c1a", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 82, "avg_line_length": 31.125, "alnum_prop": 0.6224899598393574, "repo_name": "pariahsoft/DennisX", "id": "896a6f7064a7d6be9e0e6585600370eb25b22fce", "size": "1864", "bin...
from oscar.core.loading import get_model Notification = get_model('communication', 'Notification') def notifications(request): ctx = {} if getattr(request, 'user', None) and request.user.is_authenticated: num_unread = Notification.objects.filter( recipient=request.user, date_read=None).co...
{ "content_hash": "c828cdadc998f15091a16dda0fe36290", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 72, "avg_line_length": 32.833333333333336, "alnum_prop": 0.6903553299492385, "repo_name": "django-oscar/django-oscar", "id": "db885c799fe21fd1041ec37700e6d82ac1ac9ff7", "si...
""" This module contains Pipeline class that represents a central control mechanism over a sequential image processing pipeline. It controls all the available image processing categories, handles processing results and works as an mediator between the algorithms and UI. """ from nefi2.model.categories._category i...
{ "content_hash": "3ba79983a4b592c3d20487777a6d84a2", "timestamp": "", "source": "github", "line_count": 699, "max_line_length": 110, "avg_line_length": 37.659513590844064, "alnum_prop": 0.5566403282175961, "repo_name": "LumPenPacK/NetworkExtractionFromImages", "id": "d9b07a2ec0a7b142b6d994086a788da0b...
from nanpy.arduinoboard import ArduinoObject from nanpy.arduinoboard import (arduinoobjectmethod, returns) class DHT(ArduinoObject): DHT11 = 11 DHT22 = 22 DHT21 = 21 AM2301 = 21 def __init__(self, pin, _type, count=6, connection=None): ArduinoObject.__init__(self, connection=connection) ...
{ "content_hash": "45bf359bfd0e26fce501be25c392e5be", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 61, "avg_line_length": 22.892857142857142, "alnum_prop": 0.6505460218408736, "repo_name": "ryanvade/nanpy", "id": "f0b8302c9a68c27f79a300498d2119f1aa4ed84a", "size": "641",...
from __future__ import absolute_import, division, print_function, with_statement import utils from tornado.web import addslash, authenticated from tornado.gen import coroutine from . import BaseHandler, route, check_level @route(r"/web/") class IndexHandler(BaseHandler): @authenticated @addslash def ge...
{ "content_hash": "ec93825942a56a8eb8ca160a4519702d", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 115, "avg_line_length": 29.529411764705884, "alnum_prop": 0.6523904382470119, "repo_name": "lokhman/sharedown", "id": "de0f100fd96738e2f09ea807f931a87bdd32adbf", "size": "3...
import random import string from datetime import datetime from urllib.error import HTTPError from ..viaggiatreno import viaggiatreno, format def _gen_ran_string(string_len: int = 16): return ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase) for _ in range(string_len)) def process_inline_qu...
{ "content_hash": "0124bc2a13f14bb9f2b34f811c56ecec", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 125, "avg_line_length": 45.80542986425339, "alnum_prop": 0.4168724686357799, "repo_name": "MarcoBuster/OrarioTreniBot", "id": "a090d6902dc1604d37bfb9926304c935b2648f2a", "...
"""Module containing the core callback. """ from soc.tasks.updates import project_conversion from soc.tasks.updates import proposal_conversion from soc.tasks.updates import role_conversion class Callback(object): """Callback object that handles interaction between the core. """ API_VERSION = 1 def __init_...
{ "content_hash": "f782862d306dbf1a02dd61a144ba0b78", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 78, "avg_line_length": 30.303571428571427, "alnum_prop": 0.7324690630524455, "repo_name": "adviti/melange", "id": "47aab2cb9a128a20b5f1b6c40e052beed59c04d2", "size": "2282"...
from .dataUser import DataUser __all__ = ["Property"] class Property(DataUser): """ Store a value associated with a DataObject Properties can be be accessed like methods. A method call like:: a.P() for a property ``P`` will return values appropriate to that property for ``a``, the `owner`...
{ "content_hash": "45ab49ff45e4d63bcf4be009d26afa5b", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 78, "avg_line_length": 26.019607843137255, "alnum_prop": 0.5591559909570459, "repo_name": "mwatts15/YAROM", "id": "754922f6a550f347f6d75e1bb0b405ae631d2af5", "size": "2654...
import copy from datetime import timedelta from textwrap import dedent from typing import Dict, no_type_check import warnings import numpy as np from pandas._libs import lib from pandas._libs.tslibs import NaT, Timestamp from pandas._libs.tslibs.frequencies import is_subperiod, is_superperiod from pandas._libs.tslibs...
{ "content_hash": "a0260599246287a0ecb69b7a32e83af5", "timestamp": "", "source": "github", "line_count": 1780, "max_line_length": 79, "avg_line_length": 32.613483146067416, "alnum_prop": 0.5455109212430235, "repo_name": "cbertinato/pandas", "id": "632b5a9c5e0024135b873c0c307af85842400425", "size": "...
import datetime from south.db import db from south.v2 import DataMigration from django.db import models try: import cPickle as pickle except ImportError: import pickle from src.utils.utils import to_str, to_unicode #from src.typeclasses.models import PackedDBobject,PackedDict,PackedList from src.players.models...
{ "content_hash": "27d6d0618947f6c8dad4c3f4e363bdf9", "timestamp": "", "source": "github", "line_count": 474, "max_line_length": 187, "avg_line_length": 46.37552742616034, "alnum_prop": 0.5802019834409972, "repo_name": "TaliesinSkye/evennia", "id": "d7d91294fd0af44929ab9117d1285c81be2537d0", "size":...
from swgpy.object import * def create(kernel): result = ResourceContainer() result.template = "object/resource_container/shared_resource_container_organic_food.iff" result.attribute_template_id = -1 result.stfName("resource_container_n","organic_food_small") #### BEGIN MODIFICATIONS #### #### END MODIFICA...
{ "content_hash": "25a64047bc1f47fbe9529e6118c4eb58", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 89, "avg_line_length": 26.76923076923077, "alnum_prop": 0.7241379310344828, "repo_name": "obi-two/Rebelion", "id": "143a4a08124ee9c26333ccb8872d09bd4d965afa", "size": "493"...
import pygame from pytemo import colors, fonts from pytemo.widgets.base import BaseWidget class BarChartWidget(BaseWidget): _data = None _offsets = None def __init__(self, size): BaseWidget.__init__(self, size) def update_data(self, data): if self._data is not None: old_...
{ "content_hash": "d859a4416a9a84dfe3dd504f08bbe52a", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 105, "avg_line_length": 33.61363636363637, "alnum_prop": 0.5405679513184585, "repo_name": "jochil/pytemo", "id": "13302179374f8fb83baa5c97551e75a04ef5b68a", "size": "2958",...
from direct.directnotify import DirectNotifyGlobal from direct.distributed.DistributedObjectAI import DistributedObjectAI class DistributedGardenAI(DistributedObjectAI): notify = DirectNotifyGlobal.directNotify.newCategory("DistributedGardenAI") def sendNewProp(self, todo0, todo1, todo2, todo3): pass ...
{ "content_hash": "549e38a3a968c2cb000430d15a347b60", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 79, "avg_line_length": 35.666666666666664, "alnum_prop": 0.8161993769470405, "repo_name": "ToonTownInfiniteRepo/ToontownInfinite", "id": "34378ce2ebf35f1edc16aae5093ab11a8f92e...
from dataclasses import dataclass from pathlib import PurePath from pants.backend.go.target_types import GoBinaryMainPackageField, GoBinaryTarget, GoPackageTarget from pants.backend.go.util_rules.binary import GoBinaryMainPackage, GoBinaryMainPackageRequest from pants.backend.go.util_rules.build_pkg import BuiltGoPack...
{ "content_hash": "ad4fb49e67570f180b175b9e383201f6", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 135, "avg_line_length": 42.901234567901234, "alnum_prop": 0.7398561151079137, "repo_name": "benjyw/pants", "id": "f0f65292eccaf48c9d13e61f48d29d74475f92d7", "size": "3607",...
import sys import os import pprint def index_directory(path): files = {} count = 0 for dirpath, dirnames, filenames in os.walk(path): for filename in filenames: full_path = os.path.join(dirpath, filename) size = os.stat(full_path).st_size key = '{},{}'.format(siz...
{ "content_hash": "2a3d57dd3a36e2f1eec773df7f6bca09", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 74, "avg_line_length": 27.387096774193548, "alnum_prop": 0.5694935217903416, "repo_name": "davidstrauss/file-reorg-check", "id": "b64fe35a78a84ca36d4c9bbceda59caf2736867c", ...
""" Tests for the Torque/PBS Job """ import sure from mock import Mock from .fixtures import * from metapipe.models import pbs_job def test_qstat_queued(): j = pbs_job.PBSJob('', None) pbs_job.call = Mock(return_value=pbs_job_qstat_queued) j.is_queued().should.equal(True) def test_qstat_running(): ...
{ "content_hash": "a7ceb92a9f0abea7fd64394e984bb467", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 59, "avg_line_length": 20.44736842105263, "alnum_prop": 0.6422136422136422, "repo_name": "Sonictherocketman/metapipe", "id": "20eb398bb3f3efa2c31b80284007c187f3b6055e", "si...
class TrikeActor(TObject): self.TypeID = #FIXME #FIXME class method to register TypeIDs with TObject #Which function should TObject.processEvent() call for events self.handlers = {"832E5EC291334D2193A9D51D90ADAFEA": self.__dict__[create], #TEVentCreateActor "8DBFB5BFDD0B485AA037FFB...
{ "content_hash": "8be7def7d8fc2696bbc7898738a1cb4a", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 117, "avg_line_length": 33.25954198473283, "alnum_prop": 0.6336929079641955, "repo_name": "Dymaxion00/octotrike", "id": "3703f6d4ec6057392cd983209b2fceb7e329823b", "size":...
from __future__ import print_function import unittest import pipgh import pipgh.pipgh class TestMain(unittest.TestCase): def test_init_doc(self): doc = pipgh.__doc__ self.assertTrue(doc != None) self.assertTrue('Usage:' in doc) self.assertTrue('Commands:' in doc) self.ass...
{ "content_hash": "cc5bc41e17a9a501f01b1ce5484daeff", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 108, "avg_line_length": 38.4639175257732, "alnum_prop": 0.44116858751005095, "repo_name": "ffunenga/pipgh", "id": "87f70234dee5221a82a04ea52734f0ccd6fe0650", "size": "3731"...
import re def char_freq_table(filepath): file = open(filepath) chars = file.read().lower().replace(" ", "").replace("\n", "") freqs = {key: 0 for key in chars} for char in chars: freqs[char] += 1 for word in freqs: print "%s: %s" % (word, freqs[word]) char_freq_table('Q20.txt')
{ "content_hash": "0842da86b04e67582ee3ada95b3d1400", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 66, "avg_line_length": 24.384615384615383, "alnum_prop": 0.5678233438485805, "repo_name": "coedfetr/STTP-python", "id": "1c361523bf22c5b536f7afc258a32ce1e011b425", "size": ...
"""Tests for `mvn_tri.py`.""" from absl.testing import absltest from absl.testing import parameterized import chex from distrax._src.distributions.mvn_tri import MultivariateNormalTri from distrax._src.utils import equivalence import jax.numpy as jnp import numpy as np def _get_scale_tril_from_scale_triu(scale_triu...
{ "content_hash": "7e80c7d9f7b7b4860211a43384411fdf", "timestamp": "", "source": "github", "line_count": 251, "max_line_length": 80, "avg_line_length": 39.876494023904385, "alnum_prop": 0.5885702867419322, "repo_name": "deepmind/distrax", "id": "a2c6a1486b19aff7bbc15eded66eb848ec39798e", "size": "10...
import unittest import numpy as np import paddle.fluid as fluid import paddle import paddle.fluid.layers as layers import paddle.fluid.core as core import gradient_checker import paddle.nn.functional as F from decorator_helper import prog_scope class TestSigmoidTripleGradCheck(unittest.TestCase): @prog_scope() ...
{ "content_hash": "da8c935ede90baa0b8dd117511b641d6", "timestamp": "", "source": "github", "line_count": 744, "max_line_length": 82, "avg_line_length": 31.521505376344088, "alnum_prop": 0.565410199556541, "repo_name": "PaddlePaddle/Paddle", "id": "e0c40e20021119dbd01e2f43e9a52cfb1b695a3a", "size": "...
import requests import os from bottle import route, run, template, get, debug, static_file, request, response import json debug(True) http_header = { "content-type": "application/json" } # Core Routing @route('/') def jsontest(): return template('graph_display') # return template('test') @route('/stati...
{ "content_hash": "5004aff903225e43186575042c6db3c2", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 291, "avg_line_length": 33.4, "alnum_prop": 0.6304890219560878, "repo_name": "zhiminJimmyXiang/Pregelix_Graph_UI", "id": "c8264be31c3e130aa61bd7b3fe68c7fe54dc5221", "size"...
from rest_framework import test from waldur_openstack.openstack.tests import fixtures class TenantQuotasTest(test.APITransactionTestCase): def setUp(self): super(TenantQuotasTest, self).setUp() self.fixture = fixtures.OpenStackFixture() self.tenant = self.fixture.tenant self.proje...
{ "content_hash": "a1bbcb812512bb194f0325ef34ab9b83", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 88, "avg_line_length": 51.68, "alnum_prop": 0.6845975232198143, "repo_name": "opennode/waldur-mastermind", "id": "6671a329eb2b8a2a9d2ca13e0c2945c27fe57c3c", "size": "2584",...
from setuptools import setup setup( name='scrapy-tracker', version='0.1.0', url='https://github.com/vkastyniuk/scrapy-tracker', description='A scrapy plugin to track item updates', long_description=open('README.md').read(), author='Viachaslau Kastyniuk', maintainer='Viachaslau Kastyniuk', ...
{ "content_hash": "a2022d055bc01f6a4761536e0f0ae322", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 79, "avg_line_length": 33.42857142857143, "alnum_prop": 0.5769230769230769, "repo_name": "vkastyniuk/scrapy-tracker", "id": "1adde34e6fd0c82d5918251f4455152db05dd055", "siz...
from django import forms from djmoney.forms.fields import MoneyField from foobar.wallet import api as wallet_api from django.utils.translation import ugettext as _ from .. import api class CorrectionForm(forms.Form): balance = MoneyField(label=_('Balance'), min_value=0) comment = forms.CharField(label=_('Comm...
{ "content_hash": "79f549a2b03bf39296f5f2dd96e78cbb", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 76, "avg_line_length": 35.95454545454545, "alnum_prop": 0.634007585335019, "repo_name": "uppsaladatavetare/foobar-api", "id": "d020908fa84f1f3387610d3be871490019ebfe59", "s...
""" FILE: queue_samples_hello_world_async.py DESCRIPTION: These samples demonstrate common scenarios like instantiating a client, creating a queue, and sending and receiving messages. USAGE: python queue_samples_hello_world_async.py Set the environment variables with your own values before running th...
{ "content_hash": "2b10b773c5f8f2624b8906a8184bd806", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 105, "avg_line_length": 33.31428571428572, "alnum_prop": 0.6457975986277873, "repo_name": "Azure/azure-sdk-for-python", "id": "bc33a36a29a97c12bf2bc7532b362e045e441385", "s...
from helper import greeting if __name__ == "__main__": x = 'goodbye' greeting(x)
{ "content_hash": "c3acea24c4de47c7fe34d8ac1c3b1cdb", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 27, "avg_line_length": 17.8, "alnum_prop": 0.5730337078651685, "repo_name": "Ansist/cs3240-labdemo", "id": "c508fa3fa4f025f38f30554d4953ebf2360c591a", "size": "89", "binar...
from ConfigParser import ConfigParser import errno import logging import os class AirflowConfigException(Exception): pass defaults = { 'core': { 'unit_test_mode': False, 'parallelism': 32, 'load_examples': True, 'plugins_folder': None, }, 'webserver': { 'base_u...
{ "content_hash": "7291cc26feddb487d496e1e0e68a5279", "timestamp": "", "source": "github", "line_count": 281, "max_line_length": 78, "avg_line_length": 30.177935943060497, "alnum_prop": 0.69375, "repo_name": "robbwagoner/airflow", "id": "94bcb0e30fb7eb198c41e127c4c541934054fd01", "size": "8480", "...
class Command(object): """Defines constants for the standard WebDriver commands. While these constants have no meaning in and of themselves, they are used to marshal commands through a service that implements WebDriver's remote wire protocol: http://code.google.com/p/selenium/wiki/JsonWireProto...
{ "content_hash": "62191698ee810df749772bc69daa6dc2", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 74, "avg_line_length": 36.8875, "alnum_prop": 0.7017960013554727, "repo_name": "hali4ka/robotframework-selenium2library", "id": "6a0f3ee52b226ae774a6687436737fbc8f4545d2", ...
class ReduceContext: def __init__(self,key,iterator): self.key = key self.value = None self.iterator = iterator; return def loadNextValue(self): self.key = self.keysList.pop(); self.value = self.valuesList.pop(); return
{ "content_hash": "f06a2befc4e04d10735385184e106ccf", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 43, "avg_line_length": 22.076923076923077, "alnum_prop": 0.5679442508710801, "repo_name": "neosky2142/PyMR", "id": "098a4be270648b8b3d1c11fc9da18ed4fb2f6bd1", "size": "287"...
from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('entities', '0002_auto_20150316_1433'), ] operations = [ migrations.AlterField( model_name='post', ...
{ "content_hash": "6bdb891a841f78c239d8bdeb9fc10399", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 92, "avg_line_length": 24.3, "alnum_prop": 0.6193415637860082, "repo_name": "fabteam1/komsukomsuhuhu", "id": "4945fb7345435aabe35eb7c795ffed6695a3a2b7", "size": "510", "b...
"""Tests for samba.samba3.""" from samba.samba3 import ( Registry, WinsDatabase, IdmapDatabase, ) from samba.samba3 import passdb from samba.samba3 import param as s3param from samba.tests import TestCase, TestCaseInTempDir from samba.dcerpc.security import dom_sid import os for p in [ "../../../../....
{ "content_hash": "f6d2db6976899212b185a6e581ac10f2", "timestamp": "", "source": "github", "line_count": 203, "max_line_length": 110, "avg_line_length": 37.96551724137931, "alnum_prop": 0.6444790450240041, "repo_name": "nmercier/linux-cross-gcc", "id": "126e133f4c1b196740d6f77c31dbb91d66fe1c45", "si...
from django.contrib import admin from reviewer.models import ReviewGroup, ReviewLog @admin.register(ReviewGroup) class ReviewGroupAdmin(admin.ModelAdmin): list_display = ['organization', 'group', 'visibility_level'] @admin.register(ReviewLog) class ReviewGroupAdmin(admin.ModelAdmin): list_display = ['content...
{ "content_hash": "1b7bd86c72de1b8c00a545288690f569", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 64, "avg_line_length": 34.8125, "alnum_prop": 0.6283662477558348, "repo_name": "MoveOnOrg/eventroller", "id": "c4aa30a5d6aecc91817684a21391d29347f72d5a", "size": "557", "...
""" HTTP handeler to serve specific endpoint request like http://myserver:9004/endpoints/mymodel For how generic endpoints requests is served look at endpoints_handler.py """ import json import logging import shutil from tabpy.tabpy_server.common.util import format_exception from tabpy.tabpy_server.handlers import Ma...
{ "content_hash": "463b853ee9a582aa883cf345c62d4a96", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 88, "avg_line_length": 34.690140845070424, "alnum_prop": 0.5617133576938693, "repo_name": "tableau/TabPy", "id": "583b17629d82ddfb31de07b8e3d1cf277fe462e4", "size": "4926"...
import _plotly_utils.basevalidators class UirevisionValidator(_plotly_utils.basevalidators.AnyValidator): def __init__(self, plotly_name="uirevision", parent_name="funnel", **kwargs): super(UirevisionValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
{ "content_hash": "8ecb6967536046c9103d88a215161ea1", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 81, "avg_line_length": 36.54545454545455, "alnum_prop": 0.6268656716417911, "repo_name": "plotly/plotly.py", "id": "8a0c44d507a9d884e7dfbca96ab978522c20b447", "size": "402"...
""" Set of utility function used throughout the app """ from uuid import uuid4 import hashlib import re from google.appengine.ext import ndb #pylint: disable=import-error import config from pydash import _ import itertools, operator EMAIL_REGEX = r'^[-!#$%&\'*+\\.\/0-9=?A-Za-z^_`{|}~]+@([-0-9A-Za-z]+\.)+([0-9A-Za-z]){...
{ "content_hash": "114356f3f5e78c3cd2439424f88f74f4", "timestamp": "", "source": "github", "line_count": 278, "max_line_length": 457, "avg_line_length": 34.111510791366904, "alnum_prop": 0.599388379204893, "repo_name": "wodore/wodore-ng", "id": "2775f09f0f9ac62324ca4cba31af06bda16c4598", "size": "94...
import numpy as np from rl.util import logger, log_self def create_dummy_states(state): state_shape = state.shape previous_state = np.zeros(state_shape) pre_previous_state = np.zeros(state_shape) pre_pre_previous_state = np.zeros(state_shape) if (previous_state.ndim == 1): previous_state =...
{ "content_hash": "f7b06b9c4f528899a327e6e5f776e4b4", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 77, "avg_line_length": 36.72839506172839, "alnum_prop": 0.626218487394958, "repo_name": "kengz/openai_lab", "id": "0125f519510336fa8e4d27f34900633b08b41088", "size": "2975"...
import time from unittest import mock import pytest from google.api_core import exceptions from google.cloud.bigquery_storage_v1.services import big_query_write from google.cloud.bigquery_storage_v1 import types as gapic_types from google.cloud.bigquery_storage_v1 import exceptions as bqstorage_exceptions from google...
{ "content_hash": "b19d8336092084c7b6a9cdbc85053c02", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 85, "avg_line_length": 39.44827586206897, "alnum_prop": 0.7244755244755244, "repo_name": "googleapis/python-bigquery-storage", "id": "9ecb185818d6dff178f12226a6eabbe75de9551...
import datetime from copy import deepcopy import logging import xml.etree.ElementTree as et import os import pystache import re import string import sys import subprocess import urllib2 # SDK 3.12.6: https://github.com/Parrot-Developers/arsdk_manifests/blob/d7640c80ed7147971995222d9f4655932a904aa8/release.xml LIBARCOM...
{ "content_hash": "fb975d9b7f6bcecdeeffe975a0e366c4", "timestamp": "", "source": "github", "line_count": 514, "max_line_length": 177, "avg_line_length": 39.71206225680934, "alnum_prop": 0.5123456790123457, "repo_name": "AutonomyLab/bebop_autonomy", "id": "bf4d647db5eeb3e6f73fb038e680b7e7ea91c4da", "...
"""Module which extends the Camera type.""" # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. from ._scenepic import ( Camera, camera_orbit ) Camera.orbit = camera_orbit
{ "content_hash": "94001f957d0b00bc95d16449c12436c9", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 43, "avg_line_length": 18.545454545454547, "alnum_prop": 0.7058823529411765, "repo_name": "microsoft/scenepic", "id": "75267282896104751c1d475962f0f5098d0fa58e", "size": "2...
from django import forms class UploadFileForm(forms.Form): file = forms.FileField()
{ "content_hash": "8392781165ec7ee336dadef4bf69b066", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 33, "avg_line_length": 17.8, "alnum_prop": 0.7528089887640449, "repo_name": "Omenia/RFHistory", "id": "03d9dee665a7e528d849f66d6058d7472bf364aa", "size": "89", "binary": f...
import pandas as pd from datanator.util import mongo_util import json import datetime from pymongo import ASCENDING from pymongo.collation import Collation, CollationStrength import datanator.config.core from datanator_query_python.query import query_uniprot from datanator.data_source import uniprot_nosql class Halfl...
{ "content_hash": "4e56aefb8956032010ad88587c81caf3", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 139, "avg_line_length": 52.869565217391305, "alnum_prop": 0.5444826555023924, "repo_name": "KarrLab/kinetic_datanator", "id": "c3657f768543a7eb5cd3350e44285354df2e46a1", "...
import re from dateutil import parser from django import template from django.utils.safestring import mark_safe from ..models import Phase register = template.Library() @register.filter def first_p(value): if value: p_search = re.search(r'<p(|\s+[^>]*)>.*<\/p>', value) if p_search: ...
{ "content_hash": "69757c2040af47b0363be778c073913b", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 110, "avg_line_length": 30.93617021276596, "alnum_prop": 0.6327372764786795, "repo_name": "City-of-Helsinki/digihel", "id": "b2805981da83b09f5b6d362c1c9e63863356cb79", "siz...
from .db import FlotillaClientDynamo from .region_meta import RegionMetadata
{ "content_hash": "9ecd8d8920928b4d02eb789f236ca77d", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 39, "avg_line_length": 38.5, "alnum_prop": 0.8571428571428571, "repo_name": "pebble/flotilla", "id": "c8903617591d28e1cd3d90a2f5decc3bd4451662", "size": "77", "binary": fa...
import collections class MemoKey(collections.namedtuple('MemoKey', ('value_id', 'restrict_to_child_or_null'))): """ The key used to memoize already-traversed nodes when resolving substitutions. :param value_id: id(AbstractConfigValue) :param restrict_to_child_or_null: Path """ def __...
{ "content_hash": "baea7d38f5c358e901631546454e364e", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 81, "avg_line_length": 29.12, "alnum_prop": 0.6098901098901099, "repo_name": "chris-martin/hocon-python", "id": "d22c08b9b732840d6077b2c51b12fad029a206b1", "size": "728", ...
def fetchone(cursor): "Returns o row from a cursor as a dict, or None" desc = cursor.description row = cursor.fetchone() if row: return dict(zip([col[0] for col in desc], row)) else: return None def fetchall(cursor): "Returns all rows from a cursor as a dict" desc = cursor....
{ "content_hash": "27f106e3980c8fd888aee180d1531b85", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 55, "avg_line_length": 25.705882352941178, "alnum_prop": 0.6064073226544623, "repo_name": "slaweet/autoskola", "id": "39427121d5015c6435476fa667a1c81cdb451b3f", "size": "46...
from __future__ import absolute_import, division, print_function from cryptography import utils from cryptography.hazmat.primitives import interfaces def _verify_key_size(algorithm, key): # Verify that the key size matches the expected key size if len(key) * 8 not in algorithm.key_sizes: raise ValueE...
{ "content_hash": "e31eb6081a049329d69fdb157b9927a9", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 66, "avg_line_length": 24.992537313432837, "alnum_prop": 0.6434756643774261, "repo_name": "dstufft/cryptography", "id": "bd8437c222aeafc6c60dec8f2f5c89f7f37df7e9", "size":...
"""This script handles command-line invocations of the package.""" import argparse import logging import os import signal import sys from importlib.machinery import SourceFileLoader from bidon.db.access import ModelAccess from bidon.db.core import get_pg_core from pypgq.queue import Cooperative, Queue, StopMode STO...
{ "content_hash": "c2da1fa672c609bcb005dbe831b9f9d6", "timestamp": "", "source": "github", "line_count": 356, "max_line_length": 100, "avg_line_length": 34.27247191011236, "alnum_prop": 0.5902794852880912, "repo_name": "treycucco/pypgqueue", "id": "8c38b781a368608ba8f5729191266180ac6d597e", "size": ...
import time import random from dataclasses import dataclass, field from typing import Optional from mephisto.abstractions.database import MephistoDB from mephisto.abstractions.providers.mturk.mturk_agent import MTurkAgent from mephisto.abstractions.providers.mturk.utils.script_utils import ( direct_soft_block_mtur...
{ "content_hash": "72e28a5c0184e9f5f0995bbd946d5eb4", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 129, "avg_line_length": 32.96551724137931, "alnum_prop": 0.6626569037656904, "repo_name": "facebookresearch/ParlAI", "id": "a9a28457599c62edc4f40b18276501e202bedf91", "siz...