text stringlengths 4 1.02M | meta dict |
|---|---|
"""
SAASpy
An open-source library to read and analyze images from the FOXSI Solar
Alignment and Aspect System.
"""
from __future__ import absolute_import
| {
"content_hash": "e9ba47e0df68976884006f563e4f6394",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 70,
"avg_line_length": 22.142857142857142,
"alnum_prop": 0.7612903225806451,
"repo_name": "foxsi/SAASpy",
"id": "9420a4cbc25df2f85dca2dd43afaed96d64c1954",
"size": "155",
... |
import datetime
import os
from io import BytesIO
from PIL import Image
from PIL.Image import isImageType
from django.conf import settings
from django.utils.translation import ugettext as _
from pptx import Presentation
from pptx.enum.shapes import MSO_SHAPE_TYPE
from pptx.enum.text import PP_PARAGRAPH_ALIGNMENT
from p... | {
"content_hash": "286fe26bf550fb0cd85ef9aaae4d091a",
"timestamp": "",
"source": "github",
"line_count": 391,
"max_line_length": 128,
"avg_line_length": 40.05626598465473,
"alnum_prop": 0.5193461882262802,
"repo_name": "consbio/seedsource-core",
"id": "f95a6d0baa2beee896d7970ddce47d74f7937040",
"siz... |
from django.contrib import admin
from fserver.models import *
class PairAdmin(admin.ModelAdmin):
list_display = ('name', 'pip_value', 'point', 'spread', 'is_active')
list_filter = ('spread', 'is_active')
class SignalAdmin(admin.ModelAdmin):
list_display = ('id', 'account_name', 'system', 'pair', 'tf', ... | {
"content_hash": "fadfbd4caccbe3bee9d5372245105e97",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 118,
"avg_line_length": 32.10588235294118,
"alnum_prop": 0.68083547086845,
"repo_name": "yezooz/fserver",
"id": "85cbd3eb6baf93a2d4ea155704898735c38b701e",
"size": "3849",
... |
import copy
import uuid
from lxml import etree
from webob import exc
from nova.api.openstack.compute.contrib import instance_actions
from nova.compute import api as compute_api
from nova import db
from nova.db.sqlalchemy import models
from nova import exception
from nova.openstack.common import policy
from nova impor... | {
"content_hash": "9dcf347f623e477dae5128bf2c1b7319",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 79,
"avg_line_length": 43.934306569343065,
"alnum_prop": 0.6005150357202194,
"repo_name": "CiscoSystems/nova",
"id": "1a85fedc9eb4e1a955518619b359b4a410a09b8b",
"size": "1... |
import itertools
import re
import socket
import time
from collections import defaultdict
import supervisor.xmlrpc
from six.moves import xmlrpc_client as xmlrpclib
from datadog_checks.base import AgentCheck
DEFAULT_HOST = 'localhost'
DEFAULT_PORT = '9001'
DEFAULT_SOCKET_IP = 'http://127.0.0.1'
DD_STATUS = {
'STO... | {
"content_hash": "32d856b224f834be2db52ce8cb06ab4a",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 119,
"avg_line_length": 36.30875576036866,
"alnum_prop": 0.6003299911156238,
"repo_name": "DataDog/integrations-core",
"id": "3e16ddbfd694d014a66b3895e378c7eed53870ee",
"s... |
"""API error code
"""
| {
"content_hash": "cf23c12a81e1649d9e05c99ab00e0856",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 17,
"avg_line_length": 11,
"alnum_prop": 0.5454545454545454,
"repo_name": "jack8daniels2/yabgp",
"id": "78b97fdca1f2ad974ac95f0c78744f9d5e07f8be",
"size": "657",
"binary":... |
import unittest
from ray.rllib.agents.ppo import PPOTrainer, DEFAULT_CONFIG
import ray
class LocalModeTest(unittest.TestCase):
def testLocal(self):
ray.init(local_mode=True)
cf = DEFAULT_CONFIG.copy()
agent = PPOTrainer(cf, "CartPole-v0")
print(agent.train())
if __name__ == "__m... | {
"content_hash": "fdc95c03edd4b1a50cacd2543df85ce4",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 59,
"avg_line_length": 22.4375,
"alnum_prop": 0.6573816155988857,
"repo_name": "stephanie-wang/ray",
"id": "c3341beafc9f2e2bf85a542db4ebde12dedc8cec",
"size": "359",
"bin... |
from .. import mfpackage
from ..data.mfdatautil import ListTemplateGenerator
class ModflowGwfgnc(mfpackage.MFPackage):
"""
ModflowGwfgnc defines a gnc package within a gwf6 model.
Parameters
----------
model : MFModel
Model that this package is a part of. Package is automatically
... | {
"content_hash": "44ee91271327c8f1efa9fc2c5a399566",
"timestamp": "",
"source": "github",
"line_count": 213,
"max_line_length": 79,
"avg_line_length": 41.183098591549296,
"alnum_prop": 0.6002051983584131,
"repo_name": "aleaf/flopy",
"id": "e283cb30fb7293243fb686b08186e762bda33315",
"size": "8868",
... |
from config import server
DEBUG = server.DEBUG
if DEBUG:
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
else:
SESSION_ENGINE = 'django.contrib.sessions.backends.file'
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default'... | {
"content_hash": "cbd2db9b3b39b8ce7e3775d9bf5d872a",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 115,
"avg_line_length": 33.63636363636363,
"alnum_prop": 0.6848232848232848,
"repo_name": "quanix/PenBlog",
"id": "00614cf295db3d6e0162eb6c284a2e7509aaa157",
"size": "4850... |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import object
import operator
class Status(object):
def __init__(self, name, code, reason=None):
self.name = name
self.code = code
self.reason = reason or getattr(self... | {
"content_hash": "7c9b5d83cb91ed7832908a1ad9704303",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 69,
"avg_line_length": 25.658823529411766,
"alnum_prop": 0.6629986244841816,
"repo_name": "remind101/stacker",
"id": "395d575d4e07e09830f0bcfa516351ab1da13af5",
"size": "21... |
"""
wa-report-pusher
What the hell! Why spend time filling
in the reporting tables? me and
"""
from __future__ import print_function
__version__ = '1.0'
__author__ = 'M.Price'
__license__ = 'MIT'
__prj_name__ = 'wa-report-pusher'
__description__ = 'What the hell! Why spend time filling ' \
... | {
"content_hash": "86335b2f898c00bd81bcb720aba6324c",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 77,
"avg_line_length": 30.701834862385322,
"alnum_prop": 0.5753772598236964,
"repo_name": "MihailPreis/WA_Report_pusher",
"id": "a7825e71c66f7b897dac573253137bfd60d26c51",
... |
from numpy import *
import math
def norm_pdf_multivariate(x, mu, sigma):
size = len(x)
if size == len(mu) and (size, size) == sigma.shape:
det = linalg.det(sigma)
if det == 0:
raise NameError("The covariance matrix can't be singular")
norm_const = 1.0/ ( math.pow((2*pi),float(size)... | {
"content_hash": "87a40a9243e8d519ad1353e1c7f1a9ad",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 78,
"avg_line_length": 31.61111111111111,
"alnum_prop": 0.5817223198594025,
"repo_name": "sbxzy/pygks",
"id": "704be80bed0d439b944f6f7b26ed8d3ad4177e14",
"size": "619",
"... |
'''
Created on 2016年2月9日
@author: Darren
'''
'''
Dual Palindromes
Mario Cruz (Colombia) & Hugo Rickeboer (Argentina)
A number that reads the same from right to left as when read from left to right is called a palindrome. The number 12321 is a palindrome; the number 77778 is not. Of course, palindromes have neither lea... | {
"content_hash": "7990892cf9e61738e9afab94385dadcc",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 256,
"avg_line_length": 27.904761904761905,
"alnum_prop": 0.6535836177474402,
"repo_name": "darrencheng0817/AlgorithmLearning",
"id": "8e06a512aea127a22bc6699db2acc0fea33aaa3... |
from fanstatic import DEBUG, MINIFIED, compat
BOOL_CONFIG = set(['versioning', 'recompute_hashes', DEBUG, MINIFIED,
'bottom', 'force_bottom', 'bundle', 'rollup',
'versioning_use_md5', 'compile'])
# From paste.util.converters.
def asbool(obj):
if isinstance(obj, compat.basest... | {
"content_hash": "98df765a2efbf073f099237b2bd183a7",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 69,
"avg_line_length": 30.103448275862068,
"alnum_prop": 0.5383734249713631,
"repo_name": "fanstatic/fanstatic",
"id": "038b9236a91aacd3bfb0be07898042be0350593a",
"size": "... |
from distutils.core import setup, Extension
wrapper = Extension(
'_hom4ps',
['hom4ps_wrap.cxx'],
libraries=['hom4ps']
)
setup (
name='Hom4PSpy',
version='1.0',
description='Python binding for Hom4PS-3, a numerical nonlinear system solver',
author='Tianran Chen',
author_email='chen... | {
"content_hash": "72fda7cc6676eadb7b427bdbcc56c3f5",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 83,
"avg_line_length": 25.705882352941178,
"alnum_prop": 0.6407322654462243,
"repo_name": "chentianran/h3-bindings",
"id": "e7569bbec8f86a0de8bfceaad3b54b90c0c37340",
"size... |
"""Package related functionality."""
from __future__ import print_function
import sys
from chromite.api import faux
from chromite.api import validate
from chromite.api.controller import controller_util
from chromite.api.gen.chromite.api import binhost_pb2
from chromite.api.gen.chromiumos import common_pb2
from chrom... | {
"content_hash": "c0126f5645615f3a0b083e846e5e3e09",
"timestamp": "",
"source": "github",
"line_count": 286,
"max_line_length": 80,
"avg_line_length": 40.05944055944056,
"alnum_prop": 0.7536877018416689,
"repo_name": "endlessm/chromium-browser",
"id": "a788672fa89eb9f81a90accfa89eec114269350d",
"si... |
import os
from migrate.versioning import api as versioning_api
from oslo_config import cfg
from oslo_log import log as logging
from designate.manage import base
from designate.sqlalchemy import utils
LOG = logging.getLogger(__name__)
REPOSITORY = os.path.abspath(os.path.join(os.path.dirname(__file__), '..',
... | {
"content_hash": "26b21cc735e176ef40454964e02e8db1",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 74,
"avg_line_length": 29.13953488372093,
"alnum_prop": 0.636073423782921,
"repo_name": "kiall/designate-py3",
"id": "a8da400de26215f644a82ebfc4f7c970bf75f11c",
"size": "18... |
#!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list ... | {
"content_hash": "651d6d4e7de66c11aeeaab9a5f738ecd",
"timestamp": "",
"source": "github",
"line_count": 512,
"max_line_length": 394,
"avg_line_length": 41.458984375,
"alnum_prop": 0.6844584726998634,
"repo_name": "kurli/blink-crosswalk",
"id": "50002477d373cffe52a1f44728a7969247297b4f",
"size": "21... |
import sys
import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
try:
# Numba is installed
import numba
except Import... | {
"content_hash": "63214de2d930099ba3d7e7b826110bd8",
"timestamp": "",
"source": "github",
"line_count": 283,
"max_line_length": 79,
"avg_line_length": 31.091872791519435,
"alnum_prop": 0.6950789862484373,
"repo_name": "stefanseefeld/numba",
"id": "a6bcee0991088ad9f406a5a6afddefdac18fc92f",
"size": ... |
from streamlink.plugins.onetv import OneTV
from tests.plugins import PluginCanHandleUrl
class TestPluginCanHandleUrlOneTV(PluginCanHandleUrl):
__plugin__ = OneTV
should_match = [
"https://www.1tv.ru/live",
"http://www.1tv.ru/live",
"https://static.1tv.ru/eump/embeds/1tv_live_orbit-plu... | {
"content_hash": "50ac7d7ddfebec6f1c5513510c27bfa3",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 80,
"avg_line_length": 34.07692307692308,
"alnum_prop": 0.6128668171557562,
"repo_name": "gravyboat/streamlink",
"id": "ac4efe4f4983a798653b4996da31abb3002729bf",
"size": "... |
import dns.rdtypes.dsbase
class DS(dns.rdtypes.dsbase.DSBase):
"""DS record"""
| {
"content_hash": "51963c327b965d5a47ea263faee3998b",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 36,
"avg_line_length": 14.333333333333334,
"alnum_prop": 0.686046511627907,
"repo_name": "waynechu/PythonProject",
"id": "7d457b2281e3fa4a816885299c994457c23f6ba4",
"size": ... |
from math import sqrt
from ..geometry import Vector
from .mesh import Material, MeshPart
Vertex = Vector
TexCoord = Vertex
Normal = Vertex
Color = Vertex
class FaceVertex:
"""Contains the information a vertex needs in a face
In contains the index of the vertex, the index of the texture coordinate
and the... | {
"content_hash": "e82d38fcfff197d0e9849a14949612f8",
"timestamp": "",
"source": "github",
"line_count": 334,
"max_line_length": 116,
"avg_line_length": 32.0059880239521,
"alnum_prop": 0.5711880261927035,
"repo_name": "tforgione/model-converter",
"id": "f9ee647a684fedc59099b45f7af4d6ab608e617d",
"si... |
import os
import shutil
import re
from bs4 import BeautifulSoup
from settings import FOLDER_PERMISSIONS
file1=open("downloadablelinks.txt", "r")
downloadablelinks=file1.readlines()
file1.close()
downloadablelinks = [word.rstrip("\n") for word in downloadablelinks]
file2=open("activedownloadablelinks.txt", "r")... | {
"content_hash": "3b954dd9cd4978f622159668d1af18cb",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 142,
"avg_line_length": 34.81283422459893,
"alnum_prop": 0.5831029185867895,
"repo_name": "jayadeepk/copy-website",
"id": "47f4824287cc85ba9c5675a63dee18a5af29837a",
"size... |
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.25
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from kubernete... | {
"content_hash": "c3e3d3b98aa872db5d52a6fb7e766851",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 224,
"avg_line_length": 32.32231404958678,
"alnum_prop": 0.5868064433648683,
"repo_name": "kubernetes-client/python",
"id": "c04c64578b8d8211a27e19c6fa24e2cc616d1b2e",
"si... |
from pyvisdk.base.managed_object_types import ManagedObjectTypes
from pyvisdk.mo.managed_entity import ManagedEntity
import logging
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
class ComputeResource(Manag... | {
"content_hash": "9ba758cca5aebb6b377c71b9f71746aa",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 344,
"avg_line_length": 48.083333333333336,
"alnum_prop": 0.7036395147313691,
"repo_name": "xuru/pyvisdk",
"id": "fa33cca99cd63cad7c923fd9ba88894187a65c26",
"size": "3463",... |
from __future__ import absolute_import
from __future__ import unicode_literals
# -*- coding: utf-8 -*-
import json
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
import django_nyt
def disable_notify(func):
"""Disable notifications. Example:
@disable_notify
... | {
"content_hash": "908eb86ebcc43728f241ee501bdf788b",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 79,
"avg_line_length": 32.7,
"alnum_prop": 0.600611620795107,
"repo_name": "spookylukey/django-nyt",
"id": "88d23f5ebb4202a6694e4d101dd116ec48903517",
"size": "1635",
"bi... |
import os
import re
from django import forms
from django.conf import settings
from django.forms import ModelForm
from django.forms.models import modelformset_factory
from django.template import Context, Template, TemplateSyntaxError
import commonware.log
import happyforms
from piston.models import Consumer
from produ... | {
"content_hash": "8acfeb2868123301608704d93f5e2cb6",
"timestamp": "",
"source": "github",
"line_count": 306,
"max_line_length": 79,
"avg_line_length": 36.1764705882353,
"alnum_prop": 0.6041553748870822,
"repo_name": "jpetto/olympia",
"id": "d9d3022bcb6e2454a73b0c9b90096ca6210713ba",
"size": "11070"... |
from setuptools import setup, find_packages
import sys, os
version = '0.93b'
setup(name='aha.plugin.twitteroauth',
version=version,
description="A twitter auth plugin for aha",
long_description="""\
A plugin that ssupplies authentication support of twitter oauth.""",
classifiers=[], # Get stri... | {
"content_hash": "87ebcb266b7af5a4af142b32fff29794",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 95,
"avg_line_length": 28.785714285714285,
"alnum_prop": 0.6104218362282878,
"repo_name": "Letractively/aha-gae",
"id": "7da20d91febedbdb9732a1dec1f9a475007599d5",
"size": ... |
"""Script to load runinfo from the lims process: 'Illumina Sequencing (Illumina SBS) 4.0'
into the flowcell database in statusdb.
Maya Brandi, Science for Life Laboratory, Stockholm, Sweden.
"""
import sys
import os
import codecs
from optparse import OptionParser
from pprint import pprint
from genologics.lims import ... | {
"content_hash": "5a729428be257e1e0dcf87ccb06f2775",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 102,
"avg_line_length": 41.32231404958678,
"alnum_prop": 0.6028,
"repo_name": "senthil10/scilifelab",
"id": "abb2e23ec71004c5d8f3aa631f1d8ba8a7f1e80e",
"size": "5023",
"... |
class CliFailedCommandError(Exception):
"""cli command failed."""
class CliSyntaxError(Exception):
"""cli command had a syntax error."""
class UnexpectedApiReturnValueError(Exception):
"""exception raised when the API return value is unexpected"""
def __init__(self, retval, message):
self.r... | {
"content_hash": "26b751c550748044a08de1fe193d0e99",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 66,
"avg_line_length": 26.666666666666668,
"alnum_prop": 0.6725,
"repo_name": "FDio/vpp",
"id": "611e5a3845d3c25fe526b056f9f9b5372758a399",
"size": "400",
"binary": false... |
from __future__ import print_function
import pandas as pd
from sklearn.base import TransformerMixin
class NameTransformer(TransformerMixin):
def __init__(self, use=True):
self.use = use
def transform(self, features_raw, **transform_params):
if self.use:
features = features_raw.co... | {
"content_hash": "46a1db2d0d8e39527d1d417a9037b22f",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 75,
"avg_line_length": 29.22222222222222,
"alnum_prop": 0.5868187579214195,
"repo_name": "wojtekwalczak/kaggle_titanic",
"id": "53d30541d3b9e18a12cefe5c8ccacbde02c27f62",
"... |
import numpy as np
from .basis import BasisFamily
from scipy.interpolate import BSpline, splev
class BSplineFamily(BasisFamily):
"""B-spline basis functions.
This class represents a B-spline basis for piecewise polynomials defined
across a set of breakpoints with given degree and smoothness. On each
... | {
"content_hash": "23decba813c6c4f20c07a94fd07ab2d5",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 79,
"avg_line_length": 43.71808510638298,
"alnum_prop": 0.6049397736950968,
"repo_name": "python-control/python-control",
"id": "c771beb59f2436297af6d4927879290b53cef9b8",
... |
from api import api
def init_app(app, config):
app.config.from_pyfile(config)
app.add_url_rule('/', 'root', lambda: app.send_static_file('index.html'))
app.register_blueprint(api, url_prefix='/api')
| {
"content_hash": "acce187308e8aa3eb104c8b4df1e8249",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 74,
"avg_line_length": 33.833333333333336,
"alnum_prop": 0.7093596059113301,
"repo_name": "UoMCS/syllabus-visualisation",
"id": "734909fa59c91ca656c14f6a583a99e11733bd10",
"... |
"""
Runs MultiNet on a whole bunch of input images.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import logging
import os
import sys
# configure logging
if 'TV_IS_DEV' in os.environ and os.environ['TV_IS_DEV']:
logging.basicConfig(f... | {
"content_hash": "0760f03210cc77b302a20e9647769abe",
"timestamp": "",
"source": "github",
"line_count": 336,
"max_line_length": 79,
"avg_line_length": 32.595238095238095,
"alnum_prop": 0.5962381300219138,
"repo_name": "MarvinTeichmann/MultiNet",
"id": "7134b6a2b2b17eba6f5db9ee185667dd978b4b26",
"si... |
from horizon.test import helpers as test
class BrowserTests(test.TestCase):
# Unit tests for browser.
def test_me(self):
self.assertTrue(1 + 1 == 2)
| {
"content_hash": "68f814a188630f8668a4f1205a71e4e7",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 40,
"avg_line_length": 23.857142857142858,
"alnum_prop": 0.6706586826347305,
"repo_name": "PaulMcMillan/shmoocon_2014_talk",
"id": "d470715e665749085c83f23e9dc5948b2e457d05",
... |
"""
py3compat, based on jinja2._compat
~~~~~~~~~~~~~~
Some py2/py3 compatibility support based on a stripped down
version of six so we don't have to depend on a specific version
of it.
:copyright: Copyright 2013 by the Jinja team.
:license: BSD, see LICENSE for details.
"""
from __future_... | {
"content_hash": "eed9379e2fe777a79534537b23421f8d",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 72,
"avg_line_length": 28.55,
"alnum_prop": 0.6293053123175715,
"repo_name": "yeleman/py3compat",
"id": "ed6a4012df48c7fea7ddc6ae1b60a8dbae94ed2b",
"size": "3505",
"bina... |
from weight.weight_vector import WeightVector
from data.data_pool import DataPool
import os
from learner import logger
__version__ = '1.0.0'
class PerceptronLearnerBase:
name = "PerceptronLearnerBase"
def __init__(self, w_vector=None):
self.w_vector = {}
if w_vector is None:
re... | {
"content_hash": "fc28d95aa8c9c85e04429f6c6adfb081",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 102,
"avg_line_length": 41.17880794701987,
"alnum_prop": 0.5276616275329687,
"repo_name": "sfu-natlang/glm-parser",
"id": "d88673293fcf20f2264c554e4844bdd4256ae75f",
"size... |
import os
import util
import glob
import re
import shutil
import tarfile
import types
import actions
import source
def make_conf_source(**keywds):
ex_vars = {}
src = None
make_conf = {}
if 'ex_vars' in keywds:
ex_vars = keywds['ex_vars']
if 'source' in keywds:
src =... | {
"content_hash": "064610e85decd4aa737d8b3f830a2625",
"timestamp": "",
"source": "github",
"line_count": 523,
"max_line_length": 103,
"avg_line_length": 39.879541108986615,
"alnum_prop": 0.5464831950903773,
"repo_name": "jsbronder/inhibitor",
"id": "48c9afc0aa805287fda56e11b6a17ead7e8530cb",
"size":... |
from __future__ import unicode_literals
import pytz
from nose.tools import * # flake8: noqa
from api.base.settings.defaults import API_BASE
from api_tests import utils as api_utils
from framework.auth.core import Auth
from tests.base import ApiTestCase, capture_signals
from tests.factories import (
ProjectFacto... | {
"content_hash": "849fe45e820047a5a2c5dad8da67958c",
"timestamp": "",
"source": "github",
"line_count": 532,
"max_line_length": 127,
"avg_line_length": 40.36842105263158,
"alnum_prop": 0.5909852859005401,
"repo_name": "amyshi188/osf.io",
"id": "7bc469bab1daf529314c3a6d9c1cd35aea581090",
"size": "21... |
import logging
from bson.json_util import loads, dumps
import datetime
import mock
import webapps.server
from webapps.server.views import ratelimit
from webapps.lib.db import get_db
from webapps.lib.util import to_coll_name, get_collection_names
from flask import session
from pymongo.errors import OperationFailure
fro... | {
"content_hash": "4632e2e1750e57f4a2d624ecae1d7f36",
"timestamp": "",
"source": "github",
"line_count": 590,
"max_line_length": 80,
"avg_line_length": 35.945762711864404,
"alnum_prop": 0.559364390795926,
"repo_name": "vicjwang/mongo-web-shell",
"id": "221c7bc2adf6d7320448fc4df6a022c859a6443f",
"siz... |
import eventlet
from eventlet import semaphore
import netaddr
from oslo.config import cfg
from quantum.agent.common import config
from quantum.agent.linux import external_process
from quantum.agent.linux import interface
from quantum.agent.linux import ip_lib
from quantum.agent.linux import iptables_manager
from quant... | {
"content_hash": "4326e6829537dcd63402930695859365",
"timestamp": "",
"source": "github",
"line_count": 741,
"max_line_length": 79,
"avg_line_length": 43.497975708502025,
"alnum_prop": 0.5423802432365351,
"repo_name": "ykaneko/quantum",
"id": "55bfe2908c80bc6a2141d3f622c86f77641ce090",
"size": "329... |
"""
Server API
Reference for Server API (REST/Json)
OpenAPI spec version: 2.0.21
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
import kinow_client
from kinow_client.rest import ApiException
from... | {
"content_hash": "4368b899019c5e28f33e479c931b895f",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 84,
"avg_line_length": 20.175,
"alnum_prop": 0.6864931846344485,
"repo_name": "kinow-io/kinow-python-sdk",
"id": "3cdf904205b1dd4052d14a3ccfef6b43a4b39dbb",
"size": "824",
... |
from zope.interface import Interface
class IAPIFactory(Interface):
def __call__(environ):
""" environ -> IRepozeWhoAPI
"""
class IAPI(Interface):
""" Facade for stateful invocation of underlying plugins.
"""
def authenticate():
""" -> {identity}
o Return an authenti... | {
"content_hash": "c4f2fefb860060fcabe9c13956aa5cb2",
"timestamp": "",
"source": "github",
"line_count": 280,
"max_line_length": 79,
"avg_line_length": 35.17142857142857,
"alnum_prop": 0.6474411047928513,
"repo_name": "kawamon/hue",
"id": "c0cbe143702dbecdcc0521c3ad984a5f782b8ebf",
"size": "9848",
... |
json_data = {
"cpu": {
"cpu_util": "container_cpu_system_seconds_total",
"gauge": "%"
},
"memory": {
"memory.usage": "container_memory_usage_bytes",
"guage": "MB"}
}
def get_data(metric):
return json_data[metric]
| {
"content_hash": "3a41ef0d1fcbffb0bc966c172dd5c843",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 57,
"avg_line_length": 20.23076923076923,
"alnum_prop": 0.5247148288973384,
"repo_name": "WiproOpenSourcePractice/galaxia",
"id": "eee756f51603d256680952a269cf2ee925dbdb44",
... |
NSNAM_CODE_BASE_URL = "http://code.nsnam.org/"
PYBINDGEN_BRANCH = 'https://github.com/gjcarneiro/pybindgen.git'
LOCAL_PYBINDGEN_PATH = 'pybindgen'
#
# The last part of the path name to use to find the regression traces tarball.
# path will be APPNAME + '-' + VERSION + REGRESSION_SUFFIX + TRACEBALL_SUFFIX,
# e.g., ns-3... | {
"content_hash": "88354115ef7648c18e2a665ef2981e9b",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 78,
"avg_line_length": 30.210526315789473,
"alnum_prop": 0.7142857142857143,
"repo_name": "softDi/clusim",
"id": "2b3666c49e3886e4ecd830064ea3e74ff7101ada",
"size": "575",
... |
import json
from .oauth import OAuth2Test
class SoundcloudOAuth2Test(OAuth2Test):
backend_path = "social_core.backends.soundcloud.SoundcloudOAuth2"
user_data_url = "https://api.soundcloud.com/me.json"
expected_username = "foobar"
access_token_body = json.dumps({"access_token": "foobar", "token_type":... | {
"content_hash": "617a62ea40f1cd25a751e74bb2328add",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 86,
"avg_line_length": 32.660377358490564,
"alnum_prop": 0.510687463893703,
"repo_name": "python-social-auth/social-core",
"id": "974bbc9beec0d78636ca9c142e4b3dd081395b24",
... |
from lxml import etree
import mock
from oslo_serialization import jsonutils
import webob
from cinder.api.contrib import extended_snapshot_attributes
from cinder import context
from cinder import test
from cinder.tests.api import fakes
from cinder.tests import fake_snapshot
from cinder.tests import fake_volume
UUID1 ... | {
"content_hash": "f9a9d17c02c077612051b5e037eef36e",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 76,
"avg_line_length": 34.2,
"alnum_prop": 0.6301865775549986,
"repo_name": "tmenjo/cinder-2015.1.1",
"id": "b0daf1989ad4c8a902578dc0db4828ba2c85cab3",
"size": "4228",
"... |
import setuptools
# In python < 2.7.4, a lazy loading of package `pbr` will break
# setuptools if some other modules registered functions in `atexit`.
# solution from: http://bugs.python.org/issue15881#msg170215
try:
import multiprocessing # noqa
except ImportError:
pass
setuptools.setup(
setup_requires... | {
"content_hash": "ad258d27189aab1962062637e0c215f4",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 68,
"avg_line_length": 24.571428571428573,
"alnum_prop": 0.7267441860465116,
"repo_name": "bgaifullin/python-jiractl",
"id": "b3beb7d612e15eab10bdcc8c39e77e504ec2614e",
"si... |
from .model import PaddleModel # noqa # pylint: disable=unused-import
| {
"content_hash": "dc5437809e8e829194f7a1c0a6937cfe",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 70,
"avg_line_length": 71,
"alnum_prop": 0.7746478873239436,
"repo_name": "kubeflow/kfserving-lts",
"id": "05ba18c483207e18fb226d665886e1f3035fc5dc",
"size": "648",
"binar... |
from SpatialIndexer import SpatialIndexer
from operator import sub as _sub
from operator import add as _add
from operator import mul as _mul
class ParticleSystem(object):
"""System of particles.
Maintains the set of particles and runs the physics simulation over them
the specified laws.
"""
... | {
"content_hash": "1fc75569a2fbd7df4569aeb389a3cbdd",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 91,
"avg_line_length": 37.550561797752806,
"alnum_prop": 0.6071214841412328,
"repo_name": "bbc/kamaelia",
"id": "65986c3549eee11249c73e3aef39e07f07785c81",
"size": "4394",
... |
import webbrowser
import click
from ghutil.types import Repository
@click.command()
@Repository.argument("repo")
def cli(repo):
"""Open a repository in a web browser"""
webbrowser.open_new(repo.data["html_url"])
| {
"content_hash": "eddf93faf02066f1dab069d2b9a334d8",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 46,
"avg_line_length": 22.2,
"alnum_prop": 0.7297297297297297,
"repo_name": "jwodder/ghutil",
"id": "2621fbadb0a1e2332c89fea6bfbe639f777fd0b4",
"size": "222",
"binary": f... |
import sys
import logging
import emission.net.usercache.abstract_usercache_handler as euah
import emission.net.usercache.abstract_usercache as enua
import emission.storage.timeseries.abstract_timeseries as esta
import emission.storage.decorations.tour_model_queries as esdtmq
import emission.analysis.intake.cleaning.fi... | {
"content_hash": "07f0a7a98294126af70538c41b7e4bb2",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 108,
"avg_line_length": 44.12280701754386,
"alnum_prop": 0.6616302186878728,
"repo_name": "yw374cornell/e-mission-server",
"id": "14215c93d7f6cbb164b035071280e72c5646fade",
... |
import simplejson as json
from django.shortcuts import render
from django.http import HttpResponse
from django.http import Http404
from django.core.exceptions import ValidationError
from django.db.utils import DatabaseError
from mozdns.domain.models import Domain
from core.search.compiler.django_compile import search... | {
"content_hash": "ed339398ba6b62acecec8112d3ce7530",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 78,
"avg_line_length": 31.321739130434782,
"alnum_prop": 0.6213214880621877,
"repo_name": "mozilla/inventory",
"id": "490c1eaf8583cea1997aeade51da78a7bd427145",
"size": "3... |
from django.core.exceptions import ValidationError
from django.contrib.auth.models import User
from django.db import models
class Nonce(models.Model):
server_url = models.CharField(max_length=2047)
timestamp = models.IntegerField()
salt = models.CharField(max_length=40)
def __unicode__(self):
... | {
"content_hash": "3704bbe29c389aa0faaeeeee9f312fc8",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 70,
"avg_line_length": 34.627906976744185,
"alnum_prop": 0.6816655473472129,
"repo_name": "paulosman/django-openid-auth",
"id": "193eb614107b20969f1a1a9c3e406cf42a399d70",
... |
"""
Remove all your old unwanted django models automatically !
Same feeling as blowing up Megaton guaranteed !
"""
__version__ = "0.0.0"
from .cleaner import AbraxoCleaner
| {
"content_hash": "5c3b53349df93536a6c4d693dfd1f135",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 58,
"avg_line_length": 21.75,
"alnum_prop": 0.735632183908046,
"repo_name": "PhilipGarnero/django-abraxo-cleaner",
"id": "a2b081e4411986617249cc359c4ae1a3807ab96f",
"size": ... |
import datetime
import flask
from flask_mongoengine import MongoEngine
from tests import FlaskMongoEngineTestCase
class BasicAppTestCase(FlaskMongoEngineTestCase):
def setUp(self):
super(BasicAppTestCase, self).setUp()
db = MongoEngine()
class Todo(db.Document):
title = db.St... | {
"content_hash": "af7f984dbbbb41332d505b36cd19cfa5",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 76,
"avg_line_length": 31.69736842105263,
"alnum_prop": 0.564549605645496,
"repo_name": "losintikfos/flask-mongoengine",
"id": "474a28a36f2997513bfff90144e3af450a5da777",
"... |
from __future__ import print_function
import csv
import plistlib
import sys
import os
import io
import pprint
import glob
CSV_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)),
'names.csv')
MANIFESTS_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)),
... | {
"content_hash": "5c881506c815e7d962ee3172ea9f669b",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 76,
"avg_line_length": 40.68141592920354,
"alnum_prop": 0.5708070480748314,
"repo_name": "clburlison/scripts",
"id": "f832da6e6880432733e47fa40eccb57aa26293f6",
"size": "4... |
from __future__ import print_function
import unittest
import os
from music21 import common
from music21 import converter
from music21 import corpus
from music21 import exceptions21
from music21 import stream
from music21 import text
from music21 import environment
_MOD = 'features/base.py'
environLocal = environment... | {
"content_hash": "3478dfcf561d25d193d34ff86cf90305",
"timestamp": "",
"source": "github",
"line_count": 1731,
"max_line_length": 453,
"avg_line_length": 39.552281917966496,
"alnum_prop": 0.5717958080771197,
"repo_name": "arnavd96/Cinemiezer",
"id": "63f2b55a204fba9e383381fcf70053d1e91276b1",
"size"... |
from collections import OrderedDict
import copy
from panoptes_aggregation import reducers
from panoptes_aggregation.csv_utils import flatten_data, unflatten_data, order_columns
import json
import math
import io
import os
import pandas
import progressbar
import warnings
def first_filter(data):
first_time = data.cr... | {
"content_hash": "de12e93b4195e5102af1f69851469388",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 249,
"avg_line_length": 44.50925925925926,
"alnum_prop": 0.6442687747035574,
"repo_name": "CKrawczyk/python-reducers-for-caesar",
"id": "24613f449dafcd481d73e40f021e61a11cf7... |
from .resource import Resource
class ExpressRouteCircuit(Resource):
"""ExpressRouteCircuit resource.
Variables are only populated by the server, and will be ignored when
sending a request.
:param id: Resource ID.
:type id: str
:ivar name: Resource name.
:vartype name: str
:ivar type:... | {
"content_hash": "2b796a404d47e5826b73f3e0023eecf8",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 143,
"avg_line_length": 50.51578947368421,
"alnum_prop": 0.6780579287351531,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "59b5d8c04ac92d3739b515398f38d2984a6b91d5",
... |
"""Tests for QuantizationDebugger."""
import csv
import io
from unittest import mock
from absl.testing import parameterized
import numpy as np
import tensorflow as tf
from tensorflow.lite.experimental.quantization_debugger import debugger
from tensorflow.lite.python import convert
from tensorflow.lite.python import... | {
"content_hash": "a7151562b6613e35c2f348e1ca4ede84",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 79,
"avg_line_length": 34.76923076923077,
"alnum_prop": 0.6718289085545722,
"repo_name": "petewarden/tensorflow",
"id": "fcbcbb49be05bd48e6c1920d4bdfdcaa3ac0ed1a",
"size":... |
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from tensorflow.contrib.learn.python.learn.datasets.mnist import read_data_sets
from tensorflow.python.framework import ops
ops.reset_default_graph()
# Start a graph session
sess = tf.Session()
# Load data
data_dir = 'temp'
mnist = read_data_s... | {
"content_hash": "65ce59b22dbf75128fbfd946023142f8",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 113,
"avg_line_length": 41.906666666666666,
"alnum_prop": 0.68119630925867,
"repo_name": "shanaka-desoysa/tensorflow",
"id": "bd7db895008bc568f6e9097052fe9df2032ddfb1",
"s... |
"""Sensor for the Open Sky Network."""
from __future__ import annotations
from datetime import timedelta
import requests
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import (
ATTR_ATTRIBUTION,
ATTR_LATITUDE,
ATTR_LONGITUDE,
... | {
"content_hash": "8dbc15811945112a34f6b1e1e3b30541",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 87,
"avg_line_length": 31.287128712871286,
"alnum_prop": 0.6039556962025316,
"repo_name": "toddeye/home-assistant",
"id": "b4278bcce3632cdafd02559930b1302b814f6758",
"size... |
"""
Clams Git
=========
This is the executable source-code version of git.rst.
"""
from __future__ import unicode_literals
from clams import arg, Command
# Let's get some imports out of the way first. Since we're not going to actually
# implement any of git, we need to have a method of calling the system's git
# c... | {
"content_hash": "276cbfbcc3583200796089affee14863",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 81,
"avg_line_length": 34.90909090909091,
"alnum_prop": 0.6966145833333334,
"repo_name": "unbservices/clams",
"id": "6e9b4e1b5f18c67756b8400962a77008691cfbe5",
"size": "307... |
import numpy as np
import pytest
import mbuild as mb
from mbuild.utils.io import get_fn
class BaseTest:
@pytest.fixture(autouse=True)
def initdir(self, tmpdir):
tmpdir.chdir()
@pytest.fixture
def ethane(self):
from mbuild.examples import Ethane
return Ethane()
@pytest.f... | {
"content_hash": "d6b7f4b44a85d798c713354cb7678c0a",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 81,
"avg_line_length": 29.366863905325445,
"alnum_prop": 0.5488615756598831,
"repo_name": "ctk3b/mbuild",
"id": "8bf6b4d242c3384a799229f7d7cd4383f635e425",
"size": "4963",... |
import sys
sys.path.append("C:\\PyEmu")
sys.path.append("C:\\PyEmu\\lib")
from PyEmu import *
def ret_handler(emu, address):
num1 = emu.get_stack_argument("arg_0")
num2 = emu.get_stack_argument("arg_4")
sum = emu.get_register("EAX")
print "[*] Function took: %d, %d and the result ... | {
"content_hash": "8effecebb0681f890fb6fc018eb6aa80",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 79,
"avg_line_length": 24.945454545454545,
"alnum_prop": 0.6763848396501457,
"repo_name": "psb-seclab/CTFStuff",
"id": "e72234efaf9eb447de28e7b2d27570c5ff765365",
"size": "... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "posts_manager_django.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "57f0038f1d56b078e17038c1af7f87b3",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 84,
"avg_line_length": 26.77777777777778,
"alnum_prop": 0.7178423236514523,
"repo_name": "KKorvin/posts_manager_django",
"id": "fa8e030cdfb938e4894e6a406b593efecfc36ce6",
"s... |
"""
exception classes and constants handling test outcomes
as well as functions creating them
"""
import sys
from typing import Any
from typing import Callable
from typing import cast
from typing import Optional
from typing import TypeVar
TYPE_CHECKING = False # avoid circular import through compat
if TYPE_CHECKING:... | {
"content_hash": "b8a04c9cf100826a1afb0483616322d5",
"timestamp": "",
"source": "github",
"line_count": 227,
"max_line_length": 106,
"avg_line_length": 32.779735682819386,
"alnum_prop": 0.6484343502217443,
"repo_name": "JoelMarcey/buck",
"id": "751cf9474fb3a845c18902c7ed92204b2c1a48f1",
"size": "74... |
__author__ = 'parsons'
from datetime import datetime
import requests
import json
import logging
from time import sleep
import os
import smtplib
SENT_ALERTS = []
logging.basicConfig(level=logging.INFO, format='%(asctime)s [%(module)11s] [%(levelname)7s] %(message)s')
logging.getLogger("requests").setLevel(logging.WAR... | {
"content_hash": "c47b1ff0ac2357587bbda6598cad1554",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 209,
"avg_line_length": 32.80434782608695,
"alnum_prop": 0.5950960901259112,
"repo_name": "devinjparsons/PokemonGo-Map-Notify",
"id": "7b76551f57616bfa4b9da344c9afe0d0ddfe586... |
import os
from setuptools import setup, find_packages
def read(fname):
"""
Returns the contents of the file in the top level directory with the name
``fname``.
"""
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def get_files(path):
relative_to = os.path.dirname(path)
... | {
"content_hash": "14e477becd744714748a68052f83026f",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 79,
"avg_line_length": 29.846153846153847,
"alnum_prop": 0.6146907216494846,
"repo_name": "pombredanne/superzippy",
"id": "30990f3d264cdb6c028538c7a33faac58fa1ed01",
"size"... |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name=... | {
"content_hash": "401afae6f64c05bec018cac0e9d94b93",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 114,
"avg_line_length": 41.96825396825397,
"alnum_prop": 0.5423600605143721,
"repo_name": "allcaps/tvdordrecht.nl",
"id": "bf000aad715ff1656fdabcfea4209f912b0bf13b",
"size"... |
import pandas as pd
import statsmodels.api as sm
import matplotlib.pyplot as plt
import numpy as np
import statsmodels.formula.api as smf
df = pd.read_csv('train.csv')
dfTest = pd.read_csv('test.csv')
X = df[['OverallQual', 'GarageArea', 'GarageCars','TotalBsmtSF','TotRmsAbvGrd','FullBath','GrLivArea']]
lm = smf.o... | {
"content_hash": "0d7ff039fcca1628dda01ad695296dec",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 119,
"avg_line_length": 26.772727272727273,
"alnum_prop": 0.733446519524618,
"repo_name": "talbarda/kaggle_predict_house_prices",
"id": "524d002725ab4ad84d318dbe985b3a71e67f2... |
"""Collection of tests around log handling."""
import logging
import pytest
from cookiecutter.log import configure_logger
def create_log_records():
cookiecutter_logger = logging.getLogger('cookiecutter')
foo_logger = logging.getLogger('cookiecutter.foo')
foobar_logger = logging.getLogger('cookiecutter.... | {
"content_hash": "7018a9fb15c8b6ac8f22cba212abbd2f",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 75,
"avg_line_length": 27.282442748091604,
"alnum_prop": 0.6787912702853945,
"repo_name": "luzfcb/cookiecutter",
"id": "a4d71102ee8d3c346bd1f4184b36deb1816d25c4",
"size": ... |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def HostVnicConnectedToCustomizedDVPortEvent(vim, *args, **kwargs):
'''This event records ... | {
"content_hash": "81b4e5801b0dbec59356a05e83b93598",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 124,
"avg_line_length": 38.411764705882355,
"alnum_prop": 0.6271056661562021,
"repo_name": "xuru/pyvisdk",
"id": "960c70a37162ee40fde4d3b79966f030dfc35625",
"size": "1307",... |
"""
A remote procedure call (rpc) abstraction.
For some wrappers that add message versioning to rpc, see:
rpc.dispatcher
rpc.proxy
"""
from oslo.config import cfg
from ironic.openstack.common import importutils
from ironic.openstack.common import log as logging
LOG = logging.getLogger(__name__)
rpc_opts ... | {
"content_hash": "7f01115f18c90f4eb3bb0f20d28cccc1",
"timestamp": "",
"source": "github",
"line_count": 258,
"max_line_length": 79,
"avg_line_length": 38.02713178294574,
"alnum_prop": 0.6146162470696157,
"repo_name": "JioCloud/ironic",
"id": "c334015111687d4bcb53feb3f3f8b64e32fb0adf",
"size": "1057... |
def greet(name):
print 'Hello', name
greet('Jack')
greet('Jill')
greet('Bob')
| {
"content_hash": "35ad0c1aca1598c250cbd6aedc22fc6a",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 23,
"avg_line_length": 16.4,
"alnum_prop": 0.6341463414634146,
"repo_name": "csvoss/onelinerizer",
"id": "3b5fbeac6d6eaa30e10a150143d9811c9cb57966",
"size": "141",
"binary... |
from setuptools import setup, find_packages
setup(
name='scscp',
version='0.2.0',
description='Implementation of the SCSCP protocol',
url='https://github.com/OpenMath/py-scscp',
author='Luca De Feo',
license='MIT',
classifiers=[
'Intended Audience :: Science/Research',
'Lice... | {
"content_hash": "be4f62d03cfa3a1f22e3ddba734922b6",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 59,
"avg_line_length": 30.57894736842105,
"alnum_prop": 0.6196213425129088,
"repo_name": "OpenMath/py-scscp",
"id": "8ce2809fd1ec7f3fb06007273d73a060f80636f9",
"size": "581... |
"""empty message
Revision ID: 2c579199005
Revises: 1f9c61031fa
Create Date: 2016-01-26 17:21:29.659591
"""
# revision identifiers, used by Alembic.
revision = '2c579199005'
down_revision = '1f9c61031fa'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - plea... | {
"content_hash": "b77376c9edd43724896b2b591e3df3af",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 83,
"avg_line_length": 23.192307692307693,
"alnum_prop": 0.6849087893864013,
"repo_name": "Encrylize/flask-blogger",
"id": "86bd7285dc763cb63f1ab8d432884a3e05c18d8d",
"size... |
import maya.cmds as mc
import maya.mel as mel
# appleseedMaya imports.
from logger import logger
def hyperShadePanelBuildCreateMenuCallback():
mc.menuItem(label="appleseed")
mc.menuItem(divider=True)
def hyperShadePanelBuildCreateSubMenuCallback():
return "rendernode/appleseed/surface"
def hyperShade... | {
"content_hash": "cdbbed7d8a2eacb80bfdd0b0737aa5a3",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 91,
"avg_line_length": 32.671052631578945,
"alnum_prop": 0.621828433346758,
"repo_name": "est77/appleseed-maya",
"id": "70319589ea6842d48f57e2a604401f040cfb4473",
"size": ... |
import sys
from oslo.config import cfg
from neutron.agent import securitygroups_rpc as sg_rpc
from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api
from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api
from neutron.api.v2 import attributes
from neutron.common import constants as q_const
from neutron.com... | {
"content_hash": "e33fbc70f44cb4b289d01053098e985a",
"timestamp": "",
"source": "github",
"line_count": 497,
"max_line_length": 79,
"avg_line_length": 45.12877263581489,
"alnum_prop": 0.5812118239778857,
"repo_name": "Brocade-OpenSource/OpenStack-DNRM-Neutron",
"id": "1f6383fc33edf807d685d959b0b6ac7f... |
from beanstream.gateway import Beanstream
from beanstream.billing import CreditCard
from beanstream.process_transaction import Adjustment
from django.conf import settings
from billing import Gateway, GatewayNotConfigured
from billing.gateway import CardNotSupported
from billing.signals import transaction_was_successf... | {
"content_hash": "ea5d4782851e1f3e50d55ac92cfafa3e",
"timestamp": "",
"source": "github",
"line_count": 289,
"max_line_length": 476,
"avg_line_length": 60.21107266435986,
"alnum_prop": 0.6094477328889144,
"repo_name": "agiliq/merchant",
"id": "95f2ded52653704fd443300f28449d5184e060be",
"size": "174... |
"""
Django settings for ob_census project.
Generated by 'django-admin startproject' using Django 1.8.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build pa... | {
"content_hash": "c6c8018904e182a35a93834c9923c7e4",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 71,
"avg_line_length": 26.33009708737864,
"alnum_prop": 0.6924778761061947,
"repo_name": "escobar022/cens_django",
"id": "42ad3618a4d589bd5f1327f8ce1f6b55a183840a",
"size"... |
from twilio.rest import Client
# required for all twilio access tokens
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)
ratePlans = client.wireless.rate_plans.list()
print(ratePlans)
| {
"content_hash": "c38bb82ae2366eb7c0442f4435baf080",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 50,
"avg_line_length": 23.727272727272727,
"alnum_prop": 0.7854406130268199,
"repo_name": "teoreteetik/api-snippets",
"id": "fdde021df2e6fa4612403eaf26be13bd179a37de",
"siz... |
from djblets.util.decorators import augment_method_from
from reviewboard.webapi.decorators import webapi_check_local_site
from reviewboard.webapi.resources import resources
from reviewboard.webapi.resources.base_watched_object import \
BaseWatchedObjectResource
class WatchedReviewGroupResource(BaseWatchedObjectR... | {
"content_hash": "d78aabce56d835eeba33bb299d264ab8",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 79,
"avg_line_length": 36.023809523809526,
"alnum_prop": 0.6956378056840714,
"repo_name": "reviewboard/reviewboard",
"id": "c0deb14a2de8e72e324429bce985b8634bd3e05f",
"size... |
from fabric.api import *
from fabric.contrib import * | {
"content_hash": "7b3741758da7135d5b29975cc44dbcd7",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 28,
"avg_line_length": 26.5,
"alnum_prop": 0.7924528301886793,
"repo_name": "BukGet/devfiles",
"id": "1e3dc798bdb1698c4643830b17620b44d1e08c17",
"size": "53",
"binary": fa... |
"""
Implements test cases for the file system factory.
"""
import decimal
import re
import unittest
from datafinder.persistence.common.base_factory import BaseFileSystem
from datafinder.persistence.error import PersistenceError
from datafinder.persistence.factory import FileSystem
from datafinder_te... | {
"content_hash": "22d3b8034ade846a4228ff9027032985",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 90,
"avg_line_length": 35.14358974358974,
"alnum_prop": 0.6579600175105793,
"repo_name": "DLR-SC/DataFinder",
"id": "9d471fa9fd526edb7e56269c671d865324d1328e",
"size": "85... |
"""private module containing functions used to convert database
rows into object instances and associated state.
the functions here are called primarily by Query, Mapper,
as well as some of the attribute loading strategies.
"""
from .. import util
from . import attributes, exc as orm_exc, state as statelib
from .in... | {
"content_hash": "85d86fe2eed58543b0073b2533461c75",
"timestamp": "",
"source": "github",
"line_count": 604,
"max_line_length": 79,
"avg_line_length": 35.908940397350996,
"alnum_prop": 0.5275946332242151,
"repo_name": "FRC-Team-3140/north-american-happiness",
"id": "af77fe3e0598371af4fa90ac7cd945ad17... |
"""The module contains the classes and methods that are used to
execute jobs and handle streams of data between jobs.
.. note::
Usually you do not have to interact with this module directly. The
:py:func:`jip.jobs.run` method deals with the construction of the pipe
graphs for you.
A job group is a set of ... | {
"content_hash": "d74bd10bd7ce3c0caf464b38f7d6f57c",
"timestamp": "",
"source": "github",
"line_count": 404,
"max_line_length": 79,
"avg_line_length": 35.75990099009901,
"alnum_prop": 0.5486952308437738,
"repo_name": "thasso/pyjip",
"id": "be150d5150cdc89715f63c75785c6a99e1c2dde1",
"size": "14469",... |
#-------------------------------------------------------------------------------
# IMPORTS
#-------------------------------------------------------------------------------
import Queue
import SocketServer
import threading
#-----------------------------------------------------... | {
"content_hash": "fb9047ab42476d15e1764a4de7361050",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 80,
"avg_line_length": 40.016949152542374,
"alnum_prop": 0.33587462939432444,
"repo_name": "SMS-Raiders/First2016",
"id": "9a767ac9d4193dc4d1fdfbb8e9c8d8fb7d17c62b",
"size"... |
"""elastic-companion cli runner. To see the available options, run:
>>> companion -h
"""
import logging
import argparse
from . import setup, health, reindex, backup, deletebulk
# Create main parser
parser = argparse.ArgumentParser(description='CLI tool for Elastic search.')
parser.add_argument('-u', '--url', h... | {
"content_hash": "02a2fe2b70eb75fb82d829805c00e657",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 80,
"avg_line_length": 45.168539325842694,
"alnum_prop": 0.613681592039801,
"repo_name": "Receiptful/elastic-companion",
"id": "d49d2146f77e2f61574e0c96489e50533937abf2",
"... |
import os
from skimage import io
import optparse
import circle_detector
#import detector_watershed
def save_data(filename, data):
import pickle
print("Saving data")
f = open(filename, 'w')
pickle.dump(data, f)
f.close()
if __name__ == '__main__' :
parser = optparse.OptionParser()
(options... | {
"content_hash": "15511946f57560e618bddaa677b61298",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 110,
"avg_line_length": 28.29268292682927,
"alnum_prop": 0.6594827586206896,
"repo_name": "DiamondLightSource/auto_tomo_calibration-experimental",
"id": "63e4880e6919c4b2ef20... |
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from tapi_server.models.base_model_ import Model
from tapi_server.models.tapi_oam_mep_ref import TapiOamMepRef # noqa: F401,E501
from tapi_server.models.tapi_oam_mip_ref import TapiOam... | {
"content_hash": "a9d0e2c7d37d64b81c0ddf36582c996e",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 96,
"avg_line_length": 26.361702127659573,
"alnum_prop": 0.5944309927360775,
"repo_name": "karthik-sethuraman/Snowmass-ONFOpenTransport",
"id": "2f5c7adf73a1aaa512e6a9cc4c083... |
import functools
import warnings
import sqlalchemy
from common.config import config
def new_engine_and_metadata():
"""
Create new SQLAlchemy engine and metadata.
NOTE: Every process should have AT MOST one engine.
"""
engine = sqlalchemy.create_engine(config["postgres"], echo=config["debugsql"], execution_opti... | {
"content_hash": "f319c95297716f2b1aa294be1f0f8771",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 120,
"avg_line_length": 29.82758620689655,
"alnum_prop": 0.7358381502890173,
"repo_name": "andreasots/lrrbot",
"id": "5fa206bb1575b7e5952d2bba439650290b8af230",
"size": "17... |
from RGT.XML.SVG.basicSvgNode import BasicSvgNode
from types import StringType
class FeMergeNodeNode(BasicSvgNode):
svgNodeType = BasicSvgNode.SVG_FE_MERGE_NODE_NODE
ATTRIBUTE_IN = 'in'
def __init__(self, ownerDoc):
BasicSvgNode.__init__(self, ownerDoc, 'feMergeNode')
self._al... | {
"content_hash": "f002ec8d4badb9fd518880be578f8f35",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 85,
"avg_line_length": 31.583333333333332,
"alnum_prop": 0.6266490765171504,
"repo_name": "danrg/RGT-tool",
"id": "fac102827a8ed51f5d287ec30aac5de55e5536aa",
"size": "758",... |
"""
$ python simple_cli.py --help
simple_cli.py v1.0
Usage: simple_cli.py [SWITCHES] srcfiles...
Meta-switches:
-h, --help Prints this help message and quits
--version Prints the program's version and quits
Switches:
-I VALUE:str Specify include directories; ... | {
"content_hash": "c471ca71ebb8560e10abbbc6134a3cf5",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 90,
"avg_line_length": 27.586206896551722,
"alnum_prop": 0.62,
"repo_name": "AndydeCleyre/plumbum",
"id": "47178cc9e8d4fadd059e99644bd1e598e02f1374",
"size": "1622",
"bin... |
from securitylib.advanced_crypto import safe_compare, validate_authenticator_key, hmac
from securitylib.random import get_random_bytes
from securitylib.utils import randomize, get_random_element
import string
import math
import os
import re
__all__ = ['prepare_password_for_storage', 'compare_stored_password',
... | {
"content_hash": "14c6ce98a3a66fc42e368f31741d1d84",
"timestamp": "",
"source": "github",
"line_count": 610,
"max_line_length": 145,
"avg_line_length": 39.472131147540985,
"alnum_prop": 0.6257579533183819,
"repo_name": "sapo/securitylib-python",
"id": "519bc5ddd1c8eb6688bb41b4f0402282ce66638c",
"si... |
import os
import datetime
from fnmatch import fnmatch
from process import process
from main.models import Client, Show, Location, Episode, Raw_File, Mark
VIDEO_EXTENSIONS = ('.dv', '.flv', '.mp4', '.MTS', '.mkv', '.mov', '.ts')
class add_dv(process):
def mark_file(self,pathname,show,location):
# one f... | {
"content_hash": "6b0f9b6fd46e6f927b6e893bf91a7267",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 78,
"avg_line_length": 34.16167664670659,
"alnum_prop": 0.4976336546888694,
"repo_name": "xfxf/veyepar",
"id": "9e42adb27be8e92e961c45e4433a07df3d1c91c3",
"size": "5821",
... |
"""
Compatibility functionality for GDBINIT users.
https://github.com/gdbinit/Gdbinit/blob/master/gdbinit
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import gdb
import pwndbg.commands
@pwnd... | {
"content_hash": "7c85292a6ded28b0d344545e78785959",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 120,
"avg_line_length": 33.4375,
"alnum_prop": 0.7501557632398754,
"repo_name": "cebrusfs/217gdb",
"id": "d3599d31fbb1d4b5424c8ffbc7f3cd39151d3ae6",
"size": "1651",
"bina... |
import json, urllib3
from datetime import datetime, timedelta
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.utils.cache import patch_response_headers
from core.oauth.utils import login_customrequired
from core.views import initRequest
from core.libs.DateEncoder import... | {
"content_hash": "99232287f8655a2e33fd711062da5601",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 182,
"avg_line_length": 38,
"alnum_prop": 0.6174292515207617,
"repo_name": "PanDAWMS/panda-bigmon-core",
"id": "8da24dbe0db506e835bf0e3959e957b945ec4ec2",
"size": "7562",
... |
"""@file sdr_snr_scorer.py
contains the scorer using SdrSnrScorer"""
# Edited by Pieter Appeltans (added snr score)
import scorer
import numpy as np
from nabu.postprocessing import data_reader
import bss_eval
class SdrSnrScorer(scorer.Scorer):
"""the SDR scorer class. Uses the script from
C. Raffel, B. McFee,... | {
"content_hash": "5e9bdf3bdb41f78559ff00813f74dd8c",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 133,
"avg_line_length": 40.89873417721519,
"alnum_prop": 0.6453110492107706,
"repo_name": "JeroenZegers/Nabu-MSSS",
"id": "8058f2d281ed903d9ff7ed3666c92538878bc06f",
"size"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.