text stringlengths 4 1.02M | meta dict |
|---|---|
import json
import os
class Curbd(object):
def __init__(self, service, options):
self.service = service
self.key_prefix = options.program + "/" + options.config + "/"
self.path = os.path.normpath(
"../curbd-config/" + options.environment + "/" + options.program + "/"
... | {
"content_hash": "8773bbceae5262201c37c6b5af87fc20",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 82,
"avg_line_length": 32.861111111111114,
"alnum_prop": 0.5350803043110736,
"repo_name": "ridecharge/curbd",
"id": "c976d8e2802902895674ba01001c8b65201d20f8",
"size": "118... |
import pywikibot
def replace():
print('fetching fr_words')
fr_words = [page.title() for page in pywikibot.Category(
pywikibot.Site('fr', 'wiktionary'), "gaulois").articles()]
print('done fetching fr_words')
for page in pywikibot.Category(pywikibot.Site('mg', 'wiktionary'),
... | {
"content_hash": "69e5e930148a50547e8ce45d3c0be2a1",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 70,
"avg_line_length": 33.96153846153846,
"alnum_prop": 0.5503963759909399,
"repo_name": "radomd92/botjagwar",
"id": "ebc841fe9615663c0c819368c1d368b03d335b3d",
"size": "88... |
import sys
import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General conf... | {
"content_hash": "63826739d30d98ca733db8159c740408",
"timestamp": "",
"source": "github",
"line_count": 262,
"max_line_length": 117,
"avg_line_length": 31.5,
"alnum_prop": 0.7002302193141888,
"repo_name": "sdispater/eloquent",
"id": "2938df1a18fbad1bac3f2f7f55709bf815b729fa",
"size": "8678",
"bin... |
"""
Mimics the core API with the new deserializer
"""
from __future__ import absolute_import
from typing import IO, Any # pylint:disable=W0611
try:
# Python 2
from StringIO import StringIO as BytesIO
except ImportError:
# Python 3+
from io import BytesIO
from ..utils import java_data_fd
from .api i... | {
"content_hash": "0be92312d3f046744e810150a9096550",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 80,
"avg_line_length": 30.88235294117647,
"alnum_prop": 0.6407619047619048,
"repo_name": "tcalmant/python-javaobj",
"id": "2076ccd4b259e1fdec83acae8cd6269f0d5c98be",
"size"... |
'''
Created on Jan 12, 2018
# Copyright 2017, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | {
"content_hash": "54953f1662287b1c005609785de88487",
"timestamp": "",
"source": "github",
"line_count": 281,
"max_line_length": 103,
"avg_line_length": 32.83274021352313,
"alnum_prop": 0.50845436809018,
"repo_name": "isb-cgc/ISB-CGC-data-proc",
"id": "d9edd7a8efe886a307269267827d90239a3cf6b8",
"siz... |
from MiniREST.RESTServer import RESTServer, responseCodes, responseTypes
class MyServer(RESTServer):
"""Extend the RESTServer"""
def __init__(self, *args, **kwargs):
"""Accept arguments. Ie bind address/port"""
"""Call superclass constructor"""
super(MyServer, self).__init__(*args, **k... | {
"content_hash": "7a8c4307a3f5f87efb2f7216c729fced",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 124,
"avg_line_length": 44.23529411764706,
"alnum_prop": 0.6575797872340425,
"repo_name": "amplify-education/minirest",
"id": "3a4e532c6126df5f79d01e360e701cc8d44a1f22",
"s... |
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | {
"content_hash": "8a09d76013d3f3fa917c80794e2bb925",
"timestamp": "",
"source": "github",
"line_count": 709,
"max_line_length": 163,
"avg_line_length": 36.85331452750353,
"alnum_prop": 0.6299513950017223,
"repo_name": "sekikn/ambari",
"id": "07224aeb3ca7ca9326a4b62fe96101556092919a",
"size": "26152... |
def patch():
"""
Disable creation of foreign key constraints, unsupported from Google Cloud SQL
"""
from django.db.models import get_apps, get_models
from django.db.models.fields.related import RelatedField
for app in get_apps():
for model in get_models(app):
fields = model.... | {
"content_hash": "e2efd8b985d8ecf21ee26bb08046ef30",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 82,
"avg_line_length": 40.857142857142854,
"alnum_prop": 0.6241258741258742,
"repo_name": "trik/djangae",
"id": "5311d37a42df04de377f67bb7d12e2eaa672fc4c",
"size": "572",
... |
from __future__ import unicode_literals
import os
import json
import logging
import requests
from flask import jsonify, make_response
from flask.ext.httpauth import HTTPBasicAuth
from flask.ext.restful import Resource, reqparse
from flask.ext.restful.representations.json import output_json
output_json.func_globals['se... | {
"content_hash": "9843143cb905180e34515938578c8e64",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 82,
"avg_line_length": 33.89230769230769,
"alnum_prop": 0.613708579210168,
"repo_name": "chilland/hermes",
"id": "4b612d53eadf16f076da8074cae91930d4020d85",
"size": "2222",... |
"""A scraper for downloading checklists from eBird.
This scraper creates checklists for recent observations for a given region
using the eBird API. Additional information for each checklist is also
scraped from the checklist web page.
"""
import json
import os
import re
from scrapy import log
from scrapy.http import... | {
"content_hash": "85338efa2890b46c54c14a2d2d39118a",
"timestamp": "",
"source": "github",
"line_count": 803,
"max_line_length": 86,
"avg_line_length": 35.52303860523038,
"alnum_prop": 0.564592462751972,
"repo_name": "StuartMacKay/checklists_scrapers",
"id": "6abf7fd4b55925762aa3c439f21d0cf076a6fec7",... |
import os
import mock
from oslotest import mockpatch
from cloud import cloud
from cloud import grouping
from cloudferrylib.utils import utils
from tests import test
RESULT_FILE = 'tests/grouping_result'
FILE_NAME = 'tests/groups'
FAKE_CONFIG = utils.ext_dict(src=utils.ext_dict({'user': 'fake_user',
... | {
"content_hash": "bcc066109744ef97f836d8f43d148942",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 78,
"avg_line_length": 36.03649635036496,
"alnum_prop": 0.48997366821956656,
"repo_name": "mgrygoriev/CloudFerry",
"id": "5d9e122fe7f7146498c639d40b7bc7f3ee46f96d",
"size"... |
"""## Functions for working with arbitrarily nested sequences of elements.
This module can perform operations on nested structures. A nested structure is a
Python sequence, tuple (including `namedtuple`), or dict that can contain
further sequences, tuples, and dicts.
attr.s decorated classes (http://www.attrs.org) ar... | {
"content_hash": "79e3aac01ceae2cb0e2eb5bbbc6f9140",
"timestamp": "",
"source": "github",
"line_count": 1375,
"max_line_length": 105,
"avg_line_length": 38.99854545454546,
"alnum_prop": 0.6557820338287675,
"repo_name": "jhseu/tensorflow",
"id": "211e0cc5997f2e5bbd853f4444ab94a6198a49a0",
"size": "5... |
import json
import six
from st2common.constants import action as action_constants
from st2common import log as logging
from st2common.persistence import action as action_access
from st2common.services import action as action_service
from st2common.policies.concurrency import BaseConcurrencyApplicator
from st2common.se... | {
"content_hash": "81458dcf9730b2c40bd5f96973633d59",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 99,
"avg_line_length": 45.859375,
"alnum_prop": 0.6417376490630323,
"repo_name": "peak6/st2",
"id": "cf04735b77679c3df784c152137246ab1498f9a1",
"size": "6650",
"binary":... |
import array
import sys
if sys.version > '3':
basestring = str
xrange = range
unicode = str
from abc import ABCMeta
import copy
import numpy as np
from py4j.java_gateway import JavaObject
from pyspark.ml.linalg import DenseVector, Vector
from pyspark.ml.util import Identifiable
__all__... | {
"content_hash": "16fd0870a1ce899a1908aca9754487b4",
"timestamp": "",
"source": "github",
"line_count": 475,
"max_line_length": 99,
"avg_line_length": 34.15157894736842,
"alnum_prop": 0.5603501417827641,
"repo_name": "wangyixiaohuihui/spark2-annotation",
"id": "8516289796d48e848829fb6172fa643029823cb... |
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('userprofile', '0022_auto_20190519_1105'),
]
operations = [
migrations.CreateModel(
name='TermsOfService',
... | {
"content_hash": "969cdf74d6d46807b3a31284eeb928f5",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 177,
"avg_line_length": 34.666666666666664,
"alnum_prop": 0.6019230769230769,
"repo_name": "hackerspace-ntnu/website",
"id": "311bf6ecdef7ab985658b0ee930d2c22dd49ae44",
"si... |
import os
import tarfile
import uuid
from datetime import datetime, timedelta
from io import BytesIO
import pytest
import yaml
from indico.core.db.sqlalchemy.links import LinkType
from indico.modules.attachments.util import get_attached_items
from indico.modules.events.contributions import Contribution
from indico.mo... | {
"content_hash": "ef08ca34256e9405611b02be7bb3d500",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 117,
"avg_line_length": 40.09154929577465,
"alnum_prop": 0.6641489548568418,
"repo_name": "DirkHoffmann/indico",
"id": "7836950538e2999adf8d73330990f08a5123eb4f",
"size": ... |
from azure.identity import DefaultAzureCredential
from azure.mgmt.notificationhubs import NotificationHubsManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-notificationhubs
# USAGE
python name_space_authorization_rule_create.py
Before run the sample, please set the... | {
"content_hash": "f2afd71f02f2592f1124e4315842e62e",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 174,
"avg_line_length": 37.94285714285714,
"alnum_prop": 0.7394578313253012,
"repo_name": "Azure/azure-sdk-for-python",
"id": "517dfb8d7ad7720d19784fd77015e2918b7651aa",
"s... |
import numpy as np
import cv2
import cvui
WINDOW_NAME = 'Mouse'
def main():
frame = np.zeros((300, 600, 3), np.uint8)
# Init cvui and tell it to create a OpenCV window, i.e. cv::namedWindow(WINDOW_NAME).
cvui.init(WINDOW_NAME);
# Rectangle to be rendered according to mouse interactions.
rectangle = cvui.Rect(0... | {
"content_hash": "a79457578de052edd468fea3c7a11ecb",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 161,
"avg_line_length": 37.08108108108108,
"alnum_prop": 0.6887755102040817,
"repo_name": "Dovyski/cvui",
"id": "471a5ab67583ea3cc043e2a1f1dca304264776f3",
"size": "2995",
... |
from __future__ import print_function
import unittest
import numa
class NumaTestCast(unittest.TestCase):
def test_available(self):
self.assertEqual(True, numa.available())
def test_node_size(self):
for node in range(numa.get_max_node()+1):
print('Node: %d, size: %r' % (node, num... | {
"content_hash": "28e94bc53ec210c123b783440c785b00",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 98,
"avg_line_length": 28.637931034482758,
"alnum_prop": 0.6146899458157736,
"repo_name": "smira/py-numa",
"id": "d4a35e6a8c5920297c32f07a222e1191bedf8fae",
"size": "1711",... |
import os.path
import string
import urllib, re
from datetime import datetime
from xml.dom.minidom import parse, parseString
# Django
from django.core import serializers
from django.conf import settings
from django.db import models
# Methodmint
def pubmed(keywords, latest_query=None):
# Get matching publications f... | {
"content_hash": "0f477d46c7e9ce26df52f875ede325ce",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 124,
"avg_line_length": 31.53488372093023,
"alnum_prop": 0.6393805309734514,
"repo_name": "mfitzp/django-golifescience",
"id": "d692e297965937f4e27e5c375c61cea9709d51a6",
"... |
import os
from setuptools import setup, find_packages
from datapurge import __version__ as version
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
try:
from pypandoc import convert
def read_md(f):
return convert(f, 'rst')
excep... | {
"content_hash": "7fff7057e2f4ee86f17835563bd1f0ab",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 79,
"avg_line_length": 30.596774193548388,
"alnum_prop": 0.5951502372166578,
"repo_name": "swistakm/django-datapurge",
"id": "6d0cdd47fb00a4df4bc8985d63eac6e00162dee5",
"si... |
''' Operation tests '''
from xml.etree import ElementTree
from datetime import date, timedelta
from django.contrib.auth.models import User
from django.test import Client, TestCase
from lawe.models import Account, Transaction
class TestOperations(TestCase):
''' Тестирование операций с применением API '''
# @todo #70... | {
"content_hash": "1fb402b6542f871915ca7912dd0e5770",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 98,
"avg_line_length": 31.078341013824886,
"alnum_prop": 0.6942467378410438,
"repo_name": "DronMDF/laweb",
"id": "4db2403b750a1245dcf6afe10803073a7f9dff90",
"size": "7632"... |
"""Tests the for mactime parser."""
import unittest
# pylint: disable=unused-import
from plaso.formatters import mactime as mactime_formatter
from plaso.lib import eventdata
from plaso.lib import timelib_test
from plaso.parsers import mactime
from plaso.parsers import test_lib
class MactimeUnitTest(test_lib.ParserT... | {
"content_hash": "6a17178b820ab0001d519da0c7498489",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 80,
"avg_line_length": 32.71739130434783,
"alnum_prop": 0.6887043189368771,
"repo_name": "cvandeplas/plaso",
"id": "c3a44f428e52b73b9672a6c0b37d0de18424f719",
"size": "3708... |
"""Coders for individual Variable objects."""
from typing import Any
import warnings
from functools import partial
import numpy as np
import pandas as pd
from ..core import dtypes, duck_array_ops, indexing
from ..core.pycompat import dask_array_type
from ..core.variable import Variable
class SerializationWarning(Ru... | {
"content_hash": "7d9d38768e4c0f25ac2c8d0be2c116de",
"timestamp": "",
"source": "github",
"line_count": 285,
"max_line_length": 79,
"avg_line_length": 38.06666666666667,
"alnum_prop": 0.6202414969121578,
"repo_name": "chunweiyuan/xarray",
"id": "1f74181f3b3af93075e7b3871b540f639fff671f",
"size": "1... |
from troveclient import base
from troveclient import common
class Quotas(base.ManagerWithFind):
"""Manage :class:`Quota` information."""
resource_class = base.Resource
def show(self, tenant_id):
"""Get a list of all quotas for a tenant id."""
url = "/mgmt/quotas/%s" % tenant_id
... | {
"content_hash": "6f0bc08a9d5f52739e98f6da9ef652c2",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 75,
"avg_line_length": 33.138888888888886,
"alnum_prop": 0.5892707460184409,
"repo_name": "Tesora-Release/tesora-python-troveclient",
"id": "e461c52e75ce8f3454cee13f5c763fe27... |
from django import template
from crm.date.models import Month
register = template.Library()
@register.simple_tag
def previous_month_name():
return Month.previous()
@register.simple_tag
def current_month_name():
return Month.current()
@register.simple_tag
def next_month_name():
return Month.next()
| {
"content_hash": "42c334bace6df166e080ab2cca033b97",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 33,
"avg_line_length": 15.9,
"alnum_prop": 0.7327044025157232,
"repo_name": "MattAgile/django-spa-crm",
"id": "a29a5ad07da37fd889728dd0e5165b98af3c3e7a",
"size": "318",
"... |
"""
This file contains miscellanous utility functions.
"""
import pandas as pd
from typing import Dict, List, Tuple
import functools
def group_count(df, grouping_attr):
grp = df.groupby([grouping_attr]).size().to_frame().reset_index()
grp.rename(columns = {0: 'count'}, inplace = True)
return grp
def g... | {
"content_hash": "32cb983cb66c840117811c7b8d0ced30",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 87,
"avg_line_length": 28.44776119402985,
"alnum_prop": 0.64900314795383,
"repo_name": "NVIDIA/TensorRT",
"id": "ca2edf88ebafa4f4231ba7302e54604dda63d0bf",
"size": "2595",
... |
from __future__ import print_function, division, absolute_import
import pytest
import os
import warnings
from marvin import config, MarvinConfig
from marvin.core.exceptions import MarvinError, MarvinUserWarning
from brain import bconfig
from brain.core.exceptions import BrainError, BrainUserWarning
@pytest.fixture()... | {
"content_hash": "03b67ab788604f51e43ffd585f21b067",
"timestamp": "",
"source": "github",
"line_count": 227,
"max_line_length": 129,
"avg_line_length": 34.39647577092511,
"alnum_prop": 0.602202868852459,
"repo_name": "albireox/marvin",
"id": "2c05ad0cb526d5efeee77593352ccddf745dfc74",
"size": "8038... |
"""Module containing tests against the `TypeInstanceIndex` interface.
Most if not all of these tests are ported from the public domain tests
that come with the TMAPI 2.0 distribution (http://www.tmapi.org/2.0/).
"""
from tmapi.constants import TYPE_INSTANCE_ASSOCIATIONS_FEATURE_STRING
from tmapi.indices.type_instanc... | {
"content_hash": "ef4406d587309c72235f736d864b3827",
"timestamp": "",
"source": "github",
"line_count": 225,
"max_line_length": 76,
"avg_line_length": 48.528888888888886,
"alnum_prop": 0.6299111640260097,
"repo_name": "ajenhl/django-tmapi",
"id": "2536195f401f6aeb4460c34372e5196cf599c0ab",
"size": ... |
"""Module with classes and methods used for parameter validation."""
from scar.exceptions import ValidatorError, S3CodeSizeError, \
FunctionCodeSizeError, InvocationPayloadError
from scar.utils import FileUtils, StrUtils
VALID_LAMBDA_NAME_REGEX = (r"(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}... | {
"content_hash": "bba8d918728907189d9f47dd516d1bcb",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 97,
"avg_line_length": 45.43650793650794,
"alnum_prop": 0.5846288209606987,
"repo_name": "grycap/scar",
"id": "31c8f8bf9e66498c36a8aaccefbed509faa1cc35",
"size": "6302",
... |
'''
austat: tests module.
Meant for use with py.test.
Organize tests into files, each named xxx_test.py
Read more here: http://pytest.org/
Copyright 2015, FinalInitialSolutions
Licensed under MIT
''' | {
"content_hash": "123e8517bae687bcde9b7c5d3b4f9bbc",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 49,
"avg_line_length": 20.1,
"alnum_prop": 0.7611940298507462,
"repo_name": "FinalInitialSolutions/austat",
"id": "3877c4adb11345ce7e1fe943a9600664c9098baa",
"size": "201",... |
import random
import os
import sys
import subprocess, copy
# =====================================================
# Compute paths
# =====================================================
slugsExecutableAndBasicOptions = sys.argv[0][0:sys.argv[0].rfind("analyzeStuckAtConstant.py")]+"../src/slugs"
slugsCompilerAndBasicO... | {
"content_hash": "cd085a82894996c059bbfe780fe8a9d3",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 177,
"avg_line_length": 43.101851851851855,
"alnum_prop": 0.49688506981740066,
"repo_name": "LTLMoP/slugs",
"id": "b206b2b7ac5aed3f0fa6f86be283df9d86b67aef",
"size": "9331... |
import re
from typing import Any
from pytest import mark, param, raises, warns
from omegaconf import OmegaConf
from omegaconf.errors import InterpolationResolutionError
@mark.parametrize(
("cfg", "key", "expected_value", "expected_warning"),
[
param(
{"a": 10, "b": "${oc.deprecated: a}"}... | {
"content_hash": "a1be260c3b4c4a38facf2b264b5e5dc6",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 76,
"avg_line_length": 30.327102803738317,
"alnum_prop": 0.4764252696456086,
"repo_name": "omry/omegaconf",
"id": "7f03ab34ad3bc99676e90fdfa5e768fa43b006c1",
"size": "3245... |
import sys
from glob import glob
from distutils import log
from distutils.cmd import Command
from distutils.version import LooseVersion
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration(None, parent_package, top_path)
config.set_... | {
"content_hash": "3e95857d62d4177188e90244dcb5d51f",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 80,
"avg_line_length": 34.3876404494382,
"alnum_prop": 0.5905897729129227,
"repo_name": "yarikoptic/NiPy-OLD",
"id": "14342eb0c8212825b2c2e9dc215fd75f8d7e9784",
"size": "6... |
import logging
import threading
from ceilometerclient import client as ceilometer_client
from django.conf import settings
from django.utils import datastructures
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon.utils.memoized import memoized # noqa
from openstack_d... | {
"content_hash": "c167ba46c21918624c3a13bb0507d6bc",
"timestamp": "",
"source": "github",
"line_count": 1184,
"max_line_length": 79,
"avg_line_length": 37.32432432432432,
"alnum_prop": 0.5461395727733527,
"repo_name": "xme1226/horizon",
"id": "4568d0cb876cc2df4052ee15496aa8966470e15b",
"size": "447... |
import matplotlib
import numpy as np
import pandas as pd
from collections import namedtuple
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
EpisodeStats = namedtuple("Stats",["episode_lengths", "episode_rewards"])
def plot_cost_to_go_mountain_car(env, estimator, num_tiles=20):
x = np.... | {
"content_hash": "197253d2e16c6b2a68af44c94d124c65",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 118,
"avg_line_length": 35.275510204081634,
"alnum_prop": 0.6219265258894996,
"repo_name": "transedward/ml-playground",
"id": "8efed363f615dffcbc1e415a4d1c26d7bb8161d9",
"s... |
ab={ 'Swaroop' : '[email protected]',
'Larry' : '[email protected]',
'Matsumoto' : '[email protected]',
'Spammer' : '[email protected]'
}
print "Swaroop's address is %s" %ab['Swaroop']
# Adding a key/value pair
ab['Guido']='[email protected]'
# Deleting a key/value pair
del ab['Spammer']
print '\nTh... | {
"content_hash": "779d55564e2d38603fa4e79ae9048859",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 62,
"avg_line_length": 25.571428571428573,
"alnum_prop": 0.659217877094972,
"repo_name": "weepingdog/HelloWorld",
"id": "439bd89f8497b642f1ed248eea5ebdcf748c10ae",
"size": ... |
from office365.sharepoint.base_entity import BaseEntity
class SPAuthEvent(BaseEntity):
@property
def entity_type_name(self):
return "Microsoft.SharePoint.AuthPolicy.Events.SPAuthEvent"
| {
"content_hash": "9885537d8a7807c9be086a75c110c757",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 67,
"avg_line_length": 20.6,
"alnum_prop": 0.7572815533980582,
"repo_name": "vgrem/Office365-REST-Python-Client",
"id": "140497dee252d4890385f056fc9a7ccd24872e99",
"size": ... |
from typing import Any, TYPE_CHECKING
from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy
from .._version import VERSION
if TYPE_CHECKING:
# pylint: disable=unused-import,ungro... | {
"content_hash": "6c2af1fd1b13554c6e1b554f98616ee6",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 130,
"avg_line_length": 48.875,
"alnum_prop": 0.7154731457800512,
"repo_name": "Azure/azure-sdk-for-python",
"id": "aaac6cd461cc4429d07a4fc784fccdf7ad550263",
"size": "3596... |
"""
08b.py
~~~~~~
Advent of Code 2017 - Day 8: I Heard You Like Registers
Part Two
To be safe, the CPU also needs to know the highest value held in any
register during this process so that it can decide how much memory to
allocate to these operations. For example, in the previous instructio... | {
"content_hash": "e2f040ebd62fbbf4f617880e26c20186",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 76,
"avg_line_length": 24.65671641791045,
"alnum_prop": 0.5756658595641646,
"repo_name": "mcbor/adventofcode",
"id": "fc2f1f331cc337db4926900203b8917d521e4124",
"size": "16... |
"""Emulating the wheel from apple products"""
from gi.repository import Gtk as gtk
from gi.repository import Gdk as gdk
from lib import graphics
from contrib import euclid
import cairo
import math
class Scene(graphics.Scene):
def __init__(self, progress):
graphics.Scene.__init__(self, scale=True, keep_a... | {
"content_hash": "791843a4f6bc1d436eddc31014ae9bb0",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 112,
"avg_line_length": 33.13513513513514,
"alnum_prop": 0.598694942903752,
"repo_name": "projecthamster/experiments",
"id": "4a78a565e74b90250e33ab8a15021ed4253c989d",
"s... |
class ONE(object):
roman = 'I'
value = 1
left_allowed = None
@staticmethod
def roman_for(number):
return ONE.roman
@staticmethod
def interval():
return range(4)
@staticmethod
def remaining_for(number):
return number - ONE.value
class FIVE(object):
roma... | {
"content_hash": "68273fa4c79efd3b869e2fddd1285dfb",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 100,
"avg_line_length": 22.69607843137255,
"alnum_prop": 0.5991360691144708,
"repo_name": "alejandrodob/dojo",
"id": "1d58d9833bf16fb3a841519cccb1d461d883eb95",
"size": "2... |
import cv2
import numpy as np
import os
from solver import SudokuSolver
from finder import SudokuFinder
from util import img_show
def write_missing_values(img, coords, completed_values):
"""
Using the puzzle corner coordinates and the puzzle matrix
completed values, write the missing values on the image... | {
"content_hash": "1976cf640cecdc16cc049d63ea85ce55",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 86,
"avg_line_length": 31.413793103448278,
"alnum_prop": 0.5923893157702159,
"repo_name": "bbuhai/sudoku-solver",
"id": "f2fa17a9a92206bf734310ccbe79b026e8fdc3cd",
"size": ... |
import os
import logging
import sys
import tempfile
from six import iteritems
from six.moves import range
from functools import partial, wraps
import ducky.config
import ducky.cpu.registers
import ducky.console
import ducky.log
import ducky.machine
import ducky.mm
import ducky.snapshot
import ducky.util
from ducky.u... | {
"content_hash": "3d1782aa908d1e5a683ee5e2bc4ebc84",
"timestamp": "",
"source": "github",
"line_count": 294,
"max_line_length": 255,
"avg_line_length": 29.30952380952381,
"alnum_prop": 0.6506904955320877,
"repo_name": "happz/ducky",
"id": "6f127d2a2369b5ff0df3acd351314a281a2dbc82",
"size": "8617",
... |
import cPickle
import numpy
from preprocessing import remove_short_sentences
from sen2vec import Sen2VecByWord2Vec,Sen2VecByDoc2Vec
load_dir_path = "../dataset/sentences_divided/"
save_dir_path = "../dataset/training_dataset/"
unlabeled_sentences = cPickle.load(open(load_dir_path + "unlabeled_sentences.pkl","rb"))
la... | {
"content_hash": "7fc132338ee90d9c52d34d62f0b4db74",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 88,
"avg_line_length": 28.25,
"alnum_prop": 0.7031375703942075,
"repo_name": "jphacks/KB_02",
"id": "2fa3b95f24d3602b614f4f9cffa3899520cb6403",
"size": "1245",
"binary": ... |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['BoxCox'] , ['ConstantTrend'] , ['Seasonal_DayOfMonth'] , ['NoAR'] ); | {
"content_hash": "09c2010cf992fb0873c7bd26753f88c8",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 91,
"avg_line_length": 41,
"alnum_prop": 0.7195121951219512,
"repo_name": "antoinecarme/pyaf",
"id": "d67e48d2cd17b273477f05199219ac13aaf1f9fe",
"size": "164",
"binary": f... |
import oval57 as oval
class cybox_oval_mappings(object):
def __init__(self, id_namespace):
self.test_id_base = 0
self.obj_id_base = 0
self.ste_id_base = 0
self.def_id_base = 0
self.id_namespace = id_namespace
#Mappings
#CybOX Condition to OVAL operation mappi... | {
"content_hash": "26c50accdbba50703b1cb3c0b397f8d5",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 180,
"avg_line_length": 60.37869822485207,
"alnum_prop": 0.5950607604860839,
"repo_name": "MAECProject/maec-to-oval",
"id": "78ca3198f7ede8f18eb479f0fd9836028d35a879",
"si... |
default_app_config = 'dwitter.apps.DwitterConfig'
| {
"content_hash": "53a9d1fe77bdc1a950bbfab6ccb2ec44",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 49,
"avg_line_length": 50,
"alnum_prop": 0.8,
"repo_name": "lionleaf/dwitter",
"id": "4ada851685a1ae304c0f213f8e1c40a9b71d9c9e",
"size": "50",
"binary": false,
"copies":... |
"""Switchmap-NG setup.
Manages parameters required by all classes in the module.
"""
# Main python libraries
def main():
"""Process data.
Args:
None
Returns:
None
"""
# Check the environment
pass
if __name__ == 'switchmap':
main()
| {
"content_hash": "9f8adc3c3b41c07fccdf6ec6076ff49b",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 57,
"avg_line_length": 11.4,
"alnum_prop": 0.5684210526315789,
"repo_name": "PalisadoesFoundation/switchmap-ng",
"id": "984554dc21cb0d7353b06e9542a92fc95edad32f",
"size": "... |
LUA_SOURCE = '''
function main(splash)
splash.resource_timeout = splash.args.timeout
{}
local condition = false
while not condition do
splash:wait(splash.args.wait)
condition = splash:evaljs({}{}{})
end
{}
{}
splash:runjs("window.close()")
{}
end
'''
GO = '\tassert(splash:go... | {
"content_hash": "4ada3210b00c4cf3579cd10f1f853918",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 112,
"avg_line_length": 20.08955223880597,
"alnum_prop": 0.5950965824665676,
"repo_name": "postalXdude/PySplash",
"id": "c7322e1d45d06ee499822386436e9c5c580b7c87",
"size": ... |
from six.moves.urllib.parse import urlparse, parse_qs, urlencode
from logging.config import dictConfig
import logging
try:
import gevent
except:
gevent = None
def parse_redis_connection(url):
split = urlparse(url)
protocol = split.scheme
netloc = split.netloc
path = split.path
db = int(pars... | {
"content_hash": "d06b131ad7e40126d3d622b25b37301f",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 91,
"avg_line_length": 28.166666666666668,
"alnum_prop": 0.4902139280837506,
"repo_name": "hhuuggoo/kitchensink",
"id": "5f2883f533b66711e9d54a7ccde98c87bc873c21",
"size": ... |
import os
from pkg_resources import Requirement, RequirementParseError
def add_to_requirements(package_name, url=None, file_path='requirements.txt'):
if not url:
url = package_name
if os.path.exists(file_path):
with open(file_path) as f:
lines = f.read().strip().splitlines()
... | {
"content_hash": "278244527cc06180e3c25036e8ec53eb",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 111,
"avg_line_length": 25.394736842105264,
"alnum_prop": 0.5512953367875648,
"repo_name": "django-cratis/cratis",
"id": "8075d40401b9ff2afab59c748247d509685f14c3",
"size":... |
"""
The main file for AAC. It is responsible to run the REST API
configured in controllers.py.
"""
from aac import app
app.run(port=8080, debug=True)
| {
"content_hash": "3d7477174399b255a0275dedfd1eaae3",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 60,
"avg_line_length": 21.714285714285715,
"alnum_prop": 0.7302631578947368,
"repo_name": "bdnog/avg-age-country",
"id": "ff78ccf494c08e29bc5bdcbaaca286455fad1ef0",
"size": ... |
from sqlalchemy.orm import exc
from neutron.api.v2 import attributes
from neutron.db import db_base_plugin_v2
from neutron.openstack.common import log as logging
from neutron.plugins.vmware.dbexts import nsx_models
from neutron.plugins.vmware.extensions import maclearning as mac
LOG = logging.getLogger(__name__)
cl... | {
"content_hash": "3d5f7b50ee2cc89dd20fa193089b265f",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 75,
"avg_line_length": 41.04255319148936,
"alnum_prop": 0.6340072576464489,
"repo_name": "cloudbase/neutron-virtualbox",
"id": "6a85162e1d321c6777bbb30a672ea383006d9460",
"... |
"""Classifier on the latents representations in AEs.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from absl import app
from absl import flags
import all_aes
import tensorflow as tf
from lib import data, utils, train, classifiers
FLAGS = f... | {
"content_hash": "9262821a73b25cf329904ba34d5462d8",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 77,
"avg_line_length": 32.43421052631579,
"alnum_prop": 0.5679513184584178,
"repo_name": "brain-research/acai",
"id": "7b88b39eee26edc65e77f76bf4b907661fc1343b",
"size": "3... |
from unittest import TestCase, main as ut_main
from random import random
from wallp.service import Imgur, Google, DeviantArt, Reddit, Bing
from wallp.util import log
from wallp.db import func as dbfunc
class TestGetImageUrl(TestCase):
image_url_seen_ratio = 0
interactive = True
@classmethod
def setUpClass(cls):... | {
"content_hash": "9693d967cba6853053d64cbaff1216f5",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 72,
"avg_line_length": 20.3125,
"alnum_prop": 0.703076923076923,
"repo_name": "amol9/wallp",
"id": "506a89885fbe673e01c7e88037cb8a6a7113cc02",
"size": "1300",
"binary": f... |
"""Git implementation of _version.py."""
import errno
import os
import re
import subprocess
import sys
def get_keywords():
"""Get the keywords needed to look up the version information."""
# these strings will be replaced by git during git-archive.
# setup.py/versioneer.py will grep for the variable name... | {
"content_hash": "dc25b6289a54060caea67b9ba3e6883a",
"timestamp": "",
"source": "github",
"line_count": 510,
"max_line_length": 79,
"avg_line_length": 35.252941176470586,
"alnum_prop": 0.5697758496023138,
"repo_name": "Savvysherpa/dask-funk",
"id": "ea4a9654ee238744dffb398de4df169a0d92f8d0",
"size"... |
import datetime
import itertools
import unittest
import ddt
import mock
from rally.plugins.agent import masteragent
BASE = "rally.plugins.agent.masteragent"
class MyDict(dict):
pass
def annotated(d, name=None):
d = MyDict(**d)
if name:
setattr(d, "__name__", name)
return d
@ddt.ddt
clas... | {
"content_hash": "05f1f2b4ad0c15ac8c2367a4f041985a",
"timestamp": "",
"source": "github",
"line_count": 478,
"max_line_length": 77,
"avg_line_length": 32.30962343096234,
"alnum_prop": 0.5108132608132608,
"repo_name": "paboldin/rally",
"id": "edc516e64269716e4554fca0e2d083925b19ede8",
"size": "16074... |
import logging
import requests
import urlparse
from django.core.exceptions import ValidationError
from django.db import models
from cabot.metricsapp import defs
from cabot.metricsapp.api import get_series_ids, get_panel_url
logger = logging.getLogger(__name__)
class GrafanaInstance(models.Model):
class Meta:
... | {
"content_hash": "44309148e1161d38bc641a622235aa95",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 107,
"avg_line_length": 36.49333333333333,
"alnum_prop": 0.6470588235294118,
"repo_name": "Affirm/cabot",
"id": "9da6a80b418bef92dd47fd69255de6e0f5e12fe7",
"size": "5474",... |
"""
Various functions.
by Matt Hall, Agile Geoscience, 2016
"""
from io import BytesIO
import datetime
import sys
import numpy as np
from PIL import ImageStat
from sklearn.cluster import KMeans
from sklearn.utils import shuffle
from sklearn.neighbors import BallTree
from scipy.spatial.distance import pdist, squarefor... | {
"content_hash": "8e81df09bb7db1164390b1b0afbdd9ea",
"timestamp": "",
"source": "github",
"line_count": 470,
"max_line_length": 112,
"avg_line_length": 31.448936170212765,
"alnum_prop": 0.5892023543738584,
"repo_name": "kwinkunks/rainbow",
"id": "5e021955cc500d08c22c2011d11e0ba3f2873251",
"size": "... |
"""Unit tests for OpenStack Cinder volume drivers."""
import mock
from hplefthandclient import exceptions as hpexceptions
from cinder import context
from cinder import exception
from cinder.openstack.common import log as logging
from cinder import test
from cinder import units
from cinder.volume.drivers.san.hp import... | {
"content_hash": "7d337aad355f27e014e41126734f2335",
"timestamp": "",
"source": "github",
"line_count": 1403,
"max_line_length": 79,
"avg_line_length": 38.54383464005702,
"alnum_prop": 0.5680418662277863,
"repo_name": "NeCTAR-RC/cinder",
"id": "d9ad1a8e096b873e8f64207d062cf68b2bccafef",
"size": "54... |
import logging
import os
import sqlite3
from adb_super import app_data
class DatabaseManager:
def __init__(
self,
app_data_dir_path=app_data.AppDataDirManager().app_data_dir_path
):
self.file_name = "database.db"
self.schema_version = "0.1"
self.app_data_dir_path = ap... | {
"content_hash": "a903cd99298fa6f1ae463e50b2de0572",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 76,
"avg_line_length": 33.405660377358494,
"alnum_prop": 0.5506918949449308,
"repo_name": "Kregap/ADB-Super",
"id": "1c6bf916dbacd1f3863f746964fe7ef744b0f2c8",
"size": "35... |
"""Make the custom certificate and private key files used by TLS tests.
Code heavily borrowed from Lib/tests/make_ssl_certs.py in CPython.
"""
from __future__ import annotations
import os
import shutil
import subprocess
import tempfile
req_template = """
[req]
distinguished_name = req_distinguished_name... | {
"content_hash": "e011ee8a1a885a53d9069a52f244eb19",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 83,
"avg_line_length": 26.493273542600896,
"alnum_prop": 0.47562626946513203,
"repo_name": "dask/distributed",
"id": "b963cb46c4a9631ff6e2bb9a8249eaeb0f9c63fd",
"size": "5... |
import os
import re
from lxml import etree
from lxml.etree import set_default_parser
from lxml.etree import XMLParser
from ansible.module_utils.basic import AnsibleModule
DOCUMENTATION = r'''
---
module: junitxml
short_description: JUnitXML editor
version_added: "2.9.17"
description: Edits JUnitXML files
option... | {
"content_hash": "a8c51f400b3fdbb08965d8ebc15010d8",
"timestamp": "",
"source": "github",
"line_count": 540,
"max_line_length": 79,
"avg_line_length": 32.5462962962963,
"alnum_prop": 0.5820199146514936,
"repo_name": "redhat-openstack/infrared",
"id": "63ca08a4b537f8ace5047ed91adf23b70b61bd29",
"siz... |
import socket
import sys
## Function to process requests
def process(conn):
#conn.send("Welcome to banana's potassium calculater. Please send the number of bananas.\n")
# read userInput from client
userInput = conn.recv(BUFFER_SIZE)
response = ''
if not userInput:
print "Error reading mes... | {
"content_hash": "d4857218f66c9fc06b6028919918dc04",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 96,
"avg_line_length": 22.59259259259259,
"alnum_prop": 0.6516393442622951,
"repo_name": "hantasm/dist-sys-exercises",
"id": "b0bbe600e34f43730175fec2820c06b70238c951",
"si... |
from .WaveObject import WaveObject, Vertex, FaceVertex, Face, Normal, Text_Coord
from .ObjParser import ObjParser
from .Scene import Scene
from .ObjWriter import ObjWriter
| {
"content_hash": "e3680ecf4100a92a436fd3b57178df05",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 80,
"avg_line_length": 43,
"alnum_prop": 0.8197674418604651,
"repo_name": "tretum/Avorion-Obj-Converter",
"id": "e29d709b51b13cdaadc14788b692dc2173306238",
"size": "172",
... |
import happybase
connection = happybase.Connection('192.168.1.200')
print(connection.tables())
families = {
'c': dict(), # use defaults
}
#connection.create_table('travelapi_sabre_airlines', families)
print(connection.tables()) | {
"content_hash": "0d63b6f8bb57c38726c681fba9ae1fe2",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 62,
"avg_line_length": 21.363636363636363,
"alnum_prop": 0.7276595744680852,
"repo_name": "bundgus/python-playground",
"id": "e61f30cfc5b1c8cfec6dba01cdd3e48fbf8c90c1",
"si... |
"""Deals with correlations."""
import copy
import numpy
from scipy.stats import pearsonr
from gewittergefahr.gg_utils import error_checking
from gewittergefahr.deep_learning import permutation
from gewittergefahr.deep_learning import permutation_utils
SEPARATOR_STRING = '\n\n' + '*' * 50 + '\n\n'
def _linear_idx_to... | {
"content_hash": "862cab359a40e88e1b01a5df0a9ab497",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 80,
"avg_line_length": 34.36153846153846,
"alnum_prop": 0.6516677859861204,
"repo_name": "thunderhoser/GewitterGefahr",
"id": "fa3e3cf9648d94b8a20ed16c29fb430a1f542c03",
"... |
'''
Created on 25-08-2011
'''
class DataValidator:
"""Class used to validate data in csv file. Uses schema to complete
the task. Can check number of values in rows and their types. Also checks
if each obligatory field has not empty value. Enables rule mechanism that
allows correctly validating dat... | {
"content_hash": "fe2020fd4358b769b088363a1f96329d",
"timestamp": "",
"source": "github",
"line_count": 276,
"max_line_length": 116,
"avg_line_length": 38.51086956521739,
"alnum_prop": 0.5325994919559696,
"repo_name": "CCLab/Raw-Salad",
"id": "c136f00717596486b8bf546a0cee03c3f2c9ddca",
"size": "106... |
"""
jsonapi.flask
=============
The *py-jsonapi* extension for flask. Binding the API to a flask application
is dead simple:
.. code-block:: python3
import flask
import jsonapi
import jsonapi.flask
app = flask.Flask(__name__)
api = jsonapi.flask.FlaskAPI("/api", db=..., flask_app=app)
# You... | {
"content_hash": "120ea4a8798b23c8c4308feefac82b1e",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 84,
"avg_line_length": 19.83050847457627,
"alnum_prop": 0.647008547008547,
"repo_name": "benediktschmitt/py-jsonapi",
"id": "0a9bf4cd54329cdb9b8df51094473c183078ee28",
"siz... |
from org.sikuli.basics import Debug
from org.sikuli.script import Region as JRegion
from org.sikuli.script.Constants import *
import sys
import inspect
DEBUG=False
class Region(JRegion):
# support for with:
# override all global sikuli functions by this region's methods.
def __enter__(self):
excl... | {
"content_hash": "82d766c0e98814edeab487c1bccc8c12",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 106,
"avg_line_length": 38.967213114754095,
"alnum_prop": 0.5523769457299117,
"repo_name": "henriqueguchi/SikuliServer",
"id": "4d66efa8f768ea5e25d54c6fc7eb5d6f561a8650",
"... |
import sys, os
# If your extensions are in another directory, add it here. If the directory
# is relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
#sys.path.append(os.path.abspath('.'))
# Allow module docs to build without having sqlalchemy-migrate installed:
sys.path.appe... | {
"content_hash": "89639f663c76e21302f902782813de20",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 91,
"avg_line_length": 32.4331550802139,
"alnum_prop": 0.7167353668590272,
"repo_name": "ioram7/keystone-federado-pgid2013",
"id": "ffc7c1eb4db832500f33729e7bf64e5244fe06ef"... |
"""
The most basic (working) CherryPy 3.1 Windows service possible.
Requires Mark Hammond's pywin32 package.
"""
import os
import cherrypy
import win32service
import win32serviceutil
from rfid import RFIDClient, ten_digit_to_comma_format
ip_address = "192.168.1.20"
controller_serial = 11111111
client = RFIDClient(i... | {
"content_hash": "d5440a9c9cf1203e957da31e889327e4",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 75,
"avg_line_length": 32.03529411764706,
"alnum_prop": 0.5534337128167462,
"repo_name": "pawl/Chinese-RFID-Access-Control-Library",
"id": "ebcb99eb6d6e9d7bb78ed1a6b1eacd4614... |
from samplics.datasets.datasets import (
load_auto,
load_birth,
load_county_crop,
load_county_crop_means,
load_expenditure_milk,
load_nhanes2,
load_nhanes2brr,
load_nhanes2jk,
load_nmhis,
load_psu_frame,
load_psu_sample,
load_ssu_sample,
)
from samplics.categorical import... | {
"content_hash": "6e2855a4a18990b8b9472d810e92034c",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 86,
"avg_line_length": 25.25,
"alnum_prop": 0.6895332390381895,
"repo_name": "survey-methods/samplics",
"id": "97d0d093a2a659c8196d9214ec0624eb4ae4a52a",
"size": "1414",
... |
from timeseries import TimeSeries
import numpy as np
from scipy.stats import norm
from tsdb import *
import time
identity = lambda x: x
schema = {
'pk': {'convert': identity, 'index': None},
'ts': {'convert': identity, 'index': None},
'order': {'convert': int, 'index': 1},
'blar... | {
"content_hash": "75827c3f05f7433244f0bb7cd55f74b7",
"timestamp": "",
"source": "github",
"line_count": 876,
"max_line_length": 79,
"avg_line_length": 34.04680365296804,
"alnum_prop": 0.5909807208717519,
"repo_name": "Mynti207/cs207project",
"id": "22d3323eb2bb6351a88656b13a8d99c4a0b5d5f2",
"size":... |
from __future__ import (
unicode_literals,
absolute_import,
print_function,
division,
)
str = type('')
class CompoundFileError(IOError):
"""
Base class for exceptions arising from reading compound documents.
"""
class CompoundFileHeaderError(CompoundFileError):
"""
Base class ... | {
"content_hash": "dbf7910cef386de95eec568f4096cd4a",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 79,
"avg_line_length": 26.176795580110497,
"alnum_prop": 0.7283663993246096,
"repo_name": "waveform80/compoundfiles",
"id": "aa6192b705cc0d348e41a48b729a8559a19bc109",
"si... |
import os
import re
import json
import base64
import logging
import datetime
import time
import copy
import decimal
import cgi
import numpy
import pymongo
from lib import config, util, util_litecoin
D = decimal.Decimal
def get_market_price(price_data, vol_data):
assert len(price_data) == len(vol_data)
asser... | {
"content_hash": "f8169675c4c4631185b420c2c6e25296",
"timestamp": "",
"source": "github",
"line_count": 659,
"max_line_length": 179,
"avg_line_length": 56.420333839150224,
"alnum_prop": 0.589790484387187,
"repo_name": "Paytokens/payblockd",
"id": "e44493287f29cc0fb5b30aace38c67b57ae34455",
"size": ... |
from azure.cli.core.util import sdk_no_wait
from azure.mgmt.databoxedge.models import Sku
def databoxedge_device_list(client,
resource_group_name=None,
expand=None):
if resource_group_name:
return client.list_by_resource_group(resource_group_name=res... | {
"content_hash": "b42d0fdddbdffe2ff1a2941d3b9c6c92",
"timestamp": "",
"source": "github",
"line_count": 333,
"max_line_length": 89,
"avg_line_length": 40.24024024024024,
"alnum_prop": 0.473955223880597,
"repo_name": "yugangw-msft/azure-cli",
"id": "b9690cb791fe4059b000497fb5c0e985955f4e06",
"size":... |
from django.utils.translation import ugettext, ugettext_lazy as _
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as DjangoUserAdmin
from authdata.forms import UserCreationForm, UserChangeForm
from authdata.models import Municipality
from authdata.models import School
from authdata.mode... | {
"content_hash": "9e2419dc4dd15f7f662b11f00a8b4759",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 115,
"avg_line_length": 32.33673469387755,
"alnum_prop": 0.6708740927737457,
"repo_name": "educloudalliance/eca-auth-data",
"id": "cd0c819f51326a6d89a2bea5f46be271b83b6d09",
... |
from __future__ import print_function, division
import logging
import math
import sys
import numpy as np
import numpy.lib.recfunctions
import scipy.linalg
import scipy.stats
from sklearn.linear_model import LassoLarsIC # , Lasso, LassoCV, LassoLarsCV
import statsmodels.api as sm
from errors import TSLengthExceptio... | {
"content_hash": "1bf58e30c84174c7699f35a412fd795d",
"timestamp": "",
"source": "github",
"line_count": 800,
"max_line_length": 79,
"avg_line_length": 36.755,
"alnum_prop": 0.544245680859747,
"repo_name": "jmorton/yatsm",
"id": "158e5dc8e010c318da871441df3ab61242fc79cf",
"size": "29404",
"binary"... |
"""
::BOH
$Id: connection.py,v 1.2 2006/12/07 05:25:13 peterk Exp $
$HeadURL: http://subversion/stuff/svn/owfs/trunk/ow/__init__.py $
Copyright (c) 2006 Peter Kropf. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as publis... | {
"content_hash": "51444b7c71024ee61bd3c8386c30bf6c",
"timestamp": "",
"source": "github",
"line_count": 214,
"max_line_length": 93,
"avg_line_length": 27.252336448598133,
"alnum_prop": 0.5442386831275721,
"repo_name": "Cirreth/shome",
"id": "b7d98362d40a6bbbd0e7d8dbceae414d158c6e44",
"size": "5832"... |
import os
import fnmatch
import numbers
import fcntl
import array
import mmap
import ctypes
import re
from os.path import abspath
from PIL import Image, ImageDraw
from struct import pack, unpack
from subprocess import Popen
INPUT_AUTO = ''
OUTPUT_AUTO = ''
# -----------------------------------------------------------... | {
"content_hash": "37c8aff24835675a51581f2638b3bdc0",
"timestamp": "",
"source": "github",
"line_count": 2349,
"max_line_length": 119,
"avg_line_length": 32.29714772243508,
"alnum_prop": 0.6075185194948989,
"repo_name": "ddemidov/ev3dev-lang-python-1",
"id": "2ea64aa282650e3b22908d79fe47e44c41edd061",... |
from PipelineTools.packages import metadata
import maya.cmds as cmds
import os
#print os.getpid()
import pymel.core as pm
class FacialRig(metadata.MetaRig):
'''
Example custom mRig class inheriting from MetaRig
'''
def __init__(self,*args,**kws):
super(FacialRig, self).__init__(*args,**kws)
... | {
"content_hash": "ec002642c44d47eb6bb5cc349d2c20eb",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 114,
"avg_line_length": 35.56603773584906,
"alnum_prop": 0.6047745358090185,
"repo_name": "josephkirk/PipelineTools",
"id": "24415333c01333f81dbc3c0b75cf7e5bb276a1f2",
"siz... |
import unittest
from sections.core import ComplexSection, SimpleSection, Dimensions, cached_property
class ComplexSectionTests(unittest.TestCase):
def setUp(self):
# Create a subclass of ComplexSection which suppresses
# NotImplementedErrors
class BasicImplementation(ComplexSection)... | {
"content_hash": "802a7e1f48344a01399b3c80b970d5a2",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 85,
"avg_line_length": 37.075471698113205,
"alnum_prop": 0.6455470737913486,
"repo_name": "iamlikeme/sections",
"id": "49767c849032d9277d024ecefc82a44d5421cfda",
"size": "... |
"""Mappie: A Python package for playing with webmap images
Mappie makes it easy to download map tiles from various webmap sources and use
them in visualizations with any type of geospatial data. It is designed with
'matplotlib' and 'cartopy' in mind, but should work nicely with most geospatial
plotting libraries in... | {
"content_hash": "b2103a118fd5928276e84619421df831",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 80,
"avg_line_length": 44.07692307692308,
"alnum_prop": 0.7255671902268761,
"repo_name": "carsonfarmer/mappie",
"id": "5600f02a52b990b20bd98b5c5bcbd32a0c6a5293",
"size": "2... |
import arrow
from oandakey import access_token, accountID
from OnePy.builtin_module.backtest_forex.forex_recorder import ForexRecorder
from OnePy.custom_module.api.oanda_api import OandaAPI
from OnePy.custom_module.oanda_bar import OandaBar
from OnePy.sys_module.models.base_series import (AvgPriceSeries, MoneySeries,
... | {
"content_hash": "4b4f33a6b6087a537d006d52c7e45897",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 87,
"avg_line_length": 38.88513513513514,
"alnum_prop": 0.5456125108601216,
"repo_name": "Chandlercjy/OnePy",
"id": "2d982bf3a7f8379e6a06d656edf2a87cdf415acf",
"size": "57... |
from cgi import escape
def preformat(text):
return escape(str(text))
class TagWrapper(str):
tag = None
attributes = None
@classmethod
def _wrap(cls, text):
if cls.attributes:
attrib = ' ' + ' '.join(['{}="{}"'.format(key, value)
for key, v... | {
"content_hash": "cda41adf20810cd540aad623957bd218",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 79,
"avg_line_length": 21.042857142857144,
"alnum_prop": 0.539714867617108,
"repo_name": "jasonzou/MyPapers",
"id": "dbb875f39fa2c9e6c2d36f57325bd1caab009a33",
"size": "147... |
import sys
import getopt
import re as re_
etree_ = None
Verbose_import_ = False
( XMLParser_import_none, XMLParser_import_lxml,
XMLParser_import_elementtree
) = range(3)
XMLParser_import_library = None
try:
# lxml
from lxml import etree as etree_
XMLParser_import_library = XMLParser_import_lxml
... | {
"content_hash": "8d8c7a867bc42ec65b59b860d1ff0e2b",
"timestamp": "",
"source": "github",
"line_count": 734,
"max_line_length": 172,
"avg_line_length": 43.6158038147139,
"alnum_prop": 0.6260698444430561,
"repo_name": "botondus/generateds",
"id": "a4feb517fc8238d982bfb63046dbe7079eb0f988",
"size": "... |
from ._base import BaseEvent
from . import register_event
from ..schema import types
@register_event('channel_unarchive')
class ChannelUnarchive(BaseEvent):
"""
.. code-block:: json
:caption: Example json response
{
"type": "channel_unarchive",
"cha... | {
"content_hash": "4ea61aa028808aaa0f87d138e500d974",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 75,
"avg_line_length": 24.037037037037038,
"alnum_prop": 0.5408320493066255,
"repo_name": "huntcsg/slackly",
"id": "a9f1d8e7c044dd854071b31af55ab1f1b4e841ff",
"size": "649"... |
from setuptools import setup
setup(
name = 'tagm',
version = '0.2-dev',
maintainer = u'Martin Hult\xe9n-Ashauer',
maintainer_email = '[email protected]',
url = 'http://github.com/Nimdraug/tagm',
license = 'MIT',
description = 'A command and library for managing meta tags for arbitrary ... | {
"content_hash": "cbbd9a445394647eea60b2f2dc7c2d53",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 85,
"avg_line_length": 21.545454545454547,
"alnum_prop": 0.5590717299578059,
"repo_name": "Nimdraug/tagm",
"id": "6d66d25ce236d5eecf776211cf23a31f81d7e297",
"size": "497",
... |
import json
import logging
import requests
from datetime import datetime
from django.conf import settings
from optparse import make_option
from django.db import transaction, DEFAULT_DB_ALIAS
from django.core.management.base import BaseCommand
from requests.exceptions import SSLError, ConnectionError, RequestException
f... | {
"content_hash": "2d73397cf256e06ddceec988dae9e402",
"timestamp": "",
"source": "github",
"line_count": 263,
"max_line_length": 79,
"avg_line_length": 44.14448669201521,
"alnum_prop": 0.5063738156761413,
"repo_name": "chop-dbhi/varify-data-warehouse",
"id": "b89be1c345d6c30aa61826a7c65742a14df858b2",... |
"""Test processing of unrequested blocks.
Setup: two nodes, node0 + node1, not connected to each other. Node1 will have
nMinimumChainWork set to 0x10, so it won't process low-work unrequested blocks.
We have one P2PInterface connection to node0 called test_node, and one to node1
called min_work_node.
The test:
1. Ge... | {
"content_hash": "36551f99dcf277a075ff9c6a2e3ffbf1",
"timestamp": "",
"source": "github",
"line_count": 288,
"max_line_length": 113,
"avg_line_length": 45.017361111111114,
"alnum_prop": 0.6551484766679522,
"repo_name": "bitcoinknots/bitcoin",
"id": "759af1dce710d4a1550588fc9982266a893e5b84",
"size"... |
"""
A simple module to do repetitive tasks in the morning.
Targeted as updating git repos.
"""
__author__ = 'Matthias Bussonnier'
__email__ = '[email protected]'
__version__ = '0.1.5'
version = __version__
import sys
import os
import re
from os.path import expanduser
import configparser
import io
impor... | {
"content_hash": "126dd9a68b69413d28d01b38f624ec82",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 113,
"avg_line_length": 31.19858156028369,
"alnum_prop": 0.585360309161173,
"repo_name": "Carreau/morning",
"id": "d280cf0dc743ce35e623cff4e2abbbfcfe87d990",
"size": "4423... |
from numpy import full, nan
from scipy.stats import rankdata
from .check_nd_array_for_bad import check_nd_array_for_bad
def _normalize_nd_array(_nd_array, method, rank_method, raise_for_bad):
is_good = ~check_nd_array_for_bad(_nd_array, raise_for_bad=raise_for_bad)
nd_array_normalized = full(_nd_array.shap... | {
"content_hash": "c0dae7a8eea5423664bca09b2769dff5",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 86,
"avg_line_length": 25.17391304347826,
"alnum_prop": 0.5261945883707542,
"repo_name": "UCSD-CCAL/ccal",
"id": "d22b859cac1bd51d4959aafaa6c3f18c47698c25",
"size": "1737",... |
from django.utils.timezone import now
import factory
import factory.fuzzy
from . import models
class Sms(factory.django.DjangoModelFactory):
class Meta:
model = models.Sms
uuid = factory.Faker('uuid4')
source_address = factory.fuzzy.FuzzyText(length=15)
destination_address = factory.fuzzy.Fuz... | {
"content_hash": "117502225ae4507f539829a48f505f9d",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 60,
"avg_line_length": 25.34375,
"alnum_prop": 0.7114673242909988,
"repo_name": "telminov/sms-service",
"id": "3df3db03f997768fbcc211064ba378cb018a2b19",
"size": "827",
"... |
"""
breathe.apidoc
~~~~~~~~~~~~~~
Parses doxygen XML tree looking for C/C++ modules and creates ReST files
appropriately to create code documentation with Sphinx. It also creates a
modules index (See TYPEDICT below.).
This is derived from the "sphinx-autopackage" script, which is:
Copyrigh... | {
"content_hash": "fb596315a9a609f44f46a2052136352f",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 81,
"avg_line_length": 36,
"alnum_prop": 0.613997113997114,
"repo_name": "frontg8/frontg8lib",
"id": "c6866be51d19c7643d9fec091f72bfb03975811c",
"size": "5570",
"binary"... |
import fileinput
for line in fileinput.input():
splitLine = line.split()
a = splitLine[0]
b = splitLine[1]
c = int(a) - int(b)
print(abs(c))
| {
"content_hash": "ccc9f49e18e34036c9b8f46cd4020e0e",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 30,
"avg_line_length": 20.25,
"alnum_prop": 0.5925925925925926,
"repo_name": "NLSteveO/Kattis",
"id": "5077bdacd40de49bb75049ae02b5b2ec2604cec8",
"size": "162",
"binary": ... |
import os
from PyQt5.QtCore import pyqtProperty, pyqtSignal, pyqtSlot, QObject
from electrum_ltc.logging import get_logger
from electrum_ltc.storage import WalletStorage, StorageEncryptionVersion
from electrum_ltc.wallet_db import WalletDB
from electrum_ltc.bip32 import normalize_bip32_derivation, xpub_type
from elec... | {
"content_hash": "2dd1a01dd0492679ad97e0af0fa3a3f4",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 103,
"avg_line_length": 29.540697674418606,
"alnum_prop": 0.6327494587679591,
"repo_name": "pooler/electrum-ltc",
"id": "491c3d635636bc1ed4811fc7c7793882dc082792",
"size":... |
__author__ = 'thor'
# import ut
import ut.util.ulist
import ut.daf.ch
import ut.daf.get
import pandas as pd
def group_and_count(df, count_col=None, frequency=False):
if isinstance(df, pd.Series):
t = pd.DataFrame()
t[df.name] = df
df = t
del t
count_col = count_col or ut.daf.g... | {
"content_hash": "e68292c95eed87f78015e80dca98c301",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 113,
"avg_line_length": 38.60655737704918,
"alnum_prop": 0.6326963906581741,
"repo_name": "thorwhalen/ut",
"id": "5825e32854abd609e56b2462e80532ba4bd6aa73",
"size": "2355",... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf import settings
from core.views import HomePageView
urlpatterns = patterns('',
url(r'^$', HomePageView.as_view(), name='home'),
url(r'^admin/', include(admin.site.urls)),
url(r'^accounts/', include('all... | {
"content_hash": "fe3ab3d1bb14603efc3844056a8197d5",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 64,
"avg_line_length": 30.7,
"alnum_prop": 0.6628664495114006,
"repo_name": "moshthepitt/Kenyan-News",
"id": "ed17821c974185734a31f3538fa7a4968b23444c",
"size": "614",
"b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.