text stringlengths 4 1.02M | meta dict |
|---|---|
"""Implement Prometheus client."""
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer.
# Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2018 The Contributors
#
# Licensed under the Apac... | {
"content_hash": "62b1130ed819311b78820d558f367abe",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 94,
"avg_line_length": 39.09090909090909,
"alnum_prop": 0.6465116279069767,
"repo_name": "trentindav/faucet",
"id": "247dc01a245e96a2197534b1a9b8c86b9f6a42e5",
"size": "344... |
from collections import defaultdict
from functools import wraps
import copy
EPSILON = '&'
class SymbolNotInAlphabetError(Exception):
def __init__(self, symbol, alphabet):
message = "The symbol %s doesn't belong to the alphabet %s" % \
(symbol, alphabet)
Exception.__init__(self, messag... | {
"content_hash": "bd2257c0290233ca09abf1c9fff3ddea",
"timestamp": "",
"source": "github",
"line_count": 266,
"max_line_length": 100,
"avg_line_length": 37.537593984962406,
"alnum_prop": 0.5696544817225839,
"repo_name": "miguelfrde/openautomata",
"id": "e735b72e76f5793be906467b7b116f14d8479c5c",
"si... |
"""
Tests For Scheduler Host Filters.
"""
import httplib
import stubout
from nova import context
from nova import db
from nova.openstack.common import cfg
from nova.openstack.common import jsonutils
from nova.scheduler import filters
from nova.scheduler.filters import extra_specs_ops
from nova.scheduler.filters.trust... | {
"content_hash": "4c1baf2d53e2d61f3fceb37873e16c7e",
"timestamp": "",
"source": "github",
"line_count": 1305,
"max_line_length": 79,
"avg_line_length": 42.019157088122604,
"alnum_prop": 0.5413695632351601,
"repo_name": "houshengbo/nova_vmware_compute_driver",
"id": "f291e81126c8c86c2505991ed4a04439e4... |
import argparse
import os
import re
import sys
from em import BANGPATH_OPT
from em import Hook
from ros_buildfarm.argument import add_argument_arch
from ros_buildfarm.argument import add_argument_build_name
from ros_buildfarm.argument import add_argument_build_tool
from ros_buildfarm.argument import add_argument_build... | {
"content_hash": "ccbfb29ee58c7facc3232c50eafebb50",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 97,
"avg_line_length": 43.03896103896104,
"alnum_prop": 0.622057936028968,
"repo_name": "ros-infrastructure/ros_buildfarm",
"id": "5e3bef3c15fb63536e1a53b2c031da5de4e8b4d0",... |
"""
flask_wtf
~~~~~~~~~
Flask-WTF extension
:copyright: (c) 2010 by Dan Jacob.
:copyright: (c) 2013 - 2014 by Hsiaoming Yang.
:license: BSD, see LICENSE for more details.
"""
# flake8: noqa
from __future__ import absolute_import
from .form import Form
from .csrf import CsrfProtect
from .recap... | {
"content_hash": "e43555cf2be408cc94c46b95c818868f",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 50,
"avg_line_length": 19.833333333333332,
"alnum_prop": 0.6386554621848739,
"repo_name": "codeforamerica/skillcamp",
"id": "30a8a1ccaa0259666d6e1a473a9cc19bff1b265e",
"siz... |
import pytest
from aioconsul import NotFound
from collections.abc import Sequence
@pytest.mark.asyncio
async def test_endpoint(client):
assert repr(client.kv) == "<KVEndpoint(%r)>" % str(client.address)
@pytest.mark.asyncio
async def test_create_only(client):
await cas(client, "foo", b"bar", 0, True)
aw... | {
"content_hash": "e46783158a11dc46107a03ca4e5a7459",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 70,
"avg_line_length": 26.32894736842105,
"alnum_prop": 0.6541729135432284,
"repo_name": "johnnoone/aioconsul",
"id": "5804268cf72c29e0eb1ef08a7582768c093bd738",
"size": "2... |
import pexpect
import time
import unittest
import node
LEADER = 1
ROUTER1 = 2
REED0 = 3
REED1 = 4
ROUTER2 = 5
class Cert_5_1_09_REEDAttachConnectivity(unittest.TestCase):
def setUp(self):
self.nodes = {}
for i in range(1,6):
self.nodes[i] = node.Node(i)
self.nodes[LEADER].set... | {
"content_hash": "4905c0e3bd716235ed3c3df1d5aa41ed",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 74,
"avg_line_length": 34.87951807228916,
"alnum_prop": 0.6352331606217616,
"repo_name": "JiahuiZHONG/Internship_Thread",
"id": "4616bc0240b2567794a02a3b3704095cc53aef6b",
... |
from django.urls import path, re_path
from wagtail.documents.views import serve
urlpatterns = [
re_path(r"^(\d+)/(.*)$", serve.serve, name="wagtaildocs_serve"),
path(
"authenticate_with_password/<int:restriction_id>/",
serve.authenticate_with_password,
name="wagtaildocs_authenticate_wi... | {
"content_hash": "d5458391ea1369090a9a3f904fc83232",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 68,
"avg_line_length": 28.583333333333332,
"alnum_prop": 0.6618075801749271,
"repo_name": "zerolab/wagtail",
"id": "da8bc9bf687a4d7b8f2a845b94c2957d5e8b9383",
"size": "343"... |
from pyDrivers.ada_lcd import *
from subprocess import *
from time import sleep, strftime
from datetime import datetime
# Create an insatnce of the LCD display
lcd = ADA_LCD()
# This complicated command will do a few things:
# 1) Get the network information for the network interface eth0
# 2) Find the lines where ine... | {
"content_hash": "3ba902a5736e1d2957f7acd7dc645101",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 86,
"avg_line_length": 36.3235294117647,
"alnum_prop": 0.6963562753036437,
"repo_name": "steelee/minnow_max_maker",
"id": "0f810e108b1c8f669c57fad9adf552f7b6405ffa",
"size"... |
"""Methods for disfluency and utterance segmentation from final and
increco-style inputs.
"""
from __future__ import division
import re
import numpy
from copy import deepcopy
from collections import defaultdict
import pandas as pd
# requires mumodo from https://github.com/dsg-bielefeld/mumodo
# from mumodo.analysis im... | {
"content_hash": "9fb3ec53679a766d001a3615fc26da37",
"timestamp": "",
"source": "github",
"line_count": 1334,
"max_line_length": 91,
"avg_line_length": 44.181409295352324,
"alnum_prop": 0.475397875733822,
"repo_name": "dsg-bielefeld/deep_disfluency",
"id": "4e0ec2e1598d5dc6bdf5eb51c37598d6ab17eb60",
... |
from twisted.trial.unittest import TestCase
from twisted.internet import defer
from zope.interface.verify import verifyObject
from mock import MagicMock
from norm.interface import IAsyncCursor
from norm.common import BlockingCursor
from norm.postgres import PostgresCursorWrapper
from norm.test.util import postgresCon... | {
"content_hash": "b17bd52e99ba6937305c38ac82afccad",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 95,
"avg_line_length": 25.34285714285714,
"alnum_prop": 0.6837655016910936,
"repo_name": "iffy/norm",
"id": "64910e7a1e333cbe836e3b0cfa36bb9e8b36f27f",
"size": "1832",
"b... |
''' High-level HTTP communication interface. '''
import re
import codecs
import httplib
from spidy.common.errors import WebException
WEB_URL_PATTERN = re.compile('''([a-z]{3,9}:\/\/|[a-z]{3,9}:\/\/www\.|www\.)([\w.-]+)((?:\/[\w\/:@\-_~.%!$&'()*+=,;]*)?(?:\?[\w\-\+=&;%@._]*)?(?:#[\w\/:?@\-_~.%!$&'()*+=,... | {
"content_hash": "9d94415fef251ceedaea9086b2f91f96",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 184,
"avg_line_length": 36.07058823529412,
"alnum_prop": 0.4680365296803653,
"repo_name": "AlexPereverzyev/spidy",
"id": "c3e5670d43d5a64be540915a719b766b25022128",
"size":... |
from __future__ import (absolute_import, division, print_function)
from owslib.crs import Crs
try:
from urllib import urlencode
except ImportError:
from urllib.parse import urlencode
import logging
from owslib.util import log
from owslib.feature.schema import get_schema
class WebFeatureService_(object):
... | {
"content_hash": "4b091e448112d0f999c87fc6b6a9586a",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 137,
"avg_line_length": 38.646341463414636,
"alnum_prop": 0.5675291890186178,
"repo_name": "QuLogic/OWSLib",
"id": "ecb20e41a2db7a2464b9abc8da511222dad3db17",
"size": "658... |
from netforce.model import Model, fields, get_model
class PaymentLine(Model):
_name = "account.payment.line"
_string = "Payment Line"
_fields = {
"payment_id": fields.Many2One("account.payment", "Payment", required=True, on_delete="cascade"),
"type": fields.Selection([["direct", "Direct Pa... | {
"content_hash": "564840e8372ba81f5cfb327018b14aa7",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 232,
"avg_line_length": 46.184615384615384,
"alnum_prop": 0.5539640239840107,
"repo_name": "nfco/netforce",
"id": "2fef87eace725f8a4cc1f7406ce2b38339e37602",
"size": "4107"... |
from __future__ import unicode_literals
import ckeditor.fields
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
replaces = [('meas_models', '0001_initial'), ('meas_models', '0002_auto_20161123_2101'), ('meas_models', '0003_auto_20161124_1428'), ('m... | {
"content_hash": "3f61040d278e3c9968c02a3ce70c10b5",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 687,
"avg_line_length": 64.33532934131736,
"alnum_prop": 0.5764147431124349,
"repo_name": "deka108/mathqa-server",
"id": "9b5949c2248608727616fddd644ecff1c266ed39",
"size"... |
"""
next dashboard.py
author: Lalit Jain, lalitkumarj@gmail.com
last updated: 9/16/15
Flask controller for dashboards.
"""
import os
import json
import yaml
from flask import Blueprint, render_template, url_for, request, jsonify
from jinja2 import Environment, PackageLoader, ChoiceLoader
import requests
import next.b... | {
"content_hash": "e8a72878a263eb5941dd723e96849aea",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 121,
"avg_line_length": 39.44805194805195,
"alnum_prop": 0.5809053497942387,
"repo_name": "lalitkumarj/NEXT",
"id": "970aa0d0b40277bf1675ec46e167c9777d1dea48",
"size": "60... |
import logging
import operator
from datetime import datetime
from django.conf import settings
from django.db.backends.ddl_references import (
Columns,
Expressions,
ForeignKeyName,
IndexName,
Statement,
Table,
)
from django.db.backends.utils import names_digest, split_identifier
from django.db.m... | {
"content_hash": "348e0c59280a4e1a1a7079d55d7cbb7d",
"timestamp": "",
"source": "github",
"line_count": 1754,
"max_line_length": 88,
"avg_line_length": 39.99144811858609,
"alnum_prop": 0.5533252548292822,
"repo_name": "shaib/django",
"id": "09785e85862b54b34293eb6dd027607aea8bdc5d",
"size": "70145"... |
"""This code example updates a user by adding " Sr." to the end of their name.
To determine which users exist, run get_all_users.py."""
__author__ = ('Nicholas Chen',
'Joseph DiLallo')
# Import appropriate modules from the client library.
from googleads import dfp
USER_ID = 'INSERT_USER_ID_TO_UPDATE_H... | {
"content_hash": "0019b0de1b69cd3e282594a1f693b61b",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 78,
"avg_line_length": 26.36,
"alnum_prop": 0.6305007587253414,
"repo_name": "cctaylor/googleads-python-lib",
"id": "8476420c04bb71d9a9fdf4f636f237cf1627d924",
"size": "193... |
"""Tests for the XLSX output module."""
from __future__ import unicode_literals
import os
import unittest
import zipfile
from defusedxml import ElementTree
from plaso.formatters import manager as formatters_manager
from plaso.lib import definitions
from plaso.output import xlsx
from tests import test_lib as shared... | {
"content_hash": "311a7d7cc0d9a5e76f11450ff0b5abdf",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 80,
"avg_line_length": 32.54651162790697,
"alnum_prop": 0.6504108610217935,
"repo_name": "rgayon/plaso",
"id": "59e32c68abb5744ec6d79b5f9cbdba982ee199cb",
"size": "5645",
... |
from __future__ import print_function
import copy
import os
import sys
import numpy as np
this_directory = os.path.dirname(__file__)
sys.path.append(this_directory)
from evaluation_util import get_dataset_getters, BaseEvaluatorTest
from autosklearn.evaluation import NestedCVEvaluator
N_TEST_RUNS = 10
class Dummy... | {
"content_hash": "c1ff1a9b637af54799177480925d607d",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 78,
"avg_line_length": 31.652173913043477,
"alnum_prop": 0.5480769230769231,
"repo_name": "hmendozap/auto-sklearn",
"id": "1c43e5c04b506a59cbecd506609583593df110ee",
"size"... |
"""
A module for dealing with the polylines used throughout matplotlib.
The primary class for polyline handling in matplotlib is :class:`Path`.
Almost all vector drawing makes use of Paths somewhere in the drawing
pipeline.
Whilst a :class:`Path` instance itself cannot be drawn, there exists
:class:`~matplotlib.artis... | {
"content_hash": "9e692b2995850d53901b2d0885296284",
"timestamp": "",
"source": "github",
"line_count": 1034,
"max_line_length": 79,
"avg_line_length": 36.004835589941976,
"alnum_prop": 0.5644255822074189,
"repo_name": "jeffery-do/Vizdoombot",
"id": "67e340be2b5f8fc7b8a39cb112a200594d30e369",
"size... |
import json
dictVal = { "father": "leon",
"daughters": [ 'cindy', 'laura']
}
print json.dumps(dictVal)
jsonStr = '{"mather": "grace"}'
dictVal2 = json.loads(jsonStr)
print dictVal2[u"mather"]
import decimal
decimal.getcontext().prec = 2
print decimal.Decimal('0.243352')
| {
"content_hash": "6aadc3cccd7ce6ab1c441e3bb744694f",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 44,
"avg_line_length": 19.8,
"alnum_prop": 0.6397306397306397,
"repo_name": "leon-github/cloudlight",
"id": "9a755ed4ff2b44a84eb9823440a4bd66dff604be",
"size": "316",
"bi... |
import cv2
from palette.cv.image import rgb2bgr
def saveVideo(file_path, images, fps=30, size=None):
if size is None:
h, w = images[0].shape[:2]
size = (w, h)
print size
fourcc = cv2.cv.CV_FOURCC('W', 'M', 'V', '2')
writer = cv2.VideoWriter(file_path, fourcc, fps, size, True)
... | {
"content_hash": "0c06a69d75d4b9de9ed8afbcec2e8bb6",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 64,
"avg_line_length": 22.105263157894736,
"alnum_prop": 0.5880952380952381,
"repo_name": "tody411/PaletteSelection",
"id": "150acfb582790162f1a246da0eeba5b5a06f3c62",
"siz... |
default_app_config = 'readthedocs.projects.apps.ProjectsConfig'
| {
"content_hash": "de7941896aaff61d7109382ad210af77",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 63,
"avg_line_length": 64,
"alnum_prop": 0.828125,
"repo_name": "rtfd/readthedocs.org",
"id": "186dc5eb84147255e5245eb6bf1d0280da5cdb61",
"size": "88",
"binary": false,
... |
import boto
import inspect
import os
import pytest
from boto.s3 import connection
from s3_integration_help import (
FreshBucket,
no_real_s3_credentials,
)
from wal_e.blobstore.s3 import Credentials
from wal_e.blobstore.s3 import calling_format
from wal_e.blobstore.s3.calling_format import (
_is_mostly_subd... | {
"content_hash": "116e850270a06741817dd325ed0c93af",
"timestamp": "",
"source": "github",
"line_count": 290,
"max_line_length": 78,
"avg_line_length": 32.34137931034483,
"alnum_prop": 0.6423925791662224,
"repo_name": "modulexcite/wal-e",
"id": "be31e98f4178966e22039879390e1fb2340204f7",
"size": "93... |
from django.test import TestCase
from django.utils.timezone import now
from mock import Mock
from .models import CommitAuthor, Commit
from projects.models import Project
class CommitAuthorModelTest(TestCase):
def test_update_from_commit(self):
author = CommitAuthor(author_id=99)
self.assertFals... | {
"content_hash": "f2cd5ab8e86956717cd8563e632fa8da",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 71,
"avg_line_length": 35.675,
"alnum_prop": 0.6608269096005606,
"repo_name": "dmrz/gitality",
"id": "ecd7a4b05d22d58874a94e118b0bf9506796bd7e",
"size": "1427",
"binary":... |
"""Create / interact with Google Cloud Storage buckets."""
import base64
import copy
import datetime
import json
import google.auth.credentials
import six
from google.cloud._helpers import _datetime_to_rfc3339
from google.cloud._helpers import _NOW
from google.cloud._helpers import _rfc3339_to_datetime
from google.c... | {
"content_hash": "5adf883e02ff5a091e3c686bf47263a6",
"timestamp": "",
"source": "github",
"line_count": 909,
"max_line_length": 81,
"avg_line_length": 36.993399339933994,
"alnum_prop": 0.5961578493472507,
"repo_name": "daspecster/google-cloud-python",
"id": "daf3d9fda8a26a3343906075a1831ea5be110474",... |
from django.core.management.base import NoArgsCommand
from django.core.management import call_command
from django.db import connection
from django.conf import settings
import sys, os, subprocess, shutil
class Command(NoArgsCommand):
def handle_noargs(self, **options):
self.dropdb()
self.createdb... | {
"content_hash": "1dba9bde3684b3eed7466a9f7272d29d",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 84,
"avg_line_length": 30.40506329113924,
"alnum_prop": 0.4866777685262281,
"repo_name": "scottcrespo/django_nukedb",
"id": "c467998dbcf12bd9a29a8da49602729b0585de52",
"siz... |
from gtk.keysyms import Escape
from scribes_helpers import weak_connect
from ..signals import Signals
class Window(object):
def __init__(self, manager):
self.manager = manager
self.window = manager.gui.get_object("Window")
self.window.set_transient_for(manager.editor.window)
... | {
"content_hash": "f6c2113a39737cdc4b3206770daaf379",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 89,
"avg_line_length": 26.94871794871795,
"alnum_prop": 0.6251189343482397,
"repo_name": "baverman/scribes-goodies",
"id": "9d476cedcef11bb6d645b4a576b1b73f3b3bb0e0",
"size... |
import json
from os.path import expanduser
from string import Template
vars_config_file = 'vars.json'
HOME_DIR = expanduser("~")
irssi_config_file = '{}/.irssi/config'.format(HOME_DIR)
irssi_template_file = "config"
with open(vars_config_file) as data_file:
data = json.load(data_file)
with open(irssi_template_file... | {
"content_hash": "b865f78c995129b8ace318dbd9d5856e",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 55,
"avg_line_length": 22.31578947368421,
"alnum_prop": 0.6757075471698113,
"repo_name": "NathanMarsh/dotfiles",
"id": "059b399410f931db27e0534098fd23ab2303f212",
"size": "... |
from __future__ import unicode_literals
import json
from typing import List, Dict, Optional, Tuple, Union
from accounts.models import Group
from common.methods import set_progress
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import Resource as GCPResource
from googleapiclient.disco... | {
"content_hash": "0bc398b9d943b7fd2675331d9f16b241",
"timestamp": "",
"source": "github",
"line_count": 241,
"max_line_length": 95,
"avg_line_length": 34.22406639004149,
"alnum_prop": 0.6327594568380214,
"repo_name": "CloudBoltSoftware/cloudbolt-forge",
"id": "9296c5e5190ee7b11d3068e50d35ffcaf6e69f5e... |
from __future__ import absolute_import
# ============= standard library imports ========================
from datetime import datetime
from traits.trait_types import Bool, Instance, Int
from traits.traits import Color
# ============= local library imports ==========================
from pychron.loggable import Logg... | {
"content_hash": "e73e618e4d22dc7ff740f2e8e112464d",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 85,
"avg_line_length": 31.990909090909092,
"alnum_prop": 0.5711849957374254,
"repo_name": "USGSDenverPychron/pychron",
"id": "e9ca6211cc9cd039dade4acaee7599b461f8da60",
"s... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('AT', '0009_remove_atcontext_current_step'),
]
operations = [
migrations.AddField(
model_name='atcontext',
name='current_step',
field=models.TextField(def... | {
"content_hash": "c2628e035692b4a8a4fadf41e3d13b16",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 53,
"avg_line_length": 21.6875,
"alnum_prop": 0.5734870317002881,
"repo_name": "seakers/daphne_brain",
"id": "3d7b62ea3d605fb586c69b3c5b2653ecbf48a6db",
"size": "396",
"b... |
"""Test the aiohttp client helper."""
import asyncio
from unittest.mock import Mock, patch
import aiohttp
import pytest
from homeassistant.components.mjpeg.const import (
CONF_MJPEG_URL,
CONF_STILL_IMAGE_URL,
DOMAIN as MJPEG_DOMAIN,
)
from homeassistant.const import (
CONF_AUTHENTICATION,
CONF_PAS... | {
"content_hash": "e436a1db4f9747566d4d57d3a9feb664",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 90,
"avg_line_length": 35.584070796460175,
"alnum_prop": 0.6735886595374285,
"repo_name": "toddeye/home-assistant",
"id": "599b2c6984e5c7a95c6c0122da98661f340c5398",
"size... |
"""Fake LDAP server for test harness.
This class does very little error checking, and knows nothing about ldap
class definitions. It implements the minimum emulation of the python ldap
library to work with nova.
"""
import fnmatch
import json
class Store(object):
def __init__(self):
if hasattr(self.__... | {
"content_hash": "b2152031cdd098cc7d08d49116c6a72e",
"timestamp": "",
"source": "github",
"line_count": 271,
"max_line_length": 77,
"avg_line_length": 28.638376383763838,
"alnum_prop": 0.5728643216080402,
"repo_name": "anotherjesse/nova",
"id": "4466051f0e6b0f1203502c8a8a5224818aa696b0",
"size": "8... |
import time
import bs4 as bs
import urllib.request
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import NoSuchElementException
sauce = urllib.request.urlopen('https://sis.rpi.edu/reg/zs201701.htm').read() #go to sis website with all courses
soup = bs.Be... | {
"content_hash": "07ff5440c0257c48317a37f3bed0de5e",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 114,
"avg_line_length": 38.73076923076923,
"alnum_prop": 0.6683217477656405,
"repo_name": "ericemmanuel29/texchange",
"id": "c7b2241c90ce285094b1c16f6bf00fe8c6e6a3d0",
"siz... |
import collections
import numpy as np
from threeML.classicMLE.joint_likelihood_set import JointLikelihoodSet
from threeML.data_list import DataList
from astromodels import clone_model
class GoodnessOfFit(object):
def __init__(self, joint_likelihood_instance, like_data_frame=None):
self._jl_instance = j... | {
"content_hash": "7a987336b27f15d5621907d5839db0b0",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 121,
"avg_line_length": 35.265306122448976,
"alnum_prop": 0.6600115740740741,
"repo_name": "volodymyrss/3ML",
"id": "9e732c2464a4ec06ea1cb162a2104d5782a9d3df",
"size": "345... |
from .estestcase import ESTestCase
class UpdateTestCase(ESTestCase):
def setUp(self):
super(UpdateTestCase, self).setUp()
self.conn.create_index(self.index_name)
self.conn.index({"counter": 0}, self.index_name, self.document_type, 1)
def testPartialUpdateWithoutParams(self):
se... | {
"content_hash": "420db36913724209cf274cdd0f25cdd9",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 126,
"avg_line_length": 49.31818181818182,
"alnum_prop": 0.6755760368663595,
"repo_name": "rookdev/pyes",
"id": "fbc2735ed4199cc1d75fdf1a2fe197e0e7bb5782",
"size": "1109",
... |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("attribute", "0023_extend_reference_attr_with_variant"),
("attribute", "0023_lstrip_slash_from_value_file_url"),
]
operations = []
| {
"content_hash": "292a9ac7c14a5aed011c1e99bafbe274",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 65,
"avg_line_length": 23,
"alnum_prop": 0.6561264822134387,
"repo_name": "mociepka/saleor",
"id": "d709168305a0291867249553543e19aa6dcc7faf",
"size": "303",
"binary": fa... |
from org.transcrypt.stubs.browser import __pragma__
class UppercaserMeta (type):
def __new__ (meta, name, bases, attribs):
__pragma__ ('jsiter') # Translate for ... in directly to JavaScript for ... in ... and translate {} to bare {} rather than to dict {}
# U... | {
"content_hash": "24e32fa46fa8f155c4cd98e55752a750",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 175,
"avg_line_length": 33.32203389830509,
"alnum_prop": 0.572736520854527,
"repo_name": "QQuick/Transcrypt",
"id": "0ff07d2a16e92fe8480bb09f5fce5b426d9c4c48",
"size": "196... |
<<<<<<< HEAD
<<<<<<< HEAD
import unittest.test
from test import support
def test_main():
# used by regrtest
support.run_unittest(unittest.test.suite())
support.reap_children()
def load_tests(*_):
# used by unittest
return unittest.test.suite()
if __name__ == "__main__":
test_main()
=======
... | {
"content_hash": "ef59029aeb493e3a6db434779d239ed4",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 48,
"avg_line_length": 18.48148148148148,
"alnum_prop": 0.6442885771543087,
"repo_name": "ArcherSys/ArcherSys",
"id": "614d0acdb923663a9b378ce048b10b1efb8b4e77",
"size": "9... |
"""
=======================
MNIST dataset benchmark
=======================
Benchmark on the MNIST dataset. The dataset comprises 70,000 samples
and 784 features. Here, we consider the task of predicting
10 classes - digits from 0 to 9 from their raw images. By contrast to the
covertype dataset, the feature space is... | {
"content_hash": "120bace315dd48d07f6404407bbd59a9",
"timestamp": "",
"source": "github",
"line_count": 233,
"max_line_length": 85,
"avg_line_length": 30.180257510729614,
"alnum_prop": 0.5486348122866894,
"repo_name": "sergeyf/scikit-learn",
"id": "84111d0a37969903d89dd2be295ca5b2d85c0c4c",
"size":... |
"""
assembles raw cuts into final, titles, tweaks audio, encodes to format for upload.
"""
import datetime
import os
from pprint import pprint
import sys
import subprocess
import xml.etree.ElementTree
from textwrap import wrap
import pycaption
from mk_mlt import mk_mlt
from process import process
from django.db imp... | {
"content_hash": "85d8ba8764e53e9bd2db673f1076768b",
"timestamp": "",
"source": "github",
"line_count": 876,
"max_line_length": 229,
"avg_line_length": 36.05251141552512,
"alnum_prop": 0.48549806852004307,
"repo_name": "CarlFK/veyepar",
"id": "de214399648e1d64b8b28e81b6432a312e042e91",
"size": "316... |
from __future__ import absolute_import, division, print_function
import tensorflow as tf
from tensorflow.python.ops import standard_ops
from polyaxon_lib.models.rl.base import BaseQModel
class DDQNModel(BaseQModel):
"""Implements a double deep Q model.
Args:
mode: `str`, Specifies if this training,... | {
"content_hash": "2609a2be7960e8c7679a85f809bddd56",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 100,
"avg_line_length": 50.208955223880594,
"alnum_prop": 0.6272294887039239,
"repo_name": "polyaxon/polyaxon-api",
"id": "df534c0109b332a9fd46abad97cc4057955c33f7",
"size"... |
"""
calculatepi.py
Author: Avery Wallis
This was an experiment for Math Modeling and Fractions
"""
import math
lists = []
a = 0
b = 0
for x in range(0,2):
a += 1
b = 1
c = a/b
lists.append(c)
for x in range(0,2):
a = a
b += 1
c = a/b
lists.append(c)
print(lists)
... | {
"content_hash": "5392baf80d2879c50b04f29ab12055ae",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 77,
"avg_line_length": 17.970588235294116,
"alnum_prop": 0.5793780687397708,
"repo_name": "averywallis/Fractionspatterns",
"id": "26446973a3ff7788ff7f41e5dac87afe7cc92cb8",
... |
from .base import (
Extender,
ExtenderError,
DoesNotExistError,
)
| {
"content_hash": "07fb11a9c2cfad32c20dff8e11e62a11",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 22,
"avg_line_length": 13.166666666666666,
"alnum_prop": 0.6582278481012658,
"repo_name": "jayclassless/tidypy",
"id": "54d3d2afca26abb315ea753b34cbf421e00cb339",
"size": "8... |
"""Tests for ceilometer/storage/impl_mongodb.py
.. note::
In order to run the tests against another MongoDB server set the
environment variable CEILOMETER_TEST_MONGODB_URL to point to a MongoDB
server before running the tests.
"""
import copy
import datetime
from oslo.config import cfg
from ceilometer.publis... | {
"content_hash": "a8d06cf03f594bc16fb2ea3c10db0ef9",
"timestamp": "",
"source": "github",
"line_count": 281,
"max_line_length": 78,
"avg_line_length": 40.95373665480427,
"alnum_prop": 0.49887035106013206,
"repo_name": "JioCloud/ceilometer",
"id": "7c440b34460bb7936c6a41ae30480fe3285da388",
"size": ... |
import datetime
import functools
import inspect
import microversion_parse
import pecan
from pecan import rest
from webob import exc
import wsme
from wsme import types as wtypes
API_V2 = 'v2'
# name of attribute to keep version method information
class APIBase(wtypes.Base):
created_at = wsme.wsattr(datetime.dat... | {
"content_hash": "0e9a508c4f12c44b8193513ef52c20ba",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 77,
"avg_line_length": 32.263565891472865,
"alnum_prop": 0.6299855838539163,
"repo_name": "openstack/nomad",
"id": "b62077d135fc8164b46fb5a640f654e52e52a9fe",
"size": "480... |
from djangoappengine.settings_base import *
import os
# Activate django-dbindexer for the default database
DATABASES['native'] = DATABASES['default']
DATABASES['default'] = {'ENGINE': 'dbindexer', 'TARGET': 'native'}
AUTOLOAD_SITECONF = 'indexes'
SECRET_KEY = '=r-$b*8hglm+858&9t043hlm6-&6-3d3vfc4((7yd0dbrakhvi'
SIT... | {
"content_hash": "3ffd307b8bcc83b48b79aaf9f2c8e138",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 83,
"avg_line_length": 32.8235294117647,
"alnum_prop": 0.724910394265233,
"repo_name": "burdell/CS4464-Final-Project",
"id": "e553c41f5dbed6f452d447c5782c294fa04916fd",
"si... |
from msrest.serialization import Model
class RunCommandDocumentBase(Model):
"""Describes the properties of a Run Command metadata.
:param schema: The VM run command schema.
:type schema: str
:param id: The VM run command id.
:type id: str
:param os_type: The Operating System type. Possible va... | {
"content_hash": "931c8ebe8a028a0d383070818ed5c597",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 74,
"avg_line_length": 32.95238095238095,
"alnum_prop": 0.5874277456647399,
"repo_name": "v-iam/azure-sdk-for-python",
"id": "9cd04be2b33ca35b625c6b30337ee8ffcba1b841",
"si... |
import sys
import ddt
import mock
from oslo_log import log
from oslo_log import versionutils
from manila.cmd import all as manila_all
from manila import service
from manila import test
from manila import utils
from manila import version
CONF = manila_all.CONF
@ddt.ddt
class ManilaCmdAllTestCase(test.TestCase):
... | {
"content_hash": "df4c63fb617b555a6d993612219b072a",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 78,
"avg_line_length": 33.84285714285714,
"alnum_prop": 0.6669480793583791,
"repo_name": "NetApp/manila",
"id": "3196f6ad072c7e6e77fa31b1225bb34af81fa1f5",
"size": "2966",
... |
from .rman_sg_node import RmanSgNode
class RmanSgRunProgram(RmanSgNode):
def __init__(self, rman_scene, sg_node, db_name):
super().__init__(rman_scene, sg_node, db_name)
| {
"content_hash": "39a5c8b725d09d953fa8b2156dce5d47",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 54,
"avg_line_length": 30.666666666666668,
"alnum_prop": 0.6684782608695652,
"repo_name": "prman-pixar/RenderManForBlender",
"id": "cc23370c300a78027b73dbf74dbdd0a9c2479848",
... |
from collections import Counter
from kademlia.log import Logger
from kademlia.utils import deferredDict
from kademlia.node import Node, NodeHeap
class SpiderCrawl(object):
"""
Crawl the network and look for given 160-bit keys.
"""
def __init__(self, protocol, node, peers, ksize, alpha):
"""
... | {
"content_hash": "7310d4de4562763b3430831ed512556d",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 112,
"avg_line_length": 34.717514124293785,
"alnum_prop": 0.5938161106590725,
"repo_name": "CSNoyes/kademlia",
"id": "0206e89243a7dda133d094757d37447d56fd9043",
"size": "6... |
from vtk import *
import os.path
def setup_view(link, file, domain1, domain2, hue_range):
reader = vtkDelimitedTextReader()
reader.SetHaveHeaders(True)
reader.SetFileName(file)
ttg = vtkTableToGraph()
ttg.SetInputConnection(0, reader.GetOutputPort())
ttg.AddLinkVertex(domain1, domain1, False)
... | {
"content_hash": "654d0106a19c8077e4102d69a927f630",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 70,
"avg_line_length": 30.231884057971016,
"alnum_prop": 0.6951102588686481,
"repo_name": "timkrentz/SunTracker",
"id": "e6c8dc6dc18a41062badc1b46e777251b2b9b9e3",
"size": ... |
import json
import random
from functools import partial
from pydoc import locate
from smartmin.models import SmartModel
from temba_client.v2 import TembaClient
from timezone_field import TimeZoneField
from django.conf import settings
from django.contrib.auth.models import Group, User
from django.db import models
from... | {
"content_hash": "564478e7963ed5f4553d90a93d65a8bd",
"timestamp": "",
"source": "github",
"line_count": 418,
"max_line_length": 116,
"avg_line_length": 29.45693779904306,
"alnum_prop": 0.6153658734670673,
"repo_name": "rapidpro/dash",
"id": "f85cdada5e43b32951ef65edd866f90cf2581cda",
"size": "12313... |
from distutils.core import setup
setup(
name='easygui',
version='0.96',
py_modules=['easygui'],
)
| {
"content_hash": "7ad8bda7f33cb61d75ff3bc4102de37e",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 32,
"avg_line_length": 19,
"alnum_prop": 0.6140350877192983,
"repo_name": "TxDOT/python",
"id": "48969078bb8079eaa8a147a1996a8683ae0f408e",
"size": "114",
"binary": false,... |
import ConfigParser
import os
import uuid
from robot.libraries.BuiltIn import BuiltIn
from robotremoteserver import RobotRemoteServer
from robot.libraries.Remote import Remote
from robot.api import logger
import time
class _PabotLib(object):
def __init__(self, resourcefile=None):
self._locks = {}
... | {
"content_hash": "b53c332c3754f949090736a7e3942307",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 124,
"avg_line_length": 38.4264705882353,
"alnum_prop": 0.5841306289067483,
"repo_name": "hirsivaja/pabot",
"id": "678466e55ae038c03f554a6b5a983206542136fa",
"size": "8438... |
class Player:
"""
Represents an agent in the game of War. Remembers hand and name.
"""
def __init__(self, name, hand=None):
self.name = name
if hand:
self.hand = hand
else:
self.hand = []
def take_card(self, card):
"""
Accept a card w... | {
"content_hash": "a1f61ddfad06fd46c82b2b8b0ff02a76",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 72,
"avg_line_length": 22.57894736842105,
"alnum_prop": 0.5256410256410257,
"repo_name": "emilyst/war",
"id": "f9df8f7ec8eb8e2b1f4d3a79fa83216f37e89dbf",
"size": "858",
"... |
from __future__ import print_function
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.node import RemoteController
from mininet.util import dumpNodeConnections
from mininet.log import setLogLevel
from time import sleep
# Enclosing folder for this file, and sdns-server.py/sdns-proxy.py
PROJ... | {
"content_hash": "b38a977e1094e0b5b4577aca11846ad5",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 120,
"avg_line_length": 32.72631578947368,
"alnum_prop": 0.6529430685107752,
"repo_name": "bduddie/cs538-project",
"id": "cf93bd298c15dfbb985bbd31576556647125c1ca",
"size":... |
from setuptools import setup, find_packages
PACKAGE = "django-undodelete"
NAME = "django-undodelete"
DESCRIPTION = "Undo support for Django models"
AUTHOR = "Jan Češpivo (http://www.cespivo.cz)"
AUTHOR_EMAIL = "jan.cespivo@gmail.com"
URL = "https://github.com/cespivo/django-undodelete"
VERSION = '0.0.1a'
setup(
n... | {
"content_hash": "44586e7057788b364a64834af7f30811",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 54,
"avg_line_length": 26.93548387096774,
"alnum_prop": 0.6431137724550898,
"repo_name": "jancespivo/django-undodelete",
"id": "2984a78f52fa36fbebacb0ad290b550dab257804",
"... |
import sys
import flask
import flask.ext.github
import flask.ext.script
import flask.ext.session
import flask.ext.basicauth
import data
import config.env as env
import config.logs as logs
import blueprints.api as api
import blueprints.auth as auth
import blueprints.webhook as webhook
# CONFIGURING LOGGING
logs.def... | {
"content_hash": "f4fdc6098525af6e317729de05be738a",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 120,
"avg_line_length": 28.24590163934426,
"alnum_prop": 0.7684271619268718,
"repo_name": "rhlobo/github_jackdaw",
"id": "0dcc6325cecc5878d032bf529885aeac6eb3e870",
"size":... |
"""
werkzeug.contrib.testtools
~~~~~~~~~~~~~~~~~~~~~~~~~~
This module implements extended wrappers for simplified testing.
`TestResponse`
A response wrapper which adds various cached attributes for
simplified assertions on various content types.
:copyright: (c) 2014 by t... | {
"content_hash": "5800841f3af645fbda75bf4e885fd5a6",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 76,
"avg_line_length": 34.736111111111114,
"alnum_prop": 0.6005597760895641,
"repo_name": "pcu4dros/pandora-core",
"id": "b5b4acd04c55883589ac6231db6d2f3229fa796e",
"size":... |
import hashlib
import psutil
from amplify.agent.common.context import context
from amplify.agent.common.util import subp
from amplify.agent.managers.abstract import launch_method_supported
from amplify.agent.data.eventd import INFO
from amplify.ext.abstract.manager import ExtObjectManager
from amplify.ext.mysql.util i... | {
"content_hash": "23c627160559429b990a4034050c96d4",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 106,
"avg_line_length": 36.35249042145594,
"alnum_prop": 0.49599494097807756,
"repo_name": "nginxinc/nginx-amplify-agent",
"id": "a2151e4f3ee844472a6709e3f538610cce001e1a",
... |
"""
----------------------------------------------------------------------
--- jumeg.decompose --------------------------------------------------
----------------------------------------------------------------------
autor : Lukas Breuer
email : l.breuer@fz-juelich.de
last update: 12.11.2015
version : ... | {
"content_hash": "60bbca0cc10e85dd1f16b6477d3bdbed",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 70,
"avg_line_length": 35.2289156626506,
"alnum_prop": 0.5677154582763337,
"repo_name": "fboers/jumegX",
"id": "06fbd83e3a08d6d531a6bd3c2064a9f30645e3dd",
"size": "3002",
... |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('courses', '0025_remove_unused_fi... | {
"content_hash": "7834febf840dc71b191a07e7f48db7e2",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 118,
"avg_line_length": 39.90625,
"alnum_prop": 0.6264682850430697,
"repo_name": "mitodl/micromasters",
"id": "8aac400387a041309d8202b956c0e6daa0b8f181",
"size": "1350",
... |
"""Default variable filters."""
from __future__ import unicode_literals
import re
import random as random_module
from decimal import Decimal, InvalidOperation, Context, ROUND_HALF_UP
from functools import wraps
from pprint import pformat
from django.template.base import Variable, Library, VariableDoesNotExist
from dj... | {
"content_hash": "333aa3d602d8d9f89a00e23252ce11e4",
"timestamp": "",
"source": "github",
"line_count": 895,
"max_line_length": 85,
"avg_line_length": 31.0536312849162,
"alnum_prop": 0.6131040189975894,
"repo_name": "ericholscher/django",
"id": "6e424fc6cbd7133a5c04b5edcba57f4140302bbc",
"size": "2... |
import contextlib
import functools
import importlib
import os
try:
import unittest.mock as mock
except ImportError:
import mock
import six
from cloudbaseinit import conf as cloudbaseinit_conf
from cloudbaseinit import exception
from cloudbaseinit.tests import fake
from cloudbaseinit.tests import testutils
CO... | {
"content_hash": "9915a48ca81214fcf2fcfb629fa1fba6",
"timestamp": "",
"source": "github",
"line_count": 2101,
"max_line_length": 79,
"avg_line_length": 42.236078058067584,
"alnum_prop": 0.5938831165904123,
"repo_name": "stefan-caraiman/cloudbase-init",
"id": "8b17ca414cbcdd3fc316f1395048f516c53cd838"... |
import _plotly_utils.basevalidators
class AlignsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="alignsrc", parent_name="scattergeo.hoverlabel", **kwargs
):
super(AlignsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_... | {
"content_hash": "8b91606b184953f0e1d5dcb55e08f53f",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 83,
"avg_line_length": 32.69230769230769,
"alnum_prop": 0.611764705882353,
"repo_name": "plotly/plotly.py",
"id": "2efe0fc6dceaff6b9500ee866414beef5447a8fa",
"size": "425",... |
import re
class ActiveBranchMixin():
def get_current_branch_name(self):
"""
Return the name of the last checkout-out branch.
"""
stdout = self.git("branch")
try:
correct_line = next(line for line in stdout.split("\n") if line.startswith("*"))
return... | {
"content_hash": "2bd7c2b72bbaf279693864e799002468",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 128,
"avg_line_length": 32.484848484848484,
"alnum_prop": 0.5331156716417911,
"repo_name": "ypersyntelykos/GitSavvy",
"id": "0cf3c8bbd33c96b6c711068c968ce0ca1542f150",
"siz... |
import tensorflow as tf
import tensorblock as tb
class recipe_base:
####### Get Collection
def collection( self , name = None ):
if name is None: name = self.folder
return tf.get_collection( tf.GraphKeys.GLOBAL_VARIABLES , name )
####### Get Tag
def tag( self , name ):
list = name.s... | {
"content_hash": "a5835a3f68a39e314453cdd45cd87389",
"timestamp": "",
"source": "github",
"line_count": 179,
"max_line_length": 95,
"avg_line_length": 29.47486033519553,
"alnum_prop": 0.49109173616376045,
"repo_name": "NiloFreitas/Deep-Reinforcement-Learning",
"id": "c741e31015dcc56400221cf01109250ae... |
import bz2
import errno
import filecmp
import gzip
import logging
import shutil
import tempfile
import unittest
from airflow.utils import compression
class TestCompression(unittest.TestCase):
def setUp(self):
self.file_names = {}
try:
header = b"Sno\tSome,Text \n"
line1 = ... | {
"content_hash": "cc11b552d829522ecd7676b1dcef9cbd",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 101,
"avg_line_length": 34.53164556962025,
"alnum_prop": 0.5700146627565983,
"repo_name": "DinoCow/airflow",
"id": "b288ca60fde64510a776c0ffe65be47920ee34a0",
"size": "3516... |
__author__ = "Ted Wen"
__version__ = "0.1"
import logging
import base64,urllib,cgi,hmac,hashlib
from datetime import datetime
from re import compile
from google.appengine.ext import db
from google.appengine.api import taskqueue
from google.appengine.api import urlfetch
from models import *
import helper
from main impo... | {
"content_hash": "db447835c06f54c0f50a4428fdfcc995",
"timestamp": "",
"source": "github",
"line_count": 578,
"max_line_length": 194,
"avg_line_length": 46.188581314878896,
"alnum_prop": 0.6142263175637712,
"repo_name": "tedwen/suicomics",
"id": "e4b5afd9caee2b2af115cd3e25d35bc267192442",
"size": "2... |
from rply.token import SourcePosition
from hippy.sourceparser import SourceParser, LexerWrapper, ParseError, get_lexer
from hippy.astcompiler import compile_ast
from rpython.rlib.objectmodel import we_are_translated
MODE_LITERAL = 0
MODE_EQUALSIGN = 1
MODE_PHPCODE = 2
class PHPLexerWrapper(LexerWrapper):
def __... | {
"content_hash": "c1c3c38a102a9d80f32f18d76918248a",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 82,
"avg_line_length": 38.16447368421053,
"alnum_prop": 0.5542147905533529,
"repo_name": "hippyvm/hippyvm",
"id": "9a9e97802f0981c4f0911036905ecc9eab3f2104",
"size": "5801... |
class RouteResult:
"""
An object to be returned from Page.route, which encapsulates
all the information necessary to serve an HTTP response. Analogous to
django.urls.resolvers.ResolverMatch, except that it identifies
a Page instance that we will call serve(*args, **kwargs) on, rather
than a view... | {
"content_hash": "ba037ddc7abd9ce91dda6404f709ff8e",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 73,
"avg_line_length": 36.125,
"alnum_prop": 0.6539792387543253,
"repo_name": "rsalmaso/wagtail",
"id": "1c5fe1da8e1bee89e969df97beaa467b7dc52999",
"size": "578",
"binary... |
import os
import pandas as pd
import matplotlib.pyplot as plt
def symbol_to_path(symbol, base_dir="data"):
"""Return CSV file path given ticker symbol."""
return os.path.join(base_dir, "{}.csv".format(str(symbol)))
def get_data(symbols, dates):
"""Read stock data (adjusted close) for given symbols from C... | {
"content_hash": "3ef5408c44f7a33a69148ebedaab9602",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 78,
"avg_line_length": 27.69811320754717,
"alnum_prop": 0.5783378746594006,
"repo_name": "alexey-ernest/ml-for-trading",
"id": "330af9abff4dfe568dbc06b8017dd145d772f2fc",
"... |
print("Hello world!") | {
"content_hash": "db256a66c302eab34c8c960c83482250",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 21,
"avg_line_length": 21,
"alnum_prop": 0.7142857142857143,
"repo_name": "WebClub-NITK/Hacktoberfest-2k17",
"id": "f353b1456955fe2efa62dc87058a9118ced839ff",
"size": "22",
... |
"""Incremental reconstruction pipeline"""
import datetime
import logging
import math
from collections import defaultdict
from itertools import combinations
from timeit import default_timer as timer
from typing import Dict, Any, List, Tuple, Set, Optional
import cv2
import numpy as np
from opensfm import (
exif as... | {
"content_hash": "f89be6fda41d853db4e446bb72e085a9",
"timestamp": "",
"source": "github",
"line_count": 1418,
"max_line_length": 88,
"avg_line_length": 34.41043723554302,
"alnum_prop": 0.6140918965446571,
"repo_name": "oscarlorentzon/OpenSfM",
"id": "93083e860d5b1806306ba8400c2fef2ea591bbd8",
"size... |
"""
<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>
A Brianer
"""
#<DefineAugmentation>
import ShareYourSystem as SYS
BaseModuleStr="ShareYourSystem.Standards.Recorders.Simulater"
DecorationModuleStr="ShareYourSystem.Standards.Classors.Classer"
SYS.setSubModule(globa... | {
"content_hash": "a87a30e401a067e79c7f8a596bae5b2e",
"timestamp": "",
"source": "github",
"line_count": 4641,
"max_line_length": 268,
"avg_line_length": 20.11032105149752,
"alnum_prop": 0.6392127030386149,
"repo_name": "Ledoux/ShareYourSystem",
"id": "1d143242a641cdbe5988a2a6314d748ecd1a1e3c",
"siz... |
from __future__ import print_function
import argparse
import os
import sys
def main():
"""The main progam."""
parser = argparse.ArgumentParser(
prog="fill-edge-cut.py",
usage="%(prog)s [options] gerber-file",
description="Converts a polygon edge cut into a filled polygon edge cut"
... | {
"content_hash": "7b7dc003b5b7598f1992dca5830af7de",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 80,
"avg_line_length": 29.694915254237287,
"alnum_prop": 0.502283105022831,
"repo_name": "dhylands/kicad",
"id": "aa1d9fc511a50a2e95cab7e6f51466dc588baf2f",
"size": "2022",... |
""" Funcions for verifying the internal consistency of a upax server. """
from upax import UpaxError
from upax.ftlog import BoundLog, FileReader # , LogEntry
from upax.server import BlockingServer
from upax.walker import UWalker
__all__ = ['check', ]
def setup_server(options):
""" Add server configuration i... | {
"content_hash": "ec58836b39a76ecb3f75a1218e7677d4",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 75,
"avg_line_length": 35.98275862068966,
"alnum_prop": 0.5848107331097269,
"repo_name": "jddixon/upax_py",
"id": "9d63b0f817668c7b73069c060baa8949b3fb562e",
"size": "4229... |
"""TensorBoard Plugin asset abstract class.
TensorBoard plugins may need to write arbitrary assets to disk, such as
configuration information for specific outputs, or vocabulary files, or sprite
images, etc.
This module contains methods that allow plugin assets to be specified at graph
construction time. Plugin autho... | {
"content_hash": "069f201e02353d36fc8708b5042a1041",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 80,
"avg_line_length": 35.11904761904762,
"alnum_prop": 0.7242937853107345,
"repo_name": "MycChiu/tensorflow",
"id": "18b6bd4fc412ea501741687186a5dfed80f4d3f0",
"size": "5... |
from csv import reader
from csv import writer
def read(filepath):
predictions = []
with open(filepath, 'rU') as datafile:
datareader = reader(datafile)
next(datareader)
for row in datareader:
predictions.append(row[1])
return predictions
rf_tf_idf = read('predictions/p... | {
"content_hash": "ca0e619c434f9f697162308b519324f0",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 64,
"avg_line_length": 30.161290322580644,
"alnum_prop": 0.6695187165775401,
"repo_name": "jvanbrug/kaggle-crisis",
"id": "d83376a1f2a096ef41141306107173167e3748fc",
"size"... |
"""
Symbol of SqueezeNet
Reference:
Iandola, Forrest N., et al.
"Squeezenet: Alexnet-level accuracy with 50x fewer parameters and< 0.5 mb model size." (2016).
"""
from tvm import relay
from .init import create_workload
from . import layers
# Helpers
def _make_fire(net, squeeze_channels, expand1x1_channels, expand3x3... | {
"content_hash": "4f4b9ab21642b212ebdbb221e41948b4",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 94,
"avg_line_length": 35.90714285714286,
"alnum_prop": 0.5492341356673961,
"repo_name": "mlperf/training_results_v0.7",
"id": "1e9ea73e9360ecfae862332e75c0232402a32970",
... |
from __future__ import print_function
from .jenkins_api import UnknownJobException
try:
import tenjin
from tenjin.helpers import *
engine = tenjin.Engine()
except ImportError: # pragma: no cover
engine = None
def update_job(jenkins, job_name, config_xml, pre_delete=False, async=False):
"""Update... | {
"content_hash": "63a741c455a26d941220c623827c3abe",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 114,
"avg_line_length": 33.35849056603774,
"alnum_prop": 0.6549773755656109,
"repo_name": "lechat/jenkinsflow",
"id": "4649b33cf9b3b575fd9c0865cc58ceb98ea6476b",
"size": "1... |
from otree.api import Currency as c, currency_range
from . import views
from ._builtin import Bot
from .models import Constants
class PlayerBot(Bot):
def play_round(self):
pass
| {
"content_hash": "702c5c2c60d2802c253aea59675555b8",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 51,
"avg_line_length": 19.2,
"alnum_prop": 0.7239583333333334,
"repo_name": "PinkyOne/otree_game",
"id": "59477b0b94a3f07c922b8462692b621b765d194c",
"size": "192",
"binar... |
from setuptools import setup
setup(
name='dj-config-url',
version='0.1.1',
url='https://github.com/julianwachholz/dj-config-url',
license='BSD',
author='Julian Wachholz',
author_email='julian@wachholz.ch',
description='Use configuration URLs in your Django Application.',
long_descriptio... | {
"content_hash": "446c36de3806b05cab4db5088d480eb9",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 71,
"avg_line_length": 36.774193548387096,
"alnum_prop": 0.6149122807017544,
"repo_name": "julianwachholz/dj-config-url",
"id": "731209550b5e474725bdf6b305f01f1bf73feebe",
... |
import datetime
from typing import Any, Dict, Optional, Union
from cron_descriptor import CasingTypeEnum, ExpressionDescriptor, FormatException, MissingFieldException
from croniter import CroniterBadCronError, CroniterBadDateError, croniter
from dateutil.relativedelta import relativedelta
from pendulum import DateTime... | {
"content_hash": "61ae334be4d308c26a5ceedec70cc979",
"timestamp": "",
"source": "github",
"line_count": 299,
"max_line_length": 105,
"avg_line_length": 41.42140468227425,
"alnum_prop": 0.6612838110617683,
"repo_name": "mistercrunch/airflow",
"id": "2238afa4e668a9f17b57d422ddccedd44ffa00e2",
"size":... |
from paraview.simple import *
from math import log10
##------------ General functions for adding/extracting and labeling planes ---------------------
# do the math for logarithmic coordinates - no coordinate conversion
def Lin2Log(x, ratio=1.0, basis=1e3):
"""Convert linear coordinate to logarithmic coordinate va... | {
"content_hash": "8cd71fc717ac3f16e4a0cc7f79a74755",
"timestamp": "",
"source": "github",
"line_count": 593,
"max_line_length": 250,
"avg_line_length": 47.25969645868465,
"alnum_prop": 0.6175557537912578,
"repo_name": "mjucker/pv_atmos",
"id": "e21489a389ec21d770a21b1e12175115fd781d17",
"size": "28... |
import error, decimal
class handler:
def flag_handler(self):
if self.flag_const:
i = 0
while self.imem[i] != 0: i+=1
if self.indentlvl == 0:
value = self.i.split("const ")[-1].replace("\n","")
else:
value = self.char_data[self... | {
"content_hash": "d92c07b6d2a87a588bf83ec8d8d47645",
"timestamp": "",
"source": "github",
"line_count": 468,
"max_line_length": 87,
"avg_line_length": 36.73504273504273,
"alnum_prop": 0.400476966030712,
"repo_name": "mynameajeff/toyeso",
"id": "0eb9b4f2683bd561a4ea1d02bf47fa04e7ade806",
"size": "17... |
from collections import defaultdict
from functools import lru_cache
def sum_of_squares_of_digits(n):
return sum(int(d) ** 2 for d in str(n))
@lru_cache(maxsize=None)
def get_terminal_number(n):
if n in [0, 1, 89]:
return n
return get_terminal_number(sum_of_squares_of_digits(n))
def ans():
... | {
"content_hash": "b63ed5c658eda04aa2dcc7440ed10665",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 63,
"avg_line_length": 27.571428571428573,
"alnum_prop": 0.6207253886010363,
"repo_name": "mackorone/euler",
"id": "79fbc9944959e5bf743b503e915d0f37e3e280ad",
"size": "965"... |
import re
import json
import urllib
from random import choice
import serial
from mock import Mock, call, create_autospec, patch
from django.utils import unittest
from django.core.urlresolvers import reverse
from django.test import TestCase as TestCase
from . import get_path
import AC
import AC.views
from AC.models i... | {
"content_hash": "fafc5bc6459fcaefa44967d4aaa5a905",
"timestamp": "",
"source": "github",
"line_count": 442,
"max_line_length": 79,
"avg_line_length": 42.34389140271493,
"alnum_prop": 0.5629407993160932,
"repo_name": "itamaro/home-control-RPC",
"id": "5d824c58cf8b5f602e2af6a5bc2c1884dd1c6816",
"siz... |
import unittest
import json
import httpretty
from abduct import captured, out, err
from caravan.tests.util import mock_args
from caravan.commands.terminate import Command
def httpretty_register():
headers = {
'x-amzn-RequestId': 'd68969c7-3f0d-11e1-9b11-7182192d0b57',
}
body = '{"runId": "1e... | {
"content_hash": "ab9012210c80bb2aa274b8ab2e175f67",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 76,
"avg_line_length": 28.71698113207547,
"alnum_prop": 0.5676741130091985,
"repo_name": "pior/caravan",
"id": "39283b9ec270c71bc72b19b16490997a771d461c",
"size": "3044",
... |
"""Reverter class saves configuration checkpoints and allows for recovery."""
import csv
import glob
import logging
import os
import shutil
import time
import traceback
import zope.component
from certbot import constants
from certbot import errors
from certbot import interfaces
from certbot import le_util
from certb... | {
"content_hash": "1c7f1d5106c86277d8b78733de6fab07",
"timestamp": "",
"source": "github",
"line_count": 552,
"max_line_length": 97,
"avg_line_length": 39.903985507246375,
"alnum_prop": 0.5905025650338221,
"repo_name": "DavidGarciaCat/letsencrypt",
"id": "fe6d9f24fd59b44a2fa2d2ef338649f18d252f2b",
"... |
''' Handlers for the Player List pages /players/{firstletter}
This only returns a small dataset on each player like Name, College, Draft Year'''
import pandas
import requests
import datetime
import os
from bs4 import BeautifulSoup
baseurl = "http://www.basketball-reference.com/players/{firstletter}/{playerid}.html"... | {
"content_hash": "ae0f4e6445b96b78ada8fb8d9ba61334",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 104,
"avg_line_length": 35.57798165137615,
"alnum_prop": 0.628158844765343,
"repo_name": "mblanchard23/brefcrawler",
"id": "548be1faf77a38c2508337777f56cbc801e1a5f8",
"siz... |
"""Handlers that compose handlers."""
__all__ = [
'Chain',
'MethodRouter',
'PathPatternRouter',
# Context.
'PATH_MATCH',
'get_path',
'get_path_str',
'group',
]
import re
from g1.bases import labels
from g1.bases.assertions import ASSERT
from .. import consts
from .. import wsgi_apps
... | {
"content_hash": "345909653ea4e8252c0804d511652d98",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 75,
"avg_line_length": 27.756756756756758,
"alnum_prop": 0.6270691333982473,
"repo_name": "clchiou/garage",
"id": "22f827630e4ba840551bfb6ff62a1dd88da6b939",
"size": "3081... |
import struct
import traceback
from time import time as now
from collections import namedtuple
from ._keyboard_event import KeyboardEvent, KEY_DOWN, KEY_UP
from ._canonical_names import all_modifiers, normalize_name
from ._nixcommon import EV_KEY, aggregate_devices, ensure_root
# TODO: start by reading current keyboar... | {
"content_hash": "c911b3e514f77a86ff326287b85b7f94",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 171,
"avg_line_length": 32.18681318681319,
"alnum_prop": 0.6167634004779788,
"repo_name": "glitchassassin/keyboard",
"id": "d3950a141474935f3ef99bf4afc2229b85be9962",
"siz... |
"""
Support for Daikin AC Sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.daikin/
"""
import logging
from homeassistant.components.daikin import DOMAIN as DAIKIN_DOMAIN
from homeassistant.components.daikin.const import (
ATTR_INSIDE_T... | {
"content_hash": "80862d5dbde09900cce091035721c6e1",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 79,
"avg_line_length": 31.09009009009009,
"alnum_prop": 0.6198203419298755,
"repo_name": "tinloaf/home-assistant",
"id": "f887ccf64a0f2befc531824b29a25ff28783947b",
"size"... |
import telnetlib
import time
TELNET_PORT = 23
TELNET_TIMEOUT = 6
READ_TIMEOUT = 6
def disable_paging(remote_conn, command="terminal length 0\n", delay=1):
'''
Disable router paging i.e. --More--
Returns the output buffer
'''
remote_conn.write(command)
time.sleep(delay)
return remote_conn... | {
"content_hash": "28355ba3f080973c89d36d831d492678",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 72,
"avg_line_length": 20.016666666666666,
"alnum_prop": 0.6336386344712739,
"repo_name": "cb1234/pynet-test",
"id": "d0d1a0eb702bdad526711cac9b4b6d4def72f316",
"size": "12... |
import subprocess
from docker_tests.command_utils import run_command
from docker_tests.docker_tests_utils import (
display_dependency_conflict_message,
docker_image,
run_bash_in_docker,
)
class TestFiles:
def test_dist_folder_should_exists(self):
run_bash_in_docker('[ -f /opt/airflow/airflow/... | {
"content_hash": "ac4ec7aa8c3486544988baeb89a88d3d",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 103,
"avg_line_length": 29.875,
"alnum_prop": 0.6401673640167364,
"repo_name": "mistercrunch/airflow",
"id": "00823328b8b6cbe3a4fce0073f5f6fd0c817ebde",
"size": "1503",
"... |
from flask import Flask
from flask import session,request,render_template, url_for, redirect
import os
app = Flask(__name__)
app.secret_key = "lavaryss"
@app.route("/")
def home():
return render_template("index.html")
@app.route('/results')
def results():
x = os.listdir('static/images')
print x
retur... | {
"content_hash": "cec6dd09f811e1c164c83a37e52a809b",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 68,
"avg_line_length": 21.7,
"alnum_prop": 0.652073732718894,
"repo_name": "timothyong/hackillinois",
"id": "4afff27f22ebf7be51445047050e88cee875d7c7",
"size": "434",
"bi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.