text
stringlengths
4
1.02M
meta
dict
import os from mock import MagicMock, patch from .. import cfy from .mocks import execution_mock from .constants import BLUEPRINTS_DIR, DEFAULT_BLUEPRINT_FILE_NAME from .test_base import CliCommandTest from ...commands import executions from cloudify_rest_client.exceptions import \ DeploymentEnvironmentCreationPe...
{ "content_hash": "25682063047d12a4b73459f7197b695e", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 78, "avg_line_length": 40.681481481481484, "alnum_prop": 0.6260014566642389, "repo_name": "isaac-s/cloudify-cli", "id": "aea409123a2bfa5af1224c531b1372b970ef301e", "size":...
from .prepare import make_train_test import os import tempfile import scipy.io as sio from hashlib import sha256 try: import urllib.request as urllib_request # for Python 3 except ImportError: import urllib2 as urllib_request # for Python 2 urls = { "chembl-IC50-346targets.mm" : ( ...
{ "content_hash": "16f744dfdbc4b00c8dad51d9d5712f2a", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 80, "avg_line_length": 26.822580645161292, "alnum_prop": 0.6458208057727, "repo_name": "ExaScience/smurff", "id": "75df3bdbb199a7bcc281a52dd191464560de1d6f", "size": "1663"...
from setuptools import setup setup( setup_requires=['pbr>=1.9', 'setuptools>=17.1'], pbr=True)
{ "content_hash": "f06958ec28336512dbd24075c680b804", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 52, "avg_line_length": 17.5, "alnum_prop": 0.6476190476190476, "repo_name": "stand1921/python-huaweivbsclient", "id": "64cb1dae715bab99c354b93008b4acc794d36f3a", "size": "10...
''' cgat_check_deps.py - check whether the software dependencies are on your PATH ============================================================================= Purpose ------- .. The goal of this script is to provide a list of third-party command-line programs used in a Python script given as input, and check whether...
{ "content_hash": "e59eab79becbc818c279eab367237a2f", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 98, "avg_line_length": 30.651162790697676, "alnum_prop": 0.575113808801214, "repo_name": "AntonioJBT/CGATPipeline_core", "id": "d578da0f96c9f5aa4b0438e559714cbe0a4c2e6f", ...
import errno import os from lxml import etree def _indent(element, indent_char='\t', level=0): indent_text = '\n' + level * indent_char if len(element): if not element.text or not element.text.strip(): element.text = indent_text + indent_char if not element.tail or not element.tai...
{ "content_hash": "29c5452e92b05b2d67f1ccd223075367", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 80, "avg_line_length": 29.612244897959183, "alnum_prop": 0.5868366643694004, "repo_name": "Tunous/StringSheet", "id": "43b87666efb027245d7cc3a0d2e1fa619d7d84d2", "size": "2...
""" AngularJS, Django, and Jquery File-upload App. Sandeep Jadoonanan """ from django.conf.urls import patterns, include, url from django.contrib import admin from django.conf import settings urlpatterns = patterns('', # Examples: # url(r'^$', 'portal.views.home', name='home'), # url(r'^blog...
{ "content_hash": "e96e423c2822a00f7e2a028047435758", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 123, "avg_line_length": 28.818181818181817, "alnum_prop": 0.6451104100946372, "repo_name": "TunedMystic/file-upload-django-angular", "id": "8bf3829e1b779fbaf4569640748149fc32...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os from errno import EEXIST from ansible.errors import AnsibleError from ansible.module_utils._text import to_bytes, to_native, to_text __all__ = ['unfrackpath', 'makedirs_safe'] def unfrackpath(path, follow=True): '...
{ "content_hash": "f6e4e660c84031f501d3bf8f12b6e0c2", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 141, "avg_line_length": 39.611111111111114, "alnum_prop": 0.6774193548387096, "repo_name": "abtreece/ansible", "id": "cd74877124fb51cb3548a030c14c9595be616fcb", "size": "28...
import os import unittest from PwdsTestLib import PwdsBaseTest class PwdsBasicTest( PwdsBaseTest ): def setUp( self ): super( PwdsBasicTest, self ).setUp() self.initSafe() def tearDown( self ): os.remove( self.safeFile ) def test_second_run( self ): out = self.runPwds( 's...
{ "content_hash": "9d13840bbec19c8b9dc75932602ff2fa", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 51, "avg_line_length": 23.153846153846153, "alnum_prop": 0.5730897009966778, "repo_name": "tsiemens/pwds", "id": "f0f77e5b7d498e5567d9cbde6ca8387a92811216", "size": "625", ...
import os from config import Config class LogConfig(Config): def __new__(cls, *args, **kwargs): if not hasattr(cls, "__instance__"): cls.__instance__ = super(LogConfig, cls).__new__(cls, *args, **kwargs) return cls.__instance__ def __init__(self): super(LogConfig, self).__i...
{ "content_hash": "35188cbb9d5bc07eb129922db3dea6ba", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 82, "avg_line_length": 25.6, "alnum_prop": 0.513671875, "repo_name": "dev1x-org/python-example", "id": "1c36b6aee039d1b54c3fdb9734ea58bac7f4db12", "size": "526", "binary"...
""" :Author: Adam Ginsburg <[email protected]> and Jordan Mirocha <[email protected]> .. moduleauthor:: Adam Ginsburg <[email protected]> """ __all__ = ['spectrum','cubes','wrappers'] from __version__ import __version__ import spectrum import specwarnings try: import cubes except ImportError: s...
{ "content_hash": "88a946c9f3f116a5d6ecaa2da6799d21", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 90, "avg_line_length": 30.1875, "alnum_prop": 0.7391304347826086, "repo_name": "keflavich/pyspeckit-obsolete", "id": "a74e4f7cefde9f67b26c8dd3053b66abbd9ccbbe", "size": "48...
from concurrence import TIMEOUT_CURRENT from _io import Buffer, BufferOverflowError, BufferUnderflowError, BufferInvalidArgumentError, get_errno class IOStream(object): """abstract class to indicate that something is a stream and capable of the basic read and write ops on a buffer""" def write(self, buffer...
{ "content_hash": "9e3d82cb2b22003de5a5abd72a92fe73", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 119, "avg_line_length": 48.148936170212764, "alnum_prop": 0.7034909412284578, "repo_name": "toymachine/concurrence", "id": "687f2f3ce5ecffd760c88c3fca71d8d38daefe98", "size...
import mock import unittest from uuid import uuid4 from django.core.urlresolvers import reverse from django.core import mail from django.db import IntegrityError from django.http import HttpResponse from django.test import TestCase, Client from django.test.client import RequestFactory from django.contrib.auth.models im...
{ "content_hash": "4376f9c0f8ae55bbc32eda74154576be", "timestamp": "", "source": "github", "line_count": 946, "max_line_length": 123, "avg_line_length": 39.99577167019027, "alnum_prop": 0.5893857701659795, "repo_name": "raccoongang/socraticqs2", "id": "91eed0580dbdc280dcdb0fbf730d54468c9de113", "siz...
"""A small demo showcasing a saxpy computation.""" from __future__ import print_function import sys import numpy as np import pycuda.autoinit import pycuda.driver as driver import pycuda.gpuarray as gpuarray saxpy_kernel = """__global__ void saxpy_kernel(const float* const x, ...
{ "content_hash": "785104784ccf8c7f978753b28735176a", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 73, "avg_line_length": 30.04, "alnum_prop": 0.5552596537949401, "repo_name": "MisanthropicBit/pycuda_examples", "id": "f85d9e44a1bfa806f4e247f76c4eb7d27513b699", "size": "1...
""" # UI/UX Authoring Tool # @license http://www.apache.org/licenses/LICENSE-2.0 # Author @ Jamil Hussain """ from django.conf.urls import url, include from django.contrib import admin from . import views urlpatterns = [ url(r'^$',views.homeView, name='home'), url(r'^overview',views.overviewView, n...
{ "content_hash": "211c75f29d485d4ee13ed28337ce7075", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 68, "avg_line_length": 32.6, "alnum_prop": 0.661042944785276, "repo_name": "ubiquitous-computing-lab/Mining-Minds", "id": "79e535113fbfde1ea1c5b96b2348ae363aa166ef", "size"...
""" WSGI config for algotrade project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SET...
{ "content_hash": "8f10d5a0f6e6d44381f2e638fb531bae", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 24.6875, "alnum_prop": 0.7721518987341772, "repo_name": "softage0/algorithm-trading-webapp", "id": "41e5cc0e6401f089f677c69b4d0e39ce8051911e", "size"...
from fabric.api import * from fabric.contrib.files import exists, append, comment from fabric.colors import red import os env.sitename = os.path.basename(os.getcwd()) env.mongo_host = 'fire.rccc.ou.edu' env.psql_host = 'fire.rccc.ou.edu' env.apache_config = '/etc/httpd/conf.d/%(sitename)s.conf' % env env.python = '/u...
{ "content_hash": "cba23f758b593b0d2adeeb63e552d037", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 108, "avg_line_length": 31.690140845070424, "alnum_prop": 0.6371111111111111, "repo_name": "ouinformatics/queue", "id": "ce94b2eb8a449a8d93fc905fa09cae34b9944f13", "size":...
__revision__ = "test/AS/nasm.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog" """ Verify correct use of the live 'nasm' assembler. """ import os import sys import TestSCons _python_ = TestSCons._python_ _exe = TestSCons._exe test = TestSCons.TestSCons() nasm = test.where_is('nasm') if not nasm: ...
{ "content_hash": "d4e3233280000bf95e2106b53ed8995a", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 89, "avg_line_length": 23.27906976744186, "alnum_prop": 0.6163836163836164, "repo_name": "EmanueleCannizzaro/scons", "id": "8656f096383d7d654e5b11b28ffe70c77d15c5f8", "siz...
import os import platform import re import subprocess import tempfile import lit.formats import lit.util from lit.llvm import llvm_config from lit.llvm.subst import ToolSubst from lit.llvm.subst import FindTool # Configuration file for the 'lit' test runner. # name: The name of this test suite. config.name = 'STAND...
{ "content_hash": "5259d6043c426fa4df2416eb6a45a621", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 87, "avg_line_length": 32, "alnum_prop": 0.7489224137931034, "repo_name": "endlessm/chromium-browser", "id": "049fbc73cd81629711ecca1b48591f57d7addf06", "size": "1874", "...
from msrest.pipeline import ClientRawResponse from .. import models class ListManagementTermOperations(object): """ListManagementTermOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :...
{ "content_hash": "7d480d8aa2d21ba10f55af094583a5fb", "timestamp": "", "source": "github", "line_count": 255, "max_line_length": 133, "avg_line_length": 41.090196078431376, "alnum_prop": 0.6417255201374308, "repo_name": "lmazuel/azure-sdk-for-python", "id": "bae3190cb9ad3f42e39a14d342625766ce8040d2", ...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Node', fields=[ ('...
{ "content_hash": "04b8dd4d8b22f6520f6be0c3608ec215", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 123, "avg_line_length": 31.63888888888889, "alnum_prop": 0.5610184372256365, "repo_name": "kmccormick/rmm", "id": "c66e4fbf05b9e78599464ff34a4758795bcbe3af", "size": "1212"...
import io import json import os import unittest from . import adverseevent from .fhirdate import FHIRDate class AdverseEventTests(unittest.TestCase): def instantiate_from(self, filename): datadir = os.environ.get('FHIR_UNITTEST_DATADIR') or '' with io.open(os.path.join(datadir, filename), 'r', en...
{ "content_hash": "19181fde07d7231fd074c76a5c8de685", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 108, "avg_line_length": 45.27906976744186, "alnum_prop": 0.6789933230611197, "repo_name": "all-of-us/raw-data-repository", "id": "c6a62dd4f7ce2050e401fc22e3db01f41052f0af", ...
""" В данный пакет включаются кнопочные компоненты """ from __future__ import absolute_import from .buttons import ExtButton
{ "content_hash": "46863a25b70b3debbe8f48e60a0a6240", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 46, "avg_line_length": 21, "alnum_prop": 0.7698412698412699, "repo_name": "barsgroup/m3-ext", "id": "7daa0c8b19306b9d25813740cef423a0c0e2f2f7", "size": "183", "binary": fa...
""" Post-process Oprofile logs for x86-64 nexes running under sel_ldr. Maps event counts in the "anon" region, to the appropriate addresses in the nexe assembly. "Anon" represents the untrusted sandbox. This will become unnecessary once we get immutable files for our .nexe so that sel_ldr can use mmap the .nexe inste...
{ "content_hash": "3ae742701579fbc399ce2d530ecb1984", "timestamp": "", "source": "github", "line_count": 481, "max_line_length": 80, "avg_line_length": 35.14968814968815, "alnum_prop": 0.6145383568935944, "repo_name": "Lind-Project/native_client", "id": "ad4d5ce1be2e88450f20642b45d35594df32c0c1", "s...
import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf im...
{ "content_hash": "eb99f15c7dd75071ad9e26b152a51a1a", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 308, "avg_line_length": 31.890625, "alnum_prop": 0.7383635472807447, "repo_name": "bellowsj/aiopogo", "id": "4536c3a3c3c490cda5896a8f8a2b0cfa3f77b0e5", "size": "2152", "b...
class ForeignKeyError(Exception): pass
{ "content_hash": "c40ed598d00f71fc06431a877725f140", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 33, "avg_line_length": 21.5, "alnum_prop": 0.7674418604651163, "repo_name": "fcurella/django-fakery", "id": "e4cdbadb5cbcb6df277b6a08cc63a9f098803c7a", "size": "43", "bina...
from msrest.serialization import Model class HttpRequestInfo(Model): """The Http request info. :param client_request_id: the client request id. :type client_request_id: str :param client_ip_address: the client Ip Address :type client_ip_address: str :param method: the Http request method. ...
{ "content_hash": "ed60c63e1b6265608cd5d0edfe8c408c", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 135, "avg_line_length": 34.827586206896555, "alnum_prop": 0.6049504950495049, "repo_name": "lmazuel/azure-sdk-for-python", "id": "5e0e15d35a832cbbd6eeeb5afab4dbf0968a1333", ...
from __future__ import absolute_import, unicode_literals import re from collections import OrderedDict from datetime import datetime from misaka import BaseRenderer class ChangelogParserMixin(object): versions = None _current_version = None _current_section = None def reset(self): self.vers...
{ "content_hash": "cbddf328a0bfa2c5572d6c4f7b2a687a", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 103, "avg_line_length": 31.492753623188406, "alnum_prop": 0.5462494247583985, "repo_name": "rcmachado/pykeepachangelog", "id": "52117cc3242bea6d130c179dc39ada98294de2c4", "...
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list ...
{ "content_hash": "3ad6a387b3f628916af3f4ad65064f8e", "timestamp": "", "source": "github", "line_count": 524, "max_line_length": 176, "avg_line_length": 39.204198473282446, "alnum_prop": 0.6745850167940418, "repo_name": "danakj/chromium", "id": "aed1a8feebfec114af24d565728f46914750e592", "size": "20...
"""This example gets all text ads for a given ad group. To add an ad, run add_text_ads.py. Tags: AdGroupAdService.get Api: AdWordsOnly """ __author__ = '[email protected] (Kevin Winter)' import os import sys sys.path.insert(0, os.path.join('..', '..', '..', '..', '..')) # Import appropriate classes from the cli...
{ "content_hash": "c4e23c834e5759b3d8aadd104400234e", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 80, "avg_line_length": 27.02777777777778, "alnum_prop": 0.5488180883864338, "repo_name": "nearlyfreeapps/python-googleadwords", "id": "8ae7806409adf8c7304444de90b08564a8954dc...
class Solution(object): def addTwoNumbers(self, l1, l2): """ :type l1: ListNode :type l2: ListNode :rtype: ListNode """ return self.getll(self.getnum(l1) + self.getnum(l2)) def getnum(self, l): length = self.getlength(l) num = 0 for i in r...
{ "content_hash": "ebe6f954546ed55febd603450c507477", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 91, "avg_line_length": 25.365853658536587, "alnum_prop": 0.4913461538461538, "repo_name": "mistwave/leetcode", "id": "379138f9d58efa0c6816b87ba2ad8f34a2e196cb", "size": "11...
import sys import os, os.path import shutil import ConfigParser import subprocess import re from contextlib import contextmanager def _check_ndk_root_env(): ''' Checking the environment NDK_ROOT, which will be used for building ''' try: NDK_ROOT = os.environ['NDK_ROOT'] except Exception: ...
{ "content_hash": "0f8a5bcf9b30c213ddb2732426eb6e7c", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 132, "avg_line_length": 35.59659090909091, "alnum_prop": 0.569193934557063, "repo_name": "wanmaple/PokemonRPG", "id": "46a02d6d1fbe2c0fb73f0fd9dc9f4d913b2f8ec9", "size": "...
from fonts import *
{ "content_hash": "aa5b3da00c28fc988ea9ee8b88db69ec", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 19, "avg_line_length": 20, "alnum_prop": 0.75, "repo_name": "MikhailMS/Final_Project", "id": "bb8bc1cba3db05479eb10825cb9deb3f40a256b8", "size": "58", "binary": false, "...
import _plotly_utils.basevalidators class TicklabeloverflowValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="ticklabeloverflow", parent_name="layout.yaxis", **kwargs ): super(TicklabeloverflowValidator, self).__init__( plotly_name=plotly_...
{ "content_hash": "982e73588923eec047232da698707430", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 88, "avg_line_length": 38.5, "alnum_prop": 0.6233766233766234, "repo_name": "plotly/plotly.py", "id": "ff2bf9766c226c2d2b8c7303ebbe88abf74823fe", "size": "539", "binary":...
import os from urllib.parse import urljoin, urlparse from xml.sax.saxutils import escape import docutils.nodes from reportlab.platypus.paragraph import Paragraph from .basenodehandler import NodeHandler from .image import MyImage, missing class FontHandler(NodeHandler): def get_pre_post(self, client, node, repl...
{ "content_hash": "727b2a28bb23567532ce96356f11e373", "timestamp": "", "source": "github", "line_count": 270, "max_line_length": 88, "avg_line_length": 32.662962962962965, "alnum_prop": 0.5505159315115092, "repo_name": "rst2pdf/rst2pdf", "id": "b22ff7569362ee9d9fbfacdbaff0a7a503bbe780", "size": "888...
try: from setuptools import setup except ImportError: from distutils.core import setup from distutils.extension import Extension from distutils.command.build_ext import build_ext import sys, os, shutil, fnmatch platform = sys.platform if platform[:6] == 'darwin': platform = 'darwin' elif platform[:5] == ...
{ "content_hash": "a89017963ca8a17e674fb6529b25a466", "timestamp": "", "source": "github", "line_count": 250, "max_line_length": 118, "avg_line_length": 34.708, "alnum_prop": 0.6203757058891322, "repo_name": "zeroc-ice/ice-packaging", "id": "16f5e24127d5f6a98a621cebd99b5b3b7384b7f4", "size": "8773",...
""" RoBERTa: A Robustly Optimized BERT Pretraining Approach. """ import logging import torch import torch.nn as nn import torch.nn.functional as F from fairseq import utils from fairseq.model_parallel.models.transformer import ModelParallelTransformerEncoder from fairseq.models import register_model, register_model_a...
{ "content_hash": "db788378564bccc6ff56c481f8baf1d0", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 88, "avg_line_length": 35.411764705882355, "alnum_prop": 0.6579350881676463, "repo_name": "pytorch/fairseq", "id": "77a80ef72057219110b34678a38705549910edd3", "size": "800...
"""Django page CMS unit test suite module.""" from pages.models import Page, Content from pages.placeholders import PlaceholderNode from pages.tests.testcase import TestCase, MockRequest from pages import urlconf_registry as reg from pages.http import get_language_from_request, get_slug from pages.http import get_reque...
{ "content_hash": "97bd24302cb0742b337d62a2efd52c91", "timestamp": "", "source": "github", "line_count": 634, "max_line_length": 87, "avg_line_length": 38.01577287066246, "alnum_prop": 0.582067878184383, "repo_name": "oliciv/django-page-cms", "id": "624a175f1eadbf9a8a9af7fc95368d1fcce33b44", "size":...
""" Python package to interact with UniFi Controller """ import shutil import time import warnings import json import logging import requests from urllib3.exceptions import InsecureRequestWarning """For testing purposes: logging.basicConfig(filename='pyunifi.log', level=logging.WARN, format='%(as...
{ "content_hash": "1f596cbf5858b5645d9d99a27dd1a433", "timestamp": "", "source": "github", "line_count": 863, "max_line_length": 79, "avg_line_length": 33.82039397450753, "alnum_prop": 0.5552129372665913, "repo_name": "finish06/pyunifi", "id": "aafc9a20694a5976802fea5d954de39bfc48b38a", "size": "291...
import sublime import sublime_plugin class UnderlinerCommand(sublime_plugin.TextCommand): replacements = { ' ': '_', '_': ' ', } names = { ' ': 'spaces', '_': 'underlines', } def run(self, edit): sels = self.view.sel() replace_char = self.get_prev...
{ "content_hash": "7abb4333eb2898758939683ebde4b5d9", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 75, "avg_line_length": 28.928571428571427, "alnum_prop": 0.5489711934156378, "repo_name": "dfleury/underliner", "id": "3bab1fb6c37c2aa9c876e40ac293e3dca3275896", "size": "1...
import mock import hashlib from django.core.cache import cache from siglock.decorators import single_task def test_single_task_no_arguments(add_mock): """ Tests cache key without any args or kwargs """ def fn(): pass # decorate & call single_task(60)(fn)() assert add_mock.call_count ==...
{ "content_hash": "70a1e4113c992e00069c7ba39a9ec34c", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 87, "avg_line_length": 25.057291666666668, "alnum_prop": 0.618166701309499, "repo_name": "lockwooddev/djcelery-siglock", "id": "7f659b630e68880cc65600795e6a992f6fab7802", ...
""" Comments in PyCharm style. References - Tag sorter by Zack /common-samples/blob/master/tools/net/tag_sorter/tag_sorter.py - README standard format /common-samples/wiki/Standard-sample-documentation-template-%28README.md%29 """ import os import re import typing import argparse # region Global sets # A set o...
{ "content_hash": "c80306421cbc8329bfca0f865feca0bc", "timestamp": "", "source": "github", "line_count": 445, "max_line_length": 80, "avg_line_length": 32.65842696629213, "alnum_prop": 0.5941650037844904, "repo_name": "Esri/arcgis-runtime-samples-ios", "id": "93279aca23d77929211035c3b055bcb28bc92042",...
from uspeda import app, db, bcrypt, mail from uspeda.models import Crime, Residence, User, Review import uspeda.validate as validate from flask import render_template, jsonify, redirect, request, \ url_for, abort, flash, session from flask_mail import Message from itsdangerous import URLSafeTimedSeria...
{ "content_hash": "4c168bb13fa5b548debe320d909c5e90", "timestamp": "", "source": "github", "line_count": 296, "max_line_length": 99, "avg_line_length": 31.27027027027027, "alnum_prop": 0.5707649092480553, "repo_name": "stutumi/USPeda", "id": "b04c6bca30702792221b06e619d2cc22b4fc8558", "size": "9265"...
from beritest_tools import BaseBERITestCase class test_raw_arithmetic_combo(BaseBERITestCase): def test_a0(self): '''Test that stages of the arithmetic combo test produced the correct result.''' self.assertRegisterEqual(self.MIPS.s0, 0x0000002800000014, "Stage 1 Incorrect") self.assertRegis...
{ "content_hash": "1f5dc5467ae98d7d9e8e3ad926af3c12", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 88, "avg_line_length": 60.333333333333336, "alnum_prop": 0.7430939226519337, "repo_name": "8l/beri", "id": "7117d221c785109110bf4228b9ffdfa2615b5951", "size": "1862", "bi...
""" A base class for creating CEA plugins. Subclass this class in your own namespace to become a CEA plugin. """ import importlib import os import configparser from typing import Generator, Sequence import yaml import inspect import cea.schemas import cea.config import cea.plots.categories import cea.inputlocator i...
{ "content_hash": "cee1cac3903ca3881a94689d66e68c67", "timestamp": "", "source": "github", "line_count": 299, "max_line_length": 125, "avg_line_length": 41.1438127090301, "alnum_prop": 0.647943423833523, "repo_name": "architecture-building-systems/CityEnergyAnalyst", "id": "69398e200731e9bf6d5644cc4cc...
import hashlib import uuid from oslo_config import cfg import webob from keystone.common import authorization from keystone.common import tokenless_auth from keystone.contrib.federation import constants as federation_constants from keystone import exception from keystone import middleware from keystone.tests import u...
{ "content_hash": "8ea144c803cf08f66743911bacaad9ab", "timestamp": "", "source": "github", "line_count": 735, "max_line_length": 78, "avg_line_length": 41.1578231292517, "alnum_prop": 0.587616938283032, "repo_name": "jonnary/keystone", "id": "d420a568a0ad867abbe11c624294fcbdd260dcda", "size": "30837...
import os, re, fnmatch, sys from collections import namedtuple from itertools import islice from .Source import Source from quickfind.Searcher import Ranker, CString from .Util import truncate_middle, rec_dir_up, highlight, StringRanker, simpleFormatter try: import fsnix.util as util walk = util.walk except ...
{ "content_hash": "7e4c7e2e827ab24aa26924e11faccde4", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 94, "avg_line_length": 30.18918918918919, "alnum_prop": 0.5459265890778872, "repo_name": "Refefer/quickfind", "id": "a5b4a069553c2995c1e6bd5c1b7402c7ced34df3", "size": "55...
''' Expected result of ordered probability attempts Status: Accepted ''' ############################################################################### def main(): """Read input and print output""" result, prob, words = 0.0, [], int(input()) for _ in range(words): prob.append(float(input().spli...
{ "content_hash": "6768a0610a7983a62e0379886d7ac8a8", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 79, "avg_line_length": 24.208333333333332, "alnum_prop": 0.43373493975903615, "repo_name": "ivanlyon/exercises", "id": "669ce5ecc215810f08e5fb42a337ceb332135ee6", "size": "...
import re import os import errno import argparse import asyncore import logging import logging.config # Bulk Imports from bulk.proxy import BulkProxy from bulk.helpers import * class CreateProcessor(argparse.Action): """ A custom argparse action. Instantiates a processing engine to be used in Bulk a...
{ "content_hash": "ed7dcb5666dd6074658bcea448f0a296", "timestamp": "", "source": "github", "line_count": 321, "max_line_length": 79, "avg_line_length": 27.996884735202492, "alnum_prop": 0.5649271169467008, "repo_name": "MITRECND/bulk", "id": "0b7074b75f8b15b2239722e5c1e3665698e72d69", "size": "10361...
from self_organising_systems.shared.config import cfg import ml_collections cfg.texture_ca = ml_collections.ConfigDict() cfg.texture_ca.channel_n = 12 cfg.texture_ca.hidden_n = 96 cfg.texture_ca.fire_rate = 0.5 cfg.texture_ca.batch_size = 4 cfg.texture_ca.lr = 2e-3 cfg.texture_ca.pool_size = 1024 cfg.texture_ca.fixed_...
{ "content_hash": "d83e02cc83091d50e0e374423a94a0de", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 112, "avg_line_length": 38.542857142857144, "alnum_prop": 0.7575982209043736, "repo_name": "google-research/self-organising-systems", "id": "648fb0a48d2f7b905799a9a2bb6fbe7d8...
from spotdl.metadata.exceptions import MetadataNotFoundError from spotdl.metadata.exceptions import SpotifyMetadataNotFoundError from spotdl.metadata.exceptions import YouTubeMetadataNotFoundError class TestMetadataNotFoundSubclass: def test_metadata_not_found_subclass(self): assert issubclass(MetadataNot...
{ "content_hash": "ca1e42a5fd948be76fdcaef0cc298cb1", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 78, "avg_line_length": 39.86666666666667, "alnum_prop": 0.8210702341137124, "repo_name": "Ritiek/Spotify-Downloader", "id": "ec5c32cb3e3cc525831cc7963be9e94c7f626667", "siz...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('pages', '0019_dashboardpage_show_toc'), ] operations = [ migrations.AddField( model_name='homepage', name='show_toc', ...
{ "content_hash": "d73e005bcaddfa9bc75ad760d390103b", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 89, "avg_line_length": 23.38888888888889, "alnum_prop": 0.6104513064133017, "repo_name": "bruecksen/isimip", "id": "5fa5673de515a517efab40292321d6e56dd1711a", "size": "494"...
from __future__ import print_function, unicode_literals from collections import namedtuple from itertools import cycle import mock from zope.interface import alsoProvides from twisted.trial import unittest from twisted.internet.task import Clock, Cooperator from twisted.internet.interfaces import IPullProducer from ......
{ "content_hash": "e9b3f3f97689ccf6156fc9cfb56236ae", "timestamp": "", "source": "github", "line_count": 655, "max_line_length": 87, "avg_line_length": 40.919083969465646, "alnum_prop": 0.5864114618312066, "repo_name": "warner/magic-wormhole", "id": "296d7851ab972c5c1d1d98cb736e37cac41cf9cb", "size"...
from __future__ import absolute_import, print_function import six from django.conf import settings from django.db import IntegrityError, transaction from django.utils import timezone from django.utils.safestring import mark_safe from django.views.decorators.cache import never_cache from six.moves.urllib.parse import ...
{ "content_hash": "d8cc580e2af65ac4a16ad44911f3047a", "timestamp": "", "source": "github", "line_count": 272, "max_line_length": 106, "avg_line_length": 35.31617647058823, "alnum_prop": 0.4952113262544243, "repo_name": "jean/sentry", "id": "c3e5c7c109457323f072365b439edbd759ca2740", "size": "9606", ...
from collections import Counter import os import sys import json import time import shlex import random import hashlib import argparse import threading import paramiko # # util # def rebuild_uri(uri): user, host, port = parse_uri(uri) return '{}@{}:{}'.format(user, host, port) def parse_uri(uri): if '...
{ "content_hash": "733c9396055907935b8def6949904dc2", "timestamp": "", "source": "github", "line_count": 1418, "max_line_length": 146, "avg_line_length": 31.172073342736248, "alnum_prop": 0.6061716664404325, "repo_name": "mtasic85/nspawn", "id": "c6629e17ec50e377dfd930f673c1a23360812df7", "size": "4...
"""This module contains the classes that represent Telegram InlineQueryResultArticle.""" from telegram import InlineQueryResult class InlineQueryResultArticle(InlineQueryResult): """This object represents a Telegram InlineQueryResultArticle. Attributes: type (:obj:`str`): 'article'. ...
{ "content_hash": "a948f195ae22168594a58b5a401e6cc9", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 97, "avg_line_length": 41.093333333333334, "alnum_prop": 0.5739779364049319, "repo_name": "rogerscristo/BotFWD", "id": "7957bd8c0ba70e8ced584386676b935d3d3c7186", "size": "...
from pprint import pprint from django.conf import settings from django.contrib.auth.mixins import PermissionRequiredMixin from django.shortcuts import render from django.urls import reverse from django.views import View from fo2.connections import db_cursor_so import lotes.models import lotes.queries from lotes.view...
{ "content_hash": "2413b4a89334498a26b6195b4aae023f", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 62, "avg_line_length": 28.164835164835164, "alnum_prop": 0.5622317596566524, "repo_name": "anselmobd/fo2", "id": "97cd14882ec17fe6aa3486e40f8b25d9c2138991", "size": "2566",...
from util.tipo import tipo class S_LOGIN_ACCOUNT_INFO(object): def __init__(self, tracker, time, direction, opcode, data): print(str(type(self)).split('.')[3]+'('+str(len(data))+'): '+ str(data.get_array_hex(1))[1:-1])
{ "content_hash": "28ec88687b4f44ab8ea88bccc4d0119e", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 103, "avg_line_length": 46.4, "alnum_prop": 0.6206896551724138, "repo_name": "jeff-alves/Tera", "id": "26078eea4242e1e4d177090a17fa0dcc4d568097", "size": "232", "binary": ...
################################################################################# # # The MIT License (MIT) # # Copyright (c) 2015 Dmitry Sovetov # # https://github.com/dmsovetov # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "...
{ "content_hash": "53fa903a70fe7e8b6bbf1f939bdf08a3", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 82, "avg_line_length": 32.12068965517241, "alnum_prop": 0.654320987654321, "repo_name": "dmsovetov/pygling", "id": "635a41da0dfb38dbd1cae69498c4222c6d969b29", "size": "1863...
from django.contrib import admin from orderable.admin import OrderableAdmin, OrderableStackedInline, \ OrderableTabularInline from orderable.tests.models import Book, Chapter, Review class ChapterAdmin(OrderableTabularInline): model = Chapter class ReviewAdmin(OrderableStackedInline): model = Review clas...
{ "content_hash": "0973fc578e53f186288446b24e5e01a6", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 69, "avg_line_length": 29, "alnum_prop": 0.7728194726166329, "repo_name": "tkaemming/django-orderable", "id": "93ca1c773a53619ec155021629d6393caa7a1bb9", "size": "493", "...
from component.ha.MiVacuum import MiVacuum import time import difflib import datetime import logging _LOGGER = logging.getLogger(__name__) class HAConfig(object): """HAConfig""" def __init__(self): self._nextTime = {} self._configs = {} self._objects = {} def addConfig(self, key,...
{ "content_hash": "090c24348655272a4a092d8d31d04a5b", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 83, "avg_line_length": 29.761904761904763, "alnum_prop": 0.5658666666666666, "repo_name": "pengzhangdev/slackbot", "id": "4fea9ad40586ae64c77ba6eb593724c5efcb6716", "size"...
from .trie import Trie from .dictionary import DictInterface, TrieDict
{ "content_hash": "b7b28bdb8140e9928d287c3db8c8d88e", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 47, "avg_line_length": 35.5, "alnum_prop": 0.8309859154929577, "repo_name": "hankcs/HanLP", "id": "2725b5824ce86dd6a28c94ec9a14b978a20758a0", "size": "136", "binary": fals...
import numpy as np from numpy import linalg import matplotlib.pyplot as plt from skimage.io import imread from skimage.exposure import rescale_intensity from skimage.color import rgb2grey, separate_stains #Color deconvolution #Normalized optical density matrix #see Ruifrok AC, Johnston DA. Quantification of histolo...
{ "content_hash": "52fae6734d60840b5ff6a2a9ae9a90f0", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 93, "avg_line_length": 27.970588235294116, "alnum_prop": 0.6792849631966351, "repo_name": "griffincalme/MicroDeconvolution", "id": "89d6d88dc95bc30228010084a3c647d43eb5a730",...
import os import json def zenoss_pullLargeDevicesList(): os.system("./zenoss_getDevices.sh") f = open("tmpfile.txt") data = f.read() dct_lst = json.loads(data) print "Device list lenght:", len(dct_lst) zenoss_pullLargeDevicesList()
{ "content_hash": "72acbc1d90f38d1f3205874b2fdef2e4", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 45, "avg_line_length": 18.357142857142858, "alnum_prop": 0.669260700389105, "repo_name": "thomasvincent/utilities", "id": "a7c4749279566d3812109ca7da0e3a03ff4478e5", "size"...
import logging logging.basicConfig(level=logging.DEBUG) import nengo import nengo_spinnaker import numpy as np def test_constant_node_ensemble_and_value_probe(): with nengo.Network("Test Network") as network: a = nengo.Node(0.50) b = nengo.Ensemble(100, 2) nengo.Connection(a, b, transform...
{ "content_hash": "1b266f339c741f8577be42c8da870f6c", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 76, "avg_line_length": 29.529411764705884, "alnum_prop": 0.6145418326693227, "repo_name": "project-rig/nengo_spinnaker", "id": "561a41b63372135b89d6f233aec381e10fa2847e", "...
from tornado import stack_context from tornado.tcpserver import TCPServer class SOCKS5Handler(object): def __init__(self, stream, address, server): self.stream = stream self.address = address self.server = server class SOCKS5Server(TCPServer): def __init__(self): TCPServer.__...
{ "content_hash": "16805fee326972460fceac2aa8da3e03", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 48, "avg_line_length": 25, "alnum_prop": 0.668235294117647, "repo_name": "decimalbell/socksproxy", "id": "10f80559dc30e1643b8b745a74a52b3211fa16e3", "size": "425", "binar...
import networkzero as nw0 nw0.advertise("myservice5")
{ "content_hash": "96072836d4ee4db003adc59a1e4c77fe", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 27, "avg_line_length": 18.333333333333332, "alnum_prop": 0.8, "repo_name": "tjguk/networkzero", "id": "4df5e2db9a1475722632166253e3b58f3a1395e7", "size": "55", "binary": f...
from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String Base = declarative_base() class Translation(Base): __tablename__ = 'translations' lang = Column(String(10), primary_key=True) verb = Column(String(25), primary_key=True) english = Column(String(25),...
{ "content_hash": "1a77e8d7da047c967719e4c4bc6316d8", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 104, "avg_line_length": 33.4, "alnum_prop": 0.6846307385229541, "repo_name": "saltares/conjugate", "id": "7c35a1f73c1055a37291b6d7f45b05e7967323ab", "size": "501", "binar...
import os from PIL import Image class ImageResize(object): """Redimensar imagen.""" def __init__(self, path): """Inicializa atributos. Args: path (str): Ruta absoluta de la imagen, con la imagen. Attributes: path (str): Ruta absoluta de la imagen, con la ima...
{ "content_hash": "68718ecc014ea2a8fefb0cc36613a51b", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 90, "avg_line_length": 36.214285714285715, "alnum_prop": 0.5609467455621302, "repo_name": "snicoper/snicoper.com", "id": "3ca4b9ee61c375d5fae7999555fb3a63a8f40d64", "size":...
import string import random from serial.tools.list_ports import comports try: from glob import glob except Exception as error: print 'Install glob' raise error ROOT_MESSAGE = """ .-------------------------------. ( You need Super Cow Powers here. ) '------------------------------...
{ "content_hash": "9ee2583401282cbe5738ddba51ca1c52", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 89, "avg_line_length": 31.425, "alnum_prop": 0.4009546539379475, "repo_name": "start-x/startx-src", "id": "813e4afae56dd6cedc3fa452ab3dc5952babd567", "size": "1274", "bin...
""" Form generation utilities for App Engine's ``db.Model`` class. The goal of ``model_form()`` is to provide a clean, explicit and predictable way to create forms based on ``db.Model`` classes. No malabarism or black magic should be necessary to generate a form for models, and to add custom non-model related fields: ...
{ "content_hash": "2929676a597113ddf202fa70fd34c3b6", "timestamp": "", "source": "github", "line_count": 452, "max_line_length": 108, "avg_line_length": 39.77654867256637, "alnum_prop": 0.5481951165248345, "repo_name": "webitup/python3-wforms", "id": "8ef690cfa2f7b249b29dc8669ac40e2851f1c961", "size...
import json from sovrin_client.agent.walleted_agent import WalletedAgent from sovrin_client.test.agent.mock_backend_system import MockBackendSystem import anoncreds.protocol.types from sovrin_client.client.wallet.wallet import Wallet from sovrin_client.test.constants import primes from sovrin_common.identity import I...
{ "content_hash": "005b88840d2d09ca4322531e7da8b122", "timestamp": "", "source": "github", "line_count": 234, "max_line_length": 113, "avg_line_length": 37.18376068376068, "alnum_prop": 0.5326973911044708, "repo_name": "keenondrums/sovrin-node", "id": "9bb5c2357f0adad05b5d5037f676eb6b80ee9c6b", "siz...
"""Connect to a MySensors gateway via pymysensors API.""" import asyncio import logging from typing import Callable, Dict, List, Optional, Tuple, Type, Union from mysensors import BaseAsyncGateway import voluptuous as vol from homeassistant import config_entries from homeassistant.components.mqtt import valid_publish...
{ "content_hash": "fdd4e06b76a58636fc04519676a97bf4", "timestamp": "", "source": "github", "line_count": 303, "max_line_length": 122, "avg_line_length": 33.71287128712871, "alnum_prop": 0.6309348996573666, "repo_name": "turbokongen/home-assistant", "id": "25b4d3106da5c91031d8e3e6d1db63277d2f8d4e", "...
from django.conf.urls import patterns, url urlpatterns = patterns( "legacy.views", url( r"^article/(?P<article_pk>\d+)", "legacy_blog_article", name="legacy_blog_article", ), url( r"^article/list", "legacy_blog_articles", name="legacy_blog_articles", ...
{ "content_hash": "6935cf5e509c40f61623f23f90efd382", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 42, "avg_line_length": 20.375, "alnum_prop": 0.5521472392638037, "repo_name": "daGrevis/daGrevis.lv", "id": "4efb8466f7cb7f458e3bfdf997c5040299f75297", "size": "326", "bi...
def transform(dataset, sigma=2.0): """Apply a Gaussian filter to tilt images.""" """Gaussian Filter blurs the image and reduces the noise and details.""" import scipy.ndimage import numpy as np tiltSeries = dataset.active_scalars # Transform the dataset. result = np.empty_like(tiltSeries)...
{ "content_hash": "ad2052bbf1c3fbbd3f97502622524ec3", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 76, "avg_line_length": 31, "alnum_prop": 0.6875, "repo_name": "OpenChemistry/tomviz", "id": "01548a757e351b391c936833650164e467c3b53d", "size": "496", "binary": false, ...
import sys sys.path.append('./lib') import networking as networkingLib import lib.common as comLib import re import time def getInterfaceStats(): ret = [] f = open("/proc/net/dev", "r") data = f.readlines()[2:] ips = getInterfaceIps() for d in data: cols = re.split('[\t\s]+', d) co...
{ "content_hash": "0bf11beaef8a1626c087d664233339af", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 67, "avg_line_length": 28.0546875, "alnum_prop": 0.5324422166527429, "repo_name": "GridProtectionAlliance/ARMORE", "id": "4e35d4387834c8cfea7a0684fb926639b493f012", "size"...
import unittest from threading import Event from unittest.mock import MagicMock, call, patch from streamlink.stream.hls import HLSStream, HLSStreamReader from tests.mixins.stream_hls import EventedHLSStreamWriter, Playlist, Segment, TestMixinStreamHLS FILTERED = "filtered" class SegmentFiltered(Segment): def _...
{ "content_hash": "93ef3d1302e5bdf39c6525178b84c103", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 123, "avg_line_length": 41.52808988764045, "alnum_prop": 0.6392045454545454, "repo_name": "amurzeau/streamlink-debian", "id": "10c52bc4ae2541e7469ad1c31c01464ad76347d1", "...
import os import re import ctypes import struct from os import O_RDWR, O_CLOEXEC, O_NONBLOCK from stat import S_ISCHR from mmap import mmap from pathlib import Path from ctypes import c_uint8 as ubyte PAGE_SHIFT = 12 PAGE_SIZE = 1 << PAGE_SHIFT PAGE_MASK = -PAGE_SIZE # a physical memory region associated with an uio ...
{ "content_hash": "0554b8868df105aa0aa6c77cc2bc65b5", "timestamp": "", "source": "github", "line_count": 239, "max_line_length": 80, "avg_line_length": 33.63598326359833, "alnum_prop": 0.5725836546834183, "repo_name": "mvduin/py-uio", "id": "1a93835a13ae34ce60525e0cde87f4ee89ee2071", "size": "8039",...
from __future__ import division from PyQt4 import QtCore, QtGui from vistrails.core.utils import any, expression from vistrails.core import system from constant_configuration import StandardConstantWidget, ColorWidget ############################################################################ class QueryWidgetMixi...
{ "content_hash": "0d5c4f0f1b704b9ea65a062d8804ef1b", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 77, "avg_line_length": 37.69298245614035, "alnum_prop": 0.5941354433325576, "repo_name": "minesense/VisTrails", "id": "e28d6985ea1f0d289f1560c77bc5e345dc03742b", "size": "...
from __future__ import division, absolute_import, unicode_literals from django.contrib import messages from django.utils.translation import ugettext_lazy, pgettext_lazy from djadmin2 import permissions from djadmin2.actions import BaseListAction class CustomPublishAction(BaseListAction): permission_classes = ...
{ "content_hash": "15d5cfa1739eb16fa3f9477235017c09", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 85, "avg_line_length": 29.71014492753623, "alnum_prop": 0.713170731707317, "repo_name": "andrewsmedina/django-admin2", "id": "fcb6e5da906895129423e7a3c4df6a037270a04b", "si...
from __future__ import unicode_literals import platform if platform.python_version() < '2.7': import unittest2 as unittest else: import unittest import requests import responses from magma.session import Session class TestSession(unittest.TestCase): def test_ua_set_on_init(self): ua = 'th+is/a...
{ "content_hash": "0d828b9bedc05c5b010565c811da1f8f", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 78, "avg_line_length": 29.44776119402985, "alnum_prop": 0.6203750633552965, "repo_name": "bfontaine/p7magma", "id": "ea35f7e204a4e7ddd202cc5f82d7cd237601d8ca", "size": "212...
from __future__ import absolute_import, print_function import io import re from glob import glob from os.path import basename from os.path import dirname from os.path import join from os.path import splitext from setuptools import find_packages from setuptools import setup def read(*names, **kwargs): return io....
{ "content_hash": "687e4800017b74719720e38f21c9f3df", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 96, "avg_line_length": 33.924050632911396, "alnum_prop": 0.591044776119403, "repo_name": "jiocloudservices/jcsclient", "id": "685c5978d7b49840ede7540dd9b5637bc7215a97", "si...
import phase_disassembler_native import phase_disassembler_jvm def init_argparser(argparser): subparsers = argparser.add_subparsers(help='Input format') native_parser = subparsers.add_parser('native') jvm_parser = subparsers.add_parser('jvm') phase_disassembler_native.init_argparser(native_parser) ...
{ "content_hash": "2e3694cc9f0f115bfb07c4db50f65288", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 62, "avg_line_length": 30.12, "alnum_prop": 0.7250996015936255, "repo_name": "RainM/perf-toolkit", "id": "1577ce2d5fd6f64f8ac2885c0612f3c1d6883199", "size": "1353", "bina...
import base64 from typing import Optional, TypedDict from backend.common.sitevars.sitevar import Sitevar class ContentType(TypedDict): username: str authkey: str class FMSApiSecrets(Sitevar[ContentType]): @staticmethod def key() -> str: return "fmsapi.secrets" @staticmethod def def...
{ "content_hash": "a4a20f2055bd2faa7e2ad256420440ba", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 92, "avg_line_length": 29.54, "alnum_prop": 0.6472579553148273, "repo_name": "the-blue-alliance/the-blue-alliance", "id": "48ef4556a9cd78aeb6223ea37988e1616aa2a818", "size"...
import os if os.path.isfile('_ls'): os.system("make clean") else: os.system("make qemu");
{ "content_hash": "2e7832ffdd7ffec66852b09f0c2bc2d1", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 25, "avg_line_length": 15.5, "alnum_prop": 0.6559139784946236, "repo_name": "belfazt/xv6", "id": "a07732cf5c6d0f4dfee830601370b0db6c62c1b1", "size": "93", "binary": false,...
import numpy as np from multiprocessing import Process, Pipe from baselines.common.vec_env import VecEnv def rollout(env, ob, new, ac, pi, horizon, stochastic): # Initialize history arrays obs = np.array([ob for _ in range(horizon)]) rews = np.zeros(horizon, 'float32') vpreds = np.zeros(horizon, 'float...
{ "content_hash": "b5ad8f65a494c2301d0977a45c61c7b2", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 115, "avg_line_length": 32.661764705882355, "alnum_prop": 0.5634849167041873, "repo_name": "pcchenxi/baseline", "id": "705d65ac4bdb21b501ebfc3f83539e9159179568", "size": "...
""" Adds a "category" capability to Traits-based classes, similar to that provided by the Cocoa (Objective-C) environment for the Macintosh. You can use categories to extend an existing HasTraits class, as an alternative to subclassing. An advantage of categories over subclassing is that you can access...
{ "content_hash": "e40934e557791ccf55bfe0f92aa0dce8", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 80, "avg_line_length": 41.064516129032256, "alnum_prop": 0.49515579994763026, "repo_name": "burnpanck/traits", "id": "fdbc52332810658ccb282cdec8003ad502160a09", "size": "44...
import urllib import json import os import constants import accounts from flask import Flask from flask import request from flask import make_response # Flask app should start in global layout app = Flask(__name__) PERSON = constants.TEST_1 @app.route('/webhook', methods=['POST']) def webhook(): req = request.g...
{ "content_hash": "e473e5ee6daeb59b1df9c5a521303f28", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 144, "avg_line_length": 27.49367088607595, "alnum_prop": 0.6252302025782689, "repo_name": "10239847509238470925387z/tmp123", "id": "a477cbe56b0f143b53d9193de114c7aa2f5db5ad",...
__author__ = 'OSAMA' # This file tests serial communication with Arduino UNO # when sending a message of data very quickly; Also, # examine the initialization flag. # Imports import serial import time import threading import socket def main(): # All the main code resides here. def read(): try: ...
{ "content_hash": "a8648e232dfece0f8228cba24a2d7e83", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 71, "avg_line_length": 23.352941176470587, "alnum_prop": 0.5575146935348446, "repo_name": "osamadel/ROV-Hydra", "id": "51f99c17999f78d2996b5f9e62fcda23a37efd82", "size": "1...
from os import path from urllib import urlencode try: import json # try stdlib (Python 2.6) except ImportError: try: import simplejson as json # try external module except: import gluon.contrib.simplejson as json # fallback to pure-Python module from gluon import current, URL from gluon.ht...
{ "content_hash": "cda9a2188f386718a3dd0d12629733ad", "timestamp": "", "source": "github", "line_count": 405, "max_line_length": 108, "avg_line_length": 37.65432098765432, "alnum_prop": 0.43875409836065576, "repo_name": "code-for-india/sahana_shelter_worldbank", "id": "46c9b8ce80591c7aa72524fba1735e00...
from fabric.api import local import re import sys import os import shutil scala_version_path = 'project/Version.scala' gradle_version_path = 'aeromock-dsl/gradle.properties' gradle_tmp_path = 'tmp_gradle_version' scala_tmp_path = 'tmp_scala_version' versions_path = 'versions.txt' versions_tmp_path = 'tmp_versions.txt'...
{ "content_hash": "f35f5811c941613cfc150931130835cf", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 102, "avg_line_length": 28.426136363636363, "alnum_prop": 0.6012392564461323, "repo_name": "CyberAgent/aeromock", "id": "2b0f76a358dc00c23f62f4abe0543159ad71a2c8", "size":...
""" BlueButtonFHIR_API FILE: apps.v1api.contract Created: 1/4/16 1:22 AM Write consent by beneficiary to allow use of their data by third party application Status: Experimental Get FHIR Contract format from http://hl7.org/fhir/contract.html { "resourceType" : "Contract", // from Resource: id, meta, implicitRule...
{ "content_hash": "ff0b57619ae6a944fa30f538b4d55e7a", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 109, "avg_line_length": 46.892857142857146, "alnum_prop": 0.6713632901751714, "repo_name": "ekivemark/BlueButtonFHIR_API", "id": "25cc917b26808f7902aee415f3383c9b04b96aba", ...
""" The MatchMaker classes should except a Topic or Fanout exchange key and return keys for direct exchanges, per (approximate) AMQP parlance. """ import contextlib import itertools import json import logging from cinder.openstack.common import cfg from cinder.openstack.common.gettextutils import _ matchmaker_opts ...
{ "content_hash": "8e0e3b0d6847b33e953fb5c8c1cea75c", "timestamp": "", "source": "github", "line_count": 272, "max_line_length": 79, "avg_line_length": 29.125, "alnum_prop": 0.6032567533451149, "repo_name": "rnirmal/cinder", "id": "ffe4870aa4a0c12df6e7336fe076d2d3af53e1e6", "size": "8585", "binary...
import Turbo_I2C.BMP280 as BMP280 #sensor = BMP280(mode=BMP280_OSAMPLE_16) sensor = BMP280.BMP280() degrees = sensor.read_temperature() pascals = sensor.read_pressure() hectopascals = pascals / 100 print 'ChipID = 0x{0:2x} '.format(sensor.ChipID ) print 'Version = 0x{0:2x}'.format(sensor.Version ) print 'Times...
{ "content_hash": "74fff6bf498433d53fa7fe895d7d1026", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 53, "avg_line_length": 31.3, "alnum_prop": 0.694888178913738, "repo_name": "emwtur/Turbo_Python_I2C", "id": "a7a02d0b82eee8f18398721aaa587441eae4b723", "size": "704", "bi...
from django.test.utils import override_settings from hc.api.models import Channel from hc.test import BaseTestCase class AddSlackTestCase(BaseTestCase): def setUp(self): super().setUp() self.url = "/projects/%s/add_slack/" % self.project.code def test_instructions_work(self): self.cli...
{ "content_hash": "f821d03364313475294c8875d7d1fb8f", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 76, "avg_line_length": 36.46808510638298, "alnum_prop": 0.6534422403733956, "repo_name": "iphoting/healthchecks", "id": "73fa1269dfeb422765b999d5d3da79dbcb149bec", "size": ...
""" Fantastic Add-on Copyright (C) 2016 Fantastic This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ...
{ "content_hash": "198a56075eb5303a08a0a94a9bfef528", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 109, "avg_line_length": 35.64, "alnum_prop": 0.7182940516273849, "repo_name": "TheWardoctor/Wardoctors-repo", "id": "9a8a264a48e3d3f5c25a17483284b0d8113523f0", "size": "916...
import socket from pysnmp import debug SYMBOLS = { 'IP_PKTINFO': 8, 'IP_TRANSPARENT': 19, 'SOL_IPV6': 41, 'IPV6_RECVPKTINFO': 49, 'IPV6_PKTINFO': 50, 'IPV6_TRANSPARENT': 75 } for symbol, value in SYMBOLS.items(): if not hasattr(socket, symbol): setattr(socket, symbol, value) ...
{ "content_hash": "66377b60c51713bbf0c8893c994e8e82", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 76, "avg_line_length": 24.571428571428573, "alnum_prop": 0.6046511627906976, "repo_name": "etingof/pysnmp", "id": "bba068faed7c653d8ad6208a083380b38be3035e", "size": "673",...
""" Created on Sat Mar 25 17:21:17 2017 @author: kissf """ from .dist import * from .ioRule import * from .queue_m import *
{ "content_hash": "b4e5c7304e9055809567c0fc01daffee", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 35, "avg_line_length": 11.636363636363637, "alnum_prop": 0.65625, "repo_name": "kissf-lu/jupyter_app", "id": "2c485dfe84c41b3bcd4818e93bb2cc0586974e8b", "size": "152", "b...
import logging from common_fixtures import * # NOQA DEFAULT_TIMEOUT = 900 subscription_id = os.environ.get('AZURE_SUBSCRIPTION_ID') subscription_cert = os.environ.get('AZURE_SUBSCRIPTION_CERT') # Use azure settings from environment variables , if set i = 'b39f27a8b8c64d52b05eac6a62ebad85__' i = i + 'Ubuntu-14_04_1...
{ "content_hash": "46470ecfdb2dee39f7e3d76d07e504fd", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 77, "avg_line_length": 35.946236559139784, "alnum_prop": 0.575231827699671, "repo_name": "sonchang/validation-tests", "id": "2b1533df519c305680a98bb1ad4d95a2027dead3", "siz...
import common as c from config import bitness, msvc_version, build_dir, dependencies_dir, build_type import os import platform c.print('>> Installing leptonica') install_dir = dependencies_dir url = 'https://github.com/DanBloomberg/leptonica/releases/download/1.82.0/leptonica-1.82.0.tar.gz' required_version = '1.82.0...
{ "content_hash": "a5f2de52671e3f3cdd5513b29fd8480e", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 98, "avg_line_length": 31.89, "alnum_prop": 0.6462841015992474, "repo_name": "OneMoreGres/ScreenTranslator", "id": "6361abfed475cd9b801391d1f10fba8176d815a3", "size": "318...
from binding import * from .namespace import llvm from .Type import Type GenericValue = llvm.Class() @GenericValue class GenericValue: delete = Destructor() def _factory(name, *argtys): return CustomStaticMethod('GenericValue_' + name, ptr(GenericValue), *argtys) ...
{ "content_hash": "d1901acb35b68d40808b053f32fdf719", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 75, "avg_line_length": 31.470588235294116, "alnum_prop": 0.6570093457943925, "repo_name": "llvmpy/llvmpy", "id": "4dc50d840f5321b5ce4905af4c7108cbf55ea737", "size": "1070",...