text
stringlengths
4
1.02M
meta
dict
from __future__ import absolute_import # import apis into api package from .apis_api import ApisApi from .apps_api import AppsApi from .apps_v1beta1_api import AppsV1beta1Api from .authentication_api import AuthenticationApi from .authentication_v1_api import AuthenticationV1Api from .authentication_v1beta1_api import...
{ "content_hash": "d849327b6e1fbab4c4d377e9318dd5ff", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 73, "avg_line_length": 45.166666666666664, "alnum_prop": 0.8548585485854858, "repo_name": "skuda/client-python", "id": "ca1f5b9bc07f0a82af8450f334cb4dc569fd50da", "size": "...
import logging from urllib import quote import jsonpickle from Vulnerability import Vulnerability from VulnerabilityEnvironmentProperties import VulnerabilityEnvironmentProperties from tests.CairisTests import CairisTests __author__ = 'Robin Quetin' class VulnerabilityTests(CairisTests): # region Class fields ...
{ "content_hash": "88eb82ae94462ce7a37003d69b8c3ab2", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 188, "avg_line_length": 50.63636363636363, "alnum_prop": 0.6696588868940754, "repo_name": "RobinQuetin/CAIRIS-web", "id": "3253d80831713a5d8d25a5ef97f1f3664c6a47fd", "size...
import tornado.ioloop import tornado.iostream from tornado import gen import socket import uuid from urlparse import urlsplit JOIN_GROUP = 1 LEAVE_GROUP = 2 NEW_PEER = 3 EXISTING_PEER = 4 REMOVE_PEER = 5 _MAX_HEALTH = 5 _PEER_HEALTH_INTERVAL = 1.5 _GROUP_ADDR = ('224.0.0.1', 9999) _ADVERTISE_INTERVAL = 1000 * 1 _1KB...
{ "content_hash": "74ae806ec88a2af947c26a0a11ee1405", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 107, "avg_line_length": 33.94230769230769, "alnum_prop": 0.5996222851746931, "repo_name": "jerluc/qdpy", "id": "50691ec5268fb26202b825d49f0dfae9a8a5f48c", "size": "5295", ...
REDRAW_SCREEN = 'redraw screen' CURSOR_UP = 'cursor up' CURSOR_DOWN = 'cursor down' CURSOR_LEFT = 'cursor left' CURSOR_RIGHT = 'cursor right' CURSOR_PAGE_UP = 'cursor page up' CURSOR_PAGE_DOWN = 'cursor page down' CURSOR_MAX_LEFT = 'cursor max left' CURSOR_MAX_RIGHT = 'cursor max right' ACTIVATE = 'activate' class Com...
{ "content_hash": "1c0cc8c26a1f4e4cca9222c76ed307af", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 69, "avg_line_length": 28.951807228915662, "alnum_prop": 0.5372451102788182, "repo_name": "AnyMesh/anyMesh-Python", "id": "15633f8480aefcc2e5d357957bc9650c3f21b3b1", "size"...
import asyncio from urllib.parse import urlparse from Levenshtein import distance, hamming, jaro, jaro_winkler, median, ratio MESSAGES = { "names": ("Send some names to compare. Ej: " "?name=oneligin&name=OneLogin%20Inc."), "domains": ("Send some domains and URLs to get the canonical one. " ...
{ "content_hash": "52a5e545a476b8b8288cc5a7b07b0629", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 76, "avg_line_length": 32.867924528301884, "alnum_prop": 0.605625717566016, "repo_name": "versae/partnermatcher", "id": "89a031251a695b4162bf2b0ef804c342537d86b2", "size": ...
from __future__ import print_function, division import os import warnings import numpy as np from astropy import log as logger import six from ..util.constants import c, pi from ..util.functions import FreezableClass from ..dust import SphericalDust from ..util.otf_hdf5 import on_the_fly_hdf5 from ..grid import Cart...
{ "content_hash": "f2f4baca85628e7c2e9fce188a8a05af", "timestamp": "", "source": "github", "line_count": 1136, "max_line_length": 158, "avg_line_length": 37.76496478873239, "alnum_prop": 0.5435537633155404, "repo_name": "hyperion-rt/hyperion", "id": "54ad80089aab29d90835a4244642f88c18de604a", "size"...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('conf', '0003_v310_JSONField_changes'), ] operations = [ # This list is intentionally empty. # Tower 3.2 included several data migrations that are no...
{ "content_hash": "2e1a2e3acdfba1e1c03698c8ce5287d7", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 77, "avg_line_length": 28.176470588235293, "alnum_prop": 0.6701461377870563, "repo_name": "GoogleCloudPlatform/sap-deployment-automation", "id": "99fcd7ffcecd32c11cb338599c16...
import pytest import numpy as np from collections import defaultdict from stellargraph.data.unsupervised_sampler import UnsupervisedSampler from stellargraph.data.explorer import UniformRandomWalk from ..test_utils.graphs import line_graph def test_init_parameters(line_graph): # if no graph is provided with...
{ "content_hash": "0100f841ba5b5d87287bf71d465f065f", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 99, "avg_line_length": 34.26890756302521, "alnum_prop": 0.6907797940166749, "repo_name": "stellargraph/stellargraph", "id": "463e52edd657fb08596eb70ef32c2d4b4a7f1286", "si...
"""Collections contain content documents and blueprints.""" from . import documents from . import formats from . import messages from grow.common import structures from grow.common import utils from grow.pods import locales import copy import json import logging import operator import os import re import sys class E...
{ "content_hash": "cccd933cd022f6d3dc013caa47cc6c6c", "timestamp": "", "source": "github", "line_count": 300, "max_line_length": 87, "avg_line_length": 35.91, "alnum_prop": 0.5907360995080293, "repo_name": "denmojo/pygrow", "id": "c5b36167c0632399dc722a69a24bdc203bb8a7b0", "size": "10773", "binary...
""" Pentagonal numbers are generated by the formula, Pn=n(3n−1)/2. The first ten pentagonal numbers are: 1, 5, 12, 22, 35, 51, 70, 92, 117, 145, ... It can be seen that P4 + P7 = 22 + 70 = 92 = P8. However, their difference, 70 − 22 = 48, is not pentagonal. Find the pair of pentagonal numbers, Pj and Pk, for which t...
{ "content_hash": "5c54a933190589a4ada97ff77984aba9", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 153, "avg_line_length": 36.46153846153846, "alnum_prop": 0.6782700421940928, "repo_name": "bsamseth/project-euler", "id": "0f9ffa33020ce743d6eb9bc9adb14c838c8ab4c8", "size"...
''' Created on Feb 8, 2011 @author: Blodstone ''' import pymongo conn = pymongo.Connection() col = conn['QAnlp_head_whWord']['feature10_Fine'] result = col.find() count = 0 question = [] for tes in result: print len(tes)-5 # break # if len(tes) != 7979: # count = count + 1 # ...
{ "content_hash": "d675fc1eb92b375b8cb7e00557d384ef", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 49, "avg_line_length": 17.59090909090909, "alnum_prop": 0.5943152454780362, "repo_name": "blodstone/CCS590v2", "id": "ddc971f04ec4da42dca59bbfe4894c6f3befe0ff", "size": "38...
import logging from gi.repository import Gst, GstNet __all__ = ['Clock', 'NetTimeProvider'] port = 9998 log = logging.getLogger('Clock') log.debug("Obtaining System-Clock") Clock = Gst.SystemClock.obtain() log.info("Using System-Clock for all pipelines.") log.info("Starting NetTimeProvider on Port %u", port) NetTim...
{ "content_hash": "914dd9265454023423b2a217550d332e", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 63, "avg_line_length": 27, "alnum_prop": 0.7380952380952381, "repo_name": "voc/voctomix", "id": "3eb85832cd8445bfd9a4398038900e98ed3fd387", "size": "397", "binary": false...
from django.utils.text import slugify from ...product.models import Attribute, AttributeValue def attributes_to_hstore(attribute_value_input, attributes_queryset): """Transform attributes to the HStore representation. Attributes configuration per product is stored in a HStore field as a dict of IDs. Thi...
{ "content_hash": "a9f172117a428175cf34a5724ddaceda", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 77, "avg_line_length": 34.395348837209305, "alnum_prop": 0.6355645706558486, "repo_name": "UITools/saleor", "id": "4e0442ef562bed5f512d73214670eae61ebff69b", "size": "1479"...
"""empty message Revision ID: 276a647f828a Revises: None Create Date: 2015-06-26 15:13:05.579248 """ # revision identifiers, used by Alembic. revision = '276a647f828a' down_revision = None from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - please adjust! ###...
{ "content_hash": "b83415940f3f3aacce8eb252dbfd3471", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 63, "avg_line_length": 24.75, "alnum_prop": 0.6666666666666666, "repo_name": "LandRegistry/register-metadata", "id": "dea67fca986468d9f50f3f614df6734df1b6208d", "size": "79...
"""Logging """ import sys import os import logging from pip._vendor import colorama, pkg_resources def _color_wrap(*colors): def wrapped(inp): return "".join(list(colors) + [inp, colorama.Style.RESET_ALL]) return wrapped def should_color(consumer, environ, std=(sys.stdout, sys.stderr)): real_c...
{ "content_hash": "ef28a73798f473b44e169a24a407e3f2", "timestamp": "", "source": "github", "line_count": 290, "max_line_length": 79, "avg_line_length": 34.19310344827586, "alnum_prop": 0.5488100040338846, "repo_name": "blueyed/pip", "id": "f7dfd144aaba079c8176330923206a3af935b7ae", "size": "9916", ...
from eclcli.common import command from eclcli.common import utils from ..networkclient.common import utils as to_obj class ListLoadBalancer(command.Lister): def get_parser(self, prog_name): parser = super(ListLoadBalancer, self).get_parser(prog_name) parser.add_argument( '--admin_usern...
{ "content_hash": "ee1726af0d780882e48a7d95a95724a0", "timestamp": "", "source": "github", "line_count": 276, "max_line_length": 92, "avg_line_length": 34.119565217391305, "alnum_prop": 0.5737496017840077, "repo_name": "nttcom/eclcli", "id": "e09dc8ee3f4fa3b3eb646a623b07a2e2bf486b01", "size": "9417"...
#!/usr/bin/env python3 # Copyright (c) 2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test message sending before handshake completion. A node should never send anything other than VERSION/VER...
{ "content_hash": "e482386ea76bd8fb0f93922d9e8a4537", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 104, "avg_line_length": 40.184, "alnum_prop": 0.6938084809874577, "repo_name": "biblepay/biblepay", "id": "d50a7380b07e65c1d24a49cacbdc413f494a30fc", "size": "5025", "bi...
"""" Problem Statement ================= Given certain stock values over a period of days (d days) and a number K, the number of transactions allowed, find the maximum profit that be obtained with at most K transactions. Video ----- * https://youtu.be/oDhu5uGq_ic Complexity ---------- * Space Complexity O(days * tr...
{ "content_hash": "46550c264e155f1af55e4a5187eab7a0", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 120, "avg_line_length": 33.120879120879124, "alnum_prop": 0.5630391506303916, "repo_name": "mission-peace/interview", "id": "c7070d7a2b9c717846e49b74dc10e00da0449278", "siz...
import os from data_importers.tests.stubs import BaseStubCsvStationsJsonDistrictsImporter """ Define a stub implementation of json importer we can run tests against uses data that will return a duplicate station on (council_id, internal_council_id) by design """ class Command(BaseStubCsvStationsJsonDistrictsImporte...
{ "content_hash": "7aa242d759731a30afab0a31b79f88d2", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 79, "avg_line_length": 27.263157894736842, "alnum_prop": 0.7393822393822393, "repo_name": "DemocracyClub/UK-Polling-Stations", "id": "7738867ad5a1c7a8373ca73e0f2f686b8479bc79...
"""\ FuzzPy visualization plugins abstract base class. Enforce an interface that visualization plugins must follow, namely: - types: most provide a list of supported object types - is_supported: must return True if the plugin can run in the current \ environment. - visualize: must return a tuple (forma...
{ "content_hash": "241776d007240ef588a7548e6a420af6", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 79, "avg_line_length": 28.925925925925927, "alnum_prop": 0.6446862996158771, "repo_name": "cmantas/tiramola_v3", "id": "6b7e0c238f0d2422b4f06350b6769a021b3568d8", "size": "...
import logging class NullHandler(logging.Handler): def emit(self, record): pass log = logging.getLogger('MotesPages') log.setLevel(logging.ERROR) log.addHandler(NullHandler()) import random from dustWeb import web from DustLinkData import DataVaultException, \ DustLinkDa...
{ "content_hash": "1665d0808e7ddf5307cfe4bcd2506a57", "timestamp": "", "source": "github", "line_count": 370, "max_line_length": 99, "avg_line_length": 40.58108108108108, "alnum_prop": 0.37116217116217115, "repo_name": "twatteyne/dustlink_academy", "id": "4cbc74dbf445c7987eab26121e1a960e66448ab0", "...
"""Annotation and rtyping support for the result of os.stat(), os.lstat() and os.fstat(). In RPython like in plain Python the stat result can be indexed like a tuple but also exposes the st_xxx attributes. """ import os import sys from rpython.annotator import model as annmodel from rpython.rtyper.llannotation impor...
{ "content_hash": "bb87c5400994af0430dcc5e89d2c5efa", "timestamp": "", "source": "github", "line_count": 592, "max_line_length": 103, "avg_line_length": 35.792229729729726, "alnum_prop": 0.5988956534050687, "repo_name": "jptomo/rpython-lang-scheme", "id": "74e5644538488139d2d4952fb54741eafeaa6ed0", ...
""" Make build alignments for starting a new HDP """ from __future__ import print_function import glob import os import sys import string import pandas as pd import numpy as np from argparse import ArgumentParser from random import shuffle def parse_args(): parser = ArgumentParser(description=__doc__) # quer...
{ "content_hash": "891abe4be7710d3b32ae6a98644dadaf", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 112, "avg_line_length": 44.153225806451616, "alnum_prop": 0.5864840182648402, "repo_name": "ArtRand/cPecan", "id": "1b53f93fe46c0d4a06e55507265ae519dcd689ba", "size": "549...
"""fix foreign constraints Revision ID: 06382790fb2c Create Date: 2016-08-11 14:45:34.416120 """ from alembic import op from sqlalchemy.engine import reflection from neutron.db import migration # revision identifiers, used by Alembic. revision = '06382790fb2c' down_revision = '010308b06b49' def upgrade(): in...
{ "content_hash": "2e344a6c7b1b7976e027c1c4b1247deb", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 68, "avg_line_length": 30.62857142857143, "alnum_prop": 0.6660447761194029, "repo_name": "openstack/networking-sfc", "id": "155978b212f878fb6693089a8ae77faaa655ad09", "size...
import sys # For getting generic exception info import datetime # For getting time deltas for timeouts import time # For sleep import json # For packing ros message properties import random # For picking robot responses and shuffling answer options import logging # Log messages import Queue # for queuing messages for t...
{ "content_hash": "24d4b768acd5075cacf7ea73929138e3", "timestamp": "", "source": "github", "line_count": 865, "max_line_length": 81, "avg_line_length": 48.795375722543355, "alnum_prop": 0.5238106520090978, "repo_name": "personal-robots/sar_social_stories", "id": "297b2e13ec4021fd48b2903dc297b505a6188c...
import logging import os from addons.base.apps import BaseAddonAppConfig from addons.gitlab.api import GitLabClient, ref_to_params from addons.gitlab.exceptions import NotFoundError, GitLabError from addons.gitlab.utils import get_refs, check_permissions from website.util import rubeus logger = logging.getLogger(__na...
{ "content_hash": "c872b8f6f8169ef7461910dc1b09ea4a", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 150, "avg_line_length": 33.256, "alnum_prop": 0.6564830406543181, "repo_name": "sloria/osf.io", "id": "7d597ad35f132c3a015ca2308ad73982a2d05b53", "size": "4157", "binary...
import WebCrawler import CMSDetector Crawler = WebCrawler.Crawler() def request_init(): url_request = "http://" + str(input("Enter url to crawl and fuck (e.g. www.noobs.com) : ")) Crawler.request_set(url_request) print("\nFuck Scrap just started crawling ...\n") print("Sending request ...") Crawl...
{ "content_hash": "f7544715720bafcdb8a11db1fa65aa70", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 97, "avg_line_length": 33.8235294117647, "alnum_prop": 0.6239130434782608, "repo_name": "stinkymonkeyph/FuckScrap", "id": "434fe85bb9a352952bf77eb1323088e955695229", "size"...
from __future__ import unicode_literals from flask_pluginengine import current_plugin from indico.core.notifications import email_sender, make_email from indico.core.plugins import get_plugin_template_module from indico.util.placeholders import replace_placeholders from indico.web.flask.templating import get_template...
{ "content_hash": "009c9e69b141d3e5ae2644ad9f02d4a9", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 118, "avg_line_length": 48.513513513513516, "alnum_prop": 0.7520891364902507, "repo_name": "mic4ael/indico", "id": "0747c7a493992ce42df9fa591b988578f1924999", "size": "2009...
"""TOLO Sauna (non-binary, general) sensors.""" from homeassistant.components.sensor import ( SensorDeviceClass, SensorEntity, SensorStateClass, ) from homeassistant.config_entries import ConfigEntry from homeassistant.const import PERCENTAGE, TEMP_CELSIUS from homeassistant.core import HomeAssistant from ...
{ "content_hash": "60ec3ad46e80c7bb9b87c08d8cf7d2b2", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 74, "avg_line_length": 33.55263157894737, "alnum_prop": 0.7082352941176471, "repo_name": "home-assistant/home-assistant", "id": "bcdb7db016535b7018eab235ad9ee4a6191cc6f2", ...
''' Description: This script grabs web text from the given URL input It expects a input file with each line in the following format: [ticker] | [date] (e.g. Fri, 15 Jul 2011 15:25:29 GMT) | [header] (e.g. Summary of Second Quarter Margins for S&P 500 Stocks by Sectors) | [url] Dep...
{ "content_hash": "1cb482c86655d8f59010b99d8fea2f6c", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 133, "avg_line_length": 34.3421052631579, "alnum_prop": 0.5701149425287356, "repo_name": "clintpgeorge/hornbill", "id": "5cd27abce37d6d24cec5d7cced7aa3a1152b52b3", "size":...
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import # Standard imports from future import standard_library standard_library.install_aliases() from builtins import * import unittest import datetime as pydt import logging imp...
{ "content_hash": "66df731920ace625d8305da3bf157ede", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 101, "avg_line_length": 47.12820512820513, "alnum_prop": 0.6775480594849475, "repo_name": "sunil07t/e-mission-server", "id": "4350a6f0f52505ce69f938919f0f19a51913c10d", "s...
""" Tests for prediction of state space models Author: Chad Fulton License: Simplified-BSD """ import numpy as np import pandas as pd from statsmodels.tsa.statespace import sarimax from numpy.testing import assert_equal, assert_raises, assert_allclose, assert_ def test_predict_dates(): index = pd.date_range(s...
{ "content_hash": "2cd6f99d4edd2f57a86707bd6f94a16d", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 79, "avg_line_length": 36.37931034482759, "alnum_prop": 0.6849921011058452, "repo_name": "jseabold/statsmodels", "id": "8560a7de979863443b8db999ba56c6817170acd6", "size": "...
import json from buildercore import cloudformation from . import base from unittest.mock import patch, MagicMock import botocore def test_troposphere_v2_template_upgraded_to_v3_template(): "`cloudformation.read_template` will upgrade any Troposphere v2 string-booleans to v3 literal booleans." v3_fixture = json...
{ "content_hash": "6965aa81d241b6a1e1da065f9cb7e4b9", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 331, "avg_line_length": 43.732394366197184, "alnum_prop": 0.5900161030595813, "repo_name": "elifesciences/builder", "id": "93c33a0154c81f789f9d263eb9d28d626ba46371", "size"...
import itertools from .qt import Qt _role_counter = itertools.count(Qt.UserRole + 314159) _name_to_role = {} def get_role(name, create=True): try: return _name_to_role[name] except KeyError: if not create: raise if not isinstance(name, basestring): raise Type...
{ "content_hash": "0aea85303a614466950fb352189bdbe9", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 98, "avg_line_length": 22.565217391304348, "alnum_prop": 0.6088631984585742, "repo_name": "westernx/uitools", "id": "eeb5f8903100900aa658da506b59f6049137671f", "size": "519...
import os #QT import sip sip.setapi('QVariant',2) sip.setapi('QString',2) from PyQt4 import QtCore,QtGui from .tableDelegate import TableDelegate from .folderView import FolderView #------------------------------------------------------------------------------------------------------------ # Worker: Runs continuousl...
{ "content_hash": "7d9948d200634919ddde29145ccfc8c7", "timestamp": "", "source": "github", "line_count": 273, "max_line_length": 111, "avg_line_length": 30.413919413919412, "alnum_prop": 0.6774659761531976, "repo_name": "tymoreau/klusta_process_manager", "id": "865037f7a9bdb753ec35ab0e58ffa5e610d8c1ec...
from __future__ import unicode_literals from celery import task import inspect @task def do_build_project(project, branch=None): builder = project.get_builder() builder.build_project(project, branch=branch) @task def do_buildset(buildset): builder = buildset.project.get_builder() builder.run_buildse...
{ "content_hash": "c1074ba01aa4105052ac7070dfbfe96d", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 49, "avg_line_length": 20.727272727272727, "alnum_prop": 0.7171052631578947, "repo_name": "lukaszb/zeusci", "id": "c2c3cd5ca68e2224a2e3a6d4d27095fc095a45c9", "size": "456",...
"""test_maximise.py - test Skip List set implementations against the Hacker Rank maximise sum problem. This is a short test to ensure the code passes before we subject it to the ridiculously sized data. """ from .benchmark import maximise class TestMaximiseMixin(object): def test_single(self): self.asser...
{ "content_hash": "fa4f4d5a8a1c7d775f3fad908c608ebd", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 75, "avg_line_length": 33.24390243902439, "alnum_prop": 0.6294937637564196, "repo_name": "jschaf/skiplist", "id": "83163101ba6eeaaad901538a7bcbfb11aef04240", "size": "1363"...
"""Tokenization data types and interfaces.""" from abc import ABCMeta, abstractmethod from functools import reduce from sys import intern from typing import Tuple, Optional, TYPE_CHECKING, Iterable, Union, Iterator if TYPE_CHECKING: from pyramids.config import ModelConfig from pyramids.language import Languag...
{ "content_hash": "a837bce453896d223ff10b416b8e89f9", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 83, "avg_line_length": 32.983739837398375, "alnum_prop": 0.5900912003943801, "repo_name": "hosford42/pyramids", "id": "c0f6aec36163ff2ab03550a773d6cba31b21e00f", "size": "...
import argparse import ConfigParser import MySQLdb import sys import time from novanet2neutron import common CONF = ConfigParser.ConfigParser() def add_port(neutronc, instance, network_id, subnet_id, mac_address, ip_address): body_value = { "port": { "tenant_id": instance.tenant...
{ "content_hash": "a078ab3987b5a4dca7edb272e1cf1e4a", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 79, "avg_line_length": 32.69942196531792, "alnum_prop": 0.5635495845854693, "repo_name": "NeCTAR-RC/novanet2neutron", "id": "060bedd4a02061ed367c90a88fa95e92909d7e5d", "si...
import numbers from typing import TYPE_CHECKING, List, Optional, Tuple, Type, Union import warnings import numpy as np from pandas._libs import lib, missing as libmissing from pandas._typing import ArrayLike, Dtype from pandas.compat.numpy import function as nv from pandas.core.dtypes.common import ( is_bool_dty...
{ "content_hash": "9f08c1a108e81ef705fb375806751362", "timestamp": "", "source": "github", "line_count": 709, "max_line_length": 85, "avg_line_length": 31.784203102961918, "alnum_prop": 0.5646327934324384, "repo_name": "jreback/pandas", "id": "bbbc0911b484604507a0097709ab628bf18c6e95", "size": "2253...
""" Follow up for H-Index: What if the citations array is sorted in ascending order? Could you optimize your algorithm? """ __author__ = 'Daniel' class Solution(object): def hIndex(self, citations): """ From linear search into bin search :type citations: List[int] :rtype: int ...
{ "content_hash": "1ed2603c53095e9e1678f21b4220f600", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 115, "avg_line_length": 22.357142857142858, "alnum_prop": 0.476038338658147, "repo_name": "ee08b397/LeetCode-4", "id": "28b6b8ced0ac39bb16137700508c028617edf33d", "size": "...
from typing import MutableMapping, MutableSequence from google.protobuf import field_mask_pb2 # type: ignore import proto # type: ignore from google.cloud.bigquery_migration_v2.types import migration_entities __protobuf__ = proto.module( package="google.cloud.bigquery.migration.v2", manifest={ "Cre...
{ "content_hash": "e8a120d789e855586f0568fec435b19f", "timestamp": "", "source": "github", "line_count": 274, "max_line_length": 106, "avg_line_length": 30, "alnum_prop": 0.6278588807785888, "repo_name": "googleapis/python-bigquery-migration", "id": "0b38c79c80a6bea786748f5b2d2143633b2a2a8d", "size"...
import pyjd # this is dummy in pyjs. from pyjamas import DOM from pyjamas.ui.RootPanel import RootPanel, RootPanelCls, manageRootPanel from pyjamas.ui.Button import Button from pyjamas.ui.HTML import HTML from pyjamas.ui.Label import Label from pyjamas.ui.FocusPanel import FocusPanel from pyjamas.Canvas.GWTCanvas impo...
{ "content_hash": "9ce28f025cbe2da3c4e3821bf02cd95d", "timestamp": "", "source": "github", "line_count": 387, "max_line_length": 111, "avg_line_length": 30.25581395348837, "alnum_prop": 0.5716969852250405, "repo_name": "minghuascode/pyj", "id": "0bcdb9eba73413f4e2a701336cff39d3c9e3f462", "size": "12...
from tower import ugettext_lazy as _lazy DESC_GENERAL = _lazy(u'General Audiences') DESC_3 = _lazy(u'Not recommended for users younger than 3 years of age') DESC_6 = _lazy(u'Not recommended for users younger than 6 years of age') DESC_7 = _lazy(u'Not recommended for users younger than 7 years of age') DESC_10 = _lazy...
{ "content_hash": "2e349a299164be3287254deb492ee146", "timestamp": "", "source": "github", "line_count": 385, "max_line_length": 79, "avg_line_length": 22.233766233766232, "alnum_prop": 0.5974299065420561, "repo_name": "Joergen/zamboni", "id": "a751b386f46529e383fccc63433f16dac2c5c9a3", "size": "858...
import ctypes as ct import pandas as pd import numpy as np import random, csv, sys, os import math import time np.set_printoptions(suppress=True) from statistics import median import classes_water as ENC import classes_power as ODC import classes_interconnection as ICC import grb_solvers from comtypes import automa...
{ "content_hash": "6c03bb03062811bcdcc1d91a00259ab0", "timestamp": "", "source": "github", "line_count": 949, "max_line_length": 290, "avg_line_length": 45.463645943098, "alnum_prop": 0.7089813419863252, "repo_name": "btgorman/RISE-power-water-ss-1phase", "id": "a0f07062ff2f5cfc2f59ddd73f8b63aee2d3bff...
from typing import Tuple, Optional, Sequence, List import numpy as np import pandas as pd import scipy as sp from anndata import AnnData from natsort import natsorted from .. import logging as logg from ..neighbors import Neighbors, OnFlySymMatrix def _diffmap(adata, n_comps=15, neighbors_key=None, random_state=0):...
{ "content_hash": "d0ebd45e5e3872f42da3bd742ff889a3", "timestamp": "", "source": "github", "line_count": 1144, "max_line_length": 131, "avg_line_length": 43.33391608391609, "alnum_prop": 0.5398596038245854, "repo_name": "theislab/scanpy", "id": "2d298fd7f36ea816622132f19d1e3bd0ce00fc6f", "size": "49...
''' Simimple Model Railway Automation Hall-effect Sensor Support Module Author : Peter Wallen Created : 21/1/13 Version 1.0 This code encapulates hardware associated with sensors used to detect the location of trains. The hardware supported comprises of : One or more Microchip MCP2301...
{ "content_hash": "e0a9739714197034db7b301859d8486a", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 103, "avg_line_length": 33.775193798449614, "alnum_prop": 0.6844158824879504, "repo_name": "phwallen/smrc", "id": "45ee3fd83832501c88f451f983f031776f8826cc", "size": "4357...
__all__ = ("mesh") def bu_to_inches(d): """Return Blender unit d in inches.""" import bpy import mathutils # 1bu = 1 / 0.3048 ft convert = lambda v: (12.0 * bpy.context.scene.unit_settings.scale_length * v) / 0.3048 if isinstance(d, mathutils.Vector): return mathutils.Vector((convert(d...
{ "content_hash": "f4713c838151201f72efd66846b723dd", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 114, "avg_line_length": 36.27835051546392, "alnum_prop": 0.5603864734299517, "repo_name": "ijacquez/blender-tools", "id": "5077f2b85f16a1b22980a9427fbf51dfaf9b317b", "size"...
import mock from nova.network import model as network_model from nova import test from nova import utils from nova.virt.vmwareapi import fake as vmwareapi_fake from nova.virt.vmwareapi import vim_util from nova.virt.vmwareapi import vmops class fake_session(object): def __init__(self, ret=None): self.ret...
{ "content_hash": "04b593ef5770b8482762ce3c3f089be6", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 79, "avg_line_length": 43.4, "alnum_prop": 0.5272781328972796, "repo_name": "SUSE-Cloud/nova", "id": "3bd3ba3ddee5f3428da9de03669bbfa765f49147", "size": "7409", "binary"...
import pywikibot from ddt import ddt, file_data from pywikibot import Site from testfixtures import compare from service.ws_re.scanner.tasks.check_redirect_links import CHRETask from service.ws_re.scanner.tasks.test_base_task import TaskTestCase from service.ws_re.template.re_page import RePage from tools.test import ...
{ "content_hash": "9eea347c38486939e4609b63ba39b02c", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 99, "avg_line_length": 40.53061224489796, "alnum_prop": 0.675226586102719, "repo_name": "the-it/WS_THEbotIT", "id": "9deaf058a746ce8a310851bfae688c546f34dedb", "size": "202...
''' Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: A: a1 → a2 ↘ c1 → c2 → c3 ↗ B: b1 → b2 → b3 begin to intersect at node c1. ...
{ "content_hash": "063ff95699d45fa7232ff6ce9fe9ee6f", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 93, "avg_line_length": 26.875, "alnum_prop": 0.5209302325581395, "repo_name": "gavinfish/leetcode-share", "id": "5f6fb82a7536bd32d88f8d38cbb052326d854591", "size": "1949", ...
''' Reduces BED regions to overlap them. The BED file *must* be sorted in order to merge them. ''' import os import sys from ngsutils.bed import BedStreamer, BedRegion def usage(): print __doc__ print """\ Usage: bedutils reduce {opts} bedfile -extend num{,num} Extend the BED region {num} bases 5' and 3' ...
{ "content_hash": "e1b65d46211fe075602269d4f8d1a0b7", "timestamp": "", "source": "github", "line_count": 187, "max_line_length": 140, "avg_line_length": 29.893048128342247, "alnum_prop": 0.5391771019677997, "repo_name": "ngsutils/ngsutils", "id": "6c3db207b35af5fd1ccc80b32cf9993664c6f5e9", "size": "...
''' Created on 2015/11/08 @author: wildberry ''' from __builtin__ import basestring import types def raiseException(excp): ''' Raises an error if the excp is a instance of an error/exception @param excp: an error/exception instance @return: excp if and only if the excp is not a class or a sub-class o...
{ "content_hash": "4fd80aa34c7bbafe6d6ccef9315b9e2c", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 151, "avg_line_length": 31.257861635220127, "alnum_prop": 0.5505030181086519, "repo_name": "gnomeberry/pyth2", "id": "ff7b1168387657c4c4db1dd44949ae0bd42cf950", "size": "4...
""" Unittests for table management """ __revision__ = '$Id: unittest_table.py,v 1.13 2006-04-09 22:30:53 nico Exp $' import sys import os from cStringIO import StringIO from logilab.common.testlib import TestCase, unittest_main from logilab.common.table import Table, TableStyleSheet, DocbookTableWriter, \ Docbo...
{ "content_hash": "eca5ea8cfc656b8cad9a5bdc78315925", "timestamp": "", "source": "github", "line_count": 431, "max_line_length": 99, "avg_line_length": 40.009280742459396, "alnum_prop": 0.580723729993041, "repo_name": "dbbhattacharya/kitsune", "id": "86b868c4f99ea73bed38e5f26f61264060c53614", "size"...
import numbers from collections import defaultdict import numpy as np from coremltools import _logger as logger from coremltools.converters.mil.mil.types.symbolic import any_symbolic from .block import Function, curr_block from .input_type import (InternalInputType, ListOrTensorInputType, Te...
{ "content_hash": "530cc753b235118c8b2812d0801e184a", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 133, "avg_line_length": 36.045643153526974, "alnum_prop": 0.5607229193047082, "repo_name": "apple/coremltools", "id": "2f782c27fac661704a965f228a0f1a2b29cbe687", "size": "...
"""Common settings and globals.""" from os.path import abspath, basename, dirname, join, normpath from sys import path from os import environ ########## PATH CONFIGURATION # Absolute filesystem path to the Django project directory: DJANGO_ROOT = dirname(dirname(abspath(__file__))) # Absolute filesystem path to the...
{ "content_hash": "1bcd1a65068b7910bf32841886e95c00", "timestamp": "", "source": "github", "line_count": 264, "max_line_length": 100, "avg_line_length": 29.40530303030303, "alnum_prop": 0.6845291768646142, "repo_name": "dmallcott/C-Nutra", "id": "835783aea29104060de625c025b3dac57510addb", "size": "7...
class Retrier(object): """ Models a Retrier for a "Retry" field in a Task or Parallel state :param ErrorNameList: [Required] The set of error names that this ``Retrier`` will handle. :type ErrorNameList: list of str :param IntervalSeconds: [Optional] The interval in seconds before retrying the state. Default is ...
{ "content_hash": "ccd7880b722cbf2bbce9dff1d6db91ff", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 136, "avg_line_length": 33.67567567567568, "alnum_prop": 0.720545746388443, "repo_name": "gford1000/awssl", "id": "16c768757c70a3753c80b81e6fe7b40bceb10e90", "size": "6230...
NAME = 'ntpdshm' VERSION = '0.2.1' LICENSE = 'BSD License' AUTHOR = 'Markus Juenemann' EMAIL = '[email protected]' DESCRIPTION = 'Python interface to NTP Shared Memory' URL = 'https://github.com/mjuenema/python-ntpdshm' from setuptools import setup, Extension ntpdshm_module = Extension('ntpdshm._shm', sources=['ntp...
{ "content_hash": "c380328fad2e78c4f4bf7f63bcab4829", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 92, "avg_line_length": 33.40677966101695, "alnum_prop": 0.6230339928970066, "repo_name": "mjuenema/python-ntpdshm", "id": "1cb3e9dbff0ce95e028997c9295613ede9722260", "size"...
# Calculates the current version number. If possible, this is the # output of “git describe”, modified to conform to the versioning # scheme that setuptools uses. If “git describe” returns an error # (most likely because we're in an unpacked copy of a release tarball, # rather than in a git working copy), then we f...
{ "content_hash": "da2f2d639b6caba840417c1c24f6acbb", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 72, "avg_line_length": 29.94557823129252, "alnum_prop": 0.6119945479327579, "repo_name": "diffeo/pytest-diffeo", "id": "5e2283c5cca68cfe2eb157e64e4caea9ce9848bb", "size": ...
import os import sys import gzip import subprocess topics = int(sys.argv[1]) iterations = int(sys.argv[2]) def main(): samples_directory = r'C:\mallet\clinton\data\globals\samples' samples_output_directory = r'C:\mallet\clinton\data\globals\samples\output' command = 'mallet train-topics --num-topics 8 ' comman...
{ "content_hash": "246aa3c3ea4e763ed9f9093a40954c58", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 93, "avg_line_length": 35.66216216216216, "alnum_prop": 0.7032967032967034, "repo_name": "pepper-johnson/Erudition", "id": "42f18a061ca61bd18f06d2140181d8fcbb4320e1", "size...
def decimal_to_binary_fraction(x=0.5): """ Input: x, a float between 0 and 1 Returns binary representation of x """ p = 0 while ((2 ** p) * x) % 1 != 0: # print('Remainder = ' + str((2**p)*x - int((2**p)*x))) p += 1 num = int(x * (2 ** p)) result = '' if num == 0: ...
{ "content_hash": "e22eaa294865f1e81fd6e877be04eb1b", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 97, "avg_line_length": 28.3125, "alnum_prop": 0.5629139072847682, "repo_name": "Mdlkxzmcp/various_python", "id": "43a74cac582bdf300bc81daa9bedf7b376e2c024", "size": "906", ...
from decimal import Decimal from typing import Any from dataproperty import DataProperty from typepy import Typecode def bool_to_str(value) -> str: if value is True: return "true" if value is False: return "false" return value def serialize_dp(dp: DataProperty) -> Any: if dp.typeco...
{ "content_hash": "6dc0519fd9e99755e21edd0243edf8f7", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 93, "avg_line_length": 21.115384615384617, "alnum_prop": 0.6666666666666666, "repo_name": "thombashi/pytablewriter", "id": "980f2eaa18039b441cfc4757575e626923ccffba", "size...
from flask_wtf import Form from wtforms import StringField, PasswordField from wtforms.validators import DataRequired, Email, Length, EqualTo class LoginForm(Form): email = StringField('Email Address', [DataRequired(), Email()]) password = PasswordField('Password', [DataRequired()]) class RegisterForm(Form)...
{ "content_hash": "79ac725ba19cc56f4a99ac8025f8b137", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 80, "avg_line_length": 30.2, "alnum_prop": 0.6476821192052981, "repo_name": "JeromeErasmus/browserstack_automate", "id": "f75e8981ceac1313988f6fcee9bbd2c862bfa2b4", "size":...
''' usage: metadata.py <first.pdf> [<next.pdf> ...] Creates output.pdf This file demonstrates two features: 1) Concatenating multiple input PDFs. 2) adding metadata to the PDF. If you do not need to add metadata, look at subset.py, which has a simpler interface to PdfWriter. ''' import sys import os import fi...
{ "content_hash": "baf364c6559e6eb007258a3393d24f19", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 60, "avg_line_length": 20.027027027027028, "alnum_prop": 0.717948717948718, "repo_name": "lamby/pkg-pdfrw", "id": "9c691087e9d890f746f0b9f4d8aac2167ca043d8", "size": "764",...
""" A simple cache management utility for daisy. """ from __future__ import print_function import functools import optparse import os import sys import time from oslo_utils import timeutils from daisy.common import utils # If ../glance/__init__.py exists, add ../ to Python search path, so that # it will override wh...
{ "content_hash": "83f165ab4781d187d8fa0d96b53e763f", "timestamp": "", "source": "github", "line_count": 501, "max_line_length": 78, "avg_line_length": 31.64870259481038, "alnum_prop": 0.5824924318869829, "repo_name": "OpenDaisy/daisy-api", "id": "8f3eb7ed8893fbc90dc5105ce44953f0c48d3d4e", "size": "...
import time import pygame import const from os import sys import RPi.GPIO as GPIO from threading import Thread from multiprocessing import Process import subprocess import serial print("Raspberry Pi Master") driveSer = serial.Serial('/dev/ttyUSB0', 250000, timeout=1) turnSer = serial.Serial('/dev/ttyUSB1', 250000, ti...
{ "content_hash": "f2b9ec9df1330157d05a9eafafabfea9", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 92, "avg_line_length": 22.42292490118577, "alnum_prop": 0.6227745460955403, "repo_name": "maanitm/MadMobile", "id": "36c8554a93fcfd22d25593bacfaf4f3989d27eff", "size": "56...
default_app_config = 'waldur_mastermind.invoices.apps.InvoiceConfig'
{ "content_hash": "713ccf24496b23fc066f759c521253c6", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 68, "avg_line_length": 69, "alnum_prop": 0.8260869565217391, "repo_name": "opennode/waldur-mastermind", "id": "9af7789fc780de7b2c0d65f8ff91aff05b4d4923", "size": "69", "bi...
"""Test the Smart Meter Texas config flow.""" import asyncio from aiohttp import ClientError import pytest from smart_meter_texas.exceptions import ( SmartMeterTexasAPIError, SmartMeterTexasAuthError, ) from homeassistant import config_entries, setup from homeassistant.components.smart_meter_texas.const impor...
{ "content_hash": "c96ec74019d11af326ace23bca09aa39", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 86, "avg_line_length": 33.03333333333333, "alnum_prop": 0.6612008072653885, "repo_name": "titilambert/home-assistant", "id": "d1e88df8a801541e4a64c9890622e07ff96af54d", "s...
import os from contextlib import contextmanager from OpenSSL import crypto, SSL import synapse.common as s_common from synapse.tests.common import * import synapse.lib.certdir as s_certdir class CertDirTest(SynTest): @contextmanager def getCertDir(self): ''' Get a test CertDir object. ...
{ "content_hash": "7b779cc352ad56f62e355a8dd717e47f", "timestamp": "", "source": "github", "line_count": 484, "max_line_length": 143, "avg_line_length": 46.14462809917355, "alnum_prop": 0.5997134413898093, "repo_name": "vivisect/synapse", "id": "1eca8a057ff0f3fe4b6e78cc2e0abd8c8b687a70", "size": "22...
from Monument import Monument, Dataset import importer_utils as utils import importer as importer class AlSq(Monument): def set_special_is(self): if self.has_non_empty_attribute("type"): spec_is_raw = self.type.lower() is_dict = self.data_files["is"]["mappings"] matche...
{ "content_hash": "24b0814ff71cb39c24568260d019d108", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 79, "avg_line_length": 34.62337662337662, "alnum_prop": 0.5817704426106527, "repo_name": "Vesihiisi/COH-tools", "id": "9fd71e00b4f77fc09fc235b45ffe94a7d71186e9", "size": "2...
from django.utils.safestring import mark_safe from django.utils.html import escape, conditional_escape from django.utils.encoding import force_unicode from django.forms.widgets import ClearableFileInput as oldWidget, CheckboxInput, FileInput, Input from nginx_filter_image.templatetags.pimage import pimage_single, pima...
{ "content_hash": "888f73d9f80ba840829c7e7e5052fe8b", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 112, "avg_line_length": 54.142857142857146, "alnum_prop": 0.5958663148636764, "repo_name": "BlackWizard/django-misc-base", "id": "1241aefdfc588ad4f37e529c77f1b23009f1fbce", ...
from .controllers import organization_count, organization_follow, organization_follow_ignore, \ organization_stop_following, voter_count from ballot.controllers import ballot_item_options_retrieve_for_api, choose_election_from_existing_data, \ voter_ballot_items_retrieve_for_api from candidate.controllers impor...
{ "content_hash": "305235722d56a123bab1c273f02681cc", "timestamp": "", "source": "github", "line_count": 2062, "max_line_length": 120, "avg_line_length": 45.95392822502425, "alnum_prop": 0.6321116118070432, "repo_name": "wevote/WebAppPublic", "id": "c2ef1b82a400cc4ab8f328e9fa580f50f9290b32", "size":...
""" byceps.services.orga_presence.transfer.models ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2020 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from __future__ import annotations from dataclasses import dataclass from datetime import datetime from enum import Enum from...
{ "content_hash": "1c58f2324375cec594bc93d83bcccca0", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 66, "avg_line_length": 22.792207792207794, "alnum_prop": 0.6210826210826211, "repo_name": "m-ober/byceps", "id": "c6a116a9d976dda738b316c4d8f5fe0d6ac53973", "size": "1755",...
from openerp.modules.registry import RegistryManager def migrate(cr, version): registry = RegistryManager.get(cr.dbname) from openerp.addons.account.models.chart_template import migrate_tags_on_taxes migrate_tags_on_taxes(cr, registry)
{ "content_hash": "1265c10282aa155a905d727ef72372a4", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 82, "avg_line_length": 35.714285714285715, "alnum_prop": 0.78, "repo_name": "vileopratama/vitech", "id": "a37770d2c1c8db1cbf8b121823c2bbcd05fd4aa9", "size": "250", "binary...
from django.db import transaction from backend0bit.models import StaticPage @transaction.atomic def set_staticpage_order(order): _sanitize_order_list(order) _set_safe_order_values() counter = 0 for sp_id in order: sp = StaticPage.objects.get(id=sp_id) sp.order = counter sp.sa...
{ "content_hash": "9f334bec97b5ce7aa405bd84b31c7b30", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 79, "avg_line_length": 24.785714285714285, "alnum_prop": 0.6282420749279539, "repo_name": "piotrb5e3/ComfyMS-backend", "id": "303b516cadd06a84114094826211bf0ffe3e8e16", "si...
import pickle, sys # Loading bar for progress on the corpus # http://stackoverflow.com/questions/2122385/dynamic-terminal-printing-with-python # Print iterations progress def printProgress (iteration, total, prefix = '', suffix = '', decimals = 2, barLength = 100): """ Call in a loop to create terminal progres...
{ "content_hash": "c6234dcb76d31dc73a5302dac0e031a0", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 95, "avg_line_length": 37.68627450980392, "alnum_prop": 0.627471383975026, "repo_name": "jbobrow/pangramGenerator", "id": "de839ad2c814f88464f899777e125c06aae6376e", "size"...
from __future__ import absolute_import from django.views.decorators.csrf import csrf_exempt from django.conf.urls import url from django.conf import settings from django.http import HttpResponse, HttpResponseNotAllowed import json import logging import time from ..exceptions import JSONRPCInvalidRequestException from...
{ "content_hash": "7a9d2225909b1e25170a06dd37e4ff8a", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 78, "avg_line_length": 30.736263736263737, "alnum_prop": 0.6313907758312478, "repo_name": "pavlov99/json-rpc", "id": "0708e46c780214809677dcdc7868298802117a16", "size": "27...
from optparse import OptionParser import os import subprocess import sys ################################################################################ # install_dependencies.py # # Download and install Basset dependencies. ################################################################################ ##########...
{ "content_hash": "b025ae3e31fe43329bfe70eb334982c6", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 80, "avg_line_length": 27.680555555555557, "alnum_prop": 0.4014049172102358, "repo_name": "davek44/Basset", "id": "a9089aee5a7761c74f86ac4549db7f7f345abaef", "size": "2015"...
salary = float(input()) if(salary > 0 and salary <= 400): percent = 0.15 earned = salary * percent salary = salary+earned elif(salary > 400 and salary <= 800): percent = 0.12 earned = salary * percent salary = salary+earned elif(salary > 800 and salary <= 1200): percent = 0.10 earned = salary * percent sala...
{ "content_hash": "891f3d4e8d734a657c5aa7f56060f4ba", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 111, "avg_line_length": 29.043478260869566, "alnum_prop": 0.6856287425149701, "repo_name": "henrywm/URI", "id": "e17a1b5bb60fd17ffc67dc7737b20bd26eab55bd", "size": "668", ...
def f(x): while x: print (x) while 0: asgn = unreachable() while False: return unreachable() while 7: print(x) def g(x): if False: unreachable() else: reachable() print(x) return 5 for x in first_unreachable_stmt(): raise more_...
{ "content_hash": "47018ce55e0b4e170169552520cede5f", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 78, "avg_line_length": 18.154411764705884, "alnum_prop": 0.5455650060753341, "repo_name": "github/codeql", "id": "493dcc24dd15d8a6af528f1441743dd3ff2e634c", "size": "2489"...
from __future__ import unicode_literals import bluebottle.utils.fields from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('tasks', '0024_merge_20170529_1436'), ] operations = [ migrations.AddField( model_name='task', ...
{ "content_hash": "50fe59eca2c55ef1b52996d7e35b2e9f", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 158, "avg_line_length": 33.58620689655172, "alnum_prop": 0.6293634496919918, "repo_name": "onepercentclub/bluebottle", "id": "f0dd924ed9fdb4964598ce74209d0aadc87f1398", "si...
""" Bibliographic database backed by the ADS API. The intention is to have classes that the API of BibTexDB and BibTexPub. .. todo:: Add a caching mechanism; maybe with MongoDB? 2014-12-07 - Created by Jonathan Sick """ import re import ads # import texutils from .base import BasePub ARXIV_PATTERN = re.compile...
{ "content_hash": "01c1dd52892872261a3f94eba06168bb", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 79, "avg_line_length": 26.3953488372093, "alnum_prop": 0.5791483113069016, "repo_name": "jonathansick/starlit", "id": "6b43c640bf10d9e08417a8457ed0b3efe263195f", "size": "...
from migrate.versioning.shell import main if __name__ == '__main__': main(six='<module 'six' from '/Users/vivianli/Documents/2014-2015/microblog/flask/lib/python3.4/site-packages/six.py'>')
{ "content_hash": "5a7c76290cad361bcb184b2dc9fc7f33", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 124, "avg_line_length": 48.75, "alnum_prop": 0.7076923076923077, "repo_name": "vivianli32/TravelConnect", "id": "38065bc25d1ef4b5d53764edf1f395f7c75b1e2f", "size": "217", ...
import datetime from celery.schedules import crontab from celery.task import periodic_task from corehq.apps.commtrack.models import SupplyPointCase from corehq.apps.users.models import CommCareUser from custom.ilsgateway.models import SupplyPointStatusValues, SupplyPointStatusTypes from custom.ilsgateway.tanzania.remi...
{ "content_hash": "97a575ea21e51773494bf72772cc02a6", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 134, "avg_line_length": 51.19298245614035, "alnum_prop": 0.7145305003427005, "repo_name": "puttarajubr/commcare-hq", "id": "cb897472ed975df1fb70dd9ea3c4e4c1f4d5c40e", "size...
""" A script that generates the database. """ ################################################################################ class JsonJit(object): """ JsonJit is a class for Just In Time instantiation of JSON resources. The __lazy__ method downloads the JSON resource from the server. But the __lazy_...
{ "content_hash": "552ebd0de109ef37c0636aa02467cc94", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 110, "avg_line_length": 36.782051282051285, "alnum_prop": 0.554897176716626, "repo_name": "xapple/genomes", "id": "c0eddb30e90ed363e835ddbe807ca6e4314ff0c6", "size": "5738...
""" WSGI config for Dsystem project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTI...
{ "content_hash": "b268f8b56a59527c010da66785a809d8", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 24.4375, "alnum_prop": 0.7698209718670077, "repo_name": "yangfeiffei/Dsystem", "id": "3ca7e0b1efd8ad3e1b4c575656f3dbb90597ad55", "size": "391", "bi...
from typing import Optional from models.PricewarsObject import PricewarsObject from models import Product class Offer(PricewarsObject): def __init__(self, offer_id=-1, uid=-1, product_id=-1, quality=0, merchant_id: Optional[str] = None, amount=1, price=0.0, shipping_time=None, prime=False, signa...
{ "content_hash": "5c6e8f1ad05673b3c9954ad42225d585", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 114, "avg_line_length": 34.65625, "alnum_prop": 0.6086564472497745, "repo_name": "hpi-epic/pricewars-merchant", "id": "d82db75af7b6665f94ce57ef7cdb2b8f3eb1474c", "size": "1...
from ..cw_model import CWModel class Opportunity(CWModel): def __init__(self, json_dict=None): self.id = None # (Integer) self.name = None # *(String(100)) self.expectedCloseDate = None # (String) self.type = None # (OpportunityTypeReference) self.stage = Non...
{ "content_hash": "c2a72c7dfc1e2c6921ebb80af3dd07b4", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 68, "avg_line_length": 45.93181818181818, "alnum_prop": 0.6091044037605146, "repo_name": "joshuamsmith/ConnectPyse", "id": "cfd57908d99051b70ff99858db47ecce63d101c9", "size...
""" rohmu - content encryption Copyright (c) 2016 Ohmu Ltd See LICENSE for details """ import io import logging import os import struct import cryptography import cryptography.hazmat.backends.openssl.backend from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import serializa...
{ "content_hash": "215f66982bd87a63f3efa84af39b0e36", "timestamp": "", "source": "github", "line_count": 408, "max_line_length": 124, "avg_line_length": 36.13970588235294, "alnum_prop": 0.5976941336046118, "repo_name": "ohmu/pghoard", "id": "695c76d3ff9a7f0b5413508d45299ebc0c68f855", "size": "14745"...
from django.apps import AppConfig class ChannelTwitterConfig(AppConfig): name = 'channel_twitter'
{ "content_hash": "79812ea6c30d1477724b983cbd7233ff", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 38, "avg_line_length": 20.8, "alnum_prop": 0.7788461538461539, "repo_name": "daisychainme/daisychain", "id": "09f35d96d63855f4fd5dc246db83202ca57cfce9", "size": "104", "bi...
from django.shortcuts import render def home(request): ''' Address: / ''' return render(request, 'home.html')
{ "content_hash": "e1197f609f18f2d30f75140f223a4b71", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 39, "avg_line_length": 14.333333333333334, "alnum_prop": 0.6124031007751938, "repo_name": "prsevero/django-template", "id": "99314d109494a6d57bfc1417de8a30c05f1ae2fc", "size...
from utils import run # `run` does most of the work. It creates a tempdir, copys over input data, # Snakefile, and wrapper, runs the Snakefile, and runs a user-provided test # function against the output. from utils import dpath # `dpath` figures out the path the wrapper even when in a tempdir from utils import syml...
{ "content_hash": "09592ea55b01b5c13c2140a59880109f", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 83, "avg_line_length": 35.614814814814814, "alnum_prop": 0.6366472545757071, "repo_name": "lcdb/lcdb-wrapper-tests", "id": "3c097d4882606dd300d203382d988528aa26e7b3", "siz...
import copy import os import shutil from tempfile import mkdtemp from .test_utils import TestCase from dwight_chroot.cache import Cache from dwight_chroot.resources import CacheableResource class DummyCachedItem(CacheableResource): def __init__(self, key, src_path): super(DummyCachedItem, self).__init__() ...
{ "content_hash": "e06cd3ed1b978e99ec74e27154dab0b2", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 108, "avg_line_length": 39.573170731707314, "alnum_prop": 0.6206471494607088, "repo_name": "vmalloc/dwight", "id": "33a2c40929c70e657315bca12012e81e1d1f2ddc", "size": "3245...
import random from django.test import TestCase from tx_salaries.utils.transformers import base class TestOfBaseTransformedRecord(TestCase): def test_returns_mapped_value_as_an_attribute(self): some_random_key = 'some-key-{0}'.format(random.randint) class MyRecord(base.BaseTransformedRecord): ...
{ "content_hash": "7679df5c28f2ebf68d8cf927edf11a88", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 68, "avg_line_length": 31.096774193548388, "alnum_prop": 0.6441908713692946, "repo_name": "texastribune/tx_salaries", "id": "7269f41d03acbda32325d4447d125e33260f1961", "siz...
''' Main handler for all the incoming bot events ''' import logging from concurrent.futures import ThreadPoolExecutor import telegram from telegram.ext import Updater, MessageHandler, CommandHandler, Filters, CallbackQueryHandler from telegram.ext.inlinequeryhandler import InlineQueryHandler from telegram.ext.chosenin...
{ "content_hash": "808a94661b1d8160e7e4ab2d8222c5de", "timestamp": "", "source": "github", "line_count": 282, "max_line_length": 153, "avg_line_length": 37.5886524822695, "alnum_prop": 0.6424528301886793, "repo_name": "vz10/secretBot", "id": "c7045759634b4f9e4aa99c10314da8d8ec103ded", "size": "10600...
import re from genshi.filters.transform import Transformer from trac.core import Component, implements from trac.web import IRequestHandler from trac.web.api import ITemplateStreamFilter from trac.web.chrome import Chrome class AdsenseForSearch(Component): config = env = log = None implements(ITemplateStrea...
{ "content_hash": "11da666b4d06d5ee8a11d3a0ff2fafdb", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 80, "avg_line_length": 42.26229508196721, "alnum_prop": 0.5663304887509697, "repo_name": "UfSoft/trac-google-search", "id": "938b3ec097d3b018cd6391b24797eec850c9f6b2", "siz...
import praw from createMatchThread import createMatchThreadWrapper from getFixturesInfo import getFixturesDictionary from createSidebar import updateSidebar from datetime import datetime import time import logging from requests.exceptions import HTTPError from praw.errors import ExceptionList, APIException, InvalidCapt...
{ "content_hash": "de0cb69039ad4b19d8c4f5c0a96b17f9", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 157, "avg_line_length": 32.9, "alnum_prop": 0.780547112462006, "repo_name": "rreyv/r-Cricket-Bot", "id": "d4aee203507a44bd87c5de4c1b37685b149890e9", "size": "1645", "bina...
from __future__ import division import datetime __author__ = 'James Robert Lloyd' __description__ = 'Miscellaneous utility functions' import os import shutil from glob import glob import tempfile import string import random import matplotlib.pyplot as pl import numpy as np import scipy.io from sklearn.cross_validati...
{ "content_hash": "852dca480f2ad0b13d0afa5d1b89f4d8", "timestamp": "", "source": "github", "line_count": 433, "max_line_length": 119, "avg_line_length": 36.61200923787529, "alnum_prop": 0.5848735255156753, "repo_name": "jamesrobertlloyd/automl-phase-2", "id": "9963a0efeebce008000e6eabed757ffae00dfc45"...
import _plotly_utils.basevalidators class DurationValidator(_plotly_utils.basevalidators.NumberValidator): def __init__( self, plotly_name="duration", parent_name="layout.slider.transition", **kwargs ): super(DurationValidator, self).__init__( plotly_name=plotly_name, p...
{ "content_hash": "c7604c650a5782e9645ab7770d341b03", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 86, "avg_line_length": 33.857142857142854, "alnum_prop": 0.6033755274261603, "repo_name": "plotly/plotly.py", "id": "9dbb57cb487586cb2c9e7cf658689301b30544e3", "size": "474...
import read_stsp from graph import Graph from node import Node from edge import Edge from algoMST import kruskal, prim from TSPSolve import solveTSP import sys # Récupération de la liste de tous les fichiers stsp TSPpath = "./instances/stsp/" from os import listdir from os.path import isfile, join files = [f for f...
{ "content_hash": "dc02ef1f61ce8d193f20b40dea2b013f", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 227, "avg_line_length": 33.39506172839506, "alnum_prop": 0.5386321626617375, "repo_name": "Amathlog/MTH6412B", "id": "6df3de89551607952aae8c1517a732c3a1fdcd0f", "size": "27...