text stringlengths 4 1.02M | meta dict |
|---|---|
import simplejson as json
from django.test import SimpleTestCase, override_settings
from rest_witchcraft import routers, serializers, viewsets
from .models_composite import RouterTestCompositeKeyModel, RouterTestModel, session
try:
from django.conf.urls import url as re_path
from django.conf.urls import in... | {
"content_hash": "168846bd57b6326f0296b7457b2b865b",
"timestamp": "",
"source": "github",
"line_count": 233,
"max_line_length": 114,
"avg_line_length": 36.03004291845494,
"alnum_prop": 0.6402620607504467,
"repo_name": "shosca/django-rest-witchcraft",
"id": "b0ebbccd46fbe442df2ceca80333436220c47bc9",
... |
import flask
from flask import Flask
import konch
app = Flask(__name__)
@app.route("/")
def index():
return "Hello world"
konch.config({"context": [flask.url_for, flask.Flask, flask.render_template]})
# Make sure we're in a request context so we can use
# url_for
ctx = app.test_request_context()
def setup()... | {
"content_hash": "8bce709858d5a74f627905d286db93c3",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 78,
"avg_line_length": 16.48148148148148,
"alnum_prop": 0.6719101123595506,
"repo_name": "sloria/konch",
"id": "536bdad4c1d6fc3731dc7ea64a8548ebe92c15c8",
"size": "467",
... |
from __future__ import division
import sys
import numpy as np
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
from scipy.ndimage.filters import maximum_filter
from scipy.ndimage.morphology import (generate_binary_structure,
iterate_structure, binary_erosion)
import h... | {
"content_hash": "063e6f82453a54ddf3633f1e4d2a6155",
"timestamp": "",
"source": "github",
"line_count": 212,
"max_line_length": 148,
"avg_line_length": 36.424528301886795,
"alnum_prop": 0.5854700854700855,
"repo_name": "sharad23/shazam-with-time",
"id": "99a948af63e491a70f46eccd500d58dd201e7af8",
"... |
from basehandler import BaseHandler
from szgitlab import GitLab
from jenkins import Jenkins
| {
"content_hash": "72288db7f8706883ee7ea8f82a4eefdd",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 35,
"avg_line_length": 30.666666666666668,
"alnum_prop": 0.8695652173913043,
"repo_name": "Shopzilla-Ops/gitlab-jenkins-connector",
"id": "412ebe56d236ceb5360f9e2ae732bd011503... |
from django.conf import settings
from django.conf.urls import url, patterns, include
from django.contrib import admin
from django.core.urlresolvers import reverse_lazy
from django.http import HttpResponse
from django.views.decorators.cache import cache_page
from django.views.generic.base import TemplateView, RedirectVi... | {
"content_hash": "313c3a6845a324ec3b1083be842a15de",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 113,
"avg_line_length": 28.557894736842105,
"alnum_prop": 0.5307777368227055,
"repo_name": "callmealien/wazimap_zambia",
"id": "1b8b5bce3604dbc4b0ff5dfec460447c302df8f7",
... |
import base64
import datetime
import getopt
import hashlib
import json
import random
import requests
import sys
debug=True
def generate_nonce():
return base64.b64encode(bytes(str(random.randrange(10**19)), 'utf-8')).decode('utf-8')
def generate_token(url, username, password):
headers = {
'Accept-char... | {
"content_hash": "94374a9731047d8a5f6ffde5f299fadc",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 119,
"avg_line_length": 25.64864864864865,
"alnum_prop": 0.5869336143308747,
"repo_name": "Penneo/api-utils",
"id": "831b6be4cdba7cfaa5a9bbbf1b3b0f526a828ab1",
"size": "191... |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import logging
import os
import fnmatch
from flask import send_from_directory, Flask
from flexget.webserver import register_app, register_home
from flask_compress import ... | {
"content_hash": "90f7be0484e6b55af002b4f5796b4cad",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 106,
"avg_line_length": 25.943396226415093,
"alnum_prop": 0.6836363636363636,
"repo_name": "tobinjt/Flexget",
"id": "4c1fb81b8b4601b4daa821656deb2f6b34b28457",
"size": "137... |
"""Tests for editing pages."""
#
# (C) Pywikibot team, 2015-2017
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
import time
import pywikibot
from pywikibot import config
from pywikibot import page_put_queue
from pywikibot.tools import MediaWikiVersion
... | {
"content_hash": "9aff518db120c618c125035a52aa8ee1",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 80,
"avg_line_length": 31.756756756756758,
"alnum_prop": 0.5825531914893617,
"repo_name": "Darkdadaah/pywikibot-core",
"id": "62f8750ab44117667e26639573711cbd0989c425",
"s... |
from Entity.Entity import Entity
from Item import Inventory
class Humanoid(Entity):
openDoors = True
items = ()
def __init__(self, *args, **kwargs):
super(Humanoid, self).__init__(*args, **kwargs)
self.stats = {'Intellect': (12, 0), 'Strength': (10, 0), 'Toughness': (0, 0)} # FIXME Game needs proper stat system... | {
"content_hash": "28e66db367fbddd5ae0ad7a25c57afd9",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 125,
"avg_line_length": 35.44,
"alnum_prop": 0.7144469525959368,
"repo_name": "kkelk/roguelike-computing",
"id": "c5c516bbba1048eeacb969f4689ef9b5e3497065",
"size": "886",
... |
__author__ = 'Shahariar Rabby'
# main recive mail file. All recive mail, check mail, server file import it
# All function define here
# # Recive Mail
# #### Importing all dependency
# In[ ]:
import email
import imaplib
import ctypes
import getpass
import threading
try:
from playsound import playsound
except:
... | {
"content_hash": "c2ec6789405c4d340e06e717dffeec9e",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 254,
"avg_line_length": 33.17391304347826,
"alnum_prop": 0.6089121887287025,
"repo_name": "shahariarrabby/Mail_Server",
"id": "54d636bba8ab56dc1cf6caf9fbca784244c0a42c",
"... |
from .settings import hedwig_settings
from hedwig.core.emitter import Emitter
hedwig_emitter = Emitter(hedwig_settings)
| {
"content_hash": "5050bcd15f8cf44ce30d9d64e00fccae",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 41,
"avg_line_length": 30.25,
"alnum_prop": 0.8264462809917356,
"repo_name": "ofpiyush/hedwig-py",
"id": "ffd9c60d292b84501df95a522f0c39ed8485dd2a",
"size": "121",
"binary... |
from .actions import *
from .models import *
from .services import *
from .api import *
| {
"content_hash": "ddce5348adcc3132c4e19d663de7fbc6",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 23,
"avg_line_length": 22,
"alnum_prop": 0.7272727272727273,
"repo_name": "AlecAivazis/nautilus",
"id": "1b8e2fe33fcc0ec7e75901152d564357d25a074e",
"size": "88",
"binary":... |
from __future__ import unicode_literals
import httplib
import logging
from modularodm import Q
from modularodm.storage.base import KeyExistsException
from flask import request
from framework.auth import Auth
from framework.exceptions import HTTPError
from framework.auth.decorators import must_be_signed
from websit... | {
"content_hash": "5f6e7c109731520b923c2e11826a0b8c",
"timestamp": "",
"source": "github",
"line_count": 262,
"max_line_length": 129,
"avg_line_length": 31.866412213740457,
"alnum_prop": 0.6466642711702,
"repo_name": "kch8qx/osf.io",
"id": "6017fa3ac39d77b1e5d052c701704613bfd85b27",
"size": "8349",
... |
class NumberUtils(object):
def pad(cls, n):
return "%0.10d" % n
pad = classmethod(pad)
| {
"content_hash": "6abc0cb7c7c0d529a4f9bc0d24b98733",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 27,
"avg_line_length": 17.5,
"alnum_prop": 0.5714285714285714,
"repo_name": "fnp/pylucene",
"id": "02b8e2203dd87c3a61c986d9b8e379dcb64ad2e1",
"size": "810",
"binary": fals... |
from . import base_insight as insight
def get_url(coin_symbol):
if coin_symbol == "btg":
return "https://btgexplorer.com/api"
raise NotImplementedError("Explorer unavailable for Bitcoin Gold testnet")
def unspent(*args, coin_symbol="btg"):
base_url = get_url(coin_symbol)
return insight.unspent... | {
"content_hash": "7ce8d7fc189ecf2863acd944aa1319cc",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 78,
"avg_line_length": 32.28947368421053,
"alnum_prop": 0.6943765281173594,
"repo_name": "stamhe/pybitcointools",
"id": "e9f3d3429a82dd9d9288287a87f0f8273c5d88a2",
"size": ... |
import click
from newtex.util import check_output
def check_git():
"""Check to see that you have git on your path, and that your email and
username are correctly configured."""
version = check_output(['git', '--version'])[0]
if 'version' not in version:
raise click.ClickException(
... | {
"content_hash": "3e32f6e108fbc35432ee16fce47ab447",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 79,
"avg_line_length": 34.04,
"alnum_prop": 0.6110458284371327,
"repo_name": "ryanpdwyer/newtex",
"id": "875d2c4f4b64f3534a5f102eda4e7865240026a4",
"size": "1726",
"binar... |
from django.contrib.auth.models import AbstractUser
from django.urls import reverse
from django.db import models
from django.utils.translation import ugettext_lazy as _
class User(AbstractUser):
# First Name and Last Name do not cover name patterns
# around the globe.
name = models.CharField(_('Name of U... | {
"content_hash": "0a5d40c2f1ceeffb0a7422c1f1eda1b8",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 74,
"avg_line_length": 28.235294117647058,
"alnum_prop": 0.7125,
"repo_name": "bihealth/flowcelltool",
"id": "2706c200f5302e5e6d0db83a2393d8340a2362e9",
"size": "504",
"b... |
from django.apps import AppConfig
class NewsletterConfig(AppConfig):
name = 'newsletter'
| {
"content_hash": "0992e95e356d2ce308a195291dd6b407",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 34,
"avg_line_length": 19,
"alnum_prop": 0.7684210526315789,
"repo_name": "ualikhansars/Gwent",
"id": "b532e880b72c6736c823af85d1507a4f8ba2caa8",
"size": "95",
"binary": f... |
FEMALE = 'female'
MALE = 'male'
OTHER = 'other'
UNKNOWN = 'unknown'
| {
"content_hash": "66358642f1d9ca97ed5b9f19ed7fe3cf",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 19,
"avg_line_length": 17,
"alnum_prop": 0.6470588235294118,
"repo_name": "edx/edx-analytics-data-api-client",
"id": "6691f4718b9d3a8fc6ea47311200fd75e2d8fc83",
"size": "68"... |
from nova.compute import api as compute_api
from nova.compute import manager as compute_manager
from nova import context
from nova import db
from nova.objects import block_device as block_device_obj
from nova.tests.api.openstack import fakes
from nova.tests import fake_block_device
from nova.tests import fake_instance
... | {
"content_hash": "12233353ea283cd32595c3c69adec5fc",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 79,
"avg_line_length": 44.31386861313869,
"alnum_prop": 0.570252017789491,
"repo_name": "ewindisch/nova",
"id": "b3c86f18c55b7bb06eb64bf680b6d5cca06cdb41",
"size": "6703",... |
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from datetime import datetime, timedelta
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime.now(),
'email': ['chris@fregly.com'],
'email_on_failure': False,
'email_on_retry': Fals... | {
"content_hash": "e6b89bed3df989f103fd0d70df878b40",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 74,
"avg_line_length": 30.369565217391305,
"alnum_prop": 0.6993557623478883,
"repo_name": "fluxcapacitor/source.ml",
"id": "7a4b33ca4c67dfeb8bbf7c062ae96b758ccbcc2b",
"size... |
"""
Tests for database migrations. This test case reads the configuration
file test_migrations.conf for database connection settings
to use in the tests. For each connection found in the config file,
the test case runs a series of test cases to ensure that migrations work
properly both upgrading and downgrading, and th... | {
"content_hash": "dd642df8c40fd3646fc59d3ffac58670",
"timestamp": "",
"source": "github",
"line_count": 1057,
"max_line_length": 79,
"avg_line_length": 47.43614001892148,
"alnum_prop": 0.5268049461507778,
"repo_name": "Thingee/cinder",
"id": "d3ec208f3248022752e067d752c56c1e770bfd40",
"size": "5078... |
import pytest
import pytest_asyncio
from acouchbase.cluster import get_event_loop
from couchbase.exceptions import (InvalidArgumentException,
QueryIndexAlreadyExistsException,
SearchIndexNotFoundException)
from couchbase.management.search import Searc... | {
"content_hash": "3454d061345eb747c8695c72bbf2c374",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 105,
"avg_line_length": 39.457264957264954,
"alnum_prop": 0.5929816960901115,
"repo_name": "couchbase/couchbase-python-client",
"id": "e4d2bf9f015db5450c9a6a1cb6e19c0b45ef0c... |
"""
Copyright (c) 2016 Hsissou Imad
See the file 'LICENSE' for copying permission
"""
from __future__ import print_function
import logging
import os
import sys
import time
from pyarplib import *
from scapy.all import *
import subprocess
import netifaces
import cmd
logging.getLogger("scapy.runtime").setLevel(logging.... | {
"content_hash": "8aa53adb8a04903a5cc49f4c7b062235",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 88,
"avg_line_length": 28.327433628318584,
"alnum_prop": 0.5060918462980318,
"repo_name": "7BISSO/python-arp-spoofer",
"id": "3bddf45c0abc61475d858eb9a9c6582bae15ddd3",
"s... |
from __future__ import annotations
from functools import lru_cache
from inspect import signature
from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
from uuid import UUID
from sanic_routing import BaseRouter # type: ignore
from sanic_routing.exceptions import NoMethod # type: ignore
from sanic_rout... | {
"content_hash": "22d04a40fc50b3974f4eafa42b9785f0",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 79,
"avg_line_length": 32.85585585585586,
"alnum_prop": 0.5814367973676995,
"repo_name": "ashleysommer/sanic",
"id": "bad471c63872aae53316f598f20f39ca07c58c77",
"size": "7... |
import warnings
import logging
import numpy
from scipy import stats
import pandas
from wqio import utils
_logger = logging.getLogger(__name__)
def _ros_sort(df, result, censorship, log=True, warn=False):
"""
This function prepares a dataframe for ROS. It sorts ascending with
left-censored observations... | {
"content_hash": "341e1b22ae452a961a16801ff313a713",
"timestamp": "",
"source": "github",
"line_count": 623,
"max_line_length": 88,
"avg_line_length": 31.105939004815408,
"alnum_prop": 0.615511636307343,
"repo_name": "Geosyntec/wqio",
"id": "6550bc3150cb86ff23305bee0089649464133d9b",
"size": "19379... |
try:
from AAAPT.runner import register_tests
register_tests({
"skeleton": ["PackageBoilerplate.tests.test_skeleton"],
"support": ["PackageBoilerplate.tests.test_support"],
"path": ["PackageBoilerplate.tests.test_path"],
"basepath": ["PackageBoilerplate.tests.test_basepath"]
}... | {
"content_hash": "8ef4389d82806b43bc7557989a10c37b",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 77,
"avg_line_length": 38.54545454545455,
"alnum_prop": 0.6816037735849056,
"repo_name": "NicoSantangelo/package-boilerplate",
"id": "9114507fb1b2d2471545d24c33bd58fcb09b1020... |
from django.conf.urls import patterns, include, url
from eszone_ipf.settings import API_VERSION_PREFIX
urlpatterns = patterns('',
url(r'^{0}/api_ipf/'.format(API_VERSION_PREFIX), include('api_ipf.urls')),
)
| {
"content_hash": "d5a8947db751ba30a6baf5dfe2f0b209",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 78,
"avg_line_length": 30.428571428571427,
"alnum_prop": 0.7230046948356808,
"repo_name": "erigones/eszone_ipf",
"id": "fe4819d040b48e05e253ac894d6361339d0f7d3a",
"size": "2... |
import time
from typing import Tuple
def nagios_from_file(results_file: str) -> Tuple[int, str]:
"""Returns a nagios-appropriate string and return code obtained by
parsing the desired file on disk. The file on disk should be of format
%s|%s % (timestamp, nagios_string)
This file is created by variou... | {
"content_hash": "8980040d22061645c9669f171bf50f3a",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 74,
"avg_line_length": 28.878048780487806,
"alnum_prop": 0.5388513513513513,
"repo_name": "synicalsyntax/zulip",
"id": "2e14ec51845ce619744516e372f1096efe013d44",
"size": "... |
import sys
import time
import random
from pandajedi.jedicore import Interaction
from pandajedi.jedicore.ThreadUtils import ZombiCleaner
class JediKnight(Interaction.CommandReceiveInterface):
# constructor
def __init__(self, commuChannel, taskBufferIF, ddmIF, logger, **kwargs):
Interaction.CommandRece... | {
"content_hash": "a41e48b0c515422b62d7b4be6183ff4b",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 108,
"avg_line_length": 31.27777777777778,
"alnum_prop": 0.6429840142095915,
"repo_name": "PanDAWMS/panda-jedi",
"id": "436c8cd64d85fb5e51d2f7a7e2e603f8d1832410",
"size": "... |
"""
Dict performance test
"""
import timeit
SETUP = '''
import array
selected = array.array('d')
with open('selected.arr', 'rb') as fp:
selected.fromfile(fp, {size})
haystack = dict((n, n.as_integer_ratio()) for n in selected)
print('haystack: %10d' % len(haystack), end=' ')
needles = array.array('d')
with open(... | {
"content_hash": "89e514f8c5440d2c60f196779887267c",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 66,
"avg_line_length": 24.352941176470587,
"alnum_prop": 0.6159420289855072,
"repo_name": "Wallace-dyfq/example-code",
"id": "a0a9f7f3524a29a12188fbab7eba020aa0041298",
"si... |
"""Tests for the plist event formatter."""
import unittest
from plaso.formatters import plist
from tests.formatters import test_lib
class PlistFormatterTest(test_lib.EventFormatterTestCase):
"""Tests for the plist event formatter."""
def testInitialization(self):
"""Tests the initialization."""
event_... | {
"content_hash": "fe536663f1e58e217cf6a3d605c24647",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 59,
"avg_line_length": 24.11764705882353,
"alnum_prop": 0.7048780487804878,
"repo_name": "ostree/plaso",
"id": "252e6c4744fd19198a4c5591a979816f80cd9f73",
"size": "862",
... |
"""
LHCb style from lhcbStyle.C
"""
from __future__ import absolute_import
from .. import Style
__all__ = [
'style',
]
def style(name='LHCb'):
STYLE = Style(name, 'LHCb Style')
font = 132
line_width = 2
text_size = 0.06
# Default canvas size and position.
STYLE.SetCanvasDefH(600)
... | {
"content_hash": "eb75cbb76ce8454e63b6b044486f1df3",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 53,
"avg_line_length": 24.42982456140351,
"alnum_prop": 0.667145421903052,
"repo_name": "rootpy/rootpy",
"id": "0fee8ef8ed2ba253a2efcd3af03a55cec8dbc7ba",
"size": "2825",
... |
class BaseReview(object):
def __init__(self, review):
self.review = review
@property
def author(self):
raise NotImplementedError
@property
def summary(self):
raise NotImplementedError
@property
def text(self):
raise NotImplementedError
@property
de... | {
"content_hash": "927514a70d76ca38490d154753b90627",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 45,
"avg_line_length": 20.966666666666665,
"alnum_prop": 0.5643879173290938,
"repo_name": "littlepea/python-refactoring-talk",
"id": "8d808c9143df028b99035f1a6ba7e4e876338bfc... |
from netmiko.no_config import NoConfig
from netmiko.base_connection import BaseConnection
class CheckPointGaiaSSH(NoConfig, BaseConnection):
"""
Implements methods for communicating with Check Point Gaia
firewalls.
"""
def session_preparation(self) -> None:
"""
Prepare the session... | {
"content_hash": "b6c50d85c1d4856c152372c67de5e3e2",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 78,
"avg_line_length": 29.75,
"alnum_prop": 0.6442577030812325,
"repo_name": "ktbyers/netmiko",
"id": "c16858828f6dacc80f3daa16d48771d5ad140cf6",
"size": "714",
"binary":... |
"""Test cases for HINODE Map subclasses.
This particular test file pertains to XRTMap.
@Author: Pritish C. (VaticanCameos)
"""
import os
import glob
import numpy as np
from matplotlib import colors
import astropy.units as u
from sunpy.map.sources.hinode import XRTMap
from sunpy.map import Map
import sunpy.data.test
... | {
"content_hash": "6b9293ecad901be05472ca8afa9891d8",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 76,
"avg_line_length": 29.20754716981132,
"alnum_prop": 0.6873385012919897,
"repo_name": "Alex-Ian-Hamilton/sunpy",
"id": "a78fec3ed2e8c7b401605575574c0f22c6d1f9d1",
"size"... |
import os
from parlai.core.build_data import DownloadableFile
import parlai.core.build_data as build_data
import parlai.utils.logging as logging
RESOURCES = [
DownloadableFile(
'https://raw.githubusercontent.com/uclanlp/gn_glove/master/wordlist/male_word_file.txt',
'male_word_file.txt',
'd4... | {
"content_hash": "46525ccd2aa3206be4ebb1a8f04b7214",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 98,
"avg_line_length": 34.08108108108108,
"alnum_prop": 0.6724821570182395,
"repo_name": "facebookresearch/ParlAI",
"id": "f5e121acfd466c2716346b4832f373a24d3d3b03",
"size"... |
"""
STI sodars, which are currently all in SOCAL, and operate on local time as best
I can tell..
"""
from decoders.core import FileDecoder, VariableList
import decoders.messages.sodarmsg1 as sd
import time
import os
import datetime as dt
os.environ['TZ']='America/Los_Angeles'
time.tzset()
class SodarGrid1(FileDecoder... | {
"content_hash": "51331d27cf3fd17a96109686d538ce3a",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 102,
"avg_line_length": 35.63157894736842,
"alnum_prop": 0.6090595765632694,
"repo_name": "pyodec/pyodec",
"id": "41035302e918d6f77f667ae0fd4fadabd8c87822",
"size": "2031",... |
"""function module.
This module contains the Operator class, which is then passed to an integrator
to run a full depletion simulation.
"""
from abc import ABC, abstractmethod
from collections import namedtuple, defaultdict
from collections.abc import Iterable, Callable
from copy import deepcopy
from inspect import si... | {
"content_hash": "66509fc97a8df6db78000e5e681c6c55",
"timestamp": "",
"source": "github",
"line_count": 1101,
"max_line_length": 90,
"avg_line_length": 36.17438692098093,
"alnum_prop": 0.6033694888018479,
"repo_name": "mit-crpg/openmc",
"id": "7dca301f7eccdc23170aa83b1ea804e9782cddb4",
"size": "398... |
"""
This file builds H2O model
"""
from connection import H2OConnection
from frame import H2OFrame, H2OVec
from job import H2OJob
import h2o
# Response variable model building
def supervised_model_build(x,y,validation_x,validation_y,algo_url,kwargs):
# Sanity check data frames
if not y: raise ValueEr... | {
"content_hash": "fafdbd92cc5ddb9498b2cf8361744bbd",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 119,
"avg_line_length": 32.65217391304348,
"alnum_prop": 0.7117177097203728,
"repo_name": "bikash/h2o-dev",
"id": "fe36751b5a98c2e326b611469d2bb17df5279e84",
"size": "3004"... |
import os
from robot.errors import DataError
from robot.parsing import VALID_EXTENSIONS as RESOURCE_EXTENSIONS
from robot.utils import JYTHON
from .robotbuilder import LibraryDocBuilder, ResourceDocBuilder
from .specbuilder import SpecDocBuilder
if JYTHON:
from .javabuilder import JavaDocBuilder
else:
def Jav... | {
"content_hash": "15245e1869956656a30b6f45aca5b6d2",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 75,
"avg_line_length": 31.5,
"alnum_prop": 0.75,
"repo_name": "joongh/robotframework",
"id": "675ecf41f21c146573e69b864e6b2b7ef5c19206",
"size": "1400",
"binary": false,
... |
"""
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
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 applicable ... | {
"content_hash": "c45a966b196d2dcbb42843dfdf4f6fed",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 73,
"avg_line_length": 32.791666666666664,
"alnum_prop": 0.7395171537484116,
"repo_name": "parisk/pyOCD",
"id": "5bd3e06d15a4310aa23ac1403c8d714b060170b4",
"size": "787",
... |
from django import forms
from .models import ProductVariation
from django.forms import modelformset_factory
class ProductVariationForm(forms.ModelForm):
"""
Model form for ProductVariation form representation, connects to 'modelformset_factory'
"""
class Meta:
model = ProductVariation
... | {
"content_hash": "99ec40cdbd2ab24ae06ec920c34cde7d",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 100,
"avg_line_length": 32.53333333333333,
"alnum_prop": 0.7479508196721312,
"repo_name": "maistrovas/Internet-Store",
"id": "4114abc46a1c3c7c1e717aaa9c70518866ee2ff6",
"si... |
from distutils.core import setup
setup(name='l41_nbhub',
version='0.1',
description='Lab41 Modifications to Jupyter Hub, including Ganymede Logging Extension',
author='Lab41',
author_email='kylez@lab41.org',
url='https://github.com/kylemvz/l41_nbhub',
packages=['l41_nbhub']
)
| {
"content_hash": "b0ebcaf69285e49c1d65125e9b3696dc",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 93,
"avg_line_length": 32,
"alnum_prop": 0.659375,
"repo_name": "kylemvz/nbhub",
"id": "b37af815dad9fffec0855076cb977d77e509357f",
"size": "343",
"binary": false,
"copi... |
"""
This module contains symbolic implementations of VEX operations.
"""
import re
import sys
import collections
import itertools
import operator
import logging
l = logging.getLogger("angr.engines.vex.irop")
import pyvex
import claripy
#
# The more sane approach
#
def op_attrs(p):
m = re.match(r'^Iop_' \
... | {
"content_hash": "ae8f74c16ead126eae55e28b8cc08ab0",
"timestamp": "",
"source": "github",
"line_count": 914,
"max_line_length": 142,
"avg_line_length": 38.15317286652079,
"alnum_prop": 0.5511011699931176,
"repo_name": "axt/angr",
"id": "f61932929245442baf493ebaba5449c03f23d687",
"size": "34894",
... |
"""
:mod:`imports` is here to resolve import statements and return the
modules/classes/functions/whatever, which they stand for. However there's not
any actual importing done. This module is about finding modules in the
filesystem. This can be quite tricky sometimes, because Python imports are not
always that simple.
... | {
"content_hash": "583e5ad13f87e60ca05786a10c17a263",
"timestamp": "",
"source": "github",
"line_count": 412,
"max_line_length": 89,
"avg_line_length": 38.40533980582524,
"alnum_prop": 0.5328319534854326,
"repo_name": "stevenbaker/dotfiles",
"id": "e83a9c51bdde25bc1ea25ea16bdf20b5d10bb3a2",
"size": ... |
import pytest
import cupy
if cupy.cuda.runtime.is_hip:
pytest.skip('HIP sparse support is not yet ready',
allow_module_level=True)
| {
"content_hash": "8b442fa27bb31b220afeecbc2b5cc5be",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 54,
"avg_line_length": 19.25,
"alnum_prop": 0.6688311688311688,
"repo_name": "cupy/cupy",
"id": "611a436332b61fd316114431f946199aba8d8bea",
"size": "154",
"binary": false,... |
from __future__ import absolute_import, division, print_function
__all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__author__",
"__email__", "__license__", "__copyright__",
]
__title__ = "libtrust"
__summary__ = "Docker's libtrust but in Python."
__uri__ = "https://github.com/public/libtrust"... | {
"content_hash": "1f596e016cf24a0e9a2f6830823efc8b",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 71,
"avg_line_length": 28.61111111111111,
"alnum_prop": 0.5786407766990291,
"repo_name": "public/python-libtrust",
"id": "9eaa7698b056fe0a17bedb8a8a145d2ac192b52c",
"size":... |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Test that we can generate Visual Studio 6 project (.dsp) and solution
(.dsw) files that look correct.
"""
import TestSConsMSVS
test = TestSConsMSVS.TestSConsMSVS()
host_arch = test.get_vs_host_arch()
# Make the test infrastructure think we have ... | {
"content_hash": "8db3f10253dba4bb5d71ab98bfe5990a",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 76,
"avg_line_length": 26.883333333333333,
"alnum_prop": 0.7197768133911965,
"repo_name": "Distrotech/scons",
"id": "adc87d9e86663f0ed731defdab20a2ee82d9c917",
"size": "271... |
import os
from vcr import persist
from vcr.serialize import CASSETTE_FORMAT_VERSION
from vcr.serializers import compat
from vcr_unittest import VCRTestCase
# The "GENERATE_TEST" environment variable indicates that
# we're recording new cassettes.
if os.environ.get('GENERATE_TESTS'):
# Use default polling interval... | {
"content_hash": "33ce40559d73b2163c267dd7a3284b9c",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 66,
"avg_line_length": 27.641509433962263,
"alnum_prop": 0.673037542662116,
"repo_name": "civisanalytics/civis-python",
"id": "7b635bc17edee6accf21c713f02d477f2ea2ee56",
"s... |
import pygame
import sys
import time
import os
from pygame.locals import *
from .button import Button
from .application import appli_init_loop, appli_fetch_loop
from .globals import screen_width, screen_height, FPS, fps_clock, assetsPath
def draw_menu(screen, menu_img):
"""Draw the main menu where the user can c... | {
"content_hash": "3aba0958e8cc4aa5c56d24c919a46806",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 78,
"avg_line_length": 33.56603773584906,
"alnum_prop": 0.6363125351320967,
"repo_name": "pleeplee-robot/interface",
"id": "6648e00ee5cc225a664b8b1e2bee1d53a3a57a88",
"size... |
import re
import os
import sys
import multiprocessing as mp
import lxml.html
import requests
from selenium import webdriver
import selenium.webdriver.support.ui as selui
def ieee_lookup(root):
result = root.xpath('//div[@id="articleDetails"]/div/div/p/text()')
return result[0] if result else None
def spring... | {
"content_hash": "d88e1c2dd71731ad302e4d5cba511225",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 78,
"avg_line_length": 29.800904977375566,
"alnum_prop": 0.6131187367142423,
"repo_name": "praisondani/dblp",
"id": "fa2a5c9f9dd49263c3c80e3148d34de5174aa3d8",
"size": "65... |
from __future__ import absolute_import, division, print_function
from dynd._pydynd import w_type as type, \
make_byteswap, make_fixedbytes, make_convert, \
make_view, \
make_unaligned, make_fixedstring, make_string, \
make_pointer, make_struct, make_cstruct, \
make_strided_dim, ... | {
"content_hash": "367807702f84cdd6f5d824d5ce182279",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 74,
"avg_line_length": 31,
"alnum_prop": 0.693891557995882,
"repo_name": "aterrel/dynd-python",
"id": "463865910fab6294ee8dbffd6e48f86b06c03be6",
"size": "1457",
"binary"... |
""" Enable is an interactive graphical component framework built on top of Kiva.
See https://www.enthought.com/enthought/wiki/EnableProject
"""
# Major package imports
# TODO - Add basic comments for the names being imported from base and enable_traits
from base import IDroppedOnHandler, TOP, VCENTER, BOTTOM, LEFT, H... | {
"content_hash": "f76abe8c3c022f7cdd69bd564e0ca1f2",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 85,
"avg_line_length": 41,
"alnum_prop": 0.8015138772077376,
"repo_name": "tommy-u/enable",
"id": "c104ff5a64d4a9bb0961d5eb823e6fd562858f81",
"size": "2378",
"binary": fa... |
import os
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-bitcoinrpc"))
from bitcoinrpc.authproxy import JSONRPCException
from decimal import Decimal
from names import NameTestFramework
from util import assert_equal
class NameRawTxTest (NameTestFramework):
def run_test (... | {
"content_hash": "454c5ef18bd2e6e31f471f8d2a7ec7e4",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 94,
"avg_line_length": 34.73626373626374,
"alnum_prop": 0.6380892122745967,
"repo_name": "FinalHashLLC/namecore",
"id": "d3442061339479bf2b52856cebb56e8b60467d6f",
"size": ... |
from __future__ import unicode_literals
import datetime
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Categor... | {
"content_hash": "3794ba70929a104ae0b0e092bf7f5a20",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 160,
"avg_line_length": 51.722627737226276,
"alnum_prop": 0.5441716059836297,
"repo_name": "nanuxbe/django",
"id": "a7e40f503205e353763b6fd2bfae34a93d927f6a",
"size": "711... |
import numpy as np
import json
import os
import funzioniDB as fdb
STR_DIRECTORY = "."+os.sep+"Temp"+os.sep
STR_TEST_FILE = "TestSet"
STR_TRAINING_FILE = "TrainingSet"
STR_CONF_FILE = "ConfFile"
STR_ESTENSIONE = ".dip"
MSG_NO_FILE = "Un file necessario non e' stato trovato, ripetere il processo di cross-validazione"
d... | {
"content_hash": "006e2db10d0a0f05d1fbdb321851039e",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 98,
"avg_line_length": 26.03921568627451,
"alnum_prop": 0.6423192771084337,
"repo_name": "agb91/ImageRecognitionClustering",
"id": "9ba9b784e7fb4979977555a69c144b4c41870224",... |
"""Supporting functions for checks requiring the eQuilibrator API."""
from __future__ import absolute_import
import logging
from collections import Iterable, defaultdict
from sys import version_info
from six import iteritems, string_types
if version_info[:2] >= (3, 5):
from equilibrator_api import CompoundMatc... | {
"content_hash": "e2d68d2eef8c2642899968e791969c26",
"timestamp": "",
"source": "github",
"line_count": 219,
"max_line_length": 87,
"avg_line_length": 34.84931506849315,
"alnum_prop": 0.6451781970649895,
"repo_name": "opencobra/memote",
"id": "57d1f031c2654d5f1560a0f195a9172d17ff778b",
"size": "831... |
import os
from django.core.management.base import BaseCommand
from web.service import load
class Command(BaseCommand):
""" Load some words into the database """
def run_from_argv(self, argv):
load.load_words() | {
"content_hash": "4eea48bbf95b9c8a2ea413544b4e1fd6",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 51,
"avg_line_length": 18.384615384615383,
"alnum_prop": 0.6820083682008368,
"repo_name": "bdelliott/wordgame",
"id": "d18e9bed12be8ce2f07c5f84da05948693dd4dd1",
"size": "2... |
from __future__ import absolute_import
from evechem_api.models.link import Link
from .base_model_ import Model
from datetime import date, datetime
from typing import List, Dict
from ..util import deserialize_model
class EquipmentUpdate(Model):
"""
NOTE: This class is auto generated by the swagger code generat... | {
"content_hash": "f01b90c6406ccf1e032dab1f0900de29",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 122,
"avg_line_length": 26.427745664739884,
"alnum_prop": 0.5798337707786526,
"repo_name": "Melsik/evechemapi",
"id": "ef9be33ebd684e1d1bcef8e1ab7049935acbbec7",
"size": "... |
try:
from unittest import mock
except ImportError: # Python 3.2 and below
import mock
import datetime
from django.test import TestCase
from django.core.files.base import ContentFile
from django.utils.six.moves.urllib import parse as urlparse
from boto.exception import S3ResponseError
from boto.s3.key import... | {
"content_hash": "22def870a6ba7f8f0e647cacfb0f066d",
"timestamp": "",
"source": "github",
"line_count": 329,
"max_line_length": 91,
"avg_line_length": 36.25835866261398,
"alnum_prop": 0.5951881968312516,
"repo_name": "chenjyw/django-storages",
"id": "e19ed92b93c96c3f885b747949a986270a8fd6fc",
"size... |
from oslo_utils import strutils
import six.moves.urllib.parse as urlparse
import webob
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
import nova.context
from nova import exception
from nova.i18n import _
from nova import objects
from nova import quota
from nova import utils
QUOTAS = q... | {
"content_hash": "de28f82381f06935d8ecbb7e929ab74a",
"timestamp": "",
"source": "github",
"line_count": 235,
"max_line_length": 79,
"avg_line_length": 40.85531914893617,
"alnum_prop": 0.5713988126236851,
"repo_name": "bgxavier/nova",
"id": "1ac076e478e062a22db8c9ba9a5289177b7ea5c2",
"size": "10237"... |
"""
====================
The Header Docstring
====================
When writting latex in a Python string keep in mind to escape the backslashes
or use a raw docstring
.. math:: \\sin (x)
Closing this string quotes on same line"""
##############################################################################
# Direc... | {
"content_hash": "04334f95036b511457fbe2ba85f687bb",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 79,
"avg_line_length": 25.467391304347824,
"alnum_prop": 0.42168160478019634,
"repo_name": "test-organization-tmp/test-repo",
"id": "5bc0a62c271b0684541b810cbd14262498f1e4fa"... |
"""
python -c "import utool as ut; ut.write_modscript_alias('Tgen.sh', 'ibeis.templates.template_generator')"
sh Tgen.sh --key chip --Tcfg with_setters=False with_getters=True with_adders=True --modfname manual_chip_funcs
sh Tgen.sh --key chip
python -m utool.util_inspect --exec-check_module_usage --pat="manual_chip_... | {
"content_hash": "ff36152a6ae0871791aa064990b9b054",
"timestamp": "",
"source": "github",
"line_count": 382,
"max_line_length": 127,
"avg_line_length": 35.21465968586387,
"alnum_prop": 0.6140350877192983,
"repo_name": "SU-ECE-17-7/ibeis",
"id": "27a914a1f996bfffb28b7a4f1ecebf7b2558d6c2",
"size": "1... |
"""
COHORTE Monitor: Monitor included in the F/M/N process
:author: Thomas Calmant
:license: Apache Software License 2.0
:version: 1.0.0
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You ... | {
"content_hash": "cf4f208b18618300e22d925956cbd858",
"timestamp": "",
"source": "github",
"line_count": 509,
"max_line_length": 80,
"avg_line_length": 31.941060903732808,
"alnum_prop": 0.574424898511502,
"repo_name": "isandlaTech/cohorte-demos",
"id": "83d0ecd61d59652b2a64a41f26a9cf7be9cdc5b2",
"si... |
"""Helper functions for hashing functionality."""
import base64
import binascii
from hashlib import md5
import os
from boto import config
import crcmod
from gslib.commands.config import CHECK_HASH_ALWAYS
from gslib.commands.config import CHECK_HASH_IF_FAST_ELSE_FAIL
from gslib.commands.config import CHECK_HASH_IF_FA... | {
"content_hash": "7bcc3c48c9e93523e79c281314770c1c",
"timestamp": "",
"source": "github",
"line_count": 388,
"max_line_length": 80,
"avg_line_length": 35.43556701030928,
"alnum_prop": 0.706524110844425,
"repo_name": "ychen820/microblog",
"id": "a1e8c13705c16463a9853815c160fb2533ba7744",
"size": "14... |
from django.conf.urls import url
from family import views
urlpatterns = [
url(r'^(?P<slug>[-\w]+)/$', views.detail, name='detail'),
] | {
"content_hash": "c67dacf0cff8e43c3e8657e2e720efca",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 61,
"avg_line_length": 17.5,
"alnum_prop": 0.6428571428571429,
"repo_name": "cmunk/protwis",
"id": "109150d4624ab0a16e8798f3b479275365c8ac3a",
"size": "140",
"binary": fal... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('Scouting2016', '0033_auto_20170121_0010'),
]
operations = [
migrations.RenameField(
model_name='teampitscouting',
old_name='teamAlly... | {
"content_hash": "d65ccc52e6843ff551ebe749c75e8466",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 52,
"avg_line_length": 28.423076923076923,
"alnum_prop": 0.5446549391069012,
"repo_name": "ArcticWarriors/scouting-app-2016",
"id": "5ae18f9fcd620c5a6f7cc3bb654acc783df0e662"... |
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Get-SQLColumnSampleData',
'Author': ['@_nullbind', '@0xbadjuju'],
'Description': ('Returns column information from target SQL Servers. Supports '
... | {
"content_hash": "365f6c57bfc822f0fee86773aa1617c3",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 134,
"avg_line_length": 38.846846846846844,
"alnum_prop": 0.47634508348794063,
"repo_name": "api0cradle/Empire",
"id": "cb73c0748cb3979754c4cebbf3bbd792570520f5",
"size": ... |
from django.db.models import signals
def create_perm(*args, **kwargs):
"""
Creates a fake content type and permission
to be able to check for permissions
"""
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django import VERS... | {
"content_hash": "fb0ee78f9a30ba3ad3bcad74dcf3f6fd",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 83,
"avg_line_length": 34.60606060606061,
"alnum_prop": 0.638353765323993,
"repo_name": "django-leonardo/django-constance",
"id": "0dd2861ab9f694f73310d1158b1c660f06b80c9a",
... |
from __future__ import unicode_literals
import re
from django.core.mail import send_mail
from django.core import validators
from django.db import models
from django.db.models.manager import EmptyManager
from django.utils.crypto import get_random_string
from django.utils import six
from django.utils.translation import ... | {
"content_hash": "dc7d76789af6a260d1cbb5238e6a948d",
"timestamp": "",
"source": "github",
"line_count": 485,
"max_line_length": 107,
"avg_line_length": 34.876288659793815,
"alnum_prop": 0.6364173810227609,
"repo_name": "ZhaoCJ/django",
"id": "8db304f620f07c9466393b8f6b181a33a5545a48",
"size": "1691... |
from django.http import HttpResponse
# Create your views here.
def index(request):
return HttpResponse("Hello, world. You're at the polls index.") | {
"content_hash": "4864b2874c66da284e3517264bc2307a",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 67,
"avg_line_length": 25.333333333333332,
"alnum_prop": 0.75,
"repo_name": "shinzhon/dockerdjango_testrepo",
"id": "83a99b4bd3ffd0e994323cb738a0bcc32c22d70b",
"size": "152"... |
import json
import logging
import os
import signal
import sys
import time
import re
import importlib
from zerver.lib.actions import internal_send_private_message, \
internal_send_stream_message, internal_send_huddle_message
from zerver.models import UserProfile, get_active_user
from zerver.lib.bot_storage import ge... | {
"content_hash": "a9a12dbd570be6dc58cf18c13d48550a",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 101,
"avg_line_length": 38.68852459016394,
"alnum_prop": 0.6283898305084745,
"repo_name": "jackrzhang/zulip",
"id": "e14ed859a1573824e0e0868fe3e9b4e8226cdb9e",
"size": "47... |
import libpry
import libqtile, libqtile.sh, libqtile.confreader, libqtile.layout
import utils
class ShConfig(libqtile.confreader.Config):
keys = []
groups = ["a", "b"]
layouts = [
libqtile.layout.Max(),
]
screens = [
libqtile.manager.Screen()
]
class uQSh(utils.QtileTests):
... | {
"content_hash": "1cb90a5a1e9399cb7860c0df17edebd7",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 79,
"avg_line_length": 28.532608695652176,
"alnum_prop": 0.5352380952380953,
"repo_name": "bavardage/qtile",
"id": "2d2c01f0127effb0feca489bab5a16d41d099adf",
"size": "2625... |
import sys, os, re, errno
import markdown
import simplejson as json
from cuddlefish import packaging
from cuddlefish import Bunch
from cuddlefish.docs import apiparser
from cuddlefish.docs import apirenderer
INDEX_PAGE = '/doc/static-files/base.html'
BASE_URL_INSERTION_POINT = '<base '
HIGH_LEVEL_PACKAGE_SUMMARIES = ... | {
"content_hash": "ce8bdce54f491c9b24727984a98a779a",
"timestamp": "",
"source": "github",
"line_count": 200,
"max_line_length": 79,
"avg_line_length": 43.25,
"alnum_prop": 0.5858959537572255,
"repo_name": "grammarly/browser-extensions",
"id": "50f34165db4961c99137d8a514c7b9a398f3b68b",
"size": "865... |
__requires__ = 'Babel==1.3'
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
load_entry_point('Babel==1.3', 'console_scripts', 'pybabel')()
)
| {
"content_hash": "c61f088166fbd35bd8f646ba755c48b5",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 70,
"avg_line_length": 25.125,
"alnum_prop": 0.5920398009950248,
"repo_name": "barbaralluz/prog-scripts",
"id": "1b6dd6fddd068bfbf3aee184517d569fbcc9ad20",
"size": "339",
... |
import os
import sys
from configobj import ConfigObj
from ._base import BaseFinder, BaseLoader, InvalidIniError
class IniFinder(BaseFinder):
def __init__(self, *args, **kwargs):
self.ext_name = ".ini"
super(IniFinder, self).__init__(*args, **kwargs)
def find_module(self, fullname, path=None)... | {
"content_hash": "a1909f8025b2a6878e518f0746a32d16",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 76,
"avg_line_length": 28.708333333333332,
"alnum_prop": 0.5631349782293179,
"repo_name": "hzruandd/ezcf",
"id": "067481fb8e104c8230e13c267cafd9c6b082db49",
"size": "1378",... |
__author__ = 'Marcin Joachimiak <mjoachimiak@lbl.gov>'
__date__ = '11/06/15'
import doekbase.data_api
from doekbase.data_api.annotation.genome_annotation.api import GenomeAnnotationAPI
import os
import json
#skeleton method demoonstrating how to retrieve various data about an assembly
def contig_gc(genome_annotation,... | {
"content_hash": "568044bd3b7d96681fa0fab5630ca025",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 143,
"avg_line_length": 29.9,
"alnum_prop": 0.7006688963210702,
"repo_name": "kkellerlbl/data_api",
"id": "9da8506ef171b6e6fa464226f8a3364699a0a6e5",
"size": "1197",
"bin... |
from django.shortcuts import render, render_to_response, redirect
from django.http import HttpResponse
from django.core.context_processors import csrf
from models import Kullanici, Twit, Takip, DM
# Create your views here.
def index(request):
if 'is_authenticated' in request.session:
return render_to_response("inde... | {
"content_hash": "f98f8c80e7ebc38337d2238a2be0f89d",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 81,
"avg_line_length": 28.92105263157895,
"alnum_prop": 0.7179253867151957,
"repo_name": "ufukhurriyetoglu/twitter-clone",
"id": "a091e3c2822fe6303276cd8ae467db10d474ac70",
... |
"""Client side of the conductor RPC API."""
from oslo.config import cfg
from oslo import messaging
from nova.objects import base as objects_base
from nova.openstack.common import jsonutils
from nova import rpc
CONF = cfg.CONF
rpcapi_cap_opt = cfg.StrOpt('conductor',
help='Set a version cap for messages sent... | {
"content_hash": "f8acb8c9e0df3d3c432bb45c8e5cd29c",
"timestamp": "",
"source": "github",
"line_count": 419,
"max_line_length": 79,
"avg_line_length": 44.68257756563246,
"alnum_prop": 0.6055442794573229,
"repo_name": "CiscoSystems/nova",
"id": "6315d1a1b29e5e1c40691fdae7685fd25fbb7f5f",
"size": "19... |
from setuptools import setup
import os
setup(name='django-test-without-migrations',
version='0.6',
description='Disable migrations when running your Django tests.',
long_description=open(os.path.join(os.path.dirname(__file__), "README.rst")).read(),
author="Henrique Bastos", author_email="henr... | {
"content_hash": "87e45ef343ce69b99a3e6f21d8c31635",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 90,
"avg_line_length": 36.96969696969697,
"alnum_prop": 0.6065573770491803,
"repo_name": "henriquebastos/django-test-without-migrations",
"id": "37705507c52d037d45c10d4c3a78c... |
from msrest.serialization import Model
class VirtualMachineScaleSetOSProfile(Model):
"""Describes a virtual machine scale set OS profile.
:param computer_name_prefix: The computer name prefix.
:type computer_name_prefix: str
:param admin_username: The admin user name.
:type admin_username: str
... | {
"content_hash": "e87a908d4f28d5faa1de85ded40cc9f7",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 178,
"avg_line_length": 51.41860465116279,
"alnum_prop": 0.6974219810040706,
"repo_name": "v-iam/azure-sdk-for-python",
"id": "28d28b8206fd467fed548d0f7425771700ec836e",
"s... |
"""Contains generic regular expression tests which run against the entire
contents of files."""
import os
import re
from validator.contextgenerator import ContextGenerator
from validator.decorator import define_post_init
from .base import RegexTestBase
class FileRegexTest(RegexTestBase):
"""Matches regular expre... | {
"content_hash": "61f10b235b06525a5da323db2d184b2d",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 79,
"avg_line_length": 36.8780487804878,
"alnum_prop": 0.6177248677248677,
"repo_name": "kmaglione/amo-validator",
"id": "4bd92676cc479fd8be91be8a2bdca3c300367014",
"size":... |
import glob
import os
import pathlib
import shutil
import sys
import nox
import nox.sessions
import py.path
nox.options.error_on_external_run = True
nox.options.error_on_missing_interpreters = True
IS_LINUX = sys.platform in ("linux", "linux2")
IS_MACOS = sys.platform == "darwin"
IS_WINDOWS = os.name == "nt"
DEPS =... | {
"content_hash": "34949b9764c00c4590ef2725b30fb06d",
"timestamp": "",
"source": "github",
"line_count": 636,
"max_line_length": 79,
"avg_line_length": 32.007861635220124,
"alnum_prop": 0.6022989635014983,
"repo_name": "dhermes/bezier",
"id": "22bb260c653696ea9a17ec7ffaa0610ecdbc72ab",
"size": "2090... |
import os
from debian_bundle.deb822 import Dsc
from django.conf import settings
from django.core.management.base import BaseCommand
from repomgmt import utils
from repomgmt.models import Repository, Series
def get_repository_name(options, environ=os.environ):
if 'repository' in options:
return options[... | {
"content_hash": "f7f3beb68107c5525fb3ab044cc83d10",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 84,
"avg_line_length": 29.875,
"alnum_prop": 0.6126718469814704,
"repo_name": "sorenh/python-django-repomgmt",
"id": "2ab1e2a7a26f29754eb48fef9c8b60dae9590b63",
"size": "23... |
from model.group import Group
def test_add_group(app):
old_groups = app.group.get_group_list()
group = Group (gr_name="testttt1", gr_header="tt1", gr_footer="tt2")
app.group.create(group)
assert len (old_groups) + 1 == app.group.count()
new_groups = app.group.get_group_list()
old_groups.append... | {
"content_hash": "3d501c96b53960b662bd07ecbe974c6a",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 97,
"avg_line_length": 38.72727272727273,
"alnum_prop": 0.6666666666666666,
"repo_name": "denis-nuzhdin/test_py",
"id": "e874514ae9f1d640054a79aa54e42a0eb79033d0",
"size": ... |
from traits.api import Any, HasTraits, Int, Python
#--[Code]-----------------------------------------------------------------------
class Person(HasTraits):
temp_count = Int(-1)
temp_ = Any
_ = Python
| {
"content_hash": "810c85fed2729fa9222e51eb59b3993a",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 80,
"avg_line_length": 23.1,
"alnum_prop": 0.38961038961038963,
"repo_name": "burnpanck/traits",
"id": "d81a4582ee44cc302bc4f3028c9aadc4a6d2ff25",
"size": "442",
"binary"... |
## FD data in FDF
#
#
class FDClassObject:
## The constructor
#
# @param self The object pointer
#
def __init__(self):
self.FdUiName = ''
self.CreateFileName = None
self.BaseAddress = None
self.BaseAddressPcd = None
self.Size = None
... | {
"content_hash": "a165d4f478872e8899267dedc024d00a",
"timestamp": "",
"source": "github",
"line_count": 396,
"max_line_length": 67,
"avg_line_length": 24.795454545454547,
"alnum_prop": 0.5436398818616968,
"repo_name": "tianocore/buildtools-BaseTools",
"id": "ce3df12058c05ac7974dd580d9a0ade6264cccfd",... |
"""Test the Smart Meter Texas module."""
from homeassistant.components.homeassistant import (
DOMAIN as HA_DOMAIN,
SERVICE_UPDATE_ENTITY,
)
from homeassistant.components.smart_meter_texas.const import DOMAIN
from homeassistant.config_entries import (
ENTRY_STATE_LOADED,
ENTRY_STATE_NOT_LOADED,
ENTRY... | {
"content_hash": "9aa07b845f67a398943cc194f46850ef",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 82,
"avg_line_length": 35.486111111111114,
"alnum_prop": 0.7162426614481409,
"repo_name": "tboyce021/home-assistant",
"id": "861425601ece059ad9709a949da4cac329f771bd",
"siz... |
from math import ceil
import bigdl.nn.initialization_method as BInit
from bigdl.optim.optimizer import L1L2Regularizer as BRegularizer
def to_bigdl_2d_ordering(order):
if order == "tf":
return "NHWC"
elif order == "th":
return "NCHW"
else:
raise Exception("Unsupported dim_ordering... | {
"content_hash": "74520bc6950d4b7277a816b233547d53",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 88,
"avg_line_length": 30.936708860759495,
"alnum_prop": 0.5855155482815058,
"repo_name": "i8run/BigDL-1",
"id": "6e0484eec4c914ae6a7b48b1a3ab8a29fbb5ce8a",
"size": "3031",... |
"""Tests for IPython.utils.capture"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#--------------... | {
"content_hash": "52164a2b3fd0dbd8b36d5cde02f3e307",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 89,
"avg_line_length": 34.9125,
"alnum_prop": 0.5733977801646974,
"repo_name": "omni5cience/django-inlineformfield",
"id": "f3305d50487df3af3e742d550a4c06c7716e3011",
"siz... |
import tensorflow as tf
import numpy as np
from data import *
def weight_variable(shape, name=None):
initial = tf.truncated_normal(shape, stddev=0.1)
if name:
return tf.Variable(initial, name)
else:
return tf.Variable(initial)
def entropy(vecc):
vecc = np.array(vecc)
return -np.sum(np.log(vecc) * ve... | {
"content_hash": "f26d484a536f5591bbaf4cc923efcbe5",
"timestamp": "",
"source": "github",
"line_count": 244,
"max_line_length": 107,
"avg_line_length": 35.24180327868852,
"alnum_prop": 0.6215839051052447,
"repo_name": "evanthebouncy/nnhmm",
"id": "860041cd9af082abb6991b3979924be8cd5556a5",
"size": ... |
import libvirt
import xml.etree.ElementTree as ET
import sys
import getopt
import os.path
import ConfigParser
import shutil
from jinja2 import Template
import subprocess
# Colored terminals
try:
from clint.textui import colored
except:
print "Error: Please install clint library to support color in the terminal... | {
"content_hash": "124118c799adec0fa1d25822e1f5327c",
"timestamp": "",
"source": "github",
"line_count": 404,
"max_line_length": 168,
"avg_line_length": 34.527227722772274,
"alnum_prop": 0.5594666284321457,
"repo_name": "miguelaferreira/MCT-shared",
"id": "ce67e0d408b83546f1b030045d0685cab48f25bf",
... |
import os
import subprocess
import json
import time
MOUNT_DIR = "/mnt/usb"
WPA_SUPPLICANT_FILE = "/etc/wpa_supplicant/wpa_supplicant.conf"
def mount_usb():
if not os.path.exists(MOUNT_DIR):
os.makedirs(MOUNT_DIR)
cmd = "mount /dev/sda1 /mnt/usb"
subprocess.call(cmd, shell=True)
def get_creds():... | {
"content_hash": "1df7fb72a959f5b9cd1bb1132c3d5f46",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 93,
"avg_line_length": 24.705882352941178,
"alnum_prop": 0.6198412698412699,
"repo_name": "augment00/a00_pi",
"id": "c7049a6366b16ede857b0d119839ac6fcabd3a82",
"size": "126... |
__source__ = 'https://leetcode.com/problems/largest-number-at-least-twice-of-others/'
# Time: O(N)
# Space: O(1)
#
# Description: Leetcode # 747. Largest Number At Least Twice of Others
#
# In a given integer array nums, there is always exactly one largest element.
#
# Find whether the largest element in the array is ... | {
"content_hash": "769fa0321ad92b62312bebf2709d7a4c",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 109,
"avg_line_length": 26.766233766233768,
"alnum_prop": 0.6069868995633187,
"repo_name": "JulyKikuAkita/PythonPrac",
"id": "1e484e4f9c0c89658763538b15d11a5a7e675907",
"si... |
from __future__ import unicode_literals
from django.conf import settings
from django.db import models
class FeedbackItem(models.Model):
timestamp = models.DateTimeField(auto_now_add=True)
user = models.ForeignKey(settings.AUTH_USER_MODEL)
resolved = models.BooleanField(default=False)
content = models... | {
"content_hash": "6cf0f6e0276d9a7eb4bf8eb7a74a4f7f",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 90,
"avg_line_length": 35.32432432432432,
"alnum_prop": 0.6954858454475898,
"repo_name": "littleweaver/django-talkback",
"id": "593afdadc38e331bb725e05e93bf1de2903c284d",
"... |
import json
import flask
from flask import Flask
from flask import render_template
import httplib2
from apiclient import discovery
from oauth2client import client
import datetime
from main import main
app = flask.Flask(__name__)
development=True
if development:
CLIENT_SECRETS='client_secrets.json'
else:
CL... | {
"content_hash": "0497233869ab7aca58798a7b7aed5e0a",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 162,
"avg_line_length": 31.450381679389313,
"alnum_prop": 0.6912621359223301,
"repo_name": "KiranJKurian/XScheduler",
"id": "2aa1a3244be17a321fa4680fd10e901a8e45ef6c",
"si... |
import argparse
from openpyxl import load_workbook
import os
# 导入调试用工具,彩色打印,区分 print 打印 debug 打印 exception 打印
def parse_command():
parser = argparse.ArgumentParser(
prog="python3 sanitize.py",
description="sanitize data",
)
parser.add_argument(
'-f',
'--file',
... | {
"content_hash": "83bd84aef6bcfa054f869003255c7d1c",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 66,
"avg_line_length": 18.98076923076923,
"alnum_prop": 0.5759878419452887,
"repo_name": "oicebot/xlsx_parse",
"id": "cddcbf768d655a10c9acaa032079f19e99326858",
"size": "2... |
import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('tourism', '0034_touristicevent_participants'),
]
operations = [
migrations.Creat... | {
"content_hash": "e336d0f036cc73d07122b04176350c10",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 278,
"avg_line_length": 43.26470588235294,
"alnum_prop": 0.6118286879673691,
"repo_name": "GeotrekCE/Geotrek-admin",
"id": "5b574c2addedc7d5a6daa49847162eb83a9994ef",
"size... |
"""Tests for tensorflow.ops.io_ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os.path
import time
import contextlib
import shutil
import tempfile
import tensorflow.python.platform
import tensorflow as tf
import numpy as np
import six
from ... | {
"content_hash": "9652ddbb596fe8ed1fbf08aea28b9e9d",
"timestamp": "",
"source": "github",
"line_count": 703,
"max_line_length": 79,
"avg_line_length": 37.318634423897585,
"alnum_prop": 0.6343053173241853,
"repo_name": "lukas-krecan/tensorflow",
"id": "332642d9e2c3df865d3b7adc4353eb4716cd068c",
"siz... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.