text stringlengths 4 1.02M | meta dict |
|---|---|
"""The Virtual File System (VFS) error classes."""
class Error(Exception):
"""Parent class for dfVFS specific errors."""
class AccessError(Error):
"""Error indicating that a resource could not be accessed."""
class BackEndError(Error):
"""Error indicating that a dependency has encountered a problem."""
cl... | {
"content_hash": "61d9b4cc7b237670b13eb75185d62c7f",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 70,
"avg_line_length": 22.866666666666667,
"alnum_prop": 0.7278911564625851,
"repo_name": "joachimmetz/dfvfs",
"id": "6f33847841954fcd14556cbd1f04106d32ea1af5",
"size": "10... |
from atom.api import Bool, Enum, Unicode, Coerced, Typed, ForwardTyped, observe
from enaml.colors import ColorMember
from enaml.core.declarative import d_
from enaml.fonts import FontMember
from enaml.layout.geometry import Size
from .toolkit_object import ToolkitObject, ProxyToolkitObject
class ProxyWidget(ProxyTo... | {
"content_hash": "703d0d9437f1ff7032b0a77e9aed3053",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 79,
"avg_line_length": 31.189873417721518,
"alnum_prop": 0.6124188311688312,
"repo_name": "ContinuumIO/ashiba",
"id": "18fa8f5f67484625d483f9f412d5c800b3677030",
"size": "... |
"""
Manage the master configuration file
"""
import logging
import os
import salt.config
import salt.utils.files
import salt.utils.verify
import salt.utils.yaml
log = logging.getLogger(__name__)
def values():
"""
Return the raw values of the config file
"""
data = salt.config.master_config(__opts__... | {
"content_hash": "ed5ccb2764cfe00532eb4be49c9b12a9",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 76,
"avg_line_length": 24.824175824175825,
"alnum_prop": 0.5745905267817618,
"repo_name": "saltstack/salt",
"id": "a5dfee0b602478d11bdb6d45e96ffbef0e919c4e",
"size": "2259"... |
"""Huawei LTE constants."""
DOMAIN = "huawei_lte"
DEFAULT_DEVICE_NAME = "LTE"
UPDATE_SIGNAL = f"{DOMAIN}_update"
UPDATE_OPTIONS_SIGNAL = f"{DOMAIN}_options_update"
UNIT_BYTES = "B"
UNIT_SECONDS = "s"
CONNECTION_TIMEOUT = 10
KEY_DEVICE_BASIC_INFORMATION = "device_basic_information"
KEY_DEVICE_INFORMATION = "device... | {
"content_hash": "2bf05e6bf3ba7dcd8d81b3805f81e17d",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 79,
"avg_line_length": 25.82857142857143,
"alnum_prop": 0.7433628318584071,
"repo_name": "joopert/home-assistant",
"id": "b6e079576ac13211d81cc2fad9d5d65685ead9d1",
"size":... |
import pytest
from unittest import mock
from mitmproxy.test import tflow
from mitmproxy import io
from mitmproxy import exceptions
from mitmproxy.addons import clientplayback
from mitmproxy.test import taddons
def tdump(path, flows):
with open(path, "wb") as f:
w = io.FlowWriter(f)
for i in flow... | {
"content_hash": "9dbd3864c1711e367c97430cbf3a1b3c",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 89,
"avg_line_length": 32.24691358024691,
"alnum_prop": 0.5704441041347627,
"repo_name": "MatthewShao/mitmproxy",
"id": "3f990668b7b8fced0643045267831c0977f9c3a5",
"size": ... |
"""Scraper for Dept of Justice Office of Legal Counsel
CourtID: bia
Court Short Name: Dept of Justice OLC
Author: William Palin
Reviewer:
Type:
History:
2022-01-14: Created by William E. Palin
"""
from juriscraper.lib.html_utils import (
get_row_column_links,
get_row_column_text,
)
from juriscraper.Opinion... | {
"content_hash": "96b700213ea7d8d39cdeefff5b35603e",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 80,
"avg_line_length": 30.977272727272727,
"alnum_prop": 0.5363169479090242,
"repo_name": "freelawproject/juriscraper",
"id": "48a86524b9b2ba991ef9806d89d08edefb3281c7",
"s... |
import praw
import sqlite3
import time
import string
USERNAME = ""
#This is the bot's Username. In order to send mail, he must have some amount of Karma.
PASSWORD = ""
#This is the bot's Password.
USERAGENT = ""
#This is a short description of what the bot does. For example "/u/GoldenSights' Newsletter bot"
SUBRED... | {
"content_hash": "e5594815039785196ed82f5294f3a167",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 149,
"avg_line_length": 27.65,
"alnum_prop": 0.6868595539481616,
"repo_name": "tehp/reddit",
"id": "7ccf8f9a6e313ce53bfbedeccadc1b96609ee5b7",
"size": "3335",
"binary": ... |
import pytest # noqa: 401
import mock # noqa: 401
from backup.thinning import ThinningStrategy, LatestStrategy, ThinOutStrategy
from backup.utils import timestamp2date
from datetime import datetime, timedelta
from collections import namedtuple
from random import randint
def everyday(lastday):
date = lastday
... | {
"content_hash": "c1cd4bd3d5214976d4bf8f2515a3c386",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 95,
"avg_line_length": 30.906593406593405,
"alnum_prop": 0.688,
"repo_name": "edmw/site-backup",
"id": "4c5cc69f371524c0dbda06325a72bdbcd1612d8a",
"size": "5642",
"binar... |
import numpy as np
import os
from chainercv.chainer_experimental.datasets.sliceable import GetterDataset
from chainercv.datasets.voc import voc_utils
from chainercv.utils import read_image
from chainercv.utils import read_label
class VOCSemanticSegmentationDataset(GetterDataset):
"""Semantic segmentation datase... | {
"content_hash": "8dc50e134e07be21b6e97bd351dbc943",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 76,
"avg_line_length": 33.07462686567164,
"alnum_prop": 0.5843862815884476,
"repo_name": "chainer/chainercv",
"id": "75a036db5b6ebd845edcc09ac9ad9b95d10c01c3",
"size": "221... |
import datetime
import logging
import webapp2
from google.appengine.ext import ndb
from google.appengine.ext.webapp import template
# A simple log server for rebaseline-o-matic.
#
# Accepts updates to the same log entry and shows a simple status page.
# Has a special state for the case where there are no NeedsRebasel... | {
"content_hash": "6332e0b465bfc37188e5365b418ffc92",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 98,
"avg_line_length": 37.10434782608696,
"alnum_prop": 0.62034216076869,
"repo_name": "lordmos/blink",
"id": "9211df34f97bd6efdcd43d0f1e1d7bfc6571c419",
"size": "5797",
... |
import RPi.GPIO as GPIO
import time
import atexit
import sys
import re
import pygame.mixer
fd = None
PIN_ENABLE = 11 # GPIO pin to enable the motor driver
PIN_CLK = 15 # Must be same as "Using P1 pins" line above
def cleanup():
print "Cleaning up"
pygame.mixer.music.stop()
GPIO.output(PIN_ENABLE, False... | {
"content_hash": "ff9139cbc88b02ccf64961356551a6f2",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 98,
"avg_line_length": 23.58730158730159,
"alnum_prop": 0.6460296096904441,
"repo_name": "HackaRobot/rpi",
"id": "01953ff4462b70eb932373d5bca1dc75a42cce3e",
"size": "3128",... |
from segwit import send_to_witness
from test_framework.test_framework import BitcoinTestFramework
from test_framework import blocktools
from test_framework.mininode import CTransaction
from test_framework.util import *
from test_framework.util import *
import io
import time
# Sequence number that is BIP 125 opt-in an... | {
"content_hash": "9f1c895fbdc5f475511afcbf059ae6e3",
"timestamp": "",
"source": "github",
"line_count": 322,
"max_line_length": 120,
"avg_line_length": 45.046583850931675,
"alnum_prop": 0.6785246466735608,
"repo_name": "wiggi/huntercore",
"id": "4d3688a974e729958637c847ea1b62d6be41b796",
"size": "1... |
'''
thevideo urlresolver plugin
Copyright (C) 2014 Eldorado
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is di... | {
"content_hash": "c075dd7e37cc43be674620087fffb7e9",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 82,
"avg_line_length": 34.208333333333336,
"alnum_prop": 0.6571254567600487,
"repo_name": "mrknow/filmkodi",
"id": "23517bf262b0eb29f11cbdbf8dde3c6f4783a2a6",
"size": "1642... |
from __future__ import division, unicode_literals, print_function
import glob
import itertools
import logging
import math
import os
import re
import warnings
import xml.etree.cElementTree as ET
from collections import defaultdict
from io import StringIO
import numpy as np
from monty.io import zopen, reverse_readfile
... | {
"content_hash": "718be9784deff0c50c5ed308f7564896",
"timestamp": "",
"source": "github",
"line_count": 3618,
"max_line_length": 138,
"avg_line_length": 41.202045328911,
"alnum_prop": 0.5089119803580892,
"repo_name": "matk86/pymatgen",
"id": "d6ecd719a73b9fe40178f53469251f2f35e54c52",
"size": "1491... |
PYTHON_VERSION_COMPATIBILITY = "PY3"
DEPS = [
"crosvm",
]
def RunSteps(api):
with api.crosvm.cros_container_build_context():
api.crosvm.step_in_container("true", ["true"], cros=True)
def GenTests(api):
yield api.test("basic")
| {
"content_hash": "d2e9665ad9d655c7f52ba1c408d6a8a5",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 65,
"avg_line_length": 17.928571428571427,
"alnum_prop": 0.6454183266932271,
"repo_name": "google/crosvm",
"id": "e6fc32fb1139af00ff6bb832dc2f1a533d907265",
"size": "394",
... |
import json
import unittest
from service.LocalizationService import LocalizationService
from service.LocalizationService import LocalizationService
from service.LocalizationService import getErrorMessage
from service.LocalizationService import getTelegramMessage
from service.LocalizationService import COUNTRY
from serv... | {
"content_hash": "4c3dcc1e17d7e0cb308fd6504d32c721",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 116,
"avg_line_length": 37.578947368421055,
"alnum_prop": 0.665266106442577,
"repo_name": "vermer/RASPBERRY-PI-scripts",
"id": "854a7a62a718158ef06976c595911b7eaaace6ee",
"... |
from __future__ import print_function
from photoboothapp import PhotoBoothApp
from imutils.video import VideoStream
import argparse
import time
ap = argparse.ArgumentParser()
ap.add_argument("-o", "--output", required=True, help="path to output directory to store snapshots")
ap.add_argument("-p", "--picamera... | {
"content_hash": "622e17c56a180749db8615396c35fbce",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 109,
"avg_line_length": 33.55555555555556,
"alnum_prop": 0.7218543046357616,
"repo_name": "AntonioQu/pythontest",
"id": "ad49bac2b9749aae419f8f77143d7458759ce786",
"size": ... |
import threading
import Queue
import json
from gluon.common.particleGenerator.generator import getDataBaseGeneratorInstance as getDBGen
from gluon.db import api as dbapi
from oslo_log import log as logging
import etcd
LOG = logging.getLogger(__name__)
service = "net-l3vpn"
source = "proton"
port = 2379
class MyData:... | {
"content_hash": "92f6da6c9818689f21c593121f97aa02",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 95,
"avg_line_length": 33.64,
"alnum_prop": 0.5719381688466112,
"repo_name": "iawells/gluon",
"id": "ad0e0eaf392f15d6249dd01a74d582bd4ad15e75",
"size": "2523",
"binary": ... |
from .BuildCookRun import BuildCookRun, BuildCookRunLogLineObserver
| {
"content_hash": "00bd421f79570acb8c25a2299a3afdb6",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 67,
"avg_line_length": 68,
"alnum_prop": 0.8970588235294118,
"repo_name": "pampersrocker/buildbot-UnrealEngine",
"id": "f691272726aac5ea566a46390cfa9b2f7ffeadd7",
"size": "6... |
import unittest
from unittest.mock import patch
import backup_database
from lib import config
class StandardBackupTestCase(unittest.TestCase):
""" Dummy test for learning """
def testStandardBackup(self):
with patch("shutil.copyfile") as copyfile:
backup_database.copyfile = copyfile
backup_database.backup()... | {
"content_hash": "8d5f1d22da4ffa1865259083c9389a2c",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 48,
"avg_line_length": 23.941176470588236,
"alnum_prop": 0.7395577395577395,
"repo_name": "Varabe/Guild-Manager",
"id": "d12a353731d910c5107a115c54c4e77972e659e2",
"size": ... |
from django.contrib import admin
from exileui.admin import exileui, ExStacked, ExTabular, DateRangeEX
import models
import nested_admin
import forms
class OperarioAdmin(nested_admin.NestedModelAdmin):
list_display = ('identificacion', 'email', 'first_name', 'last_name',
'direccion', 'telefono'... | {
"content_hash": "0574d661163033c4d4c18b61b478538d",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 86,
"avg_line_length": 32.459016393442624,
"alnum_prop": 0.6525252525252525,
"repo_name": "exildev/AutoLavadox",
"id": "8549d4d80dcba6189fee632f03dea955253c5242",
"size": "... |
"""The hypervisors admin extension."""
from oslo_log import log as logging
from oslo_serialization import jsonutils
import webob.exc
from nova.api.openstack import api_version_request
from nova.api.openstack import common
from nova.api.openstack.compute.views import hypervisors as hyper_view
from nova.api.openstack i... | {
"content_hash": "a413f83d551637735190c644c31b80a5",
"timestamp": "",
"source": "github",
"line_count": 270,
"max_line_length": 79,
"avg_line_length": 41.111111111111114,
"alnum_prop": 0.5736936936936937,
"repo_name": "hanlind/nova",
"id": "ce28fe2d8f667cdc71332d2d9555c99fe69b2ad3",
"size": "11740"... |
import touchdown.aws # noqa
import touchdown.config # noqa
import touchdown.goals # noqa
import touchdown.gpg # noqa
import touchdown.local # noqa
import touchdown.notifications # noqa
import touchdown.provisioner # noqa
import touchdown.ssh # noqa
import touchdown.template # noqa
from touchdown.core import Wo... | {
"content_hash": "28e3ae4cde18e0563735a5ec5ba17eec",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 38,
"avg_line_length": 29.416666666666668,
"alnum_prop": 0.7705382436260623,
"repo_name": "yaybu/touchdown",
"id": "743a348b49ffb0ee6911baef80148b7d90697273",
"size": "931"... |
import logging
from django.core.management.base import BaseCommand
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import Permission
logger = logging.getLogger(__name__)
class Command(BaseCommand):
"""
This management command creates non-standard Django permissions... | {
"content_hash": "1ded3b5bb18cd6318594d85f7fd915a0",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 109,
"avg_line_length": 40.4375,
"alnum_prop": 0.6638330757341576,
"repo_name": "rackerlabs/django-DefectDojo",
"id": "61630eef2f10fb8782eca6cdeae51d8eca47df49",
"size": "1... |
"""Generic Z-Wave Entity Classes."""
import copy
import logging
from openzwavemqtt.const import (
EVENT_INSTANCE_STATUS_CHANGED,
EVENT_VALUE_CHANGED,
OZW_READY_STATES,
CommandClass,
ValueIndex,
)
from openzwavemqtt.models.node import OZWNode
from openzwavemqtt.models.value import OZWValue
from ho... | {
"content_hash": "dfe1b09d3d8bfe059fbe134723a61caa",
"timestamp": "",
"source": "github",
"line_count": 303,
"max_line_length": 91,
"avg_line_length": 34.96369636963696,
"alnum_prop": 0.6181801019444969,
"repo_name": "kennedyshead/home-assistant",
"id": "305601a2333e0b6e4adad4bc92ae8f3648e785ba",
"... |
"""Hook for HashiCorp Vault"""
import json
from typing import Optional, Tuple
import hvac
from hvac.exceptions import VaultError
from requests import Response
from airflow.hooks.base import BaseHook
from airflow.providers.hashicorp._internal_client.vault_client import ( # noqa
DEFAULT_KUBERNETES_JWT_PATH,
DE... | {
"content_hash": "32e922d484153f5dd90a6bfff054fd5b",
"timestamp": "",
"source": "github",
"line_count": 340,
"max_line_length": 110,
"avg_line_length": 43.529411764705884,
"alnum_prop": 0.6396621621621622,
"repo_name": "DinoCow/airflow",
"id": "f14c022e2e571a0800af3b7dd24da40bc258b5d8",
"size": "15... |
"""Energy for a two-phase, liquid+water vapor evaluator."""
import sys, os
sys.path.append(os.path.join(os.environ['ATS_SRC_DIR'], "tools", "evaluator_generator"))
from evaluator_generator import generate_evaluator
deps = [("porosity", "phi"),
("base_porosity", "phi0"),
("saturation_liquid", "sl"),
... | {
"content_hash": "fbe9ddb22d7c6e21565e9ec6b4592005",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 112,
"avg_line_length": 37.074074074074076,
"alnum_prop": 0.5634365634365635,
"repo_name": "amanzi/ats-dev",
"id": "a89d4baf300392ef68d14083595f05fc491ad1df",
"size": "1001... |
import errno
import sys
import urlparse
import archiveinstaller.downloader
import archiveinstaller.extractor
import os
from abc import abstractmethod, ABCMeta
from os.path import expanduser
from os.path import join
from archiveinstaller.downloader import ArchivingDownloader
def create_installer(app_directory, downlo... | {
"content_hash": "6c35ab2c1e1f51209384cb33512aa6cb",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 113,
"avg_line_length": 35.691943127962084,
"alnum_prop": 0.6924711193732572,
"repo_name": "signed/archiveinstaller",
"id": "19ee494dad5bc9762c4490cb065562be0e10a61e",
"si... |
import unittest
import pytest
import azure.mgmt.network
import azure.mgmt.network
from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
AZURE_LOCATION = 'eastus'
@pytest.mark.live_test_only
class TestMgmtNetwork(AzureMgmtRecordedTestCase):
def setup_method... | {
"content_hash": "99801903625d3583719909e09cd6e8e0",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 171,
"avg_line_length": 38.96666666666667,
"alnum_prop": 0.6120615911035072,
"repo_name": "Azure/azure-sdk-for-python",
"id": "90811e3f9ced0107cf5c24bec19ca351a3c07c14",
"... |
from .select_fittest import SelectFittest # noqa: F401
| {
"content_hash": "805da9f7d35b1df0326f27635e21bacb",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 56,
"avg_line_length": 57,
"alnum_prop": 0.7719298245614035,
"repo_name": "google-research/evoflow",
"id": "78e2fdb8d785a5cf7cb4191197836f58e8713c07",
"size": "633",
"bina... |
from flask import Blueprint
home = Blueprint('home', __name__)
from . import routes
| {
"content_hash": "0e0f13a71f34bd0cc14368d5b1a645f7",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 34,
"avg_line_length": 14.5,
"alnum_prop": 0.7011494252873564,
"repo_name": "benjaminhuanghuang/math_clone",
"id": "dabd300e02cb933206619790611bd7b89f7c1b62",
"size": "87",
... |
"""OAI-PMH 2.0 response generator."""
from datetime import MINYEAR, datetime, timedelta
import arrow
from flask import current_app, url_for
from lxml import etree
from lxml.etree import Element, ElementTree, SubElement
from invenio_oaiserver.percolator import sets_search_all
from .models import OAISet
from .provide... | {
"content_hash": "d173c2e32cc81ac1776a05ff6dd737df",
"timestamp": "",
"source": "github",
"line_count": 320,
"max_line_length": 88,
"avg_line_length": 35.73125,
"alnum_prop": 0.6431694944901172,
"repo_name": "inveniosoftware/invenio-oaiserver",
"id": "f78eef68a56c45d6d13e77a184c6baff2f6a8b49",
"siz... |
from oslo_config import cfg
import sqlalchemy
from sqlalchemy.sql.expression import false
from keystone import assignment as keystone_assignment
from keystone.common import sql
from keystone import exception
from keystone.i18n import _
CONF = cfg.CONF
class AssignmentType(object):
USER_PROJECT = 'UserProject'
... | {
"content_hash": "d19c1a61c3ae9b9433e441fb1c963b6a",
"timestamp": "",
"source": "github",
"line_count": 438,
"max_line_length": 79,
"avg_line_length": 40.82876712328767,
"alnum_prop": 0.5750153777330426,
"repo_name": "himanshu-setia/keystone",
"id": "88c10a6a9a990a4177f4cadebc0abb4dd124bc77",
"size... |
"""Manage indexing for snapshotter service"""
from sqlalchemy.sql.expression import tuple_
from ggrc import db
from ggrc import models
from ggrc.fulltext.mysql import MysqlRecordProperty as Record
from ggrc.models.reflection import AttributeInfo
from ggrc.snapshotter.rules import Types
from ggrc.snapshotter.datastru... | {
"content_hash": "27d0a1528ef62d0b799dccdada9a1956",
"timestamp": "",
"source": "github",
"line_count": 257,
"max_line_length": 78,
"avg_line_length": 29.396887159533073,
"alnum_prop": 0.671872931833223,
"repo_name": "josthkko/ggrc-core",
"id": "e1ac91a2d14301e3270010b4188f2604ef7c9c93",
"size": "7... |
class BrowserDetect:
def i_am(self):
return 'Pyjd-hulahop'
| {
"content_hash": "3b205ce07b8a38de7fe742e3cc924a20",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 29,
"avg_line_length": 23.666666666666668,
"alnum_prop": 0.6338028169014085,
"repo_name": "pombredanne/pyjs",
"id": "f9f4c6feba9f4b7bdec754a5050ba0e7c5824fff",
"size": "71",... |
from distutils.version import LooseVersion
from itertools import product
import operator
import numpy as np
from numpy import nan
import pytest
from pandas.compat import PY2, PY35, is_platform_windows, lrange, range
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
Categorical, C... | {
"content_hash": "62f89fa966e4743b9295cabf0709a066",
"timestamp": "",
"source": "github",
"line_count": 1507,
"max_line_length": 79,
"avg_line_length": 38.650298606502986,
"alnum_prop": 0.5384060708031453,
"repo_name": "MJuddBooth/pandas",
"id": "1f265d574da15ba18050b10a1d86dfc6e184a9f4",
"size": "... |
import os
import re
import dateutil.parser
import textwrap
from datetime import datetime
from flask.ext.misaka import markdown
from glob2 import glob
from logging import error
from logging import info
from titlecase import titlecase
class Documents():
meta = {}
source = ''
target = ''
def __init__(s... | {
"content_hash": "f2d34c78278ab73c9b639f7f0ca4f806",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 88,
"avg_line_length": 33.73873873873874,
"alnum_prop": 0.5476635514018692,
"repo_name": "dallbee/Bytelog",
"id": "2d387058b8dfb9f63b6bca165d3843c47d63cdd4",
"size": "3745... |
from util import *
from settings import bgp_validator_server, validator_path, \
maintenance_timeout, maintenance_log, thread_max_errors
import json
import Queue
import socket
import sys
import traceback
from datetime import datetime, timedelta
from subprocess import PIPE, Popen
from threading imp... | {
"content_hash": "d2731bc01b36d433efd4a1cec1616731",
"timestamp": "",
"source": "github",
"line_count": 367,
"max_line_length": 99,
"avg_line_length": 38.89645776566758,
"alnum_prop": 0.5634325744308231,
"repo_name": "rtrlib/rbv",
"id": "dab2d67340c2fc49e14406addccc7bc562c5a78e",
"size": "14275",
... |
import asyncio
import logging
from . import configuration
event_handlers = dict()
function_handlers = dict()
def handler(fn):
"""
Register a function to receive and handle events.
"""
module = fn.__module__.split(".")[-1]
key = module + "." + fn.__name__
logging.info("Registering Event Handle... | {
"content_hash": "fa07758f0524f75e56b665bf5fe3439f",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 85,
"avg_line_length": 25.933333333333334,
"alnum_prop": 0.6015424164524421,
"repo_name": "simonwittber/netwrok-server",
"id": "b01ae4bc621fd4abf6f0284b21d7967c6f128cc0",
"... |
"""
This is the test module to test TestRunner function of blade.
"""
import os
import blade_test
class TestTestRunner(blade_test.TargetTest):
"""Test cc_library """
def setUp(self):
"""setup method. """
self.doSetUp('test_test_runner', ':string_test_main',
fulltest=Fa... | {
"content_hash": "8bd295b610509cab03132e7b04a52759",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 77,
"avg_line_length": 34.343283582089555,
"alnum_prop": 0.6058235549760973,
"repo_name": "project-zerus/blade",
"id": "71450a6abd217f3efc61d4a3c4311cf3a6d01895",
"size": "... |
from sneakers.modules import Encoder
class Identity(Encoder):
info = {
"name": "Identity",
"author": "davinerd",
"description": "An encoder that does no encoding. Ironic, but also useful for testing channels. Or not encoding/decoding.",
"comments": []
}
def encode(self, da... | {
"content_hash": "739e9384fef3d28ff1477eff8bb631d3",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 131,
"avg_line_length": 24.625,
"alnum_prop": 0.6091370558375635,
"repo_name": "davinerd/sneaky-creeper",
"id": "6e76a09cd54b195caf2a8511873c779587050f94",
"size": "394",
... |
"""Tests for waymo_open_dataset.metrics.python.wod_detection_evaluator."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from google.protobuf import text_format
from waymo_open_dataset.metrics.python import wod_... | {
"content_hash": "354328a0def8b198136563f1e1f16af3",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 80,
"avg_line_length": 39.22485207100592,
"alnum_prop": 0.6765726353899533,
"repo_name": "waymo-research/waymo-open-dataset",
"id": "ad11a03ad334729068c6a1aa0feb04e21a4ba68c... |
from unittest import mock
from osc_lib import exceptions as exc
import yaml
from heatclient import exc as heat_exc
from heatclient.osc.v1 import software_config
from heatclient.tests.unit.osc.v1 import fakes as orchestration_fakes
from heatclient.v1 import software_configs
class TestConfig(orchestration_fakes.TestO... | {
"content_hash": "f274296160aa86680b1c947be02f13ac",
"timestamp": "",
"source": "github",
"line_count": 258,
"max_line_length": 76,
"avg_line_length": 35.31395348837209,
"alnum_prop": 0.5573482603446384,
"repo_name": "openstack/python-heatclient",
"id": "f2afcb1c3003e5a719b1823248fa709e4aa29a33",
"... |
"""EagleEye Platform settings module."""
import json
import os
__all__ = ['get_api_root_endpoint']
def get_api_root_endpoint():
"""Return a string of API root endpoint."""
return _settings.get('api_root_endpoint', None)
def _read_config_file():
"""Internal helper to read settings JSON file and return... | {
"content_hash": "baf98c939b7388914362dd94ac33deab",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 73,
"avg_line_length": 24.73913043478261,
"alnum_prop": 0.6344463971880492,
"repo_name": "CVBDL/ccollab2eeplatform-python",
"id": "0ae582f99cb6281053711ea6969d1e7d9dad63bb",
... |
import sys
import time
from django.apps import apps
from django.conf import settings
from django.core import serializers
from django.db import router
from django.utils.six import StringIO
from django.utils.six.moves import input
# The prefix to put on the default database name when creating
# the test database.
TEST_... | {
"content_hash": "d5b7e65c2b00107f5bf6ee8dc8c7ed17",
"timestamp": "",
"source": "github",
"line_count": 303,
"max_line_length": 112,
"avg_line_length": 40.08910891089109,
"alnum_prop": 0.5843418127932823,
"repo_name": "wfxiang08/django197",
"id": "bddc8ec1b003f9cb4ea6a5c7feb4292eb482ed97",
"size": ... |
"""
docker command
"""
import os
import re
import sys
import subprocess
from distutils.version import StrictVersion
from argparse import ArgumentParser, Action
from cirrus.logger import get_logger
from cirrus._2to3 import to_str
from cirrus.configuration import load_configuration
import dockerstache.dockerstache as ... | {
"content_hash": "8e8f602ed6a2b70a0b67f74e00dd976f",
"timestamp": "",
"source": "github",
"line_count": 533,
"max_line_length": 100,
"avg_line_length": 31.00375234521576,
"alnum_prop": 0.61821482602118,
"repo_name": "evansde77/cirrus",
"id": "aa6e06e903acea140fe3c8076a811dcf158c689c",
"size": "1654... |
"""
A good place for a public or proxy objects
"""
__author__ = 'dimd'
| {
"content_hash": "dbca2cce201845ee1a544d5a349c727a",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 42,
"avg_line_length": 17.75,
"alnum_prop": 0.6197183098591549,
"repo_name": "dimddev/NetCatKS",
"id": "4ace24bee15fefe147ecaaace07dfc8a23b6d0a6",
"size": "71",
"binary": ... |
import re
import cStringIO
from crispy_forms.bootstrap import FormActions
from crispy_forms.layout import Reset, Submit, Layout, Div, HTML
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db.models import Q
from django.forms import ModelMultipleChoiceField
from django.template.loader import ren... | {
"content_hash": "169fa312ce93c57238b52ab0db79ec64",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 95,
"avg_line_length": 32.19417475728155,
"alnum_prop": 0.6329915560916767,
"repo_name": "xuchao666/msz",
"id": "37d56ab5ffc7415e1d27e91b840aebb77e3d0de1",
"size": "3352",... |
"""Module for constructing <img> tag."""
from __future__ import absolute_import
from ...lib.utils import validate_attribute_values, validate_url
from ...templates.html.tags import img
ATTRIBUTES = {
'align': {
'description': 'Specifies the alignment of an image according '
'to sur... | {
"content_hash": "da31c896a05bc6c194bd76cd669eb159",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 79,
"avg_line_length": 34.72222222222222,
"alnum_prop": 0.5177142857142857,
"repo_name": "bharadwajyarlagadda/korona",
"id": "bcf321dc50babb61d4496899a1c4cdbc59a8f3f7",
"s... |
tutorial_title = u'Essential site scanning analysis'
tutorial_author = u'Burak Kaynak, Pemra Doruker'
tutorial_logo = u'' # default is ProDy logo
tutorial_version = u'' # default is latest ProDy version
# keep the following part as is
try:
execfile('../conf.py')
except NameError:
exec(open('..... | {
"content_hash": "deaae8cb7ebe134cc04ebc5d576bdd20",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 63,
"avg_line_length": 33.8,
"alnum_prop": 0.6775147928994083,
"repo_name": "prody/ProDy-website",
"id": "569e3efad6e225c77cd1785f023104f585e33589",
"size": "338",
"binar... |
"""
Law example tasks to demonstrate HTCondor workflows at NAF.
The actual payload of the tasks is rather trivial.
"""
import six
import law
# import our "framework" tasks
from analysis.framework import Task, HTCondorWorkflow
class CreateChars(Task, HTCondorWorkflow, law.LocalWorkflow):
"""
Simple task t... | {
"content_hash": "3a2c68c275cbfbeef45ea836c17ab1d1",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 99,
"avg_line_length": 40.89010989010989,
"alnum_prop": 0.6745498521902714,
"repo_name": "riga/law",
"id": "c695d6afa66525e561df90cd21b49e08d94467e8",
"size": "3738",
"bi... |
from datetime import datetime
import pytz
from django.contrib.auth.models import User
from django.urls import reverse
from django.test.utils import override_settings
from django.utils import timezone
from unittest.mock import call, patch
from casepro.test import BaseCasesTest
from .models import ROLE_ADMIN, ROLE_ANA... | {
"content_hash": "84e7ca599d2066141037b1130ac25759",
"timestamp": "",
"source": "github",
"line_count": 1175,
"max_line_length": 119,
"avg_line_length": 41.41787234042553,
"alnum_prop": 0.5869189988903958,
"repo_name": "praekelt/casepro",
"id": "c952d0ab9251268e43d2049ae724a1fbe10ffdb7",
"size": "4... |
from __future__ import unicode_literals
from operator import attrgetter
from django import VERSION
from django.contrib.contenttypes.generic import GenericRelation
from django.contrib.contenttypes.models import ContentType
from django.db import models, router
from django.db.models.fields import Field
from django.db.mod... | {
"content_hash": "ffb7b106dcea773a15469e3b18d9b785",
"timestamp": "",
"source": "github",
"line_count": 447,
"max_line_length": 123,
"avg_line_length": 37.00447427293065,
"alnum_prop": 0.5990568889426274,
"repo_name": "guoqiao/django-taggit",
"id": "f7a27196c19321e1e1699fb6868b0209538df2b7",
"size"... |
import json
from unittest2 import skipIf
from django.test.utils import override_settings
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from myuw.test.api import missing_url, get_user, get_user_pass
FDAO_SWS = 'restclients.dao_implementation.sws.Fil... | {
"content_hash": "90caef4745f1d58ec10a4058f482b665",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 75,
"avg_line_length": 44.721311475409834,
"alnum_prop": 0.6088709677419355,
"repo_name": "fanglinfang/myuw",
"id": "60007b5b5a9ea1ae025b3a0678fcb07776b225f3",
"size": "272... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from rlpy.Domains import HIVTreatment
from rlpy.Agents import SARSA, Q_LEARNING
from rlpy.Representa... | {
"content_hash": "ccd400678c96172643a51f99222d3a72",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 98,
"avg_line_length": 37.370370370370374,
"alnum_prop": 0.6283448959365708,
"repo_name": "rlpy/rlpy",
"id": "9d87a89f4f72bde65d2bfcbc1dbaf22e78238831",
"size": "2018",
"... |
import six
import mock
from neutronclient.common import exceptions as qe
from heat.common import exception
from heat.engine.clients.os import neutron
from heat.engine.clients.os.neutron import lbaas_constraints as lc
from heat.engine.clients.os.neutron import neutron_constraints as nc
from heat.tests import common
fr... | {
"content_hash": "e338cb6217d9ef6deb2417cbd6d4041b",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 78,
"avg_line_length": 41.57664233576642,
"alnum_prop": 0.5482794943820225,
"repo_name": "gonzolino/heat",
"id": "aafb64590d094e389b329e8ea0afe4828a965f9c",
"size": "11967... |
from slamon.afm.tables import Agent, AgentCapability, Task
from slamon.afm.database import Base, engine, init_connection
import logging
import argparse
import sys
logger = logging.getLogger('admin')
def create_tables():
logger.info('Creating tables')
Base.metadata.create_all(engine)
def drop_tables():
... | {
"content_hash": "98493ed1dc0ce90e6034ac315b8663c0",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 100,
"avg_line_length": 28.058823529411764,
"alnum_prop": 0.6928721174004193,
"repo_name": "StealthyLoner/SLAMon",
"id": "a0f3026e8215332a72e9fe1dc7572be8b84b499c",
"size":... |
"""The Module implements utilities to build a composite decision-maker."""
# =============================================================================
# IMPORTS
# =============================================================================
from collections import Counter
from .core import SKCMethodABC
from .uti... | {
"content_hash": "03b81917ca4e38699859b12169ba1f28",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 79,
"avg_line_length": 31.82741116751269,
"alnum_prop": 0.5688995215311005,
"repo_name": "leliel12/scikit-criteria",
"id": "9eb7a813d2b7dbfd69035aaa7e0ce4f08041bd7e",
"siz... |
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Skill',
fields=[
('id... | {
"content_hash": "e05b86dfa64cfe969d0b6cc53340df4b",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 158,
"avg_line_length": 32.48,
"alnum_prop": 0.6133004926108374,
"repo_name": "danux/danjd",
"id": "3fd1429091b6c067025376f8e2bcc44d5acbb47d",
"size": "882",
"binary": fa... |
from __future__ import unicode_literals
from django import forms
def make_form(edit_class, fields):
return type(b'EditFormFor{}'.format(edit_class.__name__),
(forms.ModelForm,),
dict(
form_fields=forms.CharField(initial=','.join(fields),
widget=forms.HiddenInput()),
... | {
"content_hash": "9cdfd9941e7cbdec4ff1a56dc3217fbe",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 65,
"avg_line_length": 31.571428571428573,
"alnum_prop": 0.5633484162895928,
"repo_name": "eduardolujan/trainning_site",
"id": "a4e7450ad489aa8cc1c262c57dc1577c5193a588",
"... |
import sys
import warnings
class PyStdIsDeprecatedWarning(DeprecationWarning):
pass
class Std(object):
""" makes top-level python modules available as an attribute,
importing them on first access.
"""
def __init__(self):
self.__dict__ = sys.modules
def __getattr__(self, name):
... | {
"content_hash": "ebe5c559a35cbab9a0adb2e3ed8cc20f",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 78,
"avg_line_length": 24.26923076923077,
"alnum_prop": 0.6038034865293186,
"repo_name": "lmregus/Portfolio",
"id": "74d43672654e7bca9aa2617d8f6f14ae0ad8d8a9",
"size": "631... |
from resources import *
from cc_delegate import ComboBoxDelegate, DateDelegate, PhoneDelegate, PersonIdDelegate
class ApplyDlg(QDialog):
def __init__(self,parent=None, db="", curuser={}):
super(ApplyDlg,self).__init__(parent)
if db == "":
self.db = globaldb()
else:
... | {
"content_hash": "08ee6d633713a1373af903d1774f73be",
"timestamp": "",
"source": "github",
"line_count": 242,
"max_line_length": 109,
"avg_line_length": 39.446280991735534,
"alnum_prop": 0.6232977163209721,
"repo_name": "iefan/kfmental",
"id": "62135500535fbcd382ab3c6b5a0acfc83286e19a",
"size": "973... |
from django.contrib import admin
from django.db.models import AutoField
from django.forms import ValidationError
from django.shortcuts import redirect
from django.utils.translation import ugettext_lazy as _
from mezzanine.conf import settings
from mezzanine.core.forms import DynamicInlineAdminForm
from mezzanine.core.... | {
"content_hash": "e2e6572f2253f99a5217fe7b0a8120c0",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 79,
"avg_line_length": 37.475675675675674,
"alnum_prop": 0.617914322803981,
"repo_name": "sachingupta006/Mezzanine",
"id": "56e08beb9c15e6e2331a1c5159f1f0363cf7543b",
"siz... |
from pybuilder.core import use_plugin, init, Author
from pybuilder.vcs import VCSRevision
use_plugin("python.core")
use_plugin("python.unittest")
use_plugin("python.install_dependencies")
use_plugin("python.flake8")
use_plugin("python.coverage")
use_plugin("python.distutils")
use_plugin("python.cram")
use_plugin("filt... | {
"content_hash": "f0d11150da9afed386e1c7b6ae550f3c",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 74,
"avg_line_length": 30.945945945945947,
"alnum_prop": 0.7222707423580786,
"repo_name": "ImmobilienScout24/cbas",
"id": "1eb6e03990443caaeb7a394a6297d5351621ace4",
"size"... |
"""
Created by Ben Scott on '20/11/2016'.
"""
import io
import math
import requests
from PIL import Image
class ImageOptimAPI():
endpoint = 'https://im2.io'
def __init__(self, username):
self.username = username
def parse_options(self, options):
if options:
opList = []
try:
size =... | {
"content_hash": "d5f2aaaed1b9de231fadf939461492d1",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 78,
"avg_line_length": 29.173076923076923,
"alnum_prop": 0.6114040870138431,
"repo_name": "benscott/imageoptim",
"id": "b3ef35cab7f4783e5e864a878841d1639f7b4eda",
"size": ... |
import numpy as np
from matplotlib import pyplot as plt
import cv2
def drawMatches(img1, kp1, img2, kp2, matches):
# Create a new output image that concatenates the two images together
# (a.k.a) a montage
rows1 = img1.shape[0]
cols1 = img1.shape[1]
rows2 = img2.shape[0]
cols2 = img2.shape[1]
... | {
"content_hash": "a1cd399d76de5a90836d75e811760771",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 81,
"avg_line_length": 28.243243243243242,
"alnum_prop": 0.6330143540669857,
"repo_name": "Lord-Nazdar/OpenCVFaceRecognition",
"id": "394d57ad558eb3fd677c19478917dc0df4bbad0c... |
import os
from paste.urlparser import StaticURLParser
from pylons import request, response, session, tmpl_context as c
from pylons.controllers.util import abort, redirect
from pylons.templating import render_mako as render
from pylons import url
from webhelpers.paginate import Page
from sqlalchemy.orm import class_mapp... | {
"content_hash": "3d38ad2f583d47704c44b9aa875769c1",
"timestamp": "",
"source": "github",
"line_count": 468,
"max_line_length": 119,
"avg_line_length": 36.85897435897436,
"alnum_prop": 0.5403478260869565,
"repo_name": "FormAlchemy/formalchemy",
"id": "317210dfc525c153a7f9922c8e9efe15064f78b5",
"siz... |
from .client import *
from .log_stream import install as install_log_stream, uninstall as uninstall_log_stream
# See http://www.python.org/dev/peps/pep-0386/ for version numbering, especially NormalizedVersion
from distutils import version
version = version.LooseVersion('0.2.2-dev') | {
"content_hash": "e5370ff83839f74c59d69d8c1b15cdc3",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 98,
"avg_line_length": 40.714285714285715,
"alnum_prop": 0.7929824561403509,
"repo_name": "nkvoll/pykeeper",
"id": "5d06e9beb85a1b0fadc1cdc9432cafab8f17344e",
"size": "285",... |
import inspect
import operator
from rest_framework import permissions
__all__ = ['ConditionalPermission', 'Condition', 'C', 'And', 'Or', 'Not']
_NONE = object()
def _is_permission_factory(obj):
return inspect.isclass(obj) or inspect.isfunction(obj)
class ConditionalPermission(permissions.BasePermission):
... | {
"content_hash": "e8949e9cde80f168124129d5def9d8d3",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 89,
"avg_line_length": 32.83846153846154,
"alnum_prop": 0.6205200281096276,
"repo_name": "justanr/rest_condition",
"id": "df3f11c69ee5a5c470f92ea07a1ee41d50b3ad5d",
"size"... |
from typing import Any, Dict
from django.http import HttpRequest, HttpResponse
from zerver.decorator import webhook_view
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success
from zerver.lib.webhooks.common import check_send_webhook_message
from zerver.models import Us... | {
"content_hash": "98322ba9a478776f92b5747b1dc6d2ef",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 81,
"avg_line_length": 34.035714285714285,
"alnum_prop": 0.6836306400839455,
"repo_name": "hackerkid/zulip",
"id": "93574247d12e52c7311749a98e62b6bcb49e0ac2",
"size": "1906... |
from setuptools import setup
import re
version = ''
with open('walls.py', 'r') as f:
version = re.search(r'__version__\s*=\s*\'([\d.]+)\'', f.read()).group(1)
with open('README.rst') as f:
readme = f.read()
with open('HISTORY.rst') as f:
history = f.read()
setup(
name='walls',
version=version,
... | {
"content_hash": "4599ab393f455a3598a26a20fcf11829",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 77,
"avg_line_length": 28.18867924528302,
"alnum_prop": 0.5568942436412316,
"repo_name": "nickfrostatx/walls",
"id": "9b95b274fbb22668b32666e6705f7358382ac3c7",
"size": "15... |
"""Tensor Expressions for the NPU"""
from .convolution import *
from .depthwise import *
from .pooling import *
from .binary_elementwise import *
from .identity import *
from .unary_elementwise import *
from .inline import *
| {
"content_hash": "ee02bd564eb0e409d3c8d561b52b87eb",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 36,
"avg_line_length": 25.11111111111111,
"alnum_prop": 0.7522123893805309,
"repo_name": "Laurawly/tvm-1",
"id": "2ede967a036caac417e749e8762a2d88e4675388",
"size": "1011",
... |
"""
In this module we implement "python -m bohrium --info"
"""
import argparse
from . import stack_info
from ._bh_api import sanity_check
parser = argparse.ArgumentParser(description='Check and retrieve info on the Bohrium API installation.')
parser.add_argument(
'--info',
action="store_true",
default=Fal... | {
"content_hash": "a546451e9c4baae6f42369e48b01d33b",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 104,
"avg_line_length": 22.903225806451612,
"alnum_prop": 0.6704225352112676,
"repo_name": "madsbk/bohrium",
"id": "1fd79693c9b6382872bf018aff308c7af2f2eebb",
"size": "756"... |
"""
[env]
# Conda Environment
conda create --name nft_insights python=3.9.7
conda info --envs
source activate nft_insights
conda deactivate
# if needed to remove
conda env remove -n [NAME_OF_THE_CONDA_ENVIRONMENT]
[path]
cd /Users/brunoflaven/Documents/03_git/BlogArticlesExamples/nft_insights/002_NFT_generator_stream... | {
"content_hash": "f42b0f2f55dbf8c91846957e7d679155",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 133,
"avg_line_length": 28.34426229508197,
"alnum_prop": 0.6471949103528051,
"repo_name": "bflaven/BlogArticlesExamples",
"id": "f6c5348083c4b3946604a0078c346fc2c76686b5",
... |
from common.dbsqlite import DBsqLite
from common.requestserver import RequestAgentManager
from common.configmanager import ConfigManager
from protocol.proto_clusterRequestSetNTPInfo_pb2 import clusterRequestSetNTPInfo
from protocol.proto_clusterRequestSNMP_pb2 import clusterRequestSNMP
from alarm import AlarmObject
fro... | {
"content_hash": "957d20d662ef7ac7137e8bd63f75bcf8",
"timestamp": "",
"source": "github",
"line_count": 441,
"max_line_length": 118,
"avg_line_length": 35.04761904761905,
"alnum_prop": 0.5965967908902692,
"repo_name": "liugangabc/ccs_web",
"id": "dfa48d55d99237b470960f3c39147c78bd039ceb",
"size": "... |
import scrapy
from lfcs_scraping.items import TimeItem
class TimeTravel(scrapy.Spider):
name = 'timetravel'
#allowed_domains = ['http://web.archive.org/']
start_urls = [
'http://web.archive.org/web/20160615173215/http://wcms.inf.ed.ac.uk/lfcs/people'
]
def parse(self, response)... | {
"content_hash": "0011ede2e633340760be1bac664a3709",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 92,
"avg_line_length": 33.714285714285715,
"alnum_prop": 0.5861581920903954,
"repo_name": "AWilcke/LFCS-History",
"id": "e3361c68a865ded9095a17c58d9d9f7b67cf1fa3",
"size": ... |
import hashlib
from struct import unpack, pack
import sys
from shared import config, frozen
import shared
#import os
def _set_idle():
if 'linux' in sys.platform:
import os
os.nice(20) # @UndefinedVariable
else:
try:
sys.getwindowsversion()
import win32api,win32p... | {
"content_hash": "05e96c4cfc85336e39d4b5ca1c172a58",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 134,
"avg_line_length": 33.28,
"alnum_prop": 0.610176282051282,
"repo_name": "onejob6800/minibm",
"id": "977abac1e431c0b78628aa62826f5663be49730e",
"size": "2569",
"binar... |
import requests
from requests import exceptions
from solum.openstack.common.gettextutils import _
from solum.openstack.common import log as logging
from solum.openstack.common.py3kcompat import urlutils
LOG = logging.getLogger(__name__)
def get(url, max_size, chunk_size=None, allowed_schemes=('http', 'https')):
... | {
"content_hash": "aaebe8541e7c878cb1dd4b704df543ed",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 75,
"avg_line_length": 37.03076923076923,
"alnum_prop": 0.6439551308683008,
"repo_name": "jamesyli/solum",
"id": "fe492549c14f2892fd09c91b3250c397817f5ef0",
"size": "2954",... |
import logging
import os
import time
import subprocess
from brkt_cli.aws import aws_service, boto3_device
log = logging.getLogger(__name__)
def share(aws_svc=None, logs_svc=None, instance_id=None, region=None,
snapshot_id=None, dest=None, subnet_id=None, key=None,
bast_key=None, bast_user=None, b... | {
"content_hash": "f189dd00390e2b02fbfb26be3ba6a6f1",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 78,
"avg_line_length": 37.04371584699454,
"alnum_prop": 0.5555391650685942,
"repo_name": "brkt/brkt-cli",
"id": "815a0d628d7f175e6fd42ce466fa2783fdfe5967",
"size": "7351",... |
import time
import hashlib
import logging
import simplejson as json
from rq import Queue
from rq import use_connection
from operator import itemgetter
import tornado.web
import tornado.ioloop
import tornado.options
from tornado.web import HTTPError
tornado.options.parse_command_line()
from tasks import judge
from co... | {
"content_hash": "e2cbcde3393e16015dd2cc1cb6ed4747",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 110,
"avg_line_length": 30.796296296296298,
"alnum_prop": 0.634996993385448,
"repo_name": "ptphp/PyLib",
"id": "c22be35611cc0d6ff70f9c65764901b4f62fa927",
"size": "1816",
... |
def printSomething(myString):
print(myString) | {
"content_hash": "1b1f5afe6107e1261b9c9eb6c9729743",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 29,
"avg_line_length": 24.5,
"alnum_prop": 0.7755102040816326,
"repo_name": "digicatech/python_learn",
"id": "5b030ae5e4578561f2663d84229a8c216e7c3140",
"size": "106",
"bi... |
from corehq.apps.sms.forms import BackendForm
from dimagi.utils.django.fields import TrimmedCharField
from crispy_forms import layout as crispy
from django.utils.translation import ugettext_lazy as _
class GrapevineBackendForm(BackendForm):
affiliate_code = TrimmedCharField(
label=_("Affiliate Code"),
... | {
"content_hash": "fb746f43558bfe01f2a6a99d3caa2407",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 55,
"avg_line_length": 24.6,
"alnum_prop": 0.6715447154471544,
"repo_name": "qedsoftware/commcare-hq",
"id": "539e0f7ca2e42e675bc8794c226840d71436a88c",
"size": "615",
"b... |
"""NDArray configuration API."""
import ctypes
from ..base import _LIB
from ..base import c_str_array, c_handle_array
from ..base import NDArrayHandle, CachedOpHandle
from ..base import check_call
def _monitor_callback_wrapper(callback):
"""A wrapper for the user-defined handle."""
def callback_handle(name,... | {
"content_hash": "693c8dd5d8cb1083e29ba49e76da5ba1",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 106,
"avg_line_length": 34.451977401129945,
"alnum_prop": 0.588553624139062,
"repo_name": "larroy/mxnet",
"id": "8dce5d8692549c039ac044c943b51d29e179acd9",
"size": "7019",... |
"""
===========================================
Upper Air Analysis using Declarative Syntax
===========================================
The MetPy declarative syntax allows for a simplified interface to creating common
meteorological analyses including upper air observation plots.
"""
#################################... | {
"content_hash": "2b888737568242c7efb727a68bd91c28",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 87,
"avg_line_length": 30.051724137931036,
"alnum_prop": 0.6368330464716007,
"repo_name": "metpy/MetPy",
"id": "86a8a18697f402b1a423b3639e01f66e6e605b12",
"size": "1881",
... |
import contextlib
import copy
import mock
import netaddr
from oslo_config import cfg
from oslo_utils import importutils
from webob import exc
from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api
from neutron.api.rpc.handlers import l3_rpc
from neutron.api.v2 import attributes
from neutron.common import constan... | {
"content_hash": "edc23facaecb889bda5fdeea0c986f1f",
"timestamp": "",
"source": "github",
"line_count": 2396,
"max_line_length": 79,
"avg_line_length": 47.77170283806344,
"alnum_prop": 0.47553315102960836,
"repo_name": "cloudbase/neutron-virtualbox",
"id": "e44251a1d7b57d00efc1bde114efe765df55f823",
... |
import warnings
from datetime import date
from unittest import TestCase
from workalendar.core import Calendar
class GenericCalendarTest(TestCase):
cal_class = Calendar
def setUp(self):
warnings.simplefilter("ignore")
self.year = date.today().year
self.cal = self.cal_class()
| {
"content_hash": "303ca1d3931f947b3451086c4e6cd033",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 39,
"avg_line_length": 22.214285714285715,
"alnum_prop": 0.7106109324758842,
"repo_name": "sayoun/workalendar",
"id": "3107c1a4e182803da9116c3273375e16cd337735",
"size": "3... |
import argparse, sys
from base.xmlserializer import Serializable
from base.applog import *
class Configuration(Serializable):
# Override this function!
def setup(self, *args, **kwargs):
# Private:
self.__version = '0.0.0'
self.__appname = 'NO_APPNAME'
# Defaults (Settings):
# self.ipfix_port = 4739
def... | {
"content_hash": "f42fce3c6c0bb906facb401840ef1406",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 112,
"avg_line_length": 35.69565217391305,
"alnum_prop": 0.6784409257003654,
"repo_name": "alexbredo/site-packages3",
"id": "c01ec73461c4df4e2f3c41a1faa230c6d2633f0b",
"siz... |
root = "./"
webRoot = u"http://YOURDOMAIN"
contentDir = "content/"
templateDir = root + "templates/default/"
outputDir = root + "output/"
sitename = u'YOUR TITLE'
# From the typekit "kit" get the 7 characters before the ".js"
# If you're not using Adobe TypeKit, leave this blank and it will not process.
typekitId = ''
... | {
"content_hash": "be78fc4ad69ddef4d3119052633edd0a",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 78,
"avg_line_length": 33.7,
"alnum_prop": 0.7091988130563798,
"repo_name": "JoeIsHere/yakbarber",
"id": "4ac0d8d50319f10cbc0380869879090937fabda4",
"size": "386",
"binar... |
"""Test gettxoutproof and verifytxoutproof RPCs."""
from test_framework.blocktools import COINBASE_MATURITY
from test_framework.messages import (
CMerkleBlock,
from_hex,
)
from test_framework.test_framework import SyscoinTestFramework
from test_framework.util import (
assert_equal,
assert_raises_rpc_er... | {
"content_hash": "9845096da0d6bf096045d6c5eb939d9f",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 259,
"avg_line_length": 56.01851851851852,
"alnum_prop": 0.6940495867768595,
"repo_name": "syscoin/syscoin",
"id": "dca7268c5baef64ea474d9e9db5015590096a223",
"size": "626... |
import os
import shutil
import glob
import time
import sys
import stat
import random
import json
import logging
import zipfile
import signal
import fnmatch
import subprocess
import re
from optparse import OptionParser
reload(sys)
sys.setdefaultencoding('utf8')
TOOL_VERSION = "v0.1"
VERSION_FILE = "VERSION"
DEFAULT_CM... | {
"content_hash": "6454080ba1eb4a9f53a598d56409e862",
"timestamp": "",
"source": "github",
"line_count": 797,
"max_line_length": 102,
"avg_line_length": 33.375156838143035,
"alnum_prop": 0.5543233082706767,
"repo_name": "XiaosongWei/crosswalk-test-suite",
"id": "5b6dbc4bad5a8e2de6c4c280fcefa9c32c432da... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lucem.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is reall... | {
"content_hash": "e338bc3695d71b070cc5cb8e5fa3d00f",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 77,
"avg_line_length": 37.19047619047619,
"alnum_prop": 0.6197183098591549,
"repo_name": "cydrobolt/lucem",
"id": "7c3fb4af79a3793a99cc5833718d072c22f678f4",
"size": "803",... |
from __future__ import unicode_literals
MESSAGES = {
"%d min remaining to read": "%d minutu gelditzen dira irakurtzeko",
"(active)": "(aktibo)",
"Also available in:": "Eskuragarria hizkuntza hauetan ere:",
"Archive": "Artxiboa",
"Authors": "Egileak",
"Categories": "Kategoriak",
"Comments": ... | {
"content_hash": "52916c2e4eb9edf70692b32c25a1eed4",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 84,
"avg_line_length": 39.083333333333336,
"alnum_prop": 0.6156716417910447,
"repo_name": "knowsuchagency/nikola",
"id": "41fa9f18408088550337a3f158ce3d555c7b7509",
"size":... |
from bottle import route, run, request, response, default_app
import methods
from utils import *
from datetime import datetime
def normalize(answer):
if isinstance(answer, dict):
for i in answer:
if type(answer[i]) == datetime:
answer[i] = int(answer[i].timestamp())
elif is... | {
"content_hash": "d0d9984c3decd3f2191a6c9e38620bb5",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 75,
"avg_line_length": 26.606060606060606,
"alnum_prop": 0.643507972665148,
"repo_name": "mr-tron/forumlocal-json-api",
"id": "9a1660484fbac90fdaef898bccd220abf7cf5fe1",
"s... |
import Tkinter as tk
import tkSimpleDialog
from PIL import Image, ImageTk
import atx
class CropIDE(object):
def __init__(self, title='AirtestX Basic GUI', screenshot=None):
self._root = tk.Tk()
self._init_items()
self._root.title(title)
self._lastx = 0
self._lasty = 0
... | {
"content_hash": "107ff404b0354a10a2ba8baafffe19c9",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 108,
"avg_line_length": 34.67213114754098,
"alnum_prop": 0.5754137115839244,
"repo_name": "Andy-hpliu/AirtestX",
"id": "96d302446ad70d44fb6619ab5057e7aec22097b4",
"size": ... |
import codecs
import os
from setuptools import setup
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
file_path = os.path... | {
"content_hash": "f3fdc780831c827fd8e9d4778efd7632",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 85,
"avg_line_length": 38.36,
"alnum_prop": 0.5342370524852277,
"repo_name": "cloudera/hue",
"id": "8513c299a504f0ba3dab34cd64165bf3c5d34110",
"size": "2924",
"binary": f... |
from ._configuration_stores_operations import ConfigurationStoresOperations
from ._operations import Operations
from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations
from ._private_link_resources_operations import PrivateLinkResourcesOperations
from ._key_values_operations import Ke... | {
"content_hash": "bedce5e9dc6b5f5e760b2990037a9c88",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 90,
"avg_line_length": 41.888888888888886,
"alnum_prop": 0.7785145888594165,
"repo_name": "Azure/azure-sdk-for-python",
"id": "36f96183612a1441b8e0d73074e0064c1f29494f",
"s... |
import orange
import Orange
import math
from itertools import chain
def discrete_columns(table, cols=None):
if cols is None:
cols = [attr.name for attr in table.domain]
ret = []
for col in cols:
attr = table.domain[col]
if attr.varType == orange.VarTypes.Discrete:
ret.... | {
"content_hash": "e254edc76614e750f445bb503014a877",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 101,
"avg_line_length": 29.35820895522388,
"alnum_prop": 0.6217590238942552,
"repo_name": "sirrice/scorpion",
"id": "75b61c36a45e3d99bbe3bffab372680ddf036cf4",
"size": "59... |
from django.conf.urls import patterns, url
from explorer.views import QueryView, CreateQueryView, PlayQueryView, DeleteQueryView, ListQueryView, ListQueryLogView
urlpatterns = patterns('',
url(r'(?P<query_id>\d+)/$', QueryView.as_view(), name='query_detail'),
url(r'(?P<query_id>\d+)/download$', 'explorer.views... | {
"content_hash": "262c5f21c77366b5b0ef247a41893582",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 118,
"avg_line_length": 66.23529411764706,
"alnum_prop": 0.6705150976909414,
"repo_name": "pombredanne/django-sql-explorer",
"id": "8ad14074cc25345a64deb04e9933c338f9f49f5d",... |
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('layers', '0002_auto_20161009_1735'),
]
operations = [
migrations.AddField(
model_name='layer',
... | {
"content_hash": "b86e20c254c8ccf02653f9121f0f08da",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 89,
"avg_line_length": 24.15,
"alnum_prop": 0.6211180124223602,
"repo_name": "RubenSchmidt/giscademy",
"id": "deecbb0a808b2bc51c7080b14645c4ab742bc132",
"size": "556",
"b... |
import warnings
import numpy as np
import pytest
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
DataFrame,
Series,
isna,
)
import pandas._testing as tm
class TestDataFrameCov:
def test_cov(self, float_frame, float_string_frame):
# min_periods no NAs (corn... | {
"content_hash": "579c60c52e7af371301cff5c7b4fa93c",
"timestamp": "",
"source": "github",
"line_count": 408,
"max_line_length": 87,
"avg_line_length": 38.05882352941177,
"alnum_prop": 0.5622102009273571,
"repo_name": "datapythonista/pandas",
"id": "ee9af3f436943e417949df7817cb9cb36a5fb2c4",
"size":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.