text stringlengths 4 1.02M | meta dict |
|---|---|
import sys
import subprocess as subp
import getopt
DEFAULT_DEBUG_IMAGE_LOCATION = "/usr/lib/debug/boot/"
_default_loc = DEFAULT_DEBUG_IMAGE_LOCATION #convenience
#The list of modules to output for each kernel image. Modify this to output more or less modules
_module_list = [
"cred",
"dentry",
... | {
"content_hash": "37da110f0e30edb077c9531272f8e86c",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 96,
"avg_line_length": 25.041095890410958,
"alnum_prop": 0.5705689277899344,
"repo_name": "dalevy/python-pahole-utility",
"id": "0467f0c1f329df0ee65c1ca757998570b28ef401",
... |
import pygal
def CreateGraph(title,line1,line1_title,line2,line2_title,x_labels,save_file):
''' Needs
the file to write to
title
line line1
line line1 title
line line2
line line2 title
'''
line = pygal.Line()
line.title = title
line.x_labels = x_labels
line.add (lin... | {
"content_hash": "bf94e64b8502aa4b50f59370353f1e0c",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 78,
"avg_line_length": 17.652173913043477,
"alnum_prop": 0.6403940886699507,
"repo_name": "cocoloco69/pynet",
"id": "9f264b5ad5d8007c01a24837089b3dcefc2244ef",
"size": "429... |
from __future__ import unicode_literals
from django.db import migrations
from django.conf import settings
from django.utils.timezone import now
def add_missing_employee_vouches(apps, schema_editor):
UserProfile = apps.get_model('users', 'UserProfile')
IdpProfile = apps.get_model('users', 'IdpProfile')
f... | {
"content_hash": "f1745564558d6a39d15757b9e2dd4518",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 83,
"avg_line_length": 31.369565217391305,
"alnum_prop": 0.6243936243936244,
"repo_name": "akatsoulas/mozillians",
"id": "4faa7e0adbc44512c89403c51fbfce5e2a27a190",
"size":... |
__author__ = 'mosquito'
import os
import unittest
from project import app, db
from project._config import basedir
from project.models import User
TEST_DB = 'test.db'
class MainTests(unittest.TestCase):
############################
#### setup and teardown ####
############################
# executed... | {
"content_hash": "1f74a68f15360e69958a9b2ef3889975",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 74,
"avg_line_length": 27.904761904761905,
"alnum_prop": 0.5477815699658704,
"repo_name": "internetmosquito/flask-scheduler",
"id": "c67bba0f5102b8fffd56a49b3fafcb990a477d7e"... |
from . import app, mongo
from alexandria.decorators import *
from flask import request, jsonify, url_for, session
from flask.ext.classy import FlaskView, route
import json
from bson import json_util
import requests
import os
class UploadView(FlaskView):
route_prefix = '/api/'
@authenticated
def search(se... | {
"content_hash": "be1110db5e58ce8ef10aae7ffd59e6dc",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 111,
"avg_line_length": 30.393939393939394,
"alnum_prop": 0.5217680292455965,
"repo_name": "citruspi/Alexandria",
"id": "900e8d2a8e1d9e37ad4beb7eaecfa8d45c668487",
"size": ... |
import psutil
from flask_restful import Resource
from .. import common
class DiskPartitions(Resource):
def get(self):
return common.to_dict(psutil.disk_partitions(all=True))
class DiskUsage(Resource):
def get(self, path):
return common.to_dict(psutil.disk_usage(path))
class DiskIO(Resourc... | {
"content_hash": "a550e42bcc98430249e8178bf29699a2",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 69,
"avg_line_length": 22.25,
"alnum_prop": 0.7059925093632958,
"repo_name": "natict/roomservice",
"id": "952f4874e6b91c73e9536864ea9fdd4a1fb7a937",
"size": "534",
"binar... |
from setuptools import setup, find_packages
from setuptools import Command
__version__ = '0.4.4'
long_description = file('README.markdown', 'r').read()
class tag(Command):
"""Tag git release."""
description = __doc__
user_options = []
def initialize_options(self):
pass
def finalize_opti... | {
"content_hash": "c5a69259ac5704fe6512f5a8c0d6754c",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 84,
"avg_line_length": 26.666666666666668,
"alnum_prop": 0.5875,
"repo_name": "ftahmed/cli53",
"id": "0984a20f5b1b42762266d2e34ad51f4cd5190ba9",
"size": "1280",
"binary":... |
import six.moves.cPickle as pickle
import mock
import os
import unittest
import random
import itertools
from contextlib import closing
from gzip import GzipFile
from tempfile import mkdtemp
from shutil import rmtree
from test.unit import FakeLogger
from time import time
from distutils.dir_util import mkpath
from event... | {
"content_hash": "fce5493947cac53a7ff50b4a56f83588",
"timestamp": "",
"source": "github",
"line_count": 476,
"max_line_length": 78,
"avg_line_length": 39.42857142857143,
"alnum_prop": 0.5166773231031543,
"repo_name": "aerwin3/swift",
"id": "1990e4a6b3a1b4a2da87129ad6f9d63a0002cfb9",
"size": "19363"... |
"""Methods for read-out functions from GraphTensor."""
import tensorflow as tf
import tensorflow_gnn as tfgnn
def readout_seed_node_features(
graph_tensor: tfgnn.GraphTensor, node_set_name: str = tfgnn.NODES,
node_feature_name: str = tfgnn.HIDDEN_STATE) -> tf.Tensor:
"""Read node features of multiple seed ... | {
"content_hash": "fd435b525f6394024e62a794a6708e32",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 80,
"avg_line_length": 41.440677966101696,
"alnum_prop": 0.7214723926380369,
"repo_name": "tensorflow/gnn",
"id": "965ead9e86171dcbc69df06d416c7e11ea5fb537",
"size": "3138"... |
from __future__ import unicode_literals
from django.db import models, migrations
from ..permissions import get_or_create_survey_admins_group
class Migration(migrations.Migration):
dependencies = [
('survey', '0018_openendedquestion_input_type'),
('auth', '__first__'),
]
operations = [
... | {
"content_hash": "49a536637cb82b5bef5f29cf085270c7",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 64,
"avg_line_length": 24.375,
"alnum_prop": 0.6692307692307692,
"repo_name": "tndatacommons/tndata_backend",
"id": "ce1f50a0e3f813c762082acda78a94f78c73753c",
"size": "414... |
import itertools
import json
import os
import sys
# ANGLE uses SPIR-V 1.0 currently, so there's no reason to generate code for newer instructions.
SPIRV_GRAMMAR_FILE = '../../../third_party/vulkan-deps/spirv-headers/src/include/spirv/1.0/spirv.core.grammar.json'
# The script has two sets of outputs, a header and sour... | {
"content_hash": "5ddd90060971e4cb7f8867e488e3d73a",
"timestamp": "",
"source": "github",
"line_count": 545,
"max_line_length": 132,
"avg_line_length": 39.80733944954128,
"alnum_prop": 0.5934547130675271,
"repo_name": "ppy/angle",
"id": "7af597ad03394d01290d3be844e31fac227004da",
"size": "22059",
... |
import click
from nctrader import settings
from nctrader.compat import queue
from nctrader.price_parser import PriceParser
from nctrader.price_handler.yahoo_daily_csv_bar import YahooDailyCsvBarPriceHandler
from nctrader.strategy.moving_average_cross_strategy import MovingAverageCrossStrategy
from nctrader.strategy im... | {
"content_hash": "d88c2ba7aa3f2061e2080e18fae7af03",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 91,
"avg_line_length": 35.15,
"alnum_prop": 0.7467994310099573,
"repo_name": "nwillemse/nctrader",
"id": "16f8c524a53dd538458a0ee4a6771cdfba2b750d",
"size": "2812",
"bina... |
import datetime
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.core.paginator import Paginator, InvalidPage
from django.core.urlresolvers import reverse
from django.db import connection, transaction
from django.http import Http404, HttpResponseForbidde... | {
"content_hash": "1333295d091926b262e45dc71187566e",
"timestamp": "",
"source": "github",
"line_count": 985,
"max_line_length": 91,
"avg_line_length": 38.15532994923858,
"alnum_prop": 0.6104355692733416,
"repo_name": "insin/forum",
"id": "b03641bc7801522ffeb60743a2e49f9354b4e660",
"size": "37583",
... |
from __future__ import unicode_literals
from prompt_toolkit.contrib.shortcuts import get_input
if __name__ == '__main__':
print('Press [Meta+Enter] or [Esc] followed by [Enter] to accept input.')
answer = get_input('Give me some multiline input:\n', multiline=True)
print('You said: %s' % answer)
| {
"content_hash": "c9baed93e536721515fc7367955849b1",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 77,
"avg_line_length": 38.875,
"alnum_prop": 0.6784565916398714,
"repo_name": "Carreau/python-prompt-toolkit",
"id": "96bb4db39b284be836c443ba9fce2b7ca2651574",
"size": "333... |
"""Utilities for exploiting active subspaces when estimating integrals."""
import numpy as np
import utils.quadrature as gq
from utils.misc import conditional_expectations
from utils.designs import maximin_design
from utils.simrunners import SimulationRunner
from domains import UnboundedActiveVariableDomain, BoundedAc... | {
"content_hash": "ec4e37d8a1e4ae674d082f7e5df12414",
"timestamp": "",
"source": "github",
"line_count": 314,
"max_line_length": 81,
"avg_line_length": 30.878980891719745,
"alnum_prop": 0.6505775577557755,
"repo_name": "paulcon/active_subspaces",
"id": "9c23709d015e990ab838ea6a04bd7915c0b7e6bf",
"si... |
from gi.repository import Gtk as gtk
from gi.repository import Gdk as gdk
from gi.repository import GObject as gobject
from lib import graphics
from ui import Widget, Container, Bin, Table, Box, HBox, VBox, Fixed, Viewport, Group, TreeModel
import math
from gi.repository import Pango as pango
class _DisplayLabel(gra... | {
"content_hash": "289e7b15bbae6fd2be757c05ea9ef624",
"timestamp": "",
"source": "github",
"line_count": 272,
"max_line_length": 146,
"avg_line_length": 38.42279411764706,
"alnum_prop": 0.5962108889101522,
"repo_name": "projecthamster/experiments",
"id": "6c2af25dc74fa06e307e8253cec16727644a44f6",
"... |
class AppSettings(object):
"""App settings."""
def __init__(self, prefix):
"""Init APP_LABEL.
Here we can also perform logical check-ups of settings.
"""
self.prefix = prefix if prefix.endswith("_") else (prefix + "_")
@property
def APP_LABEL(self):
return self... | {
"content_hash": "7235d8330255a6720809669853927a0a",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 72,
"avg_line_length": 26.80327868852459,
"alnum_prop": 0.6275229357798165,
"repo_name": "atheiste/django-shop",
"id": "ffe3b9372939804386ace04de6f7065be7b488f4",
"size": "... |
from __future__ import absolute_import
import datetime
import unittest
import mock
PROJECT = "my-project"
METRIC_TYPE = "compute.googleapis.com/instance/uptime"
METRIC_LABELS = {"instance_name": "instance-1"}
METRIC_LABELS2 = {"instance_name": "instance-2"}
RESOURCE_TYPE = "gce_instance"
RESOURCE_LABELS = {
"pr... | {
"content_hash": "4aeaf60a0bce59251a8cb787c2c5cd23",
"timestamp": "",
"source": "github",
"line_count": 562,
"max_line_length": 88,
"avg_line_length": 37.61032028469751,
"alnum_prop": 0.6182996640961348,
"repo_name": "tswast/google-cloud-python",
"id": "20010ff60b3766960c954fa90822e087c8799f42",
"s... |
import warnings
import sys
import argparse
from etk.extractors.regex_extractor import RegexExtractor
def add_arguments(parser):
"""
Parse arguments
Args:
parser (argparse.ArgumentParser)
"""
parser.description = 'Examples:\n' \
'python -m etk regex_ext... | {
"content_hash": "e4c6eb1faedfe9dedc9fa78d2f4b7cfd",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 96,
"avg_line_length": 28.88235294117647,
"alnum_prop": 0.6140529531568228,
"repo_name": "usc-isi-i2/etk",
"id": "4a2be93e60be9bb1b2e8b3f59e33f0cd165e2792",
"size": "982",
... |
import itertools
import os
import collections
from mredoc.errors import InvalidDocumentTree
from mredoc.constants import ImageTypes, Languages
# Since we have 'fake' class wrappers, we let functions look like classes:
# pylint: disable-msg=C0103
def isiterable(obj):
return isinstance(obj, collections.Iterable)... | {
"content_hash": "02570ab39179f81b034b812d8999acdb",
"timestamp": "",
"source": "github",
"line_count": 714,
"max_line_length": 101,
"avg_line_length": 30.07843137254902,
"alnum_prop": 0.6253957906500279,
"repo_name": "mikehulluk/mredoc",
"id": "c58ea107285d95ea2f414cc8015d8cf8324ef82f",
"size": "2... |
import os
import time
import uuid
try:
from gssapi.exceptions import GSSError
from ipalib import api
from ipalib import errors
from ipapython.ipautil import kinit_keytab
ipalib_imported = True
except ImportError:
# ipalib/ipapython are not available in PyPy yet, don't make it
# a showstoppe... | {
"content_hash": "2906f4a47211f9d565c303d654646c7d",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 78,
"avg_line_length": 35.15422885572139,
"alnum_prop": 0.5598641381262384,
"repo_name": "vakwetu/novajoin_tempest_plugin",
"id": "ff23e35f84a4695ae6e12845521a5ceb13bc1d71",... |
import os
try:
from urllib.request import urlopen
except ImportError:
from urllib2 import urlopen
def get_test_dir():
return os.path.abspath(os.path.join(os.path.dirname(__file__), 'sources.list.d'))
def test_url_constants():
from rosdep2.rep3 import REP3_TARGETS_URL
for url_name, url in [('REP3... | {
"content_hash": "4925e844bc9c1794079b4c678b96b0ec",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 85,
"avg_line_length": 28.92105263157895,
"alnum_prop": 0.6287534121929026,
"repo_name": "allenh1/rosdep",
"id": "b6e5de8f95d84d19b25310cb066e3adf56a8ceab",
"size": "2678",... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 7, transform = "Fisher", sigma = 0.0, exog_count = 0, ar_order = 0); | {
"content_hash": "a0b36d41c71e55b8c676ba40c05d53ac",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 163,
"avg_line_length": 37.57142857142857,
"alnum_prop": 0.7034220532319392,
"repo_name": "antoinecarme/pyaf",
"id": "8b2d760e2abd047fba953c34620f1f66ae437ef9",
"size": "263... |
'''
Managing Ruby installations with rbenv.
========================================
This module is used to install and manage ruby installations with rbenv.
Different versions of ruby can be installed, and uninstalled. Rbenv will
be installed automatically the first time it is needed and can be updated
later. This mo... | {
"content_hash": "715515ec9f8360ee32a68d6ee33afce5",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 79,
"avg_line_length": 28.858870967741936,
"alnum_prop": 0.5745424060360487,
"repo_name": "victorywang80/Maintenance",
"id": "5670ebc8db164bc66524f85f4da0d39a45766f72",
"s... |
from __future__ import unicode_literals, print_function
import codecs
try:
import libextract.api
except ImportError:
libextract = None
import lxml.html
import requests
import sys
from nikola.plugin_categories import Command
from nikola import utils
LOGGER = utils.get_logger('import_page', utils.STDERR_HANDL... | {
"content_hash": "d30ccc42f69cc130c5dedfaa8c40c6d5",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 114,
"avg_line_length": 29.61764705882353,
"alnum_prop": 0.5744786494538232,
"repo_name": "getnikola/plugins",
"id": "618d6bfcde41e0885203f9ff73a4b4c2c783f1cb",
"size": "31... |
from datetime import datetime
import inspect
import sys
import wtforms.ext.dateutil.fields
import wtforms.fields
import wtforms.form
import wtforms.validators
class BaseForm(wtforms.Form):
name = "Override this in your forms"
def to_dict(self):
form_dict = {
field.name: field.data if not ... | {
"content_hash": "13f6c35c7255e41de253f274ba241dff",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 100,
"avg_line_length": 27.06,
"alnum_prop": 0.6651884700665188,
"repo_name": "regisb/mahamoti",
"id": "56472ea666df0a1c05775f116b7fa86b93da6f22",
"size": "1353",
"binary... |
import os
import sys
sys.path.insert(0, os.pardir)
from testing_harness import TestHarness, PyAPITestHarness
import openmc
class ScoreNuScatterNTestHarness(PyAPITestHarness):
def _build_inputs(self):
filt = openmc.Filter(type='cell', bins=(21, 22, 23))
t = openmc.Tally(tally_id=1)
t.add_fi... | {
"content_hash": "aebe9e4719ba609168b902db4def2fd6",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 65,
"avg_line_length": 30.47222222222222,
"alnum_prop": 0.6335460346399271,
"repo_name": "mjlong/openmc",
"id": "40029bd02c36d81c4d0510925e6189984e6bc830",
"size": "1120",
... |
'''
Verify the behavior of proxy.config.http.per_server.connection.max.
'''
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file... | {
"content_hash": "92eadab70139e30c919d98707c04af96",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 91,
"avg_line_length": 40.82432432432432,
"alnum_prop": 0.6653426017874876,
"repo_name": "duke8253/trafficserver",
"id": "d1d4a4da61475cdd0f6ac879d8e0d82db6196ba7",
"size":... |
"""
This class takes a dataframe of option chains and
returns a subset based on convenience methods provided
by this class to filter for specific option legs.
"""
import operator
import pandas as pd
from kaleidoscope.globals import Period, OptionType
class OptionQuery(object):
"""
The goal of this class is ... | {
"content_hash": "e8caae584541a9a11af7e6a4b6f16188",
"timestamp": "",
"source": "github",
"line_count": 285,
"max_line_length": 109,
"avg_line_length": 37.70175438596491,
"alnum_prop": 0.6056770590972546,
"repo_name": "michaelchu/kaleidoscope",
"id": "858d2c396853f6adc9502144dc90b52aaf999097",
"siz... |
from telemetry.value import list_of_scalar_values
from telemetry.value import scalar
from telemetry.value import improvement_direction
from telemetry.web_perf.metrics import timeline_based_metric
from telemetry.web_perf.metrics import webrtc_rendering_stats as stats_helper
WEB_MEDIA_PLAYER_MS_EVENT = 'WebMediaPlayerMS... | {
"content_hash": "6888c4ff3f14fef3b10ee63958807c09",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 79,
"avg_line_length": 38.32786885245902,
"alnum_prop": 0.7025235243798118,
"repo_name": "Workday/OpenFrame",
"id": "b49563e6caa1bf31d02028ec4235c85e6088f28b",
"size": "48... |
'''Map binary email table of contents files for the Eudora mail client to
Python objects.
The `Eudora <http://en.wikipedia.org/wiki/Eudora_(e-mail_client)>`_ email
client has a long history through the early years of email. It supported
versions for early Mac systems as well as early Windows OSes. Unfortunately,
most ... | {
"content_hash": "68726e7777964370ff71e2c15f0d8fe0",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 79,
"avg_line_length": 46.330357142857146,
"alnum_prop": 0.7429177105415301,
"repo_name": "emory-libraries/eulcommon",
"id": "24a0e623405fc5a3e34537f5a7fb882f9f8c86f8",
"s... |
"""
Similar to the autocompletion example. But display all the completions in multiple columns.
"""
from __future__ import unicode_literals
from prompt_toolkit.contrib.completers import WordCompleter
from prompt_toolkit.shortcuts import get_input
animal_completer = WordCompleter([
'alligator',
'ant',
'ap... | {
"content_hash": "28190419d18a49a77176239720205a98",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 108,
"avg_line_length": 17.942307692307693,
"alnum_prop": 0.5766345123258306,
"repo_name": "ALSchwalm/python-prompt-toolkit",
"id": "857a0a0386af14815f1e590a6da275eeea1b03cb"... |
"""Visual Studio Helper Utils."""
#===============================================================================
# Imports
#===============================================================================
import uuid
#===============================================================================
# Globals
#=========... | {
"content_hash": "73eb5dcd3c9324834a3e8ff77bff8036",
"timestamp": "",
"source": "github",
"line_count": 317,
"max_line_length": 179,
"avg_line_length": 50.32492113564669,
"alnum_prop": 0.6872061681188492,
"repo_name": "tpn/tpn",
"id": "f71029e0362daf93beff056b71cb94f06389a620",
"size": "15953",
"... |
"""
Django settings for demo project.
Generated by 'django-admin startproject' using Django 2.2.11.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
impo... | {
"content_hash": "c2b9872a13b6bafbd1dd1cfd0dce7940",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 91,
"avg_line_length": 26.77777777777778,
"alnum_prop": 0.6567542646380821,
"repo_name": "erdem/django-map-widgets",
"id": "7bcd9251c5fb35afbe1d36156b55a6b519d7ded4",
"siz... |
import json
from datetime import datetime, timedelta
from django.conf import settings
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.test.client import RequestFactory
import mock
from cache_nuggets.lib import Token
from nose.tools import eq_, ok_
import mkt
import mkt.re... | {
"content_hash": "63616c3801b34dafafd803d519036a52",
"timestamp": "",
"source": "github",
"line_count": 1056,
"max_line_length": 79,
"avg_line_length": 37.11742424242424,
"alnum_prop": 0.5900346974181039,
"repo_name": "mstriemer/zamboni",
"id": "df2d7789b5fb641181e94e612f2bcce00b4f6f84",
"size": "3... |
"""Model unit tests."""
import datetime as dt
from operator import methodcaller
import pytest
from league.admin.models import Role, User
from league.dashboard.models import Color, Game, Player
from .factories import GameFactory, PlayerFactory, UserFactory
@pytest.mark.usefixtures('db')
class TestUser:
"""User ... | {
"content_hash": "4970e57c7c850e2d7ba10335a4363f78",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 78,
"avg_line_length": 31.884615384615383,
"alnum_prop": 0.5904704463208685,
"repo_name": "hwchen/league",
"id": "7651e1a845313b8b346479fdec79919de8f77f6f",
"size": "3340"... |
import unittest, doctest
# These tests check that error handling in the Pyrex code is
# complete.
# It is likely that if there are errors, instead of failing the code
# will simply crash.
import sys, gc, os.path
from lxml import etree
this_dir = os.path.dirname(__file__)
if this_dir not in sys.path:
sys.path.ins... | {
"content_hash": "47cd4ad66006dc724cce51ed8645fa1c",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 69,
"avg_line_length": 27.122448979591837,
"alnum_prop": 0.6583897667419112,
"repo_name": "wilsonssun/baseball-gamethread",
"id": "c170784277c1145cbe14fe549dac319308023a4b",
... |
"""
Copyright 2013 Steven Diamond
This file is part of CVXPY.
CVXPY is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CVXPY is distributed i... | {
"content_hash": "877dd6bdcbd69f85d6415996d70cdd10",
"timestamp": "",
"source": "github",
"line_count": 660,
"max_line_length": 117,
"avg_line_length": 31.186363636363637,
"alnum_prop": 0.5200893941602294,
"repo_name": "riadnassiffe/Simulator",
"id": "2619a9130ead9dec03de4c1e2c3d801684e0a6ae",
"siz... |
'''
Created on May 10, 2011
@author: bolme
Reads in two sigsets and computes overlap statistics.
'''
import pyvision as pv
import optparse
import csv
import os.path
def parseOptions():
usage = "usage: %prog [options] <SIGSET_A.xml> <SIGSET_B.xml> \nReads in two sigsets and computes overlap statistics."
... | {
"content_hash": "3d7c8c875d7d149e76296c1d640d76d9",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 122,
"avg_line_length": 25.1125,
"alnum_prop": 0.5778994524639124,
"repo_name": "tigerking/pyvision",
"id": "5b5ca56756ada66baad19a64e19efea4405380e6",
"size": "3566",
"b... |
import sys, os
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../.."))
#print os.path.join(os.path.dirname(os.path.abspath(__file__)), "../..")
from Core.IdSet import IdSet
import Utils.Libraries.PorterStemmer as PorterStemmer
import Core.ExampleUtils as ExampleUtils
from FeatureBuilder impor... | {
"content_hash": "720d314e7713ef29c2c788ac76a12970",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 82,
"avg_line_length": 33.971830985915496,
"alnum_prop": 0.5866500829187397,
"repo_name": "ashishbaghudana/mthesis-ashish",
"id": "cc946f9a2aedd8a826384c68b296384133a26d5f",
... |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('VERSION.txt', 'r') as v:
version = v.read().strip()
with open('README.rst', 'r') as r:
readme = r.read()
download_url = (
'https://github.com/juliomalegria/django-chunked-upload/tarball/%s'
)
setup... | {
"content_hash": "251788a1e68042f69d78aee7f0b05bfa",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 77,
"avg_line_length": 27.233333333333334,
"alnum_prop": 0.6707466340269278,
"repo_name": "CodeYellowBV/django-chunked-upload",
"id": "d0b3866322796b696c3c0973dada4e0f27978e1... |
import copy
from functools import partial
import numpy as np
from neupy import algorithms, init, layers
from neupy.layers import Input, Sigmoid
from neupy.utils import asfloat
from helpers import compare_networks
from base import BaseTestCase
simple_x_train = asfloat(np.array([
[0.1, 0.1, 0.2],
[0.2, 0.3, ... | {
"content_hash": "8190dd2bb61975f2c5b2b272eaa758d9",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 69,
"avg_line_length": 27.045454545454547,
"alnum_prop": 0.523249299719888,
"repo_name": "itdxer/neupy",
"id": "9e6d04c0b77b4b8c98ae24a49c0491d1bca8302e",
"size": "3570",
... |
import pytest
import contextlib
import re
from xd.docker.client import *
def test_image_pull_1_ok(docker, stdout):
with stdout.redirect():
assert docker.image_pull('busybox:latest')
assert re.match('Status: (Image is up to date|Downloaded newer image)',
stdout.lastline())
def... | {
"content_hash": "52864f82a6133a9302e32457d8818e0a",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 80,
"avg_line_length": 33.523809523809526,
"alnum_prop": 0.6960227272727273,
"repo_name": "esben/xd-docker",
"id": "001b6d8d914d0ae6fb368eb55d46c738e06e1dbd",
"size": "704"... |
"""TensorFlow Lite tooling helper functionality.
EXPERIMENTAL: APIs here are unstable and likely to change without notice.
@@TocoConverter
@@toco_convert
@@toco_convert_protos
@@Interpreter
@@OpHint
@@convert_op_hints_to_stubs
@@build_toco_convert_protos
@@FLOAT
@@QUANTIZED_UINT8
@@TFLITE
@@GRAPHVIZ_DOT
"""
from __... | {
"content_hash": "dd9ae6376e5490ebc9f5adfad0f77410",
"timestamp": "",
"source": "github",
"line_count": 421,
"max_line_length": 126,
"avg_line_length": 40.74821852731591,
"alnum_prop": 0.6870300204022151,
"repo_name": "jalexvig/tensorflow",
"id": "2f9b9d469a27cc8910cb61c0da14769e5ff0baf0",
"size": ... |
import os
from skimage._build import cython
base_path = os.path.abspath(os.path.dirname(__file__))
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
config = Configuration('feature', parent_package, top_path)
config.add_data_... | {
"content_hash": "bb1705ddb859974bdaea67eeadde25aa",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 79,
"avg_line_length": 43.31818181818182,
"alnum_prop": 0.6164742917103883,
"repo_name": "bennlich/scikit-image",
"id": "d7be3dcfcbde4f5bea3f526e73edd7996098b4fd",
"size": ... |
"""
Tests for misc.py "replace" directive.
"""
from __init__ import DocutilsTestSupport
def suite():
s = DocutilsTestSupport.ParserTestSuite()
s.generateTests(totest)
return s
totest = {}
totest['replace'] = [
["""\
Test the |name| directive.
.. |name| replace:: "**replace**"
""",
"""\
<document sourc... | {
"content_hash": "4ab8c26898b75ba7a9786862fe6ad01b",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 103,
"avg_line_length": 29.118110236220474,
"alnum_prop": 0.5865332612222823,
"repo_name": "indro/t2c",
"id": "5b95e1e8cdf5fa590e10fcda015f392d81a910c6",
"size": "3943",
... |
from django.views.generic import TemplateView, ListView, CreateView, DetailView
from models import Company, Venue, Booking, Location, Event
from forms import VenueForm
from simple_rest.auth.decorators import login_required, admin_required
from django.http import HttpResponse
from django.core import serializers
#from j... | {
"content_hash": "660f783509ed5c12d5c938b9a8427631",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 98,
"avg_line_length": 27.597826086956523,
"alnum_prop": 0.6675856636471051,
"repo_name": "hellsgate1001/bookit",
"id": "d4aa170febbd15a2c17c9e26cc25faf735e308d0",
"size": ... |
"""Core async task wrapper. This module contains the `Async` class, which is
used to create asynchronous jobs, and a `defaults` decorator you may use to
specify default settings for a particular async task. To use,
# Create a task.
work = Async(
target="function.to.run",
args=(args, for, func... | {
"content_hash": "fdbf26a6f309408b6b1b107dc0e5c65c",
"timestamp": "",
"source": "github",
"line_count": 318,
"max_line_length": 79,
"avg_line_length": 27.50943396226415,
"alnum_prop": 0.6151120256058528,
"repo_name": "robertkluin/furious",
"id": "48931c5fe6846e1762403da6c7ae2aee4094f57c",
"size": "... |
from sys import maxsize
class Contact:
def __init__(self, firstname2=None, middlename=None, lastname=None, nickname=None, title=None,
company=None, address=None, home=None, mobile=None, work=None, fax=None, email=None, email2=None, email3=None,
address2=None, phone2=None, notes=No... | {
"content_hash": "15c798c58d1b58a871a57fff530422c1",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 149,
"avg_line_length": 38.58974358974359,
"alnum_prop": 0.6132890365448505,
"repo_name": "anjel-ershova/python_training",
"id": "4309cbe1a9c9157bf09a667a2584c0195eb186c3",
... |
class ConflictingAliasError(ValueError):
'''
An Alias cant be created because it conflicts with a existing Alias to a different Word.
'''
pass
class ConflictingWordMisSpellingError(ValueError):
'''
A WordMisSpelling cant be created because it conflicts with a existing WordMisSpelling to a diffe... | {
"content_hash": "fc9931f4c0db63f7bc6e5115a5c28d14",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 111,
"avg_line_length": 28.608695652173914,
"alnum_prop": 0.71580547112462,
"repo_name": "jakeogh/anormbookmarker",
"id": "e2a13955458646ba8822744fbb6ac08efd358145",
"size"... |
import unittest, StringIO, robotparser
from test import test_support
class RobotTestCase(unittest.TestCase):
def __init__(self, index, parser, url, good, agent):
unittest.TestCase.__init__(self)
if good:
self.str = "RobotTest(%d, good, %s)" % (index, url)
else:
... | {
"content_hash": "0e76c6b7a8a7e005a86e636ee587909b",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 88,
"avg_line_length": 23.597701149425287,
"alnum_prop": 0.5953888618282188,
"repo_name": "google/google-ctf",
"id": "45c91f1a8e3474a166ff7fe71e50f783f42eb32f",
"size": "6... |
"""
Example for aiohttp.web basic server
Uses a background timer to read from a file to update a shared datastructure
Because it's going to be used as a simulator
Made available under the MIT license as follows:
Copyright 2017 Brian Bulkowski brian@bulkowski.org
Permission is hereby granted, free of charge, to any p... | {
"content_hash": "aefef77bf3d10fabb59757f8fabb2658",
"timestamp": "",
"source": "github",
"line_count": 627,
"max_line_length": 139,
"avg_line_length": 34.366826156299844,
"alnum_prop": 0.5671524039354,
"repo_name": "bbulkow/MagnusFlora",
"id": "05c13a187ac937c3061a260b966fb2e2efe5d0ef",
"size": "2... |
import unittest
from .nice_strings import SantaString
class TestEnigma(unittest.TestCase):
def test_nice(self):
nice = [
"ugknbfddgicrmopn",
"ugknbfaagcrmpn",
]
for s in nice:
self.assertTrue(SantaString(s).is_nice())
def test_naughty(self):
... | {
"content_hash": "bdf8a04b56c285f02e38f7bc32fc11b8",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 56,
"avg_line_length": 21.833333333333332,
"alnum_prop": 0.5515267175572519,
"repo_name": "intenthq/code-challenges",
"id": "949e52180d1f8503e0fb811aaf8b33d0bc102e0f",
"siz... |
from OSEncryptionState import *
from pprint import pprint
class PrereqState(OSEncryptionState):
def __init__(self, context):
super(PrereqState, self).__init__('PrereqState', context)
def should_enter(self):
self.context.logger.log("Verifying if machine should enter prereq state")
if n... | {
"content_hash": "8bf95debd06fb135d8ce90d9c2b2e3e5",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 110,
"avg_line_length": 41.985074626865675,
"alnum_prop": 0.5655883398506932,
"repo_name": "vityagi/azure-linux-extensions",
"id": "bdbbbf1239fc3937d4a9f520db7b6d4ebd819b46",... |
"""
Qc API
Qc API # noqa: E501
The version of the OpenAPI document: 3.0.0
Contact: cloudsupport@telestream.net
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import datetime
import telestream_cloud_qc
from telestream_cloud_qc.models.sum... | {
"content_hash": "2dfa82b3d3ea4c152228d720fa765318",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 76,
"avg_line_length": 26.125,
"alnum_prop": 0.5933014354066986,
"repo_name": "Telestream/telestream-cloud-python-sdk",
"id": "1592267d9eafe323c2706eed06e7753173cd5f59",
"s... |
"""Alexa configuration for Home Assistant Cloud."""
import asyncio
from datetime import timedelta
import logging
import aiohttp
import async_timeout
from hass_nabucasa import cloud_api
from homeassistant.components.alexa import (
config as alexa_config,
entities as alexa_entities,
errors as alexa_errors,
... | {
"content_hash": "c91275eed81d09798ee9b95fc298dea5",
"timestamp": "",
"source": "github",
"line_count": 311,
"max_line_length": 91,
"avg_line_length": 32.60450160771704,
"alnum_prop": 0.5883629191321499,
"repo_name": "tboyce021/home-assistant",
"id": "1bb74053ea4f5f2f9021ea3c58f9aeb1a48ba784",
"siz... |
import pickle
import socket
import threading, time
# Here's our thread:
class ConnectionThread ( threading.Thread ):
def run ( self ):
# Connect to the server:
client = socket.socket ( socket.AF_INET, socket.SOCK_STREAM )
client.connect ( ( 'localhost', 2727 ) )
# Retrieve and unpickle th... | {
"content_hash": "be12c8757b7457a7db160fb6d959b6f8",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 67,
"avg_line_length": 24,
"alnum_prop": 0.6080246913580247,
"repo_name": "vmiklos/vmexam",
"id": "e4fe82804f3d00fd3f2ed4f03356c6286e7c572c",
"size": "648",
"binary": fal... |
# -*- coding: utf-8 -*-
#Plotting is on python since this will make it much easier to debug and adjsut
#no need to recompile everytime i change graph color....
#needs a serious refactor
from matplotlib import pyplot as plt
import numpy as np
from .nputil import mid, minmax, vector_apply
from util import parse_arg, de... | {
"content_hash": "6441efd6f7329116b732d4d1cf1f49a4",
"timestamp": "",
"source": "github",
"line_count": 555,
"max_line_length": 117,
"avg_line_length": 31.71891891891892,
"alnum_prop": 0.5681663258350375,
"repo_name": "mtresch/probfit",
"id": "551c0201591368de1dda6c1ec79314dc2533159c",
"size": "176... |
from allauth.socialaccount.tests import OAuth2TestsMixin
from allauth.tests import MockedResponse, TestCase
from .provider import HubicProvider
class HubicTests(OAuth2TestsMixin, TestCase):
provider_id = HubicProvider.id
def get_mocked_response(self):
return MockedResponse(200, """
{
"email": "u... | {
"content_hash": "9f2791dda0b31799426aec6711f1e095",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 63,
"avg_line_length": 24.4,
"alnum_prop": 0.6379781420765027,
"repo_name": "bittner/django-allauth",
"id": "6f3de24ba9b0cbad64b95cb235da0e3041618587",
"size": "732",
"bi... |
from django.db import models
class Comment(models.Model):
alias = models.CharField(max_length=512, blank=True)
content = models.TextField()
created = models.DateTimeField(auto_now_add=True)
def url_delete(self):
return "/comment/delete/%i" % self.id
class Meta:
ordering = ["created"]
| {
"content_hash": "970433cbf3dfbd4f39e157e2945f739f",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 54,
"avg_line_length": 20.6,
"alnum_prop": 0.6990291262135923,
"repo_name": "F483/trainlessmagazine.com",
"id": "37bda98382386d3289698abeb2279745db72d3e6",
"size": "309",
... |
from __future__ import absolute_import
# NOTE: The following imports are adapted to use as a vendored subpackge.
# from https://github.com/cloudpipe/cloudpickle/blob/d3279a0689b769d5315fc6ff00cd0f5897844526/cloudpickle/init.py
from .cloudpickle import * # noqa
from .cloudpickle_fast import CloudPickler, dumps, dump ... | {
"content_hash": "22af011ce11f47af79a7fac00c3be518",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 113,
"avg_line_length": 43.333333333333336,
"alnum_prop": 0.7826923076923077,
"repo_name": "stuartarchibald/numba",
"id": "e40ba3ec1e31d9f291a300da63731eb3ad9c2cec",
"size"... |
from setuptools import setup, find_packages
import sys, os
version = '0.2'
setup(
name='ckanext-tnext',
version=version,
description="Tainan open data ckan extension",
long_description='''
''',
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywor... | {
"content_hash": "16a76944532ded9703bd383c94871f5d",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 93,
"avg_line_length": 26.310344827586206,
"alnum_prop": 0.6277850589777195,
"repo_name": "WilJoey/ckanext-tnext",
"id": "551d6783a21963df017caebc02d3434ab873cb84",
"size":... |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:5888")
else:
access = Ser... | {
"content_hash": "da0f55f4a59c00eb30b1ab8e7521c49e",
"timestamp": "",
"source": "github",
"line_count": 324,
"max_line_length": 79,
"avg_line_length": 24.185185185185187,
"alnum_prop": 0.6616896375701888,
"repo_name": "Lyrabar/Lyrabar",
"id": "4af5185acfb9bb0b85e23d101d504df1a0c9c0cf",
"size": "783... |
import unittest
import logging
import os
# from tests.test_source import SourceTestCase
from dipper.sources.Orphanet import Orphanet
from dipper.utils.TestUtils import TestUtils
from dipper.graph.RDFGraph import RDFGraph
logging.getLogger().setLevel(logging.DEBUG)
LOG = logging.getLogger(__name__)
class GeneVariantD... | {
"content_hash": "da7215b7fd57e82ea99bf2accd3385e0",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 86,
"avg_line_length": 33.48322147651007,
"alnum_prop": 0.6865103227099619,
"repo_name": "TomConlin/dipper",
"id": "875946baeb6ad84a402274039222aa9aba9e1406",
"size": "501... |
"""
homeassistant.components.thermostat.homematic
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Adds support for Homematic (HM-TC-IT-WM-W-EU, HM-CC-RT-DN) thermostats using
Homegear or Homematic central (CCU1/CCU2).
For more details about this platform, please refer to the documentation at
https://home-assistant.io/co... | {
"content_hash": "08bba62488641548a0e1da30034b3880",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 78,
"avg_line_length": 35.63358778625954,
"alnum_prop": 0.5717652099400171,
"repo_name": "nevercast/home-assistant",
"id": "ab81e3685892c029958da221057a953b00c69ad2",
"siz... |
import os
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
setup(name='smrzr',
version='0.1',
description='Extracts key points from news articles',
url='https://github.com/lekhakpadmanabh/Summarizer',
long_description=open('README.md'... | {
"content_hash": "c153eb1369dcd9e8c0ca2aa70cdba20f",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 79,
"avg_line_length": 30.8125,
"alnum_prop": 0.6754563894523327,
"repo_name": "lekhakpadmanabh/Summarizer",
"id": "7e9164b8e477354eb0f6e809deec64fa45cab8c7",
"size": "515"... |
"""==================================================
* Filename: bt_comm.py
*
* Description: Handle serial communication between a computer
* and the domotic embedded system
*
* Version: 2.1
* Created: 22 - 02 - 2012
* Compiler: none, python interpreter
*
* Author: Xavier Bruhière
===================... | {
"content_hash": "55ec3b987c4d4af014d8291b618e0d20",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 91,
"avg_line_length": 29.72680412371134,
"alnum_prop": 0.6249349748569447,
"repo_name": "hackliff/domobot",
"id": "3549e065e053d77ed9f5ace45e0520e70d7b3cbd",
"size": "581... |
from __future__ import print_function
import os
from scriptCommon import catchPath
changedFiles = 0
def isSourceFile( path ):
return path.endswith( ".cpp" ) or path.endswith( ".h" ) or path.endswith( ".hpp" )
def fixAllFilesInDir( dir ):
for f in os.listdir( dir ):
path = os.path.join( dir,f )
... | {
"content_hash": "e96b9cb26cab42fb370c64020ca106b0",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 86,
"avg_line_length": 27.130434782608695,
"alnum_prop": 0.5480769230769231,
"repo_name": "tuffz/pi-weather-app",
"id": "a1b6bbe871bbd8942517cbe00febeaef15c42bf7",
"size": ... |
"""
Exceptions that may happen in all the webdriver code.
"""
class WebDriverException(Exception):
"""
Base webdriver exception.
"""
def __init__(self, msg=None, screen=None, stacktrace=None):
self.msg = msg
self.screen = screen
self.stacktrace = stacktrace
def __str__(sel... | {
"content_hash": "872be8281a7cbad6498853f0544edb6f",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 95,
"avg_line_length": 31.019607843137255,
"alnum_prop": 0.6877370417193426,
"repo_name": "cisco-open-source/selenium",
"id": "5585ccd238f79d63e6aeb782334162c9b17811d0",
"... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('photologue', '0004_auto_20140915_1259'),
]
operations = [
migrations.AlterField(
model_name='photo',
name='title',
... | {
"content_hash": "4192b60701076e074343735a6d492041",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 85,
"avg_line_length": 23.63157894736842,
"alnum_prop": 0.5991091314031181,
"repo_name": "jlemaes/django-photologue",
"id": "45cecf7bc1595a9c844dd7e03f5ab6f60059b8b2",
"siz... |
{
'name': "Online Event's Tickets",
'category': 'Hidden',
'summary': "Sell Your Event's Tickets",
'website': 'https://www.odoo.com/page/events',
'version': '1.0',
'description': """
Online Event's Tickets
======================
""",
'author': 'OpenERP SA',
'depends': ['website_e... | {
"content_hash": "7ad986749e896019dfe0e318557f74b1",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 63,
"avg_line_length": 26.90909090909091,
"alnum_prop": 0.5371621621621622,
"repo_name": "cristianquaglio/odoo",
"id": "0c532b78de84fb55d7bad3d27095da029a348ffc",
"size": "... |
from ckan.logic.schema import (default_create_package_schema,
default_show_package_schema,
default_update_package_schema)
from ckan.plugins import toolkit
from ckanext.nhm.logic.validators import string_max_length, uuid_validator
not_empty = toolkit.get_va... | {
"content_hash": "bc25fe365f4b2eaae68c70c4b3b4b7e3",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 82,
"avg_line_length": 37.04716981132076,
"alnum_prop": 0.6322892793481029,
"repo_name": "NaturalHistoryMuseum/ckanext-nhm",
"id": "d76f8a551fef9be4e1b8374a551dcb0c9b6c4d2b"... |
try:
import j2p2j
except ImportError:
import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', '..'))
import j2p2j
from tornado import gen
class MyApp(j2p2j.Application):
pass
class MyClient(j2p2j.Client):
def __init__(self):
super(MyClient, self).__in... | {
"content_hash": "1f114fe7ec20a280a916818dd2fcc9ed",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 92,
"avg_line_length": 29.533333333333335,
"alnum_prop": 0.5197516930022573,
"repo_name": "cuthbertLab/j2p2j",
"id": "c511a175c694e898a0ec60b0196de13aeb671c43",
"size": "17... |
__author__ = 'think'
from time import ctime
from tkinter import *
import socket
import threading
import sys
class DNCclitGUI(object):
def __init__(self):
self.top=Tk()
self.top.title('Dog is Not a Chat client')
#creer le socket
self.ChatClitSock=socket.socket(socket.AF_INET,socket.... | {
"content_hash": "bf5f01ff49acd31e343239f7e3a25252",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 133,
"avg_line_length": 32.056603773584904,
"alnum_prop": 0.5971159505591525,
"repo_name": "geoff11/dnc",
"id": "a50aaa736c9e9376efb28eaee9d8a2e8e94b816c",
"size": "3398",... |
import json
from lxml import objectify, etree
from django.contrib.auth.models import Group, User
from useradmin.models import HuePermission, GroupPermission, get_default_user_group
def grant_access(username, groupname, appname):
add_permission(username, groupname, 'access', appname)
def add_permission(username... | {
"content_hash": "a8fb0ced5a99c86beb6aa2bf71d46f6c",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 120,
"avg_line_length": 31.448979591836736,
"alnum_prop": 0.709279688513952,
"repo_name": "rahul67/hue",
"id": "fa8d6348239a3ca1c9ab26da8bda36f1cf8abd7d",
"size": "2333",
... |
def cors_allow_credentials():
def decorator_func(func):
def wrapper_func(*args, **kwargs):
retval = func(*args, **kwargs)
retval['Access-Control-Allow-Credentials'] = 'true'
return retval
return wrapper_func
return decorator_func
| {
"content_hash": "68e2024e092c59b4495fcaedfd84ab2d",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 63,
"avg_line_length": 36.25,
"alnum_prop": 0.6,
"repo_name": "rodorgas/django-rocketchat-auth",
"id": "fc3bda3d65abf352b6ab62e211e9dc54f0c0cc47",
"size": "290",
"binary":... |
from parse import parse_line, convert_dashed_dms_to_float
from format_definitions.awos import AWOS_RECORDS
def parse_awos_line(line):
"Parse a single line in the AWOS file"
r = parse_line(line, AWOS_RECORDS)
# Parse out useful coordinates
if r['record_type'] == 'AWOS1': # only if it's a record type 1
... | {
"content_hash": "c1cace2262396362e0db24cf3368258d",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 89,
"avg_line_length": 36.4,
"alnum_prop": 0.6236263736263736,
"repo_name": "adamfast/faddsdata",
"id": "397d9a5ec6bc3a069863958db2097f79610046db",
"size": "757",
"binary... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('trips', '0016_auto_20150725_1749'),
]
operations = [
migrations.AlterField(
model_name='calendar',
name='service_id',
... | {
"content_hash": "87fa3137f50787af56aaa9ba87621e8f",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 91,
"avg_line_length": 28.678571428571427,
"alnum_prop": 0.5765877957658779,
"repo_name": "renanalencar/hermes",
"id": "bb19d12f7da460534b742ee73a837a4a43e3a353",
"size": "... |
from api import Engage
| {
"content_hash": "c1f954054e01d20de59f312ac22cf9c4",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 22,
"avg_line_length": 23,
"alnum_prop": 0.8260869565217391,
"repo_name": "kevinwaddle/silverpoppy",
"id": "ac67b3e3e37afc0f06a025dabf5a4a4ab70bbd61",
"size": "26",
"binar... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('groups', '0001_initial'),
('auth', '0001_initial'),
('media', '0001_initial'),
('accounts', '0001_initial'),
]
operations = [
... | {
"content_hash": "5d15be6055ef95f1a045ace362f3ce17",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 256,
"avg_line_length": 38.083333333333336,
"alnum_prop": 0.5995623632385121,
"repo_name": "ofa/connect",
"id": "71184ac2564a8386b0d2edef80f7796b1325b13f",
"size": "1395",
... |
import csv
from pkg_resources import parse_version
from retriever.lib.models import Table
from retriever.lib.templates import Script
try:
from retriever.lib.defaults import VERSION
try:
from retriever.lib.tools import open_fr, open_fw, open_csvw
except ImportError:
from retriever.lib.scri... | {
"content_hash": "84dc162dfee1d334143c1be655e06fa0",
"timestamp": "",
"source": "github",
"line_count": 268,
"max_line_length": 216,
"avg_line_length": 39.473880597014926,
"alnum_prop": 0.5084601569146422,
"repo_name": "henrykironde/deletedret",
"id": "8ba7adf2647235100a0787a4ca2190d5ca0b563c",
"si... |
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python create_certificate__full.py
Before run the sample, please set the values of the client ID, tenant ID and clien... | {
"content_hash": "7afd71fa08f93cd0537d0b17790e4166",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 129,
"avg_line_length": 34.325581395348834,
"alnum_prop": 0.6727642276422764,
"repo_name": "Azure/azure-sdk-for-python",
"id": "f303f0d706932c206bc1200ed5cb3426f35c4b7e",
"... |
"""
Scraps WRDC Solar Radiation data from
http://wrdc.mgo.rssi.ru/wrdccgi/protect.exe?wrdc/data_gaw.htm
:copyright: (c) 2014 by Ajay Ranipeta.
:license: MIT, see LICENSE for more details.
"""
import re
import os
from array import array
import requests
from bs4 import BeautifulSoup
link_list = []
# start a se... | {
"content_hash": "2195706f048db8913db4668d376a26c9",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 74,
"avg_line_length": 27.181818181818183,
"alnum_prop": 0.6717630195891066,
"repo_name": "funkycoda/scrappy",
"id": "837e161387219d7d0ed07b747434b894e77b4509",
"size": "21... |
"""Tests for the python3 checkers."""
from __future__ import absolute_import
import sys
import textwrap
import pytest
import astroid
from pylint import testutils
from pylint.checkers import python3 as checker
from pylint.interfaces import INFERENCE_FAILURE, INFERENCE
# Decorator for any tests that will fail under... | {
"content_hash": "9cbd8d046d87c04d821e51f8d160ed03",
"timestamp": "",
"source": "github",
"line_count": 938,
"max_line_length": 89,
"avg_line_length": 35.41684434968017,
"alnum_prop": 0.5849914210890702,
"repo_name": "lucidmotifs/auto-aoc",
"id": "4a9454815aaf3cb52a407be1796631829fa66475",
"size": ... |
__revision__ = "test/Libs/SharedLibraryIxes.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
"""
Test that we can build shared libraries and link against shared
libraries that have non-standard library prefixes and suffixes.
"""
import re
import sys
import TestSCons
test = TestSCons.TestSCons()
test.wri... | {
"content_hash": "e3c1665597d61f7e1eea75807d2887e7",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 104,
"avg_line_length": 28.244525547445257,
"alnum_prop": 0.6396175216436232,
"repo_name": "EmanueleCannizzaro/scons",
"id": "2b4e6ee1b37c8952ad4bf2d51cbe1398a77ecfb9",
"s... |
from auto_nag.bzcleaner import BzCleaner
class RegressionButEnhancementTask(BzCleaner):
def __init__(self):
super(RegressionButEnhancementTask, self).__init__()
def description(self):
return (
'Enhancement or task with the "regression", "crash" or "assertion" keyword'
)
... | {
"content_hash": "111cc165aa19dd346aeb927eb6a18012",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 87,
"avg_line_length": 28.64516129032258,
"alnum_prop": 0.5484234234234234,
"repo_name": "mozilla/bztools",
"id": "518cc3b33b9e5b05f3c0fe1b4d3121577f8db684",
"size": "1088"... |
import openpnm as op
from openpnm.topotools import trim, extend
import numpy as np
import pytest
class CheckNetworkHealthTest:
def setup_class(self):
self.ws = op.Workspace()
self.ws.clear()
self.proj = self.ws.new_project()
self.net = op.network.Cubic(shape=[2, 2, 2], project=sel... | {
"content_hash": "2307460cba8a5f754849f774d55ada68",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 71,
"avg_line_length": 39.489208633093526,
"alnum_prop": 0.5758790307888504,
"repo_name": "TomTranter/OpenPNM",
"id": "c5ac5304e8297e0fef0d9aa1ddb7092b94f4f0da",
"size": "... |
import sys
'''
euclidGCD takes two integers where a > b
returns Greatest Common Divisor
'''
def euclidGCD(a, b):
if b == 0:
return a
rem = a % b # a'
return euclidGCD(b, rem)
'''
main function expects data from std input in the format:
line 1 an int representing the number of lines to read
l... | {
"content_hash": "265896e4c21e4404164b7144413d2e91",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 77,
"avg_line_length": 24.576923076923077,
"alnum_prop": 0.6322378716744914,
"repo_name": "seyedrezamirkhani/algorithms_toolbox",
"id": "506412775db63e75fc07cc5741885cd3226d1... |
""" FGDC metadata parser """
from owslib.etree import etree
from owslib import util
class Metadata(object):
""" Process metadata """
def __init__(self, md):
if hasattr(md, 'getroot'): # standalone document
self.xml = etree.tostring(md.getroot())
else: # part of a larger document... | {
"content_hash": "34e784f5c362234c3cbe1dea9eecce35",
"timestamp": "",
"source": "github",
"line_count": 342,
"max_line_length": 113,
"avg_line_length": 29.423976608187136,
"alnum_prop": 0.5560965914737156,
"repo_name": "ocefpaf/OWSLib",
"id": "a22dd55890459489df1afba9f16b46da1883abca",
"size": "103... |
from PySide import QtCore, QtGui
class Ui_CrestDialog(object):
def setupUi(self, CrestDialog):
CrestDialog.setObjectName("CrestDialog")
CrestDialog.resize(400, 320)
CrestDialog.setMinimumSize(QtCore.QSize(400, 320))
CrestDialog.setMaximumSize(QtCore.QSize(400, 320))
font = Q... | {
"content_hash": "6b90c03c909c15791c820ee3ad8268c8",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 329,
"avg_line_length": 67.63440860215054,
"alnum_prop": 0.7131955484896662,
"repo_name": "farshield/pathfinder",
"id": "44a3db2a48d445b55ab5511274ebb845bb614f6b",
"size": ... |
import json
import time
import datetime
from pick import pick
from colorama import Fore
from pytimeparse.timeparse import timeparse
from plugin import plugin, alias
from utilities.textParser import parse_date
"""
Module content:
* RemindTodoBase: Shared functionality between Remind and Todo
* TodoBase: Based on R... | {
"content_hash": "9253fa5209ca5fd380a6267dd11b526c",
"timestamp": "",
"source": "github",
"line_count": 691,
"max_line_length": 104,
"avg_line_length": 29.21562952243126,
"alnum_prop": 0.5518129581929859,
"repo_name": "sukeesh/Jarvis",
"id": "d005f0071c9abaa7e2ce16b1b3618e8429d3a52e",
"size": "2018... |
from __future__ import print_function
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
from h2o.utils.typechecks import assert_is_type
from h2o.frame import H2OFrame
from random import randrange
import numpy as np
import math
def h2o_H2OFrame_rep_len():
"""
Python API test: ... | {
"content_hash": "15bd89d238185d415170eaa4dc345bd7",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 107,
"avg_line_length": 35.628571428571426,
"alnum_prop": 0.6752205292702486,
"repo_name": "h2oai/h2o-3",
"id": "1827dff41244733fcb5fe8697dcd6223beb93217",
"size": "1247",
... |
from django.db import models
class User(models.Model):
hobbies = models.ManyToManyField('Hobby', related_name='users')
class Pet(models.Model):
user = models.ForeignKey('User', on_delete=models.CASCADE)
class Allergy(models.Model):
pets = models.ManyToManyField('Pet')
class Occupation(models.Model):... | {
"content_hash": "86915fb57bb6b6420c30daeeb87c8c18",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 88,
"avg_line_length": 22.346153846153847,
"alnum_prop": 0.7160068846815835,
"repo_name": "jmcarp/nplusone",
"id": "6ffc15aa5bf61bec6c4b8138cc278b06640bb605",
"size": "606"... |
from __future__ import division
import numpy as np
from numpy.lib.stride_tricks import as_strided as ast
import scipy.linalg
import copy, collections, os, shutil
from contextlib import closing
from urllib2 import urlopen
from itertools import izip, chain, count, ifilter
def solve_psd(A,b,chol=None,overwrite_b=False,ov... | {
"content_hash": "68a5288f16354f998ad6f15c4233b2b2",
"timestamp": "",
"source": "github",
"line_count": 280,
"max_line_length": 97,
"avg_line_length": 31.432142857142857,
"alnum_prop": 0.6166344733553005,
"repo_name": "bikash/pyhsmm",
"id": "eb0ac977111983db3bf3204e346295101cd9bd60",
"size": "8801"... |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Fisher'] , ['LinearTrend'] , ['NoCycle'] , ['AR'] ); | {
"content_hash": "11450e6b0486f02d13fb3a63d92cccd5",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 75,
"avg_line_length": 37,
"alnum_prop": 0.6959459459459459,
"repo_name": "antoinecarme/pyaf",
"id": "38495c82c7a2d3bfb9884bb3f49691f19e953730",
"size": "148",
"binary": f... |
# ====================================================================
# The Apache Software License, Version 1.1
#
# Copyright (c) 2000-2002 The Apache Software Foundation. All rights
# reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that... | {
"content_hash": "3653ccbda2c0f5fbd60d13b1d06e071b",
"timestamp": "",
"source": "github",
"line_count": 320,
"max_line_length": 77,
"avg_line_length": 35.2625,
"alnum_prop": 0.5928748670684154,
"repo_name": "easel/gamestats",
"id": "e58be80d06c3be563674df2f7a9cc6c0c8c2918a",
"size": "11284",
"bin... |
from __future__ import absolute_import, print_function, division
from pyModeS.decoder.common import hex2bin, bin2int, data, allzeros
def is10(msg):
"""Check if a message is likely to be BDS code 1,0
Args:
msg (String): 28 bytes hexadecimal message string
Returns:
bool: True or False
"... | {
"content_hash": "133d3ea9abaee26995abb523ea3df828",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 67,
"avg_line_length": 21.82608695652174,
"alnum_prop": 0.602589641434263,
"repo_name": "junzis/py-adsb-decoder",
"id": "836a252b76142fab354561ce52b560426f67e70a",
"size": ... |
"""Contains the SnippetManager facade used by all Vim Functions."""
from collections import defaultdict
from functools import wraps
import os
import platform
import traceback
import sys
import vim
import re
from contextlib import contextmanager
from UltiSnips import _vim
from UltiSnips import err_to_scratch_buffer
fr... | {
"content_hash": "8e238ed618f5f7c14eaac1452cb8d8b8",
"timestamp": "",
"source": "github",
"line_count": 853,
"max_line_length": 102,
"avg_line_length": 38.36225087924971,
"alnum_prop": 0.5474131344925588,
"repo_name": "NcLang/vimrc",
"id": "331500e6e41cf53441b683223d85b59c1ce0ae00",
"size": "32764"... |
"""This example gets a bid landscape for an ad group and a criterion.
To get ad groups, run get_ad_groups.py. To get criteria, run get_keywords.py.
The LoadFromStorage method is pulling credentials and properties from a
"googleads.yaml" file. By default, it looks for this file in your home
directory. For more informa... | {
"content_hash": "558752fba16afa14ce96d1a311f8f7ca",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 80,
"avg_line_length": 38.130434782608695,
"alnum_prop": 0.6267578867350817,
"repo_name": "Aloomaio/googleads-python-lib",
"id": "79a8cf5cbd0ea0f76a8cd2cf4d3d27a442259ee0",
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from six.moves import xrange # pylint: disable=redefined-builtin
import tensorflow as tf
from tensorflow.core.framework import graph_pb2
from tensorflow.core.util.event_pb2 import SessionLog
from t... | {
"content_hash": "44bfe67394f0cf87d70a2b138ba33184",
"timestamp": "",
"source": "github",
"line_count": 680,
"max_line_length": 80,
"avg_line_length": 36.167647058823526,
"alnum_prop": 0.5723753761079938,
"repo_name": "neilhan/tensorflow",
"id": "a8db2c50e9bf08e44a3a855deca047ea7cccd373",
"size": "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.