text
stringlengths
4
1.02M
meta
dict
import unittest from Fold import Fold, clusters_to_labels from load_data import load_files __author__ = 'mbarnes1' class MyTestCase(unittest.TestCase): def setUp(self): text, self.labels, ad_id, self.phones = load_files(max_lines=500) self.folds = Fold(text, self.phones, self.labels, number_proces...
{ "content_hash": "3ae911034bdd483710de0bb74f92057c", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 95, "avg_line_length": 44.702127659574465, "alnum_prop": 0.6539742979533556, "repo_name": "benbo/QPR_CP1", "id": "77e0719e2ac81f3c584562bf9cfcc95b542e3334", "size": "2101",...
"""This module converts SuperMemo collections to Anki.""" class Converter: """ This class converts a dictionary of Element objects into a format that can be imported into an Anki deck. """ def __init__(self, elements, path_to_media_directory): """ elements: A dictionar...
{ "content_hash": "f1d378f4a1fafdaa97a7659418e35529", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 85, "avg_line_length": 38.86734693877551, "alnum_prop": 0.5563139931740614, "repo_name": "michalmazur/sm2anki", "id": "91daf77c7e8781a7b25701b8beaf79ac0c530d80", "size": "...
import webapp2 import jinja2 import os import re import string #initiate jinja template_dir = os.path.join(os.path.dirname(__file__), 'templates') jinja_env = jinja2.Environment(loader = jinja2.FileSystemLoader(template_dir), autoescape = True) #Constants PAGE_RE = r'(/(?:[a-zA-Z0-9...
{ "content_hash": "89d4eb621e2b3368b49c380087757029", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 101, "avg_line_length": 28.647058823529413, "alnum_prop": 0.6427104722792608, "repo_name": "andyttran/flappichicken", "id": "a50f0620bb009213a5779327fe3628063d9d2788", "siz...
from os.path import join from pythonforandroid.recipe import CompiledComponentsPythonRecipe class PillowRecipe(CompiledComponentsPythonRecipe): """ A recipe for Pillow (previously known as Pil). This recipe allow us to build the Pillow recipe with support for different types of images and fonts. But...
{ "content_hash": "23e48250030f60fa76274a1eb9c6b8cf", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 79, "avg_line_length": 41.34444444444444, "alnum_prop": 0.6226820747110992, "repo_name": "kivy/python-for-android", "id": "f8f6929db5639a3fc887f457a875b201879d6738", "size"...
from collections import OrderedDict import functools import re from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from googl...
{ "content_hash": "1dbbf76c12f6cc01a7d297f2c6728b0b", "timestamp": "", "source": "github", "line_count": 1082, "max_line_length": 154, "avg_line_length": 41.975970425138634, "alnum_prop": 0.6223523713065304, "repo_name": "googleapis/python-dialogflow-cx", "id": "8ca567634beba8ab7814ce82c17d2a9b7641bad...
import ctypes import os import shutil from unittest import mock import ddt from os_win import constants from os_win import exceptions from os_win.tests.unit import test_base from os_win.utils import pathutils from os_win.utils.winapi import constants as w_const from os_win.utils.winapi.libs import advapi32 as advapi3...
{ "content_hash": "f9c34f2bc9b176dd4c9d72ea3c8e3c54", "timestamp": "", "source": "github", "line_count": 422, "max_line_length": 79, "avg_line_length": 39.36255924170616, "alnum_prop": 0.5952079947023057, "repo_name": "openstack/os-win", "id": "08b71348093eef84dc2152677a9844a79ceeb00a", "size": "172...
import logging import os import re from packstack.installer import basedefs from packstack.installer.setup_controller import Controller from packstack.installer.exceptions import PackStackError controller = Controller() PUPPET_DIR = os.path.join(basedefs.DIR_PROJECT_DIR, "puppet") PUPPET_TEMPLATE_DIR = os.path.join(...
{ "content_hash": "47fa8545d9744de45cc75f0487ce34c2", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 76, "avg_line_length": 29.835164835164836, "alnum_prop": 0.596316758747698, "repo_name": "radez/packstack", "id": "d4fc0e0041c8cf4a544de22f3fc58706b63305ed", "size": "2716"...
from llvm.core import * from llvm.tbaa import * from llvm.tests.support import TestCase import unittest class TestTBAABuilder(TestCase): def test_tbaa_builder(self): mod = Module.new('test_tbaa_builder') fty = Type.function(Type.void(), [Type.pointer(Type.float())]) foo = mod.add_function(f...
{ "content_hash": "b21d05aca750cfee688c1abd5449aad5", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 70, "avg_line_length": 28.37142857142857, "alnum_prop": 0.6112789526686808, "repo_name": "llvmpy/llvmpy", "id": "4a24de877d28556a5136f1cf9259b141e0f2eddd", "size": "993", ...
"""Tests unitofwork operations.""" from test.lib.testing import eq_, assert_raises, assert_raises_message import datetime import operator from sqlalchemy.orm import mapper as orm_mapper import sqlalchemy as sa from sqlalchemy import Integer, String, ForeignKey, literal_column, event from test.lib import engines, test...
{ "content_hash": "345564853469e6cd848b883ea24f27df", "timestamp": "", "source": "github", "line_count": 2519, "max_line_length": 141, "avg_line_length": 32.987693529178244, "alnum_prop": 0.5299533070183884, "repo_name": "ioram7/keystone-federado-pgid2013", "id": "725e0c543ed439062ce40c0a2b9977b359c74...
from __future__ import absolute_import, division, print_function, unicode_literals from generate_travis_yml import generate_travis_yml if __name__ == '__main__': generate_travis_yml()
{ "content_hash": "9b7e87d61375f58062622aece41258fa", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 82, "avg_line_length": 27, "alnum_prop": 0.7248677248677249, "repo_name": "twitter/pants", "id": "c128eccd8bfccba16d7bebe299019485f27cb38e", "size": "336", "binary": false...
from django.contrib import admin from .models import ImagerProfile # Register your models here. admin.site.register(ImagerProfile)
{ "content_hash": "a7e13724263ce9a3aa979c46ff4ba124", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 34, "avg_line_length": 32.75, "alnum_prop": 0.8320610687022901, "repo_name": "wohlfea/django_imager", "id": "a61af3908f8da3b706f4818056d1bcfd2bd59803", "size": "131", "bin...
""" OCR - Controllers """ import StringIO #Importing reportlab stuff from reportlab.pdfgen.canvas import Canvas from reportlab.lib.pagesizes import A4 # Fonts Courier = 'Courier' Helvetica = 'Helvetica' Helvetica_Bold = 'Helvetica-Bold' Helvetica_Bold_Oblique = 'Helvetica-BoldOblique' Helvetica_Oblique = 'Helveti...
{ "content_hash": "afcc9834a0b192bfe68d35aa79b13cfe", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 120, "avg_line_length": 33.675324675324674, "alnum_prop": 0.6247589664481296, "repo_name": "luisibanez/SahanaEden", "id": "8d8fed746e4c7de9fb8ccee1bd852c6c8f32af0d", "size...
import math import pygame class Simulation: def __init__(self, width, height, ms_to_minutes): """ width - The width of the simulation in arbitrary internal units. height - The height of the simulation in arbitrary internal units. ms_to_minutes - Multiplied by the numbe...
{ "content_hash": "7789f1c4fc709c2526f12a622d5b0173", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 89, "avg_line_length": 31.86842105263158, "alnum_prop": 0.541701073492981, "repo_name": "DaveTCode/tradingsim", "id": "91e5e07c0a141294a5b129c2157a29258ef5d601", "size": "2...
""" Public interface for flanker address (email or url) parsing and validation capabilities. Public Functions in flanker.addresslib.address module: * parse(address, addr_spec_only=False) Parse a single address or URL. Can parse just the address spec or the full mailbox. * parse_list(address_list...
{ "content_hash": "f6cec3112a8fcafc159549ff1c74a333", "timestamp": "", "source": "github", "line_count": 620, "max_line_length": 91, "avg_line_length": 29.532258064516128, "alnum_prop": 0.5994538503549973, "repo_name": "aroberts/flanker", "id": "6fb098d7736b5995427155e8ee00707015434fb0", "size": "18...
import sys import time import cli from scapy.all import * class Proto: pass const = Proto() stores = Proto() def GetToday(): return str((time.strftime("%d-%m-%Y-%H%M%S"))) def check_dependencies(): #CHECK FOR DEPENDENCIES if len(cli.check_sysfile('scapy'))==0: print 'scapy executable not found. Make sure you ...
{ "content_hash": "3ed8713d9a901da44d03969e9ba58864", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 116, "avg_line_length": 34.84166666666667, "alnum_prop": 0.7084429562305669, "repo_name": "greenygh0st/authwatch-gg", "id": "2221529e48aace465212fa16e85d62b6d70af7dd", "si...
"""This tests for things in source files. Initially, absence of tabs :-) """ from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, SecureTestCase, GlobDirectoryWalker, printLocation setOutDir(__name__) from reportlab.lib.testutils import RL_HOME,testsFolder __version__=''' $Id$ ''' import os, ...
{ "content_hash": "bc16762b229ff2d9442515d2abf8f682", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 138, "avg_line_length": 36.7752808988764, "alnum_prop": 0.6119767797128017, "repo_name": "malexandre/python-xhtml2pdf-demo", "id": "496d2092499a228bf970667e4bfc44229a1ba576",...
import json import threading import time from dcp import DcpClient, ResponseHandler class MyHandler(ResponseHandler): def __init__(self): ResponseHandler.__init__(self) self.lock = threading.Lock() self.count = 0 def mutation(self, response): self.lock.acquire() #pri...
{ "content_hash": "47b1a794c1ab6dd25f393a632e02a5dc", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 83, "avg_line_length": 25.360655737704917, "alnum_prop": 0.5817711700064642, "repo_name": "couchbaselabs/python-dcp-client", "id": "edda838e50c3d60de428921c695327696154a365",...
from django.db import connections from django.db.models.aggregates import Count from django.utils.unittest import TestCase from django_orm.postgresql.hstore.functions import HstoreKeys, HstoreSlice, HstorePeek from django_orm.postgresql.hstore.expressions import HstoreExpression from .models import DataBag, Ref, Refs...
{ "content_hash": "81090664ee295da9b9c106f6eb2c21fc", "timestamp": "", "source": "github", "line_count": 316, "max_line_length": 109, "avg_line_length": 38.10126582278481, "alnum_prop": 0.5866279069767442, "repo_name": "cr8ivecodesmith/django-orm-extensions-save22", "id": "6a3c31d4ad3b6bd3ba4e52add191...
from __future__ import unicode_literals import datetime import os from decimal import Decimal from unittest import skipUnless from django import forms from django.core.exceptions import ( NON_FIELD_ERRORS, FieldError, ImproperlyConfigured, ) from django.core.files.uploadedfile import SimpleUploadedFile from djang...
{ "content_hash": "b7add052742b669c347911d78322dfc5", "timestamp": "", "source": "github", "line_count": 2609, "max_line_length": 219, "avg_line_length": 41.27251820620928, "alnum_prop": 0.599925705794948, "repo_name": "52ai/django-ccsds", "id": "2672fa51164f02e4d5a17713e14d15c07401d6b6", "size": "1...
from django import template from dashboard.models import PagePos, SiteSetting register = template.Library() @register.inclusion_tag('header_links.html') def show_header_links(): header_pos = PagePos.objects.get_headers() return locals() @register.inclusion_tag('footer.html') def show_footer(): footer_e...
{ "content_hash": "e52200459de20405329f371b931b8a04", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 76, "avg_line_length": 30.76923076923077, "alnum_prop": 0.65875, "repo_name": "Ma233/beijingteach", "id": "85e3fc1da9f0197c157805b96b47634ce070c7d1", "size": "800", "bina...
"""Inception Resnet v2 Faster R-CNN implementation in Keras. See "Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning" by Szegedy et al. (https://arxiv.org/abs/1602.07261) as well as "Speed/accuracy trade-offs for modern convolutional object detectors" by Huang et al. (https://arxiv.org/a...
{ "content_hash": "8ffc6364bc9f75a04bc86f3d9aa5a8a6", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 79, "avg_line_length": 39.06944444444444, "alnum_prop": 0.679701386420192, "repo_name": "tombstone/models", "id": "f185aa01dd377c66b94ca37cc244350b2071f21c", "size": "6316...
"""Handle the SCOP HIErarchy files, which describe the SCOP hierarchy in terms of SCOP unique identifiers (sunid). The file format is described in the scop "release notes.":http://scop.berkeley.edu/release-notes-1.55.html The latest HIE file can be found "elsewhere at SCOP.":http://scop.mrc-lmb.cam.ac.uk/scop/parse/ ...
{ "content_hash": "1d260b22b4a0768283ea91fd1fa21ba1", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 79, "avg_line_length": 27.053763440860216, "alnum_prop": 0.5397456279809221, "repo_name": "zjuchenyuan/BioWeb", "id": "3e2bc040ee0abd1b83645f8e091035a220f15f67", "size": "2...
from __future__ import division, print_function, absolute_import import numpy as np from functools import reduce from itertools import product from t_test import * def size(shape, axis=None): """ Return the number of elements along a given axis. Parameters ---------- shape : tuple The shape...
{ "content_hash": "5cbdcac8cd41cb3e68a1ac4c2ccc62e4", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 93, "avg_line_length": 27.95145631067961, "alnum_prop": 0.6015977770059048, "repo_name": "ye-zhi/project-epsilon", "id": "f0b043aabd118dccc3ea71c08736ea52193d7046", "size"...
import mxnet as mx import numpy as np import unittest from mxnet.test_utils import rand_ndarray, assert_almost_equal from common import setup_module, with_seed, assertRaises, teardown from mxnet.base import py_str, MXNetError shape = (4, 4) keys = [5, 7, 11] str_keys = ['b', 'c', 'd'] def init_kv(stype='default'): ...
{ "content_hash": "6166bca2a176b0ae066d6d4615035113", "timestamp": "", "source": "github", "line_count": 331, "max_line_length": 98, "avg_line_length": 32.55287009063444, "alnum_prop": 0.5693735498839907, "repo_name": "mbaijal/incubator-mxnet", "id": "28d4ec262c06110f620e69d2b85c7249c5bad88d", "size...
from PyQt4 import QtGui, QtCore from PyQt4.QtCore import Qt from time import strftime class DateTime(QtGui.QDialog): def __init__(self,parent = None): QtGui.QDialog.__init__(self, parent) self.parent = parent self.formats = ["%A, %d. %B %Y %H:%M", "%A, %d. %B %Y",...
{ "content_hash": "8cab1c7c2b904308cd75eb2ff956a3ef", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 66, "avg_line_length": 26.203389830508474, "alnum_prop": 0.4896507115135834, "repo_name": "goldsborough/Writer-Tutorial", "id": "24c8b5ac55dad7244e91416a2093563a9342ff7e", ...
import os, sys; sys.path.insert(0, os.path.join("..", "..")) import datetime import codecs import random import unittest from pattern import db # To test MySQL, you need MySQLdb and a username + password with rights to create a database. HOST, PORT, USERNAME, PASSWORD = \ "localhost", 3306, "root", "" DB_MYSQL ...
{ "content_hash": "db54961a497726f6b7602d0dadbbd3b7", "timestamp": "", "source": "github", "line_count": 1080, "max_line_length": 125, "avg_line_length": 43.983333333333334, "alnum_prop": 0.5135783756473412, "repo_name": "piskvorky/pattern", "id": "3c84c66d431b755e638b43215ea8657c6907dd7e", "size": ...
"""Setup script for the pyparsing module distribution.""" from distutils.core import setup import sys import os _PY3 = sys.version_info[0] > 2 if _PY3: from pyparsing_py3 import __version__ as pyparsing_version else: from pyparsing_py2 import __version__ as pyparsing_version modules = ["p...
{ "content_hash": "533f9b5e642fec053cecf381ae74a44c", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 83, "avg_line_length": 30.363636363636363, "alnum_prop": 0.6281437125748504, "repo_name": "5monkeys/pyparsing", "id": "642c5f001e6e5ba672929bcfeb4450f93985a836", "size": "1...
import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # Get the project root ...
{ "content_hash": "8b6cb3a791a73d57f14a49b9dddcb33e", "timestamp": "", "source": "github", "line_count": 246, "max_line_length": 80, "avg_line_length": 32.32113821138211, "alnum_prop": 0.7067035593007169, "repo_name": "lpomfrey/latexrender", "id": "f22a86d437825968d9dbd6fa7cdecc7809027c38", "size": ...
__author__ = 'Michael Montero <mcmontero@gmail.com>' # ----- Imports --------------------------------------------------------------- from tinyAPI.base.config import ConfigManager import logging import random import tinyAPI __all__ = [ 'StatsLogger' ] # ----- Public Classes -------------------------------------...
{ "content_hash": "054329344cb1fad5d6e463011665fa9b", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 79, "avg_line_length": 31.872340425531913, "alnum_prop": 0.42923898531375165, "repo_name": "mcmontero/tinyAPI", "id": "fb3269d2512b17d26b67ae9fdaef9a7777ab6ef6", "size": "1...
import json import os import sys from aldryn_client import forms SYSTEM_FIELD_WARNING = 'WARNING: this field is auto-written. Please do not change it here.' class Form(forms.BaseForm): languages = forms.CharField( 'Languages', required=True, initial='["en", "de"]', help_text=SYSTE...
{ "content_hash": "90febeb1228876ba8e012ffb45bbb604", "timestamp": "", "source": "github", "line_count": 289, "max_line_length": 148, "avg_line_length": 42.13840830449827, "alnum_prop": 0.5436853342092297, "repo_name": "JimyRyan/jimyryan-djangocms", "id": "2a83b3c3a6d47addf0c2178a1049fc51be4a6519", ...
import yaml from pyramid_mako import add_mako_renderer from pyramid.interfaces import IStaticURLInfo import sqlalchemy import sqlahelper import pyramid_tm from papyrus.renderers import GeoJSON, XSD import simplejson as json from c2cgeoportal.lib import dbreflection, get_setting, caching, \ MultiDomainPregenerat...
{ "content_hash": "77489c88b51f511440a02191c133740a", "timestamp": "", "source": "github", "line_count": 507, "max_line_length": 98, "avg_line_length": 34.67061143984221, "alnum_prop": 0.634656957560587, "repo_name": "tsauerwein/c2cgeoportal", "id": "07eca2768c26398f56e42073e94003207e2ac36e", "size"...
import pytest import sqlalchemy as sa from sqlalchemy_utils import assert_max_length, assert_non_nullable from tests.factories import UserFactory @pytest.mark.usefixtures('database') class TestUser(object): @pytest.mark.parametrize( 'column', ( 'id', 'email', 'f...
{ "content_hash": "fcd54c1a44e9b02b3cada9d1da8d7502", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 67, "avg_line_length": 28.217391304347824, "alnum_prop": 0.5631741140215717, "repo_name": "wappulehti-apy/diilikone-api", "id": "95eaa8e21ccc054a72d461a51467198f1ed0b629", ...
class Pipeline(object): def __init__(self, filters, **kwargs): """Initialize a new pipeline Any arguments that should be passed to specific filters should be passed as a kwarg. :param list filters: A list of filters. All filters should inherit Example: import ...
{ "content_hash": "8fec2bdb46fed42b30b94a195dbb84cd", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 74, "avg_line_length": 25.75, "alnum_prop": 0.5631067961165048, "repo_name": "rsenk330/html-pypeline", "id": "36dbb1fec6ee5a94fb4b632796ad3f36c6fdd354", "size": "927", "b...
""" Various common informations """ from .exact_common_information import exact_common_information from .functional_common_information import functional_common_information from .gk_common_information import gk_common_information from .mss_common_information import mss_common_information from .wyner_common_information ...
{ "content_hash": "5ade8400490768a1725a34d8342335bd", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 72, "avg_line_length": 39.111111111111114, "alnum_prop": 0.8380681818181818, "repo_name": "Autoplectic/dit", "id": "aab4bd67485658304bfe7142406677c082d911de", "size": "352",...
__author__ = 'Dustin Whittle <dustin@yahoo-inc.com>' __version__ = '0.1' import os, sys, unittest # update sys path to include bundled modules with priority sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../../../src')) import yahoo.yql class YQLTest(unittest.TestCase): def setUp(self): self....
{ "content_hash": "c02cd1a639201850c293b378f161357e", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 117, "avg_line_length": 29.6, "alnum_prop": 0.6718146718146718, "repo_name": "yahoo/yos-social-python", "id": "eee6795359d647346114d3e2042e62af2baa90a2", "size": "1055", ...
"""Tests for the HTTP API for the cloud component.""" import asyncio from unittest.mock import patch, MagicMock import pytest from homeassistant.bootstrap import async_setup_component from homeassistant.components.cloud import DOMAIN, auth_api from tests.common import mock_coro @pytest.fixture def cloud_client(has...
{ "content_hash": "62f8b5653b6e216e364a5babeb351e91", "timestamp": "", "source": "github", "line_count": 353, "max_line_length": 79, "avg_line_length": 34.51558073654391, "alnum_prop": 0.6492941562705187, "repo_name": "stefan-jonasson/home-assistant", "id": "1090acb01e992c04f9ff507a29453c1e4e212a29", ...
from PyQt5.QtWidgets import QWidget, QDialogButtonBox from PyQt5.QtCore import QEvent, Qt from .password_input_uic import Ui_PasswordInputWidget class PasswordInputView(QWidget, Ui_PasswordInputWidget): """ The model of Navigation component """ def __init__(self, parent): # construct from qtDe...
{ "content_hash": "6a3f2fdcc137e9bd9804976b372b4648", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 89, "avg_line_length": 34.951219512195124, "alnum_prop": 0.6699232379623168, "repo_name": "ucoin-io/cutecoin", "id": "51a32a20c6a6fc787719860b997b7f662506c394", "size": "14...
"""A word-counting workflow.""" from __future__ import absolute_import import logging import re import apache_beam as beam from apache_beam.io import ReadFromText from apache_beam.io import WriteToText from apache_beam.metrics import Metrics from apache_beam.metrics.metric import MetricsFilter from apache_beam.utils...
{ "content_hash": "f4ad6688e96c24f12ff5533f6b80bc3a", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 80, "avg_line_length": 36.25925925925926, "alnum_prop": 0.6693054136874361, "repo_name": "vikkyrk/incubator-beam", "id": "e93fd2b2a33fb27f2f3233e7d0910ad1eaa9e43f", "size"...
"""The SpectralMixture kernel.""" import numpy as np import tensorflow.compat.v2 as tf from tensorflow_probability.python.internal import assert_util from tensorflow_probability.python.internal import dtype_util from tensorflow_probability.python.internal import parameter_properties from tensorflow_probability.python...
{ "content_hash": "b575b27593c51d5d2bba65d9b5fca761", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 102, "avg_line_length": 41.30167597765363, "alnum_prop": 0.6591370215068307, "repo_name": "tensorflow/probability", "id": "bfd6846a3b07af631b438094942a66a63db0af79", "size...
import json import time from airflow.utils.log.logging_mixin import LoggingMixin from airflow.utils.state import State from datetime import datetime as dt from airflow.contrib.kubernetes.pod import Pod from airflow.contrib.kubernetes.kubernetes_request_factory import \ pod_request_factory as pod_factory from kubern...
{ "content_hash": "cf94cda8a5364885a64c3844f33833af", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 90, "avg_line_length": 39.63793103448276, "alnum_prop": 0.5761925474844135, "repo_name": "fenglu-g/incubator-airflow", "id": "2704fd9d327151a4bf16dc6f5146c8b3bb96cdfe", "s...
import math class Controller(): """ The controller class defines a behavior for the supervisor class. Any implemention must inherit from this class and implement the :meth:`~Controller,execute` method to return a unicycle model output. :param params: A structure containing the inte...
{ "content_hash": "fe8e175752ea949f962f72617c891514", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 105, "avg_line_length": 38.48837209302326, "alnum_prop": 0.6519637462235649, "repo_name": "ZhuangER/robot_path_planning", "id": "45fe7b756bf1d91cfa75ff93bc29621a92a58d30", ...
BASE_DIR = '/home/travis/build/whitews/PubMedVis' DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAM...
{ "content_hash": "b165c53091e17b6d135c654949981b31", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 108, "avg_line_length": 34.189542483660134, "alnum_prop": 0.6792200344102466, "repo_name": "whitews/PubMedVis", "id": "f920eb163bde3304aed2592a4db6bd076c7fee78", "size": "...
from collections import defaultdict import datetime import inspect import json import os import subprocess import traceback import sys import shutil from functools import wraps from multiprocessing import Pool, cpu_count from submitty_utils import submitty_schema_validator # global variable available to be used by th...
{ "content_hash": "2dedf2bcc460391c4e3c2bd570a8fa6d", "timestamp": "", "source": "github", "line_count": 779, "max_line_length": 145, "avg_line_length": 42.28754813863928, "alnum_prop": 0.5905227369315768, "repo_name": "Submitty/Submitty", "id": "b79418f468fa73b2073d4f36cd4c3c1563b1c3f2", "size": "3...
""" Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ from lib.core.exception import SqlmapUnsupportedFeatureException from plugins.generic.filesystem import Filesystem as GenericFilesystem class Filesystem(GenericFilesystem): def __init__(self): ...
{ "content_hash": "8539ef63687d252c423c579b1e8bfc60", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 71, "avg_line_length": 37.21052631578947, "alnum_prop": 0.7397454031117398, "repo_name": "JeyZeta/Dangerous", "id": "da8fc26ed969fb4da6d9c270daa4bc5506343e3b", "size": "730...
"""Tests for grr_response_client.client_build.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import io import multiprocessing import os from absl.testing import absltest import mock from grr_response_client_builder import client_build from grr_respo...
{ "content_hash": "47e0fd141ae93e4c7c17d2594e68fd4a", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 66, "avg_line_length": 35.78688524590164, "alnum_prop": 0.6610169491525424, "repo_name": "dunkhong/grr", "id": "564bfbc816ee6523f6e993193cb6d25e3ab08d1d", "size": "2205", ...
import gettext #: Version information (major, minor, revision[, 'dev']). version_info = (2, 0, 2) #: Version string 'major.minor.revision'. version = __version__ = ".".join(map(str, version_info)) gettext.install('stalkerutils')
{ "content_hash": "7027ae88aa8edf9e6b014e2fb31f3fad", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 57, "avg_line_length": 28.875, "alnum_prop": 0.683982683982684, "repo_name": "pandemicsyn/stalker", "id": "6b258b5c37c2dbffe84aef18b33e9d896fdc85d2", "size": "231", "binar...
from __future__ import annotations import json import random import string import textwrap from io import StringIO from unittest import mock import paramiko import pytest from airflow import settings from airflow.exceptions import AirflowException from airflow.models import Connection from airflow.providers.ssh.hook...
{ "content_hash": "980a5f050a3dbb88ec53e37938166176", "timestamp": "", "source": "github", "line_count": 940, "max_line_length": 110, "avg_line_length": 39.12340425531915, "alnum_prop": 0.5602023058516423, "repo_name": "apache/airflow", "id": "6448d88efe49736020ca8108205b2a771d62190d", "size": "3756...
from lxml import etree from tempest.common import http from tempest.common import rest_client from tempest.common import xml_utils as common from tempest import config CONF = config.CONF XMLNS = "http://docs.openstack.org/identity/api/v3" class PolicyClientXML(rest_client.RestClient): TYPE = "xml" def __i...
{ "content_hash": "a83644d3cee96da2e73a3e0116250f1b", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 79, "avg_line_length": 36.70786516853933, "alnum_prop": 0.5791245791245792, "repo_name": "nikolay-fedotov/tempest", "id": "41bbfe55638f41268071692f363e1f94b71409ae", "size"...
import sys import fileinput from foreman.client import Foreman with open("password_foreman.txt") as f: password_foreman = f.readline().rstrip() fore = Foreman(url="https://foreman-crn.acis.ufl.edu", api_version=2, auth=('mjcollin', password_foreman)) for line in fileinput.input(): fields = line.split(","...
{ "content_hash": "8840e917e7c35c5f2f7102a632b37c75", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 83, "avg_line_length": 27.20689655172414, "alnum_prop": 0.523447401774398, "repo_name": "acislab/vm_scripts", "id": "d073a72025b8a151ff58fb0b3f098bb157ffa861", "size": "987...
import re import os import stat import json import Queue import hashlib import ansible import ansible.runner import ansible.playbook from ansible import callbacks from ansible import utils from flask import flash, redirect, url_for def command_runner(user, command, inventory, view): if re.findall('rm', command) o...
{ "content_hash": "0a16c5f332a8c2aeace2d9bbf685f87a", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 130, "avg_line_length": 25.60747663551402, "alnum_prop": 0.6401459854014598, "repo_name": "kefatong/ops", "id": "e599b6039bdabb155123a95c80ad59a2d1541354", "size": "2832",...
from cms.models.pluginmodel import CMSPlugin from cms.models.pagemodel import Page from django.utils.translation import ugettext_lazy as _ from django.db import models class NavbarPluginModel(CMSPlugin): DISPLAY_CHOICES =(("", _("default")), ("navbar-fixed-top", _("fixed to top")), ...
{ "content_hash": "a2a5fa04609d7c0f91918ce394db7cbc", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 211, "avg_line_length": 49.48148148148148, "alnum_prop": 0.6070359281437125, "repo_name": "RacingTadpole/cmsplugin-rt", "id": "6de00f6ee8998216f2033161063135b19348b3ff", "s...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('goals', '0097_auto_20151125_1802'), ] operations = [ migrations.AddField( model_name='trigger', name='start_when_selected', ...
{ "content_hash": "4eb38cd7270d80edba1fdbc27c21e559", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 133, "avg_line_length": 26.166666666666668, "alnum_prop": 0.6284501061571125, "repo_name": "izzyalonso/tndata_backend", "id": "cbded46db66a37989804cf5bb586dc6e536856ea", "s...
"""Extract, format and print information about Python stack traces.""" import linecache import string import sys import types def _print(file, str='', terminator='\n'): file.write(str+terminator) def print_list(extracted_list, file=None): """Print the list of tuples as returned by extract_tb() or extract_stack()...
{ "content_hash": "c54deb47f520e3221815379f98309577", "timestamp": "", "source": "github", "line_count": 274, "max_line_length": 75, "avg_line_length": 32.85766423357664, "alnum_prop": 0.6871042985671443, "repo_name": "MalloyPower/parsing-python", "id": "b733598f258476b34721d8b99a133e7d28a65eb0", "s...
"""b3j0f.sync version module.""" __all__ = ['__version__'] # Store the version here so: # 1) we don't load dependencies by storing it in __init__.py # 2) we can import it in setup.py for the same reason # 3) we can import it into the utils module # thanks to https://github.com/pycontribs/jira/blob/master/jira/version...
{ "content_hash": "0f34a006966f56d8dbe15673159293c5", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 74, "avg_line_length": 30.5, "alnum_prop": 0.680327868852459, "repo_name": "b3j0f/sync", "id": "8e3fa88dff41be304e3fa316e16da0ee09a3c828", "size": "1686", "binary": false...
''' view_log_meta worker ''' import pprint class ViewLogMeta(object): ''' ViewLogMeta: Generates a view for meta data on the sample ''' dependencies = ['log_meta'] def execute(self, input_data): ''' Execute the ViewLogMeta worker ''' # Deprecation unless something more interesting happens...
{ "content_hash": "cdc4926355e6f3afdcace43d48b8d548", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 99, "avg_line_length": 33.625, "alnum_prop": 0.6505576208178439, "repo_name": "SuperCowPowers/workbench", "id": "56d908184d04d84bfc4f12f1a8a9a483ccc844b4", "size": "1346", ...
import pytest from plenum.test.checkpoints.helper import check_for_nodes, check_stable_checkpoint from stp_core.common.log import getlogger from plenum.test.conftest import getValueFromModule from plenum.test.helper import waitForViewChange, \ sdk_send_random_and_check from plenum.test.node_catchup.helper import ...
{ "content_hash": "242460714b26d58e5f4ef25d25bf6e09", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 104, "avg_line_length": 45.48684210526316, "alnum_prop": 0.6994503905120046, "repo_name": "evernym/zeno", "id": "72d5954dde105bf53975a7d8374189ed07963efa", "size": "3457", ...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('builds', '0001_initial'), ] operations = [ migrations.CreateModel( name='Application', fields=[ ('id', model...
{ "content_hash": "f45732f06cc659a8240fb3d06a75a65c", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 218, "avg_line_length": 43.23809523809524, "alnum_prop": 0.5458883994126285, "repo_name": "mback2k/django-app-downloads", "id": "af794064f6d836b3492fc83b604e2e25fb8345c1", ...
import sys import inspect import logging from textwrap import dedent import discord from discord.ext.commands.bot import _get_variable from .exceptions import HelpfulError from .bot import MusicBot from .constructs import BetterLogRecord class Yikes: """ TODO """ def find_module(self, fullname, path=None)...
{ "content_hash": "7650110d32074cf0ea0f9cdaf36e9601", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 102, "avg_line_length": 32.56115107913669, "alnum_prop": 0.6042863455589925, "repo_name": "DiscordMusicBot/MusicBot", "id": "29007e5187aa03ed80117c8dcc6adc7b94911990", "si...
''' This module contains code to build PDF "Form XObjects". A Form XObject allows a fragment from one PDF file to be cleanly included in another PDF file. Reference for syntax: "Parameters for opening PDF files" from SDK 8.1 http://www.adobe.com/devnet/acrobat/pdfs/pdf_open_parameters.pdf supported...
{ "content_hash": "b16e66d73d7d73e0f188a93aaf62e8ea", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 91, "avg_line_length": 34.371428571428574, "alnum_prop": 0.6071725448284052, "repo_name": "tajtiattila/pdfrw", "id": "ba34f61557328fd7d1c7d226f2e25b1193061ecb", "size": "8...
orIfInt = eval(input('Please enter an int:')) if orIfInt == 1 or orIfInt == 2 or orIfInt == 3: print('Value of orIfInt is', orIfInt, '\n') else: print(orIfInt, 'is not in the scope.\n') print('End of program')
{ "content_hash": "777cac2957096b89129998d2aefaccd9", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 48, "avg_line_length": 27.5, "alnum_prop": 0.6363636363636364, "repo_name": "panherz/MyPyCode", "id": "7785c03fe124476ebab55810162b1c39ac455d81", "size": "237", "binary": ...
from distutils.core import setup setup( name='belfort', version='0.0.0', packages=[''], url='https://github.com/frxncisjoseph/belfort', license='Apache License 2.0', author='Francis Joseph', author_email='francisgjoseph@outlook.com', description='Belfort is a binary options trading robo...
{ "content_hash": "757ecb2e41cf6e4933fb363171a46444", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 60, "avg_line_length": 27.166666666666668, "alnum_prop": 0.6779141104294478, "repo_name": "frxncisjoseph/belfort", "id": "36f2abfcfc0091925688e5f177d2379494128410", "size":...
import os import numpy as np import tables as tb from toolz import first from .dispatch import dispatch import datashape import shutil from blaze.utils import tmpfile from .resource import resource __all__ = ['PyTables'] def dtype_to_pytables(dtype): """ Convert NumPy dtype to PyTable descriptor Example...
{ "content_hash": "61d8af60f9563aec65ee79d179201ef5", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 83, "avg_line_length": 28.33884297520661, "alnum_prop": 0.5567220764071158, "repo_name": "vitan/blaze", "id": "5fe60cee55d743526645471e63580639a2ba8578", "size": "3429", ...
"""Constants for the Goodwe component.""" from datetime import timedelta from homeassistant.const import Platform DOMAIN = "goodwe" PLATFORMS = [Platform.NUMBER, Platform.SELECT, Platform.SENSOR] DEFAULT_NAME = "GoodWe" SCAN_INTERVAL = timedelta(seconds=10) CONF_MODEL_FAMILY = "model_family" KEY_INVERTER = "inver...
{ "content_hash": "751aebb29fc00ba65973284a8320a5fe", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 63, "avg_line_length": 22.88235294117647, "alnum_prop": 0.7609254498714653, "repo_name": "GenericStudent/home-assistant", "id": "0e40601ccdb41b3c0ba407b1e29b47b3ae3bc6b8", ...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = """ --- module: ce_interface_ospf version_added: "2.4" short_description: Manages configuration of an OSPF interface instanceon HUAWEI CloudEngine switches. descrip...
{ "content_hash": "2bb6b44db8a3ddc53ea0b3cbc8f7ee6a", "timestamp": "", "source": "github", "line_count": 777, "max_line_length": 105, "avg_line_length": 38.77606177606177, "alnum_prop": 0.5529224335357961, "repo_name": "thaim/ansible", "id": "02901b7b07993087cc4d67ae41d229f8c0412911", "size": "30804...
""" WSGI config for cotndemo 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.6/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cotndemo.settings") from django.core...
{ "content_hash": "127902ca04a99e3d744bdd0a7e573d9d", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 27.928571428571427, "alnum_prop": 0.7749360613810742, "repo_name": "achoy/cotndemo", "id": "76e6b038903a34e99f756626114cf09da2a5982c", "size": "391",...
import random def meistermind(): solution = "" turns = 8 print "Meistermind" print "You have 8 tries to guess the right sequence" print "of four symbols (being the letters A through G)" colors = { 1: "A", 2: "B", 3: "C", 4: "D", 5: "E", ...
{ "content_hash": "089e4c074183c9cf5c446317579586f1", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 75, "avg_line_length": 23.322033898305083, "alnum_prop": 0.4316860465116279, "repo_name": "posiputt/Sandbox", "id": "4f20c4dbd0d353da91bfd13a9ca1df9d1baeefdc", "size": "137...
import os, sys, optparse from datetime import datetime as dt try: from common_methods import * except ImportError: sys.exit("Could not find common_methods.py... download the full toolkit from https://github.com/MonroCoury/Forensic_Tools") def read_accounts(db): '''Read account details from skype database....
{ "content_hash": "ef966a8e198d2e422a40ae087b0402f2", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 167, "avg_line_length": 51.57831325301205, "alnum_prop": 0.551156271899089, "repo_name": "MonroCoury/Forensic-Tools", "id": "bbd68c9e72a1abe2ce798241c8bcae02e548b0e4", "si...
#!/usr/bin/env python # May God Bless Us All import struct, sys, subprocess, string, re, os, json # Constants COMMENT_STR = "{3}\n\tProblem Name = {0}\n\tProblem Link = {1}\n\tUser = {2}\n{4}\n" PY_COMMENT_START = "'''" PY_COMMENT_END = "'''" CPP_JAVA_START = "/*" CPP_JAVA_END = "*/" IDE = {'c' : 'C_IDE', 'cpp' : 'CP...
{ "content_hash": "323035415dc31c7b54f13cc1f454a319", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 92, "avg_line_length": 31.824324324324323, "alnum_prop": 0.5834394904458599, "repo_name": "jarifibrahim/code-now", "id": "acabb5fa063c3721ac924fc27a177e8953a0c24d", "size":...
import time import json import sys import urllib import urllib2 import tornado.autoreload import tornado.httpserver import tornado.ioloop import tornado.web from tornado import gen from tornado.httpclient import AsyncHTTPClient, HTTPRequest from tornado.options import define, options # 希望返回成功还是失败 # 1 - 成功 # -1 - 失败...
{ "content_hash": "80057cebf25c78c4cbaaeca40038cdca", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 112, "avg_line_length": 27.181159420289855, "alnum_prop": 0.5851772860570514, "repo_name": "wchming1987/Tumbler", "id": "60de087326af1857e34cfcb293c68e6aee80cd46", "size":...
from datetime import datetime from google.appengine.api import memcache, users from google.appengine.ext import db, webapp from google.appengine.ext.webapp import util, template from google.appengine.ext.webapp.util import login_required from oauth2client.appengine import CredentialsProperty, StorageByKeyName from oaut...
{ "content_hash": "cba89f6ef3df18dc2be3ed19b6d4b8ba", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 89, "avg_line_length": 30.15686274509804, "alnum_prop": 0.7139141742522757, "repo_name": "aadityabhatia/testzone2011-ScatterGraph", "id": "630f6d7036344f34ba38fba6f7e75ddd6f...
from django.views.generic.base import TemplateView class HomeView(TemplateView): """Create HomeView class.""" template_name = 'tracker/home.html' class AboutView(TemplateView): """Create AboutView class.""" template_name = 'tracker/about.html'
{ "content_hash": "d52a1dc626163300569faafd7f73ac2e", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 50, "avg_line_length": 24, "alnum_prop": 0.7159090909090909, "repo_name": "pattern-of-life/tracker", "id": "2c189c63928a76f0fb4ecdd7c16ee94a11b483db", "size": "264", "bin...
import calendar import datetime import time from google.appengine.api import quota from google.appengine.api import taskqueue from google.appengine.ext import db import config import delete import model import utils CPU_MEGACYCLES_PER_REQUEST = 1000 EXPIRED_TTL = datetime.timedelta(delete.EXPIRED_TTL_DAYS, 0, 0) FET...
{ "content_hash": "4f6db888eb588fc839fbd9a8ed924ccb", "timestamp": "", "source": "github", "line_count": 323, "max_line_length": 80, "avg_line_length": 39.253869969040245, "alnum_prop": 0.6200015774114678, "repo_name": "santoshsahoo/personfinder", "id": "a3fb8779424f58f76266661c74df483a2c9403a3", "s...
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import os, sys, warnings def fn_name(): return sys._getframe(1).f_code.co_name if six.PY3: warnings.warn( "The gtk* backends have not been tested with Python 3.x", ImportWarning...
{ "content_hash": "6867cda4fbb2503432a7ef8cc43b6b18", "timestamp": "", "source": "github", "line_count": 1075, "max_line_length": 166, "avg_line_length": 35.11906976744186, "alnum_prop": 0.5730935289910736, "repo_name": "andyraib/data-storage", "id": "83b5c4a5cbaceaa8924531330096f36923eb30c9", "size...
""" Swaggy Jenkins Jenkins API clients generated from Swagger / Open API specification # noqa: E501 The version of the OpenAPI document: 1.5.1-pre.0 Contact: blah@cliffano.com Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import unittest import datetim...
{ "content_hash": "483014afc97de5fae1c55ec1c12e98b1", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 95, "avg_line_length": 32.233333333333334, "alnum_prop": 0.594105480868666, "repo_name": "cliffano/swaggy-jenkins", "id": "dd793cd757165991a5d74657ef31ce0b49a883f3", "size"...
from datetime import timedelta import numpy as np import warnings import copy from textwrap import dedent import pandas as pd from pandas.core.base import AbstractMethodError, GroupByMixin from pandas.core.groupby import (BinGrouper, Grouper, _GroupBy, GroupBy, SeriesGroupBy, groupby,...
{ "content_hash": "bd863f7646d5f75f85b74d8f87c4cb2f", "timestamp": "", "source": "github", "line_count": 1424, "max_line_length": 79, "avg_line_length": 32.51755617977528, "alnum_prop": 0.5518410538818702, "repo_name": "winklerand/pandas", "id": "bd441a8248841f2ed9c6bfb8615d22fd602bfd32", "size": "4...
import kbr.file_utils as file_utils def to_list(value) -> list: if isinstance(value, list): return value return [ value ] def readin_if_file(name:str) -> str: if os.path.isfile( name): name = file_utils.read(name) return name
{ "content_hash": "546d6d07a309e52286921be0434d4479", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 36, "avg_line_length": 18.785714285714285, "alnum_prop": 0.623574144486692, "repo_name": "brugger/kbr-tools", "id": "50b7ceb3a2a4ca997ea83dde410252673f4caba8", "size": "263...
""" This script asks cdash to give it a summary of all of the failing tests on the nightly expected section. It presents the tests ranked by the number of failing machines. From this view you can more easily see what is in the greatest need of fixing. """ import sys import time import datetime import urllib # Process...
{ "content_hash": "d198156dd49cd508a9c8a2d8cd9948fa", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 177, "avg_line_length": 28.309278350515463, "alnum_prop": 0.6504005826656956, "repo_name": "biddisco/VTK", "id": "e5b07bff7f39347cb14fd18504652736059f56f9", "size": "2764",...
""" Common Policy Engine Implementation Policies can be expressed in one of two forms: A list of lists, or a string written in the new policy language. In the list-of-lists representation, each check inside the innermost list is combined as with an "and" conjunction--for that check to pass, all the specified checks m...
{ "content_hash": "5ad2b09d9bf804d566ede13d36fd6418", "timestamp": "", "source": "github", "line_count": 945, "max_line_length": 79, "avg_line_length": 32.11957671957672, "alnum_prop": 0.5733864856851053, "repo_name": "sajeeshcs/nested_quota_final", "id": "d4be54643aea89a9fdc18ef96459c5e434180d1e", ...
from System.IO import * from System.Drawing import * from System.Runtime.Remoting import * from System.Threading import * from System.Windows.Forms import * from System.Xml.Serialization import * from System import * from Analysis.EDM import * from DAQ.Environment import * from EDMConfig import * r = Random() def sa...
{ "content_hash": "328cf33a5072d54cd722c4a253e06de9", "timestamp": "", "source": "github", "line_count": 349, "max_line_length": 132, "avg_line_length": 40.37535816618911, "alnum_prop": 0.7439500390320063, "repo_name": "ColdMatter/EDMSuite", "id": "83bc681c88046bebee5fd2396b6ad5aa521e5f58", "size": ...
from consul import Consul, ConsulException from common.utils.asleep import asleep from requests import ConnectionError from twisted.internet.defer import inlineCallbacks, returnValue import etcd3 import structlog class ConsulStore(object): """ Config kv store for consul with a cache for quicker subsequent reads ...
{ "content_hash": "dff4daa0d3d1ec1a6cc2adc3110b065b", "timestamp": "", "source": "github", "line_count": 275, "max_line_length": 79, "avg_line_length": 33.81818181818182, "alnum_prop": 0.551505376344086, "repo_name": "opencord/voltha", "id": "d9063488ab7745358e86935804ea0c276a37a85b", "size": "9898"...
"""Changes to start the implementation of the version 2 Revision ID: 415746eb9f6 Revises: None Create Date: 2014-10-23 16:00:47.940216 """ # revision identifiers, used by Alembic. revision = '415746eb9f6' down_revision = '166ff2dcc48d' from alembic import op, context from sqlalchemy import Column, ForeignKey, Table...
{ "content_hash": "82d5914b495b74d830075d138695a357", "timestamp": "", "source": "github", "line_count": 363, "max_line_length": 117, "avg_line_length": 41.421487603305785, "alnum_prop": 0.6174514498536845, "repo_name": "tsauerwein/c2cgeoportal", "id": "19d43040382b25c9e589dd22202a9dbe6d768cee", "si...
""" NOTE: This file is only used for backward compatibility tests with new dist_utils.py in st2common/tests/unit/test_dist_utils.py. DO NOT USE THIS FILE ANYWHERE ELSE! """ from __future__ import absolute_import import os import re import sys from distutils.version import StrictVersion # NOTE: This script can't re...
{ "content_hash": "719afb4c0a17637048e7b82bb7d16895", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 98, "avg_line_length": 27.883928571428573, "alnum_prop": 0.6295228946525776, "repo_name": "Plexxi/st2", "id": "da38f6edbf4f0c2458645e9f5ebc30c99791bf94", "size": "3775", ...
from flask import Blueprint, render_template, redirect, session, request import MySQLdb as mdb import json import hashlib blueprint = Blueprint('admin', __name__, url_prefix='/admin', static_folder='../static', template_folder='../templates') #database query functions def getHours(): #gets fec hours con = mdb.connec...
{ "content_hash": "6150f5c517c6829e3a51be9c151f4626", "timestamp": "", "source": "github", "line_count": 309, "max_line_length": 266, "avg_line_length": 32.76051779935275, "alnum_prop": 0.6956435839178109, "repo_name": "rileymjohnson/fbla", "id": "ad91dbd061f41092e1199a577103a89267035bf0", "size": "...
from util import * import sys # Usage: z3-lib-dir benchmark-dir test_cs(sys.argv[1], sys.argv[2], ext="cs", timeout_duration=60.0) exit(0)
{ "content_hash": "f4ce3c0486b2c6d54a5b00d76fb2745d", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 66, "avg_line_length": 27.8, "alnum_prop": 0.7050359712230215, "repo_name": "dstaple/z3test", "id": "58ff9b27d0a5eb5898e9c3e78bc884b57b03514d", "size": "183", "binary": fa...
import os from stash.tests.stashtest import StashTestCase class Sha256sumTests(StashTestCase): """tests for the sha256sum command.""" def setUp(self): """setup the tests""" self.cwd = self.get_data_path() StashTestCase.setUp(self) def get_data_path(self): """return the d...
{ "content_hash": "1f7c772fd1fcec68abca4549f66af5c0", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 90, "avg_line_length": 38.19672131147541, "alnum_prop": 0.6158798283261803, "repo_name": "ywangd/stash", "id": "2a56141e64c1a5ad101ec63453c05fcb832060fe", "size": "2354", ...
import copy import logging import google.oauth2.service_account from ibis_bigquery.client import BigQueryClient from data_validation import clients, consts, state_manager from data_validation.result_handlers.bigquery import BigQueryResultHandler from data_validation.result_handlers.text import TextResultHandler from ...
{ "content_hash": "90d11c6e220321db809e18520552289b", "timestamp": "", "source": "github", "line_count": 742, "max_line_length": 158, "avg_line_length": 38.014824797843666, "alnum_prop": 0.5871237636047789, "repo_name": "GoogleCloudPlatform/professional-services-data-validator", "id": "d9f224cb51bb76f...
import cPickle import gzip import os import astropy.units as u from astropy.coordinates import SkyCoord from XtDac.data_files import get_data_file_path class ChandraSourceCatalog(object): def __init__(self): # Find the catalog data file catalog_file = get_data_file_path('chandra_csc_1.1.pickle....
{ "content_hash": "93c205815c98a526dd426c40d99655b7", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 91, "avg_line_length": 26.40625, "alnum_prop": 0.6085798816568048, "repo_name": "giacomov/XtDac", "id": "2e875360ef0004d00db48f3b3809b392442fa9c9", "size": "3380", "bina...
from lite_boolean_formulae import L def test_get_literals_from_literal(): assert L("x").get_literals() == frozenset(("x",)) def test_get_literals_from_formula(): assert ((L("x") & L("y")) | L("z")).get_literals() == frozenset(("x", "y", "z"))
{ "content_hash": "ce8e6de8aa5cf14f13cbc009a9063adf", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 85, "avg_line_length": 28.444444444444443, "alnum_prop": 0.59375, "repo_name": "aubreystarktoller/lite-boolean-formulae", "id": "788bedb6f4abe47fdddeb78d11243547f7b545f7", "...
r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from tests import IntegrationTestCase from tests.holodeck import Request from twilio.base import serialize from twilio.base.exceptions import TwilioException from twilio.http.response import Response class SyncLi...
{ "content_hash": "319a05ad1f7a3dcb3df738d01432c3cd", "timestamp": "", "source": "github", "line_count": 236, "max_line_length": 219, "avg_line_length": 43.45762711864407, "alnum_prop": 0.5513845553822153, "repo_name": "tysonholub/twilio-python", "id": "5ebb704ca701ae35567556a204c226d7fda03aa8", "si...
import sys import os import fcntl import subprocess from optparse import OptionParser import select # Mwa-ha-ha, this is easiest way. Hardly portable to windowz, but who cares? TAILF_COMMAND = ['/usr/bin/tail', '-F', '-n'] def tailf_init(filename, start_count): process = subprocess.Popen( TAILF_COMMAND +...
{ "content_hash": "d0a45d7d905944b6cfa9f62312e35e2f", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 98, "avg_line_length": 30.623376623376622, "alnum_prop": 0.5712468193384224, "repo_name": "shadowleaves/acr", "id": "ace90534c6a4c2676f7214b9c296350438c8cda2", "size": "238...
"""Open metadata information in a text editor to let the user edit it. """ from __future__ import division, absolute_import, print_function from beets import plugins from beets import util from beets import ui from beets.dbcore import types from beets.importer import action from beets.ui.commands import _do_query, Pro...
{ "content_hash": "965740a768bfd3566782c1e89bd6da3b", "timestamp": "", "source": "github", "line_count": 379, "max_line_length": 79, "avg_line_length": 33.733509234828496, "alnum_prop": 0.5590144700821275, "repo_name": "jcoady9/beets", "id": "4a55e59ed55ed39765718f9329474a0b416eb738", "size": "13415...
import base64 import datetime import urlparse import uuid import iso8601 from lxml import etree from oslo.config import cfg import webob from nova.api.openstack import compute from nova.api.openstack.compute import ips from nova.api.openstack.compute import servers from nova.api.openstack.compute import views from no...
{ "content_hash": "a4554f33b251f72f5651eb7bdb129b71", "timestamp": "", "source": "github", "line_count": 5570, "max_line_length": 79, "avg_line_length": 38.49533213644524, "alnum_prop": 0.5030664260163512, "repo_name": "jessicalucci/NovaOrc", "id": "5a0c8a9017f15972cdbdade6c030fceb5d904e61", "size":...
from tests import CloudBaseTest from .blog import main class BlogTestCase(CloudBaseTest): """Simple test case that ensures the blog code doesn't throw any errors.""" def test_main(self): main(self.project_id)
{ "content_hash": "bee779b7d8d3fcbf4ba9fad6d889c7d7", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 79, "avg_line_length": 22.9, "alnum_prop": 0.7161572052401747, "repo_name": "JPO1/python-docs-samples", "id": "722ef624f2d0a0f982bf8725a97f54e43856339e", "size": "805", "...
from collections import defaultdict from functools import partial import numpy as np from matplotlib import rcParams from matplotlib.artist import Artist from matplotlib.axes import Axes, subplot_class_factory from matplotlib.transforms import Affine2D, Bbox, Transform import astropy.units as u from astropy.coordinat...
{ "content_hash": "39de674cff499a886bc872a4a09091c5", "timestamp": "", "source": "github", "line_count": 859, "max_line_length": 112, "avg_line_length": 39.84167636786962, "alnum_prop": 0.5970663861617578, "repo_name": "astropy/astropy", "id": "884fcd5bb5c5561005e1f395bc176d7b09e0e091", "size": "342...
import os from enum import Enum from typing import Sequence, Union from annotypes import Anno, Array from packaging.version import Version from malcolm.core import IncompatibleError, Table # If things don't get new frames in this time (seconds), consider them # stalled and raise FRAME_TIMEOUT = 60 class AttributeD...
{ "content_hash": "bc671e08ebd8c260833e989438c1641d", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 80, "avg_line_length": 34.44881889763779, "alnum_prop": 0.6907428571428571, "repo_name": "dls-controls/pymalcolm", "id": "0064f253b497e5013da75f602decb2845ae038c3", "size"...
"""Management script.""" import os from flask_migrate import Migrate, MigrateCommand from flask_script import Manager, Server, Shell from flask_script.commands import Clean, ShowUrls from flaskiwsapp.app import create_app from flaskiwsapp.database import db from flaskiwsapp.users.models.user import User from flaskiws...
{ "content_hash": "51f21e7cdd9da18c3ec2beceb0bb0877", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 82, "avg_line_length": 32.19178082191781, "alnum_prop": 0.7217021276595744, "repo_name": "rafasis1986/EngineeringMidLevel", "id": "03c3f1400764c6ed0776e883020110977a9afde0", ...
from __future__ import division, absolute_import, print_function import sys import warnings import functools import numpy as np from numpy.core.multiarray_tests import array_indexing from itertools import product from numpy.testing import * try: cdll = np.ctypeslib.load_library('multiarray', np.core.multiarray....
{ "content_hash": "e268c60a5bd107bd88f467e20c301ba6", "timestamp": "", "source": "github", "line_count": 964, "max_line_length": 95, "avg_line_length": 37.78423236514523, "alnum_prop": 0.5255051614320229, "repo_name": "techtonik/numpy", "id": "6b0b0a0b52f24cfb938755db7ee769e106e103f0", "size": "3642...
from contourpy import contour_generator from .bench_base import BenchBase from .util_bench import corner_masks, datasets, fill_types, problem_sizes, thread_counts class BenchFilledThreaded(BenchBase): params = ( ["threaded"], datasets(), fill_types(), corner_masks(), problem_sizes(), [40], thread...
{ "content_hash": "fda4cc83f59571416e5299394e4c4023", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 96, "avg_line_length": 44.88, "alnum_prop": 0.642602495543672, "repo_name": "contourpy/contourpy", "id": "5b1995ebb64f90884ea41a433bd7fa756b7944ac", "size": "1122", "bina...
"""Tests for the AVM Fritz!Box integration.""" from __future__ import annotations from typing import Any from unittest.mock import Mock from homeassistant.components.fritzbox.const import DOMAIN from homeassistant.core import HomeAssistant from .const import ( CONF_FAKE_AIN, CONF_FAKE_MANUFACTURER, CONF_...
{ "content_hash": "400db295b3c7afda02295d72b0d67495", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 66, "avg_line_length": 25.33884297520661, "alnum_prop": 0.6634050880626223, "repo_name": "sander76/home-assistant", "id": "da6bd982d9d1015bef9ef52e778e396da12ef0a5", "size...
""" Needed for adding an app to project. Created on Apr 10, 2014 @author: CarolinaFernandez """
{ "content_hash": "253f7dd99498fbffa5c9731593eaef31", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 36, "avg_line_length": 16.166666666666668, "alnum_prop": 0.7216494845360825, "repo_name": "ict-felix/stack", "id": "a814eb20eb6d234fe9c4605917cd16bf5d3ff618", "size": "97", ...