text
stringlengths
4
1.02M
meta
dict
from PyQt5.QtWidgets import QWidget, QVBoxLayout, \ QListWidget, QPushButton from PyQt5.QtWidgets import QInputDialog, QLineEdit from scgv.qtviews.profiles_window import ShowProfilesWindow class ProfilesActions(QWidget): def __init__(self, main, *args, **kwargs): super(ProfilesActions, self).__init...
{ "content_hash": "29cb7c3b1d47b72860ed5977e5c2646d", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 75, "avg_line_length": 31.2, "alnum_prop": 0.6109775641025641, "repo_name": "KrasnitzLab/SCGV", "id": "baca918afb179406d3c96479857140388f085f01", "size": "2496", "binary"...
import numpy as np import tensorflow as tf from candidate_selection.tensorflow_models.components.abstract_component import AbstractComponent class MultilayerPerceptron(AbstractComponent): transforms = None variable_prefix = None variables = None weights = None biases = None l2_scale = None ...
{ "content_hash": "af0999bf7f236caf8d7ef4b2deefc9d8", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 125, "avg_line_length": 37.17857142857143, "alnum_prop": 0.6296829971181557, "repo_name": "MichSchli/QuestionAnsweringGCN", "id": "0ea714aca10a4f774d400220f89e347aca98eb8a", ...
import inspect import sys import numpy as np import attrdict from mtwaffle import graphs from mtwaffle import mt class Site(attrdict.AttrDict): index_map = { 'xx': [0, 0], 'xy': [0, 1], 'yx': [1, 0], 'yy': [1, 1] } EXCLUDED_CALLABLES = ('between_freqs', ) def __in...
{ "content_hash": "746410035ecd4ecdc36a32ab9cfe2bc3", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 99, "avg_line_length": 33.825, "alnum_prop": 0.5206947524020695, "repo_name": "kinverarity1/mtwaffle", "id": "96d74d2ff0dc3fdfbc59821572994b8df28d1d63", "size": "5412", ...
from __future__ import absolute_import, division, print_function from textwrap import dedent import _pytest._code import py import pytest from _pytest.config import PytestPluginManager from _pytest.main import EXIT_NOTESTSCOLLECTED, EXIT_USAGEERROR @pytest.fixture(scope="module", params=["global", "inpackage"]) def ...
{ "content_hash": "ebd87367516af356965ac0a464b0aee1", "timestamp": "", "source": "github", "line_count": 463, "max_line_length": 81, "avg_line_length": 34.30885529157668, "alnum_prop": 0.5906200818382121, "repo_name": "flub/pytest", "id": "b6fd7814cdcc40fa99a33a99f8d75c30427eb6ee", "size": "15885", ...
"""Test the listdescriptors RPC.""" from test_framework.descriptors import ( descsum_create ) from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( assert_equal, assert_raises_rpc_error, ) class ListDescriptorsTest(BitcoinTestFramework): def set_test_params(...
{ "content_hash": "ce7dadd26f8ae23c83175ef5134c82da", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 132, "avg_line_length": 40.93684210526316, "alnum_prop": 0.6132681923373617, "repo_name": "qtumproject/qtum", "id": "7980a17bdf4dfe68ed334e221bec138f295efda4", "size": "410...
""" Defines restful interface to backend """ from flickipedia.mysqlio import DataIOMySQL from flickipedia.config import schema from flickipedia.config import log from flickipedia.model.likes import LikeModel from flickipedia.model.exclude import ExcludeModel def api_insert_article(wiki_page_id, article_name): "...
{ "content_hash": "92d1c8b9814e7dc2f78f40586d3d94e2", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 78, "avg_line_length": 25.819209039548024, "alnum_prop": 0.6102844638949672, "repo_name": "rfaulkner/Flickipedia", "id": "ace7de16d4d81da19b4e682ce4735555881f6670", "size"...
from PyQt5.QtCore import (QThread, pyqtSignal) # We spawn another # thread to set up a "Linguistica component worker" using QThread. # In this way, this worker (with lots of heavy computational work) works in a # separate thread that is not the main thread for the GUI, and therefore the # GUI stays responsive and (mos...
{ "content_hash": "87aad5d26ba47ea8f4c74d19d1a41cf9", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 79, "avg_line_length": 38.20754716981132, "alnum_prop": 0.6879012345679012, "repo_name": "linguistica-uchicago/lxa5", "id": "f117976432b7ecfa27e4da38d0b30f7cb2fe0b55", "siz...
__source__ = 'https://leetcode.com/problems/sentence-screen-fitting/' # Time: O(r + n * c) # Space: O(n) # # Description: 418. Sentence Screen Fitting # # Given a rows x cols screen and a sentence represented by a list of non-empty words, # find how many times the given sentence can be fitted on the screen. # # Note: ...
{ "content_hash": "79164f10a255582360f3d4b022dc30b9", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 106, "avg_line_length": 25.282208588957054, "alnum_prop": 0.5600582382916768, "repo_name": "JulyKikuAkita/PythonPrac", "id": "64155a0bae55e0bda87033c5c0e414b0fa12c154", "s...
""" eix experiment within gentoo chroot """ from plumbum import local import benchbuild as bb from benchbuild.projects.gentoo.gentoo import GentooGroup class Eix(GentooGroup): """Represents the package eix from the portage tree.""" NAME = 'eix' DOMAIN = 'app-portage' def run_tests(self): ""...
{ "content_hash": "7db6172438de597675760ee2efe05092", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 59, "avg_line_length": 21.857142857142858, "alnum_prop": 0.644880174291939, "repo_name": "PolyJIT/benchbuild", "id": "ed8da3afb47829f8675d62ef974a8833f1384da8", "size": "45...
from __future__ import absolute_import from rest_framework import serializers from rest_framework.response import Response from sentry.api.bases.project import ProjectEndpoint, ProjectReleasePermission from sentry.api.exceptions import ResourceDoesNotExist from sentry.api.serializers import serialize from sentry.api....
{ "content_hash": "9377eea75faf8ffa16dbe11feee590a9", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 93, "avg_line_length": 38.55, "alnum_prop": 0.6000324254215305, "repo_name": "gencer/sentry", "id": "40fc27ccba56b5c33ea165237a48551f72b364ed", "size": "6168", "binary":...
import os import ycm_core # These are the compilation flags that will be used in case there's no # compilation database set (by default, one is not set). # CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR. flags = [ '-Wall', '-Wextra', '-Werror', '-fexceptions', '-DNDEBUG', # THIS IS IMPORTA...
{ "content_hash": "f7c64826e76980082072207443828ffc", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 79, "avg_line_length": 31.748031496062993, "alnum_prop": 0.6852678571428571, "repo_name": "henriquegogo/stobo", "id": "fed5fe36cb84539ead048e81f41080aa2e9d170c", "size": "...
from django.db import IntegrityError from django.db import models from django.db import transaction from django.db.models.query import QuerySet from django.utils import timezone from openpyxl import load_workbook class Lote(models.Model): grupo = models.ForeignKey('Grupo', related_n...
{ "content_hash": "ddde64e3c87c20dbe2f853ca9ddbc7cd", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 73, "avg_line_length": 32.52413793103448, "alnum_prop": 0.6030534351145038, "repo_name": "diegoduncan21/subastas", "id": "5a9899c3b803be6f61d8bf9ecb38dd8adbc72908", "size"...
__author__ = 'SmileyBarry' from .decorators import debug class APIException(Exception): """ Base class for all API exceptions. """ pass class AccessException(APIException): """ You are attempting to query an object that you have no permission to query. (E.g.: private user, hidden screen...
{ "content_hash": "efaa51dd71eacf556aea0744a5fb2574", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 111, "avg_line_length": 27.1900826446281, "alnum_prop": 0.6425531914893617, "repo_name": "smiley/steamapi", "id": "5751a487c432cdd1e16cfa79b57492c10d8101d1", "size": "3290...
import json import redis from django.conf import settings class PushSender(object): """Push sender""" @property def r(self): """Init redis connection""" if not hasattr(self, '_r'): self._r = redis.Redis() return self._r def send(self, **msg): """Send messa...
{ "content_hash": "671dc58a91b533dad9d46f5f23a75c98", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 60, "avg_line_length": 20.38095238095238, "alnum_prop": 0.5934579439252337, "repo_name": "nvbn/coviolations_web", "id": "8e867d5b3241b798c29b24683c35703fe66921e9", "size": ...
''' Created on Nov 27, 2011 @author: ppa ''' import unittest from analyzerdam.googleDAM import GoogleDAM class testGoogleDam(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def testReadQuotes(self): dam = GoogleDAM() dam.setSymbol('...
{ "content_hash": "d52be2074d39fcb9142ef23061a010ed", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 53, "avg_line_length": 24.7027027027027, "alnum_prop": 0.5951859956236324, "repo_name": "llazzaro/analyzerdam", "id": "38d619b40a0117f71bf876ca20bd08f69fd5a4b1", "size": "9...
import urllib import urllib2 import json import string import pprint import random import socket def random_str(randomlength = 16): a = list(string.ascii_letters) random.shuffle(a) return ''.join(a[:randomlength]) def get_ip_by_domain(server_domain): ips_list = [] try: results = socket.get...
{ "content_hash": "054a382da7ab23a778c27ad22a08fba5", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 147, "avg_line_length": 32.075268817204304, "alnum_prop": 0.542406972846128, "repo_name": "louistin/fullstack", "id": "50e27bd121b770f56b5144247197fc5c0ed16f86", "size": "3...
from msrest.serialization import Model class AffinityInformation(Model): """A locality hint that can be used by the Batch service to select a compute node on which to start a task. :param affinity_id: An opaque string representing the location of a compute node or a task that has run previously. You...
{ "content_hash": "dfd30f7b42aeaa071621cd3a6075ea57", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 80, "avg_line_length": 34.44444444444444, "alnum_prop": 0.6655913978494624, "repo_name": "lmazuel/azure-sdk-for-python", "id": "0745761d1343768d276b61c4b12ca40495420ae2", "...
import sys import json import logging import optparse from bookdbtool.tools import bookDBTool if __name__ == '__main__': logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) parser = optparse.OptionParser() parser.add_option("-c", "--config", default="./configuration.json", dest="config_filename", ...
{ "content_hash": "7c2b24af3f1037bdac069afc7dc39ecb", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 106, "avg_line_length": 44.63333333333333, "alnum_prop": 0.6194921583271098, "repo_name": "DrSkippy/php_books_database", "id": "54572228e104bcb2177433fcad027ef516c243fd", "...
""" stringarrays.py are a group of helper functions to convert string input to vector and multivector class function to arrays of SymPy symbols. """ import operator from sympy.core.compatibility import reduce from itertools import combinations from sympy import S, Symbol, Function from sympy.core.compatibility impor...
{ "content_hash": "5106609e24c61165bf9e7eb62b1c60ac", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 88, "avg_line_length": 31.066037735849058, "alnum_prop": 0.5769814758578804, "repo_name": "Sumith1896/sympy", "id": "34ebca298462e850f973878c2e0c43f042ac6a91", "size": "33...
from django.contrib.auth.models import User from django.db import models class Language(models.Model): name = models.CharField(max_length=50) code = models.CharField(max_length=2) def __unicode__(self): return self.name USER_TYPES = ( ('translator', 'Translator'), ('doctor', 'Doctor'...
{ "content_hash": "798746b47b791a98826b9d2bb6d13254", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 101, "avg_line_length": 27.77777777777778, "alnum_prop": 0.644, "repo_name": "robboyle/asesor", "id": "44eea14253137495ce8ce0872f2024ffd8f79670", "size": "1750", "binary"...
import random import sqlite3 from flask import ( Flask, g, render_template, request, ) from config import DATABASE app = Flask(__name__) app.config.from_object('config') def get_db(): db = getattr(g, '_database', None) if db is None: db = g._database = sqlite3.connect(DATABASE) r...
{ "content_hash": "330541bd53c14b34c9c89e914becfa31", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 112, "avg_line_length": 28.68888888888889, "alnum_prop": 0.6363284275755229, "repo_name": "Chybby/civultimatebravery", "id": "b5a5bca7c28e1e1e65318842d1b97a14729699f7", "si...
import json import os.path import sys import charliecloud as ch import build_cache as bu ## Constants ## # Internal library of manifests, e.g. for "FROM scratch" (issue #1013). manifests_internal = { "scratch": { # magic empty image "schemaVersion": 2, "config": { "digest": None }, "layers": [...
{ "content_hash": "fd43f7eb0d52d377105b716599a339b3", "timestamp": "", "source": "github", "line_count": 316, "max_line_length": 79, "avg_line_length": 38.27215189873418, "alnum_prop": 0.5657350752439226, "repo_name": "hpc/charliecloud", "id": "421352db49953adced8245e89a4ccc1cb251c511", "size": "121...
""" Helpers for the python-quilt test suite """ import unittest class QuiltTest(unittest.TestCase): """ Base class for all TestCases """ @classmethod def suite(cls): suite = unittest.TestSuite() suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(cls)) return suite ...
{ "content_hash": "e9e5653331815ad732d8048fb66ff2a3", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 76, "avg_line_length": 24.463414634146343, "alnum_prop": 0.5852442671984048, "repo_name": "vadmium/python-quilt", "id": "52664b3b41aae14d5bd5ed4904df9fadf2da6cc5", "size": ...
from setuptools import setup, find_packages # Variables =================================================================== changelog = open('CHANGES.rst').read() long_description = "\n\n".join([ open('README.rst').read(), changelog ]) # Functions ============================================================...
{ "content_hash": "6c55b44ba14303cf31f846157fbebaf3", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 79, "avg_line_length": 25.483870967741936, "alnum_prop": 0.5278481012658228, "repo_name": "Bystroushaak/timeout_wrapper", "id": "a5d13f836c7300bbddc1e4f30a06ec07fc0cdc84", ...
"""Test deprecation of RPC calls.""" from test_framework.test_framework import FujicoinTestFramework class DeprecatedRpcTest(FujicoinTestFramework): def set_test_params(self): self.num_nodes = 2 self.setup_clean_chain = True self.extra_args = [[], ['-deprecatedrpc=bumpfee']] def run_te...
{ "content_hash": "734a7f320ce98bebb22405b1dcd54bfe", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 117, "avg_line_length": 37.72, "alnum_prop": 0.6341463414634146, "repo_name": "fujicoin/fujicoin", "id": "d15abb5338d77777f9433a491c90adaf37a90202", "size": "1158", "bina...
import bs4 import sys, os import json, copy, re import ExprParser, ExprSemantics from cgi import escape from tatl import IR def run_file(f): return run_string(open(f).read()) def compile(s, source, out='py', warn=None, parser='html.parser'): """Return Python that implements the template""" dom = _ensure_...
{ "content_hash": "53211188f8ed9ed55ec3a075677fbbfb", "timestamp": "", "source": "github", "line_count": 372, "max_line_length": 94, "avg_line_length": 31.13978494623656, "alnum_prop": 0.4855835635359116, "repo_name": "tln/tatl", "id": "8db10c9f15de0b71aa6b308909f4ca6fc6b6547d", "size": "11584", "...
import pyterminalsize try: print(pyterminalsize._from_tput()) except OSError as e: print('Caught OSError') print(e)
{ "content_hash": "831331e9ae063b1ede0f86dc3a6af3bf", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 38, "avg_line_length": 16.25, "alnum_prop": 0.6923076923076923, "repo_name": "asottile/pyterminalsize", "id": "088f881616ef36b0a6c68c7efb805bff56fe7604", "size": "130", "b...
"""Permission and action needs for Invenio.""" from collections import namedtuple from functools import partial from itertools import chain from flask_principal import ActionNeed, Identity, Need from flask_principal import Permission as _Permission from .models import ActionRoles, ActionSystemRoles, ActionUsers, get...
{ "content_hash": "f1975262799aff133a2d89a162dc63e1", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 99, "avg_line_length": 34.47417840375587, "alnum_prop": 0.668936402015525, "repo_name": "inveniosoftware/invenio-access", "id": "efec9f1c51406653f99c10524202410672857a83", ...
try: import json as _json except ImportError: import sys sys.path.append('simplejson-2.3.3') import simplejson as _json import requests as _requests import urlparse as _urlparse import random as _random import base64 as _base64 from ConfigParser import ConfigParser as _ConfigParser import os as _os _C...
{ "content_hash": "cd9530fa30eaa98d0927b1d906ee910d", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 109, "avg_line_length": 40.6, "alnum_prop": 0.5618500273672687, "repo_name": "psnovichkov/pavel_sdk_test_python", "id": "4e032a136e422f99c63d75efdd49472aa30a1bed", "size":...
"""The source file generator for configuration files.""" import glob import io import logging import os from yaldevtools.source_generators import interface class ConfigurationFileGenerator(interface.SourceFileGenerator): """Configuration file generator.""" def _GenerateACIncludeM4( self, project_configur...
{ "content_hash": "35054cda6533f2bdcde5d5138e1871f1", "timestamp": "", "source": "github", "line_count": 1628, "max_line_length": 80, "avg_line_length": 37.08353808353808, "alnum_prop": 0.6772510435301133, "repo_name": "libyal/libyal", "id": "1942188421a746947235b43219b38a98a44b9d5a", "size": "60396...
class GeneratorAdapter: def visit_selector_view(self, view): pass def visit_selector_object(self, object, property): pass def visit_selector_fk_object(self, object, property, fk_properties): pass def visit_view(self, view): pass def visit_page(self, page): ...
{ "content_hash": "e2534e3c44aa84884305bb86608de861", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 72, "avg_line_length": 22.555555555555557, "alnum_prop": 0.5952380952380952, "repo_name": "theshammy/GenAn", "id": "353e26c825cb8b000a73f97b9ad5f554abea4066", "size": "1218...
import GafferScene from _GafferSceneTest import * from SceneTestCase import SceneTestCase from ScenePlugTest import ScenePlugTest from GroupTest import GroupTest from SceneTimeWarpTest import SceneTimeWarpTest from CubeTest import CubeTest from PlaneTest import PlaneTest from SphereTest import SphereTest from Instanc...
{ "content_hash": "3fa2a14e15cd8d46c41266880b561be8", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 75, "avg_line_length": 42.2680412371134, "alnum_prop": 0.9046341463414634, "repo_name": "ivanimanishi/gaffer", "id": "055a85af164976e9e48fe4fd8d07e3f3b1f6ed49", "size": "59...
from portality import models from portality import constants from portality.bll import exceptions from doajtest.helpers import DoajTestCase from portality.events.consumers.account_created_email import AccountCreatedEmail from doajtest.fixtures import AccountFixtureFactory import uuid from io import StringIO import logg...
{ "content_hash": "9067c77025925a60e7544dfa49e60965", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 105, "avg_line_length": 39.27058823529412, "alnum_prop": 0.6773517076093469, "repo_name": "DOAJ/doaj", "id": "0016d810be5183829599050b01aab9249a16f769", "size": "3338", "...
from unittest import TestCase from mock import patch, Mock from helpscout_app.decorators import signed_request class DecoratorTest(TestCase): def test_signed_request(self): # Patch Flask's request, current_app and the is_helpscout_request helper function request_patcher = patch('helpscout_app.deco...
{ "content_hash": "ea8b6639e3b4314cd60a0e4247224972", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 89, "avg_line_length": 45.2, "alnum_prop": 0.6761061946902654, "repo_name": "carousell/Helpscout-App-Template", "id": "648b0b863da052a4ef684b21b82c51eedf9f4570", "size": "1...
import sublime import sublime_plugin class EventDump(sublime_plugin.EventListener): def on_new(self, view): sublime.message_dialog("new file is opned.")
{ "content_hash": "c884f58cfe8be93f50374ca864dc9789", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 52, "avg_line_length": 21, "alnum_prop": 0.7261904761904762, "repo_name": "ekazyam/study", "id": "6b950fe4671ab81ea5d692a7ca90768fea93cd2c", "size": "168", "binary": false...
import urllib import logging def seedfile_load(seedfile): """ seedfile_load - load crawl seed file. Args: seedfile: The seed file will be loaded. Returns: urls: All seed urls to be crawled. """ urls = [] try: with open(seedfile, "r") as f: for...
{ "content_hash": "6a6d1eafe4672770ee6926fb75a84a7a", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 80, "avg_line_length": 24.272727272727273, "alnum_prop": 0.5543071161048689, "repo_name": "fivezh/Keepgoing", "id": "10b8e049c7709ae8f752751c165f10228f3300df", "size": "573...
'''Train a Bidirectional LSTM for MHG scansion. Current accuracy 91.88 on validation data''' # Authors: Christopher Hench # ============================================================================== from __future__ import print_function import numpy as np from keras.preprocessing import sequence from keras.models ...
{ "content_hash": "d83df438bfa999cac3f8acdf12b9680f", "timestamp": "", "source": "github", "line_count": 218, "max_line_length": 80, "avg_line_length": 31.022935779816514, "alnum_prop": 0.6047612006505988, "repo_name": "henchc/MHG_Scansion", "id": "f988f0f6b7dbcf880a30cdf7376ba268c5df3653", "size": ...
from re import search import rospy from std_msgs.msg import String from sys import exit pub = rospy.Publisher('control_action', String);#,queue_size=10); state = "" def callback(data): global state state = data.data def initialize_handshake(HOST, PORT): # setup socket and start the connection to the model ...
{ "content_hash": "92fb93df283a1b2d9254ed5f0eaa4649", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 93, "avg_line_length": 31.18918918918919, "alnum_prop": 0.6169844020797227, "repo_name": "slremy/testingpubsub", "id": "eb0766084b3afda11653a322d30f38dc45ff240f", "size": "...
""" tests.unit.payload_test ~~~~~~~~~~~~~~~~~~~~~~~ """ import copy import datetime import logging import salt.exceptions import salt.payload from salt.defaults import _Constant from salt.utils import immutabletypes from salt.utils.odict import OrderedDict log = logging.getLogger(__name__) def assert_no_or...
{ "content_hash": "9924ca54fe18368ba5e4a9deb22becf2", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 86, "avg_line_length": 30.09433962264151, "alnum_prop": 0.6125391849529781, "repo_name": "saltstack/salt", "id": "ecd77ab4fcfbc85f7d3d3515e4e5eb4b342f58fc", "size": "6380"...
"""The database configuration CLI arguments helper.""" from plaso.lib import errors from plaso.cli.helpers import interface from plaso.cli.helpers import server_config class DatabaseArgumentsHelper(interface.ArgumentsHelper): """Database configuration CLI arguments helper.""" NAME = u'database_config' DESCRIP...
{ "content_hash": "403aee4e26fce331f7bb6ccd6c6c5422", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 79, "avg_line_length": 38.66197183098591, "alnum_prop": 0.7092896174863388, "repo_name": "dc3-plaso/plaso", "id": "51992f763d35613d873640a055701532a238fd2d", "size": "2769"...
"The primary module for maya commands and node classes" import sys import pymel as _pymel _pymel.core = sys.modules[__name__] import pymel.versions as _versions import pymel.internal.startup as _startup import pymel.internal as _internal # will check for the presence of an initilized Maya / launch it _startup.mayaIni...
{ "content_hash": "f7e40caa673d0e0b3760f00eeaa034bf", "timestamp": "", "source": "github", "line_count": 238, "max_line_length": 134, "avg_line_length": 34.63865546218487, "alnum_prop": 0.6146288209606987, "repo_name": "cgrebeld/pymel", "id": "b9f9513bee47034ef3d73601c28be5c858c7ccaa", "size": "8244...
from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name=...
{ "content_hash": "9705f509b40a805e1156704ecde3c96a", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 114, "avg_line_length": 32.42857142857143, "alnum_prop": 0.5715859030837004, "repo_name": "google/mirandum", "id": "e36f584ae74b58d2a869a943d5deda526fb27a30", "size": "1545...
from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import json import datetime import enum from sqlalchemy import ForeignKey from sqlalchemy import UniqueConstraint from flask import current_app as app from sqlalchemy.or...
{ "content_hash": "42d5bad9cc2e84713fd3330cabc5c1e4", "timestamp": "", "source": "github", "line_count": 366, "max_line_length": 90, "avg_line_length": 38.978142076502735, "alnum_prop": 0.5411467825599328, "repo_name": "subhankarb/dpr-api", "id": "a4ea854f2a0dc7cb6f64dd2bab44e1be40b6c094", "size": "...
import Player import GameEngine from BuildInfo import BuildInfo import HostControl import socket # import pdb; pdb.set_trace() # functions to broadcast gamestate changes def broadcast_message(message): for player in game_engine.game_state.player_array: host.send_data(player.netid[0], message) def broadcas...
{ "content_hash": "49579403dec66b7716ab524eae0af268", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 118, "avg_line_length": 41.275590551181104, "alnum_prop": 0.6152231972529569, "repo_name": "stoksc/Settlers-of-definitely-not-Katan", "id": "1d0a0c57285a5e7c435f220716f67dd1...
''' Module: deinflect.py Desc: try to discern the stem of japanese inflected words to aid in lookups. Author: john.oneil Email: [email protected] DATE: Wed May 7th 2014 ''' import os import argparse import re from transliterate import romaji2hiragana from jpn.exceptions import NonUnicodeInputException class...
{ "content_hash": "d1ae4321eb3601cd3c8b5735a9b385c8", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 122, "avg_line_length": 30.582781456953644, "alnum_prop": 0.6658726721524469, "repo_name": "johnoneil/jpn", "id": "89ed0b53cdc933592f82bb53b4da0b95a08fde1c", "size": "4990...
import abc from oslo_log import log as logging LOG = logging.getLogger(__name__) class VnflcmMgmtAbstractDriver(metaclass=abc.ABCMeta): @abc.abstractmethod def get_type(self): """Return one of predefined type of the hosting vnf drivers.""" pass @abc.abstractmethod def get_name(self...
{ "content_hash": "13a8355f90d7d2a3c7e3da68d0183837", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 71, "avg_line_length": 28.52127659574468, "alnum_prop": 0.5609847071988064, "repo_name": "openstack/tacker", "id": "1077ef019778c55250bf0bf7d14c1f438bd04ad2", "size": "3308...
"""Urls for Zinnia random entries""" from django.conf.urls import url from django.conf.urls import patterns from zinnia.views.random import EntryRandom urlpatterns = patterns( '', url(r'^$', EntryRandom.as_view(), name='entry_random'), )
{ "content_hash": "2f330af8024ee074884eff4dd5654a3a", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 43, "avg_line_length": 20.384615384615383, "alnum_prop": 0.6716981132075471, "repo_name": "ZuluPro/django-blog-zinnia", "id": "85ec2a843d674f4377f3f100b26c517cb6c7c97e", "s...
import urllib2 from HTMLParser import HTMLParser import xml.etree.ElementTree as ET import song import info import logging import json import re radio_url_temp = "http://www.xiami.com/radio/play/id/%s" radio_list_url_temp = "http://www.xiami.com/radio/xml/type/%s/id/%s?v=%s" player_path_signature = '/res/fm/xiamiRadio...
{ "content_hash": "fec6bc35d2162aa93fe4a850640301ba", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 89, "avg_line_length": 33.68115942028985, "alnum_prop": 0.5725043029259896, "repo_name": "HenryHu/xmradio", "id": "d163f788a306ddeea78fa60c09b0df9d0f4bb7d3", "size": "4648...
import io import os import setuptools # Package metadata. name = 'google-cloud-texttospeech' description = 'Google Cloud Text-to-Speech API client library' version = '0.2.0' # Should be one of: # 'Development Status :: 3 - Alpha' # 'Development Status :: 4 - Beta' # 'Development Status :: 5 - Production/Stable' rel...
{ "content_hash": "cb6bffe1520e78bc86b38f670851fd4f", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 75, "avg_line_length": 28.37837837837838, "alnum_prop": 0.6661904761904762, "repo_name": "tseaver/gcloud-python", "id": "5805b91b956c4496cc1fbc0449a5be3475fcb7cb", "size": ...
import json # 3rd party libs # Own project libs from oneview_redfish_toolkit.api.rack_chassis import RackChassis from oneview_redfish_toolkit.tests.base_test import BaseTest class TestRackChassis(BaseTest): """Tests for Chassis class Tests: - Rack chassis instantiation - Rack ch...
{ "content_hash": "e91ca9e5b7736c5a17c267956a1931bb", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 70, "avg_line_length": 29.614035087719298, "alnum_prop": 0.6095971563981043, "repo_name": "HewlettPackard/oneview-redfish-toolkit", "id": "a9a97406d97e50f346bbd7be38e0b7c9cd9...
""" Chart demos using RawQuerySet """ from chartit import DataPool, Chart from django.shortcuts import render_to_response from .decorators import add_source_code_and_doc from .models import MonthlyWeatherByCity, MonthlyWeatherSeattle from .models import SalesHistory, BookStore, Book @add_source_code_and_doc def b...
{ "content_hash": "8b13b77ded6b2465d5189219c5832db0", "timestamp": "", "source": "github", "line_count": 470, "max_line_length": 79, "avg_line_length": 31.8, "alnum_prop": 0.3539408537401311, "repo_name": "pgollakota/django-chartit", "id": "02139717c702110fd36b713a05654ce07dd7f7b3", "size": "14946",...
from scheduler_failover_controller.utils import date_utils from scheduler_failover_controller.metadata.base_metadata_service import BaseMetadataService from kazoo.client import KazooClient # documentation: https://kazoo.readthedocs.io/en/latest/basic_usage.html import datetime class ZookeeperMetadataService(BaseMeta...
{ "content_hash": "a28802860b21e30b3c98f3b523f444be", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 211, "avg_line_length": 55.75, "alnum_prop": 0.6745675848814863, "repo_name": "teamclairvoyant/airflow-scheduler-failover-controller", "id": "b53879cabd8e36b5614384a81e778118...
from distutils.core import setup setup( name='repono', version='0.1', packages=['data', 'data.api', 'data.api.tinydb', 'config', 'export', 'providers', 'providers.api', 'providers.data', 'providers.extraction', 'providers.extraction.twitter'], url='https://github.com/ademsha...
{ "content_hash": "04bfe6a194dc0d22ffc18ea6394772fd", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 76, "avg_line_length": 33.666666666666664, "alnum_prop": 0.6316831683168317, "repo_name": "ademsha/repono", "id": "25cfbe685598be4f7c43b50d4241782904a73471", "size": "505",...
from flask import Blueprint, render_template from flask_security import login_required front = Blueprint("front", __name__) @front.route("/") def index(): return render_template("front/index.html") @front.route("/secure") @login_required def admin(): return render_template("front/index.html")
{ "content_hash": "bddc24f89cb13ef36c941ed8b40be7cf", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 44, "avg_line_length": 20.066666666666666, "alnum_prop": 0.7308970099667774, "repo_name": "AthelasPeru/laborapp", "id": "711fdd352460fa4fbb7a80901a4c3371b242ca52", "size": ...
""" Script to run Pythran file compilation with specified g++ like flags. """ import argparse import logging import os import sys import pythran from distutils.errors import CompileError logger = logging.getLogger("pythran") def convert_arg_line_to_args(arg_line): """Read argument from file in a prettier way....
{ "content_hash": "087cc0b9f2cb139018d3e588cba8745e", "timestamp": "", "source": "github", "line_count": 219, "max_line_length": 85, "avg_line_length": 37.23744292237443, "alnum_prop": 0.5130594727161251, "repo_name": "serge-sans-paille/pythran", "id": "927b879c660e6ff0d3e97a856c33ea8029b7c7b7", "si...
""" sentry.web.views ~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from django.db.models import Q from django.http import HttpResponse, HttpResponseBadRequest, \ HttpResponseForbidden from django.views.decorators.csrf import ...
{ "content_hash": "caa07f801fa556186fb1deae9cba9e1a", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 100, "avg_line_length": 29.524509803921568, "alnum_prop": 0.6450273949858875, "repo_name": "Kronuz/django-sentry", "id": "34b2ecedc3f25b3551ed417c3adc631f7286a2cc", "size"...
{ 'name': 'Timesheet invoice release - sheet addition', 'version': '8.0.1.0.0', 'summary': 'Release timesheet lines after invoice was cancelled', 'author': 'Sunflower IT', 'website': 'http://www.sunflowerweb.nl', 'category': 'Sales Management', 'depends': [ 'hr_timesheet_sheet', ...
{ "content_hash": "85814d84330558268b83c480eeb4d662", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 69, "avg_line_length": 28.933333333333334, "alnum_prop": 0.5852534562211982, "repo_name": "sunflowerit/odoo-modules", "id": "82b54595ec5b36ef4f306fd50f83bc7fcdd77f76", "siz...
""" Distributions ------------- A widget for plotting attribute distributions. """ from math import sqrt import sys import collections from xml.sax.saxutils import escape from PyQt4 import QtGui, QtCore from PyQt4.QtCore import Qt from PyQt4.QtGui import QToolTip import numpy import pyqtgraph as pg import Orange.da...
{ "content_hash": "c716ae7b64e232c65cb446ababa2af71", "timestamp": "", "source": "github", "line_count": 760, "max_line_length": 133, "avg_line_length": 37.098684210526315, "alnum_prop": 0.5513743571555241, "repo_name": "qPCR4vir/orange3", "id": "2166b09572fa1ec558cf2324fe8ec4565e333d96", "size": "2...
import numpy as np import cv2 cv2.ocl.setUseOpenCL(False) class LazyFrames(object): """ From OpenAI Baseline. https://github.com/openai/baselines/blob/master/baselines/common/atari_wrappers.py This class provides a solution to optimize the use of memory when concatenating different frames, e.g. ...
{ "content_hash": "5c9354c589c71a4e3141911a2f7d633b", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 86, "avg_line_length": 26.50943396226415, "alnum_prop": 0.6548042704626335, "repo_name": "carloderamo/mushroom", "id": "2b855634b0acd7cf81e87cd557f3c506f380d50c", "size": "...
import models import config import utils import imp import numpy as np from numpy import ma imp.reload(config) imp.reload(models) imp.reload(utils) data_dir = config.data_dir path = config.path row = config.row time = config.time ul = config.ul len_sq = config.len_sq band_option = config.band_option b = band_option ...
{ "content_hash": "442186714844b6d0a52949147ae365d1", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 70, "avg_line_length": 23.298387096774192, "alnum_prop": 0.6330910349601938, "repo_name": "nicholaschris/landsatpy", "id": "e0367340fc12c7fd68eb5b0d9601c960177882ec", "siz...
from __future__ import print_function import os import sys #use aptexport module from local dir sys.path.append( os.path.join(os.path.dirname(os.path.abspath(__file__)), "../")) from aptexport import PackageListApt import unittest import tempfile import shutil import subprocess class BaseTests(unittest.TestCase...
{ "content_hash": "dc9c3573f614e952d5c26074384e1f19", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 79, "avg_line_length": 41.27, "alnum_prop": 0.6118245699055004, "repo_name": "TelekomCloud/aptexport", "id": "2077fb60733ab8c5ae92685abda724a7362caa8a", "size": "4797", ...
__author__ = 'Sergei' from model.contact import Contact from random import randrange def test_del_contact(app): if app.contact.count() == 0: app.contact.create_c(Contact(first_n= "first",mid_n= "middle",last_n= "last",nick_n= "kuk",company= "adda",address= "575 oiweojdckjgsd,russia",home_ph= "12134519827"...
{ "content_hash": "22fe4b96f19e7455686a918a18b1cbd8", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 174, "avg_line_length": 43.9375, "alnum_prop": 0.6799431009957326, "repo_name": "serglit/python_traning", "id": "c1def88bd752ddb4143eb05c94350dfc37286bf9", "size": "703", ...
''' Remove the two objects created in exercise #3 from the database. DISCLAIMER NOTE: Solution is limited to the exercise's scope ''' from net_system.models import NetworkDevice import django from termcolor import colored def main(): # Delete the 2 NOKIA routers added in exercise 3 django.setup() try: ...
{ "content_hash": "5236f160707caacc67e7fe6022be32dc", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 105, "avg_line_length": 34.06666666666667, "alnum_prop": 0.6673189823874756, "repo_name": "p-montero/py-ans", "id": "99c92424360387b28dce343dda2b8fbe95eab698", "size": "104...
import logging import time import threading from dataclasses import dataclass from typing import List, Dict, Set, Callable from chip.discovery.library_handle import _GetDiscoveryLibraryHandle from chip.discovery.types import DiscoverSuccessCallback_t, DiscoverFailureCallback_t @dataclass(unsafe_hash=True) class Pee...
{ "content_hash": "8cde00679196ae71c2f38d5811f5d684", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 108, "avg_line_length": 31.585365853658537, "alnum_prop": 0.646023166023166, "repo_name": "nestlabs/connectedhomeip", "id": "e41360414bee8b154e30ab60acbf6408b3b2b4a3", "si...
""" Django settings for go_green project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ from __future__ import absolute_import, unicode_literals import environ ...
{ "content_hash": "1ecc7867155d0d3b509426d3d602d3ee", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 98, "avg_line_length": 35.59574468085106, "alnum_prop": 0.6053795576808129, "repo_name": "TraMZzz/GoGreen", "id": "16115f1b3a4110db6dacb308a5816a66bc02fc98", "size": "8389...
import base64 import binascii from functools import cached_property from rest_framework import generics from rest_framework.authentication import get_authorization_header from rest_framework.exceptions import NotFound, ValidationError from rest_framework.response import Response from desecapi import metrics from dese...
{ "content_hash": "4f512116db506dc96db4e51035419787", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 87, "avg_line_length": 30.970588235294116, "alnum_prop": 0.5650522317188984, "repo_name": "desec-io/desec-stack", "id": "93dec8f779f514f1131bf1be482e69f4bb067c6e", "size":...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('nc', '0001_initial'), ] operations = [ migrations.AddField( model_name='agency', name='census_profile_id', field...
{ "content_hash": "9bfa03056fc2bb730c407f437425433a", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 74, "avg_line_length": 21.944444444444443, "alnum_prop": 0.5873417721518988, "repo_name": "OpenDataPolicingNC/Traffic-Stops", "id": "90f6dbd059392deb239ab75a5b282b60ff83bab4"...
from django.contrib import admin from .models import Movie, MovieList, MovieListMembership #from .models import Genre # Register your models here. class MovieListModelAdmin(admin.ModelAdmin): list_display = ['user','list_name', 'date_created'] fields = ('user','list_name', 'shared', 'shared_with') class ...
{ "content_hash": "2804c2bb2ebe6552b97926bdc6df5a18", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 71, "avg_line_length": 28.833333333333332, "alnum_prop": 0.7442196531791907, "repo_name": "introini/ourlist", "id": "a3dd8d59acca67e9fc18fa81f055374ba0da044c", "size": "692...
from ca.base.generations import Generations class Life(Generations): states = 2
{ "content_hash": "a05f0ee622d27794b92f9ae18cb9cb54", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 43, "avg_line_length": 18.8, "alnum_prop": 0.6914893617021277, "repo_name": "jandecaluwe/ca", "id": "0274d7930a49d4261b3193bc360a1be38ada367e", "size": "94", "binary": fal...
""" sphinx.util.tags ~~~~~~~~~~~~~~~~ :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import warnings # jinja2.sandbox imports the sets module on purpose warnings.filterwarnings('ignore', 'the sets module', DeprecationWarning, ...
{ "content_hash": "9619d556ed4547737452fb1e81bcf7cd", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 75, "avg_line_length": 32.04494382022472, "alnum_prop": 0.5725806451612904, "repo_name": "SurfasJones/icecream-info", "id": "a6e62140771be8f2e837da0e9d25208695d6a22b", "siz...
__author__ = "mozman <[email protected]>" import os import re import unittest from dxfwrite import DXFEngine as dxf from dxfwrite.util import is_string class TestDrawing(unittest.TestCase): def test_drawing(self): dwg = dxf.drawing() res1 = dwg.__dxf__() self.assertTrue(is_string(res1)) ...
{ "content_hash": "1501bc8ab57b372d1b0b75df676194f7", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 75, "avg_line_length": 28.577319587628867, "alnum_prop": 0.5836940836940837, "repo_name": "sbarton272/AcousticBarcodes-Explorations", "id": "ed7f706270638a9c563763d75f8d4dbb7...
"""Models for test_natural.py""" from django.db import models class NaturalKeyAnchorManager(models.Manager): def get_by_natural_key(self, data): return self.get(data=data) class NaturalKeyAnchor(models.Model): objects = NaturalKeyAnchorManager() data = models.CharField(max_length=10...
{ "content_hash": "c50e61e2c789180223faf42a79e2f5df", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 74, "avg_line_length": 27.238095238095237, "alnum_prop": 0.6940559440559441, "repo_name": "yephper/django", "id": "5f5016d16d22043c9cf0b003740d372ba9da389c", "size": "572",...
import sys import redis class Client(): def __init__(self): self.conn = redis.StrictRedis("redis") def set(self, key, value): self.conn.set(key, value) def get(self, key): return self.conn.get(key) if __name__ == '__main__': client = Client() client.get(sys.argv[1])
{ "content_hash": "79459f15c3a3b2c8ea182e4442e46560", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 46, "avg_line_length": 18.58823529411765, "alnum_prop": 0.569620253164557, "repo_name": "leehosung/pycon-testing", "id": "3f49a8b363603aa54dadcaa243f89925f8eb1be7", "size":...
from telemetry.page import page_test_results from telemetry.page import page_measurement_value class ValuesForSinglePage(object): def __init__(self, page): self.page = page self.values = [] def AddValue(self, value): self.values.append(value) @property def measurement_names(self): return [val...
{ "content_hash": "6c7b0f0cc9d2419bf6d0d08ac8b6a857", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 80, "avg_line_length": 34.2972972972973, "alnum_prop": 0.6637772524297347, "repo_name": "mogoweb/chromium-crosswalk", "id": "02ebd2a03b48bfebecc360996074fedc6a0043c3", "si...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('coopInfo', '0001_initial'), ] operations = [ migrations.AlterField( model_name='person', name='inBoardSince', fi...
{ "content_hash": "eef9b21ea7b9ed6e102c427cf3ee5f91", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 50, "avg_line_length": 21.526315789473685, "alnum_prop": 0.589242053789731, "repo_name": "antoineclaval/ruralpowerproject", "id": "7fea7bf34acd449da8af0faad7e6bc10e80f2a9b", ...
import sys import 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.append(os.path.abspath('_themes')) sys.path.append...
{ "content_hash": "46bacf41e64b6dde6c69d1a9f3cc7f50", "timestamp": "", "source": "github", "line_count": 248, "max_line_length": 79, "avg_line_length": 31.72983870967742, "alnum_prop": 0.7054263565891473, "repo_name": "tbonza/GatherNews", "id": "47b7db9ff6facd7edc73941e25199ae37a6391b0", "size": "82...
"""The sensor tests for the august platform.""" from homeassistant.const import PERCENTAGE, STATE_UNAVAILABLE from tests.components.august.mocks import ( _create_august_with_devices, _mock_activities_from_fixture, _mock_doorbell_from_fixture, _mock_doorsense_enabled_august_lock_detail, _mock_lock_...
{ "content_hash": "d522c2b7725bee6b8f366ad88795d676", "timestamp": "", "source": "github", "line_count": 298, "max_line_length": 88, "avg_line_length": 34.439597315436245, "alnum_prop": 0.667348728441976, "repo_name": "tchellomello/home-assistant", "id": "7e69b59da070584e7d8a5f8318e68217d8d09d33", "...
from os.path import abspath, dirname, join, normpath from setuptools import setup with open('README.rst') as f: long_description = f.read() setup( # Basic package information: name = 'mdx_collapse', version = '0.1.0', py_modules = ('mdx_collapse',), # Packaging options: zip_safe = False,...
{ "content_hash": "9582f6d296c45b6e3252e6ad7d4dd1d4", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 79, "avg_line_length": 28.6, "alnum_prop": 0.6678321678321678, "repo_name": "AlexJF/mdx_collapse", "id": "1b239da21d69c2148a2763d3e43c23e6323147a6", "size": "858", "binar...
""" This is a pure Python implementation of the merge-insertion sort algorithm Source: https://en.wikipedia.org/wiki/Merge-insertion_sort For doctests run following command: python3 -m doctest -v merge_insertion_sort.py or python -m doctest -v merge_insertion_sort.py For manual testing run: python3 merge_insertion_so...
{ "content_hash": "114433b0be099c7745e43a039c611b87", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 86, "avg_line_length": 29.24581005586592, "alnum_prop": 0.5379178605539637, "repo_name": "wuweilin/python", "id": "fb71d84a3c149093e0bbc3ee161d865c2d5df910", "size": "5235...
from __future__ import print_function import json import os import re import subprocess import sys try: import threading as _threading except ImportError: import dummy_threading as _threading import time from pyversion import is_python3 if is_python3(): import urllib.request import urllib.error else: import...
{ "content_hash": "9c5dfdc70e0f23f14f225077fb2fcaed", "timestamp": "", "source": "github", "line_count": 701, "max_line_length": 89, "avg_line_length": 26.713266761768903, "alnum_prop": 0.5827726156146534, "repo_name": "xin3liang/git-repo", "id": "aa07d1b757fecc805c806cfd4a34695b8a2c7b54", "size": "...
import logging import requests from fakturo.core import exceptions, utils LOG = logging.getLogger(__name__) class BaseClient(object): def __init__(self, url=None): url.rstrip('/') self.url = url self.requests = self.get_requests() def get_requests(self, headers={}, args_hooks=[],...
{ "content_hash": "15e8dd25c1a95c88b8999ccca4963143", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 78, "avg_line_length": 32.89230769230769, "alnum_prop": 0.5893358278765201, "repo_name": "billingstack/python-fakturo", "id": "75d24df5bd0e6849ca2a4865bee045cc9e29cc86", "s...
import os def writeANNProperties(in_scaler,out_scaler,scaler,labels): try: assert os.path.isdir('ANNProperties') except: os.mkdir('ANNProperties') s='_' ANNProperties = open('ANNProperties/ANNProperties_'+s.join(x for x in labels), 'w') try: with open('ANNProperties/top', ...
{ "content_hash": "15a91c478c6e7e87aad08cedeb452c7c", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 108, "avg_line_length": 42.34567901234568, "alnum_prop": 0.536734693877551, "repo_name": "uqyge/combustionML", "id": "2f3ce47d2f3269a0d71231fba3e5d9f5c9a359fe", "size": "34...
import argparse import matplotlib.pyplot as plt def view(): result = [] xindex = [] index = 0 for line in open(args.logpath): if 'Validation-accuracy' in line: result.append(line[line.index('=') + 1:]) xindex.append(index) index += 1 if len(result) >= 1:...
{ "content_hash": "7208a8a16be672a1e36c79db92c8fc5f", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 92, "avg_line_length": 27.137931034482758, "alnum_prop": 0.542566709021601, "repo_name": "gu-yan/mlAlgorithms", "id": "a2e4ab85f8ec09bb1d249b93f390eee5c2073aee", "size": "8...
from os.path import dirname, basename, isfile import glob modules = glob.glob(dirname(__file__)+"/*.py") __all__ = [basename(f)[:-3] for f in modules if isfile(f)]
{ "content_hash": "ae9eae0c48a1eaa9357b8cf66496d71f", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 58, "avg_line_length": 27.666666666666668, "alnum_prop": 0.6626506024096386, "repo_name": "sql-assurance/sql-assurance", "id": "29f180d50abbb92369a8a29f6c549ae10a9fd6cf", "s...
def merge_species_databases(species_prefix): """ Build a merged database """ from ibeis.control import IBEISControl from ibeis.dev import sysres print('[ibsfuncs] Merging species with prefix: %r' % species_prefix) ut.util_parallel.ensure_pool(warn=False) with ut.Indenter(' '): # Build...
{ "content_hash": "8611f234694529b2235f17b7e73e76d8", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 91, "avg_line_length": 44.47727272727273, "alnum_prop": 0.6226366888094022, "repo_name": "SU-ECE-17-7/ibeis", "id": "bea0d73cee33f4a395d059a9ecc8b9d50c1f71f0", "size": "391...
import logging import time from db.connection import connection from model.usuario import usuario # Enable logging logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO) logger = logging.getLogger(__name__) # Modelo que representa el retiro de la ...
{ "content_hash": "ea36f01505d65a052012fffd6be990a0", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 125, "avg_line_length": 46, "alnum_prop": 0.4966183574879227, "repo_name": "cvem8165/KodeFest12", "id": "e2ee3f095cff4701f9e57f1d26cf00bc2725ca26", "size": "6220", "bina...
from boto.iam import IAMConnection from boto.exception import BotoServerError import json import os import re import urllib from prettytable import PrettyTable from nephoria.baseops.botobaseops import BotoBaseOps class IAMops(BotoBaseOps): EUCARC_URL_NAME = 'iam_url' SERVICE_PREFIX = 'iam' CONNECTION_CLAS...
{ "content_hash": "b0bd78af4d6fe7301574f7e3f4a6715b", "timestamp": "", "source": "github", "line_count": 1051, "max_line_length": 116, "avg_line_length": 45.41769743101808, "alnum_prop": 0.5707671680563121, "repo_name": "nephomaniac/nephoria", "id": "62f99b8195868a391e5711b5582e709b25e39b0c", "size"...
from twisted.conch.ssh import keys, factory, common from twisted.python import log import primes import os class OpenSSHFactory(factory.SSHFactory): dataRoot = '/usr/local/etc' moduliRoot = '/usr/local/etc' # for openbsd which puts moduli in a different # directory from keys ...
{ "content_hash": "04d131f285d20074afe0d7829a752573", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 80, "avg_line_length": 36.30232558139535, "alnum_prop": 0.5150544522741832, "repo_name": "santisiri/popego", "id": "e14d7e280249f16b3ac622f08fa9d5fe0d77db99", "size": "1561...
import itertools import posixpath from urllib.parse import urlparse from flask import current_app, g, render_template, request, session from markupsafe import Markup from pytz import common_timezones, common_timezones_set from indico.core import signals from indico.core.config import config from indico.modules.core.s...
{ "content_hash": "3243c8a73b36581b9b5cfdc638f3b897", "timestamp": "", "source": "github", "line_count": 369, "max_line_length": 116, "avg_line_length": 39.764227642276424, "alnum_prop": 0.5922442581612486, "repo_name": "DirkHoffmann/indico", "id": "c3b9b8d808b376b2951bbc01ee0a72a342d37122", "size":...
import sys, os, re import eclim from util import caret_position, completion_popup, \ completion_popup_with_snippet class CompletionProposal(object): def __init__(self, name, insert=None, type="None"): self.name = name self.display = name self.insert = insert self.type = "None" ...
{ "content_hash": "eea864afee152b79da2b63b854b416cc", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 80, "avg_line_length": 33.69565217391305, "alnum_prop": 0.5234408602150538, "repo_name": "JulianEberius/Eclim.tmbundle", "id": "fcd2973970d1f8b5e4862d58cdc99628945d6793", "...
from azure.identity import DefaultAzureCredential from azure.mgmt.maintenance import MaintenanceManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-maintenance # USAGE python apply_updates_create_or_update.py Before run the sample, please set the values of the client...
{ "content_hash": "6ccb2363dbe411f02e470ae3be0d4ecf", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 155, "avg_line_length": 35.371428571428574, "alnum_prop": 0.7374798061389337, "repo_name": "Azure/azure-sdk-for-python", "id": "ab11de511ab1430946fdd2dff13dbe8bfddad10e", "...
""" Django settings for sw_tts project. Generated by 'django-admin startproject' using Django 1.9.8. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os # ...
{ "content_hash": "44584adcbbb06d7383aab5353d5fd742", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 93, "avg_line_length": 27.56969696969697, "alnum_prop": 0.6871839964827434, "repo_name": "g10k/sw_tts", "id": "f423912a0d20990d378662dcb60208384982dc3e", "size": "4549", ...
"""Strip static qualifier from C functions to enable unit testing.""" import os import re import sys import textwrap import gflags import makani gflags.DEFINE_string('autogen_root', makani.HOME, 'Root of the source tree for the output files.') gflags.DEFINE_string('input_source', None, ...
{ "content_hash": "139b9067d7edaf572c76827e0652edf1", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 78, "avg_line_length": 34.5607476635514, "alnum_prop": 0.58085451595457, "repo_name": "google/makani", "id": "a55e69536354b0d9582c9223213550445f29ab31", "size": "4306", ...
__doc__ = """ >>> from django.conf import settings >>> settings.ROOT_URLCONF = 'yui_loader.tests.urls' >>> from django.test import Client >>> c = Client() >>> print c.get('/').content.replace(settings.YUI_INCLUDE_BASE, 'YUI_INCLUDE_BASE/') <html> <head> <title> test-yui-include.html </t...
{ "content_hash": "14bacd466384e3da6c6de5258eb3c510", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 94, "avg_line_length": 42.21052631578947, "alnum_prop": 0.6408977556109726, "repo_name": "akaihola/django-yui-loader", "id": "5e5c9f76d09b98e7a388ea0e4bc259561842d905", "si...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'Booking.arrival' db.delete_column(u'reserved_booking', 'arrival') # De...
{ "content_hash": "15f1d4f43a148daed2c29cce8cb11ac8", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 195, "avg_line_length": 72.47014925373135, "alnum_prop": 0.5547317475028318, "repo_name": "hellsgate1001/bookit", "id": "5d00034f96bfd0029811e491b32628ca20c4c5f0", "size":...
"""Use serial protocol of Acer projector to obtain state of the projector.""" import logging import re import serial import voluptuous as vol from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity from homeassistant.const import ( CONF_FILENAME, CONF_NAME, CONF_TIMEOUT, STATE_OFF, ...
{ "content_hash": "2792c15e8d0344618eec55ee2d140ddc", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 84, "avg_line_length": 28.86904761904762, "alnum_prop": 0.5940206185567011, "repo_name": "partofthething/home-assistant", "id": "101f7cbd6155b0edb24e164ece4d4c17bbaed58a", ...
''' :codeauthor: :email:`Pedro Algarvio ([email protected])` :copyright: © 2012-2013 by the SaltStack Team, see AUTHORS for more details :license: Apache 2.0, see LICENSE for more details. tests.integration.shell.master ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ''' # Import python libs import os import yaml...
{ "content_hash": "2cdb08ef5ada7182bf34c6f0be5da8bd", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 79, "avg_line_length": 28.5974025974026, "alnum_prop": 0.5703905540417802, "repo_name": "victorywang80/Maintenance", "id": "adcc4c00eadd32041ffe0bd7dc7669580fce8c49", "size...
from __future__ import division, absolute_import import time import pygame import events import consts import levels from frames.utils import * class MainMenuFrame(object): def __init__(self): self.name = 'main_menu' self.title_font = pygame.font.SysFont('Segoe UI', 72) self.title_surfa...
{ "content_hash": "7a32f42a0283d149514346d8c9f67733", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 89, "avg_line_length": 29.293333333333333, "alnum_prop": 0.5493855257168867, "repo_name": "Michael0x2a/Amoeba", "id": "04ef7868562bd61b8264c51b5d27cda6aee597a2", "size": "2...
""" ORCID Member No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: Latest Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six from orcid_api_...
{ "content_hash": "cc68a2e38e1123c29658c14cc190f5e3", "timestamp": "", "source": "github", "line_count": 387, "max_line_length": 257, "avg_line_length": 33.48837209302326, "alnum_prop": 0.6198302469135802, "repo_name": "Royal-Society-of-New-Zealand/NZ-ORCID-Hub", "id": "771ff443fda284d6b972998f04451b0...
from .jolokia_session import JolokiaSession from .remote_jmx_queue import RemoteJmxQueue class RemoteJmxBroker(object): @staticmethod def connect(host, port, broker_name): jolokia_session = JolokiaSession.connect(host, port) return RemoteJmxBroker(jolokia_session, broker_name) def __init_...
{ "content_hash": "fc76214e192d6e5f5ec230cd2f42cee4", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 88, "avg_line_length": 36.041666666666664, "alnum_prop": 0.6520231213872832, "repo_name": "julianghionoiu/tdl-client-python", "id": "e15485d65566877f45e9d2da3f0680025101903b"...