text stringlengths 4 1.02M | meta dict |
|---|---|
import os.path
import subprocess
import shutil
from gii.core import *
from tools.ml2fsm import convertGraphMLToFSM
##----------------------------------------------------------------##
def _getModulePath( path ):
import os.path
return os.path.dirname( __file__ ) + '/' + path
##------------------------------------... | {
"content_hash": "934c1c724de2efe74534b6b8d95ed09a",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 70,
"avg_line_length": 29.09090909090909,
"alnum_prop": 0.5822916666666667,
"repo_name": "tommo/gii",
"id": "6953f02da4900ce0335a037e5cf620ea2c095158",
"size": "1920",
"b... |
import random
import string
import testtools
from tempest.api.compute import base
from tempest import config
from tempest import exceptions
from tempest.test import attr
class LiveBlockMigrationV3TestJSON(base.BaseV3ComputeAdminTest):
_host_key = 'os-extended-server-attributes:host'
_interface = 'json'
... | {
"content_hash": "510734cd378b6c3ecaaa2a5ee43f7d71",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 78,
"avg_line_length": 39.46153846153846,
"alnum_prop": 0.6198830409356725,
"repo_name": "BeenzSyed/tempest",
"id": "50a5f3c607f972420f1eaff83ad1d39652398850",
"size": "67... |
from setuptools import setup, find_packages
packages = find_packages()
namespace = packages[0]
setup(
name = namespace,
version = __import__(namespace).get_version(),
url = 'https://github.com/jimzhan/rex',
author = 'Jim Zhan',
author_email = 'jim.zhan@me.com',
packages = find_packages(),
... | {
"content_hash": "8afe761aad86e2e656c343e1849571ac",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 79,
"avg_line_length": 29.7,
"alnum_prop": 0.57996632996633,
"repo_name": "jimzhan/pyx",
"id": "4aa32f4cd97224545b85078361403d3f09150b78",
"size": "1212",
"binary": false... |
"""This module contains a collection of integration test utilities
that are intended to make writing integration tests very, very easy.
"""
from ConfigParser import ConfigParser
import httplib
import os
import re
import shutil
import signal
import subprocess
import tempfile
import time
import unittest
import requests... | {
"content_hash": "5df16ed66ee2e10f2907275e52ac56dd",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 99,
"avg_line_length": 27.502590673575128,
"alnum_prop": 0.591183119819141,
"repo_name": "simonsdave/cloudfeaster-services",
"id": "6becb2324607145a1bfa0d4f89672842dccde52d"... |
params = {
# Whether to save the results in results.txt.
'save results': True,
# Whether to plot the results in an interactive window.
'show results': True,
# Whether to plot the decay rates as a function of the max angular mode order.
# The plot is made for the smallest given distance and emi... | {
"content_hash": "a13ea6bc8230d3cea0b58a951637d830",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 83,
"avg_line_length": 27.18487394957983,
"alnum_prop": 0.6420401854714065,
"repo_name": "rjurga/plasmon-fluorescence",
"id": "5708f1b3fdb65d75834baa4d319af9d28337551a",
"... |
from django import forms
from crawler import models
class AppForm(forms.ModelForm):
class Meta:
model = models.App
fields = '__all__'
class AppDescriptionForm(forms.ModelForm):
class Meta:
model = models.AppDescription
fields = '__all__'
| {
"content_hash": "17b8f416b9ace68bee97e940fbaed962",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 42,
"avg_line_length": 18.866666666666667,
"alnum_prop": 0.6431095406360424,
"repo_name": "bkosawa/admin-recommendation",
"id": "4e2b473ae4106dced6cd574518ca13078eeaf9d1",
... |
__author__ = 'Sam Brooke'
__date__ = 'September 2017'
__copyright__ = '(C) 2017, Sam Brooke'
__email__ = "sbrooke@tuta.io"
import os
import fnmatch
import csv
import gdal
import georasters as gr
import re
from optparse import OptionParser
from dateutil.parser import parse
parser = OptionParser()
parser.add_option("-c... | {
"content_hash": "b80619e630bc60c5b376d268ec61aeea",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 132,
"avg_line_length": 27.05982905982906,
"alnum_prop": 0.6411876184459886,
"repo_name": "hijinks/python-bcet",
"id": "8a152612b84c40a439e1bba560c7a227ba28a8bc",
"size": ... |
import logging
import re
from tempest_lib import exceptions
import testtools
from tempest import cli
from tempest import clients
from tempest import config
from tempest import test
CONF = config.CONF
LOG = logging.getLogger(__name__)
class SimpleReadOnlyCinderClientTest(cli.ClientTestBase):
"""Basic, read-onl... | {
"content_hash": "bc51a797567d45cac2286f2162c30e20",
"timestamp": "",
"source": "github",
"line_count": 205,
"max_line_length": 79,
"avg_line_length": 44.40975609756097,
"alnum_prop": 0.6124780316344464,
"repo_name": "hpcloud-mon/tempest",
"id": "cb29cc89d3d4546d21a09e6e5682f4605f0c922a",
"size": "... |
import os, sys
import glob
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-r', '--root', dest='root', help='root of your dataset')
parser.add_argument('-y', '--year', dest='year', help='the year for your dataset')
args = parser.parse_args()
if not os.path.exists(args.root):
print("The path... | {
"content_hash": "6cafdfc71008b938bab3bba15f33b333",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 95,
"avg_line_length": 27.64516129032258,
"alnum_prop": 0.6604434072345391,
"repo_name": "CUFCTL/DLBD",
"id": "a9d2f0fb69aafc6b1b52beba63c5b0fdde50fd7c",
"size": "857",
"... |
import kindred
def test_pubannotation():
corpus = kindred.pubannotation.load('bionlp-st-gro-2013-development')
assert isinstance(corpus,kindred.Corpus)
fileCount = len(corpus.documents)
entityCount = sum([ len(d.entities) for d in corpus.documents ])
relationCount = sum([ len(d.relations) for d in corpus.docume... | {
"content_hash": "2c5cbba9acc75752b54d5868e31e1aba",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 70,
"avg_line_length": 26.529411764705884,
"alnum_prop": 0.729490022172949,
"repo_name": "jakelever/kindred",
"id": "c6369a91e8bc0345a2d1dd07dc859a26bc4cb682",
"size": "452... |
from django.contrib import admin
from ideas.models import Category
@admin.register(Category)
class IdeaModelAdmin(admin.ModelAdmin):
list_display = admin.ModelAdmin.list_display + (
'name',
'slug',
'created_at',
'updated_at',
)
| {
"content_hash": "c1d3f59e27ce310fba277681ff64375b",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 52,
"avg_line_length": 18.2,
"alnum_prop": 0.6410256410256411,
"repo_name": "paulsoh/moxie",
"id": "18afcf8157b5c494ad24c69b7371547f985719c3",
"size": "273",
"binary": fa... |
from django.forms.utils import ErrorList
from django.template import Context, Template, TemplateSyntaxError
# from django.template.loader import render_to_string
# from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
# from froala_editor.fields import FroalaField
#from p... | {
"content_hash": "fe2d88ef618a7606f76c3741c99690cc",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 88,
"avg_line_length": 32.58571428571429,
"alnum_prop": 0.655414291977203,
"repo_name": "rorito/django-squeezemail",
"id": "7521642d52ce0315ac538e369c2db8a31fd8cac6",
"size... |
"""Univariate features selection."""
# Authors: V. Michel, B. Thirion, G. Varoquaux, A. Gramfort, E. Duchesnay.
# L. Buitinck, A. Joly
# License: BSD 3 clause
import numpy as np
import warnings
from scipy import special, stats
from scipy.sparse import issparse
from ..base import BaseEstimator
from ..prepr... | {
"content_hash": "bbf7134f375ffd14f9e806c301cdda64",
"timestamp": "",
"source": "github",
"line_count": 753,
"max_line_length": 80,
"avg_line_length": 34.92828685258964,
"alnum_prop": 0.6300140679061632,
"repo_name": "BiaDarkia/scikit-learn",
"id": "612f61028e2a477f401485dc20e2e4d237f400f7",
"size"... |
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
ex... | {
"content_hash": "2a203f42c0585dadbc45aeb00ae06941",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 116,
"avg_line_length": 58.278481012658226,
"alnum_prop": 0.720894874022589,
"repo_name": "xcgspring/XSTAF",
"id": "749e732315a0f6690af109040fd381eeeb07b40d",
"size": "4842... |
"""Class containing info about a full trace."""
import collections
import sys
from common import endpoint_cmp
from connection_info import ConnectionInfo
class TraceInfo(object):
"""A class containing a summary about a full packet trace."""
ANALYSIS_TYPES = ['flow', 'packet']
def __init__(self, f, analysis_... | {
"content_hash": "58d84b8fb64cef2775a191fe31218d67",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 77,
"avg_line_length": 35.370370370370374,
"alnum_prop": 0.6010471204188481,
"repo_name": "google/rttcp",
"id": "2d32ea3deb121a975f84c9a4872e4f07b7576175",
"size": "2528",
... |
import numpy as np
import sys
import json
import pandas as pd
import re
import glob as glob
import os
from collections import defaultdict
from xml.etree import cElementTree as ET
from io import StringIO
#from metatlas.datastructures import metatlas_objects as metob
#from metatlas.io import metatlas_get_data_helper_fun... | {
"content_hash": "37452b4816c07880745ddceec4fbb5c6",
"timestamp": "",
"source": "github",
"line_count": 2327,
"max_line_length": 285,
"avg_line_length": 44.19982810485604,
"alnum_prop": 0.6042312815377286,
"repo_name": "biorack/metatlas",
"id": "be8bf43cc11997438859497c06e56daa92214eff",
"size": "1... |
import csv, os
os.makedirs('headerRemoved', exist_ok=True)
# loop through every file in the current working directory.
for csvfile in os.listdir('.'):
if not csvfile.endswith('.csv'):
continue
print('Removing header from ' + csvfile + '...')
# Read the csv file in (skipping the first row)
... | {
"content_hash": "292b5470205c5c1ee8b0b39f3d63432b",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 78,
"avg_line_length": 26.379310344827587,
"alnum_prop": 0.6196078431372549,
"repo_name": "spencerpomme/coconuts-on-fire",
"id": "33722ff74f954ca141575219ff79679beebc2bfb",
... |
from netfilterqueue import NetfilterQueue
from scapy.all import *
import subprocess
import sys
def pkt_filter_callback(packet):
print packet
packet.accept()
def packet_filter():
nfq = NetfilterQueue()
nfq.bind(1, pkt_filter_callback)
try:
print 'Controller packet filtering mode'
... | {
"content_hash": "314459e6ebb19de8af06581361ab6366",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 48,
"avg_line_length": 18.32,
"alnum_prop": 0.6746724890829694,
"repo_name": "OpenWinCon/OpenWinNet",
"id": "f8dbd9a3f7c273acd328ee66bd4b4db119c74338",
"size": "483",
"bi... |
import chainer
import chainer.backends
from chainer.backends.cuda import cupy
import chainer.links as L
import chainer.testing
import chainermn
import numpy as np
import pytest
class Param(object):
def __init__(self, param):
self.dtype = None
self.__dict__.update(param)
params = [Param(p) for p ... | {
"content_hash": "54477fafb40198d0766d286cc55d68b3",
"timestamp": "",
"source": "github",
"line_count": 451,
"max_line_length": 79,
"avg_line_length": 32.06430155210643,
"alnum_prop": 0.6016872968674366,
"repo_name": "chainer/chainer",
"id": "b771887275388028d9b189de8d49812c6fb83e86",
"size": "1446... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Todo',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=Fa... | {
"content_hash": "3047ab263ac4167d69f3d4a9d94f7f2a",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 114,
"avg_line_length": 31.208333333333332,
"alnum_prop": 0.5580774365821095,
"repo_name": "pombredanne/djangle",
"id": "44dccd2e556512519b6b8955af5571777ee77ad1",
"size": ... |
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | {
"content_hash": "0975d7d406aced5ea76e16a0ec617f7e",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 130,
"avg_line_length": 53.59722222222222,
"alnum_prop": 0.5309665716506867,
"repo_name": "radicalbit/ambari",
"id": "053d44ad15703f69cbeb80242c81a723d80ef1bf",
"size": "7... |
from marshmallow import ValidationError
from pyramid.httpexceptions import HTTPInternalServerError
from pyramid.view import view_defaults
from pyramid.view import view_config
from amnesia.utils import recaptcha
from amnesia.utils.forms import render_form
from amnesia.modules.account.validation import AccountSchema
f... | {
"content_hash": "205df140a3a32b85bfc3ef658932e618",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 83,
"avg_line_length": 31.933333333333334,
"alnum_prop": 0.6717118997912317,
"repo_name": "silenius/amnesia",
"id": "47170abad9b82ddc800ac57a0e66a8a6969db375",
"size": "194... |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WH... | {
"content_hash": "9caeddca9533778ebecff11a73a4e4a6",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 124,
"avg_line_length": 32.375,
"alnum_prop": 0.6822393822393822,
"repo_name": "jeremiedecock/snippets",
"id": "58daac6838ee8060becb61e0a80ba49f466cb2c3",
"size": "3276",
... |
import element.node
class ActionView(object):
def __init__(self, rendered, event_dispatcher):
self.rendered = rendered
self.event_dispatcher = event_dispatcher
def dispatch(self, request_handler, *args, **kwargs):
if '_controller' not in kwargs:
return
serviceId, m... | {
"content_hash": "41926af3604a607e001c09883a45c6d9",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 77,
"avg_line_length": 30.419354838709676,
"alnum_prop": 0.5885471898197243,
"repo_name": "rande/python-element",
"id": "36122811e56841ad9fc075348348a69e8b78cbe4",
"size": ... |
"""
Classes for representing and processing probabilistic information.
The ``FreqDist`` class is used to encode "frequency distributions",
which count the number of times that each outcome of an experiment
occurs.
The ``ProbDistI`` class defines a standard interface for "probability
distributions", which encode the p... | {
"content_hash": "abc5f6243232f8f75f9822d10ed4d9d4",
"timestamp": "",
"source": "github",
"line_count": 2235,
"max_line_length": 117,
"avg_line_length": 36.28545861297539,
"alnum_prop": 0.5937261091518903,
"repo_name": "JeyZeta/Dangerous",
"id": "88ce5a0d63463d1c66beb20e01361858141f5e42",
"size": "... |
'''
https://spacy.io/usage/vectors-similarity
python -m spacy download en_core_web_sm
python -m spacy download en_core_web_md
'''
import spacy
nlp = spacy.load('en_core_web_md') # make sure to use larger model!
tokens = nlp(u'dog cat banana')
for token1 in tokens:
for token2 in tokens:
print(token1.t... | {
"content_hash": "f90f7049c81bd99b33e52034177a980f",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 68,
"avg_line_length": 21.470588235294116,
"alnum_prop": 0.7041095890410959,
"repo_name": "ajrichards/bayesian-examples",
"id": "a69d0046758f0d0c7c17126bcee6cf652df6612f",
... |
import argparse
import json
import sys
import yaml
import shade
import shade.inventory
def output_format_dict(data, use_yaml):
if use_yaml:
return yaml.safe_dump(data, default_flow_style=False)
else:
return json.dumps(data, sort_keys=True, indent=2)
def parse_args():
parser = argparse.A... | {
"content_hash": "20ffa6be28b742efbae44c97af2705c5",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 78,
"avg_line_length": 31.5,
"alnum_prop": 0.6266666666666667,
"repo_name": "jsmartin/shade",
"id": "c4d396f463ac5030be7dafd460bd30f687bca74b",
"size": "2208",
"binary": ... |
from fabric.api import env, task
from fabric.operations import sudo
@task
def start():
"""Start the etherpad service."""
sudo("service etherpad start")
@task
def stop():
"""Stop the etherpad service."""
sudo("service etherpad stop", warn_only=True)
@task
def clean():
"""Remove all the code fro... | {
"content_hash": "33b9fb23a115e9e6416af8ae9e42dd8d",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 97,
"avg_line_length": 24.676470588235293,
"alnum_prop": 0.66626936829559,
"repo_name": "oaeproject/oae-fabric",
"id": "eee7cdde2f48d0dd6d481241a0e5d4a98be865cb",
"size": "... |
from haystack.query import SearchQuerySet
from lists import *
# from haystack.views import search_view_factory
from django.conf.urls import patterns, include, url
from django.contrib.auth.decorators import login_required
from django.conf import settings
# from engage.api import *
from engage import api, api_public_v1... | {
"content_hash": "f0261164101cb0a4425b25abe0dded53",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 150,
"avg_line_length": 56.34705882352941,
"alnum_prop": 0.7000730765215576,
"repo_name": "Suite5/DataColibri",
"id": "e5b5629a0511780e4e47f36b121f4a34791f1957",
"size": "... |
"""
.. py:currentmodule:: MCXRay.BackgroundProblem.mcxray
.. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca>
Base module to create and analuyze MCXRay simulations.
"""
# Script information for the file.
__author__ = "Hendrix Demers (hendrix.demers@mail.mcgill.ca)"
__version__ = ""
__date__ = ""
__copyri... | {
"content_hash": "64bfee043ba7b312c4136df871c9695b",
"timestamp": "",
"source": "github",
"line_count": 814,
"max_line_length": 182,
"avg_line_length": 39.84398034398034,
"alnum_prop": 0.6238090833410416,
"repo_name": "drix00/pymcxray",
"id": "1421bdc28f683f50cd3b11ebd46772a2930b039b",
"size": "324... |
import numpy as np
import time
import logging
from collections import Counter
from ShortTextCodec import NonEncodableTextException
from sklearn.preprocessing import OneHotEncoder
DEBUG_TIMING = False
# Taken from StackOverflow
def timeit(f):
if not DEBUG_TIMING:
return f
def timed(*args, **kw):
... | {
"content_hash": "6ec383f7c28e0c58dcba7a6c33c34cd3",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 216,
"avg_line_length": 33.270833333333336,
"alnum_prop": 0.632122730118973,
"repo_name": "colinmorris/char-rbm",
"id": "7b1baf11c44990f86e0ee4b7d27d490ee8e2c9b7",
"size": ... |
"""
Finance module forms
"""
from django.shortcuts import get_object_or_404
from django import forms
from anaf.identities.models import Contact
from models import Transaction, Liability, Category, Account, Asset, Equity, Currency, Tax
from anaf.sales.models import SaleOrder
from anaf.core.models import Object, ModuleS... | {
"content_hash": "70f8c3c704b7427632692216e702b14d",
"timestamp": "",
"source": "github",
"line_count": 777,
"max_line_length": 109,
"avg_line_length": 38.61647361647362,
"alnum_prop": 0.5449091818030328,
"repo_name": "tovmeod/anaf",
"id": "19cb2a5546c8d77d34e04c84646ae0b37f2cb313",
"size": "30005"... |
from rackattack.common import globallock
from rackattack.tcp import debug
from inaugurator.server import server
from inaugurator.server import rabbitmqwrapper
import logging
class Inaugurate:
def __init__(self, filesPath):
self._registered = {}
self._rabbit = rabbitmqwrapper.RabbitMQWrapper(filesP... | {
"content_hash": "d3935d15373842eb421b447a63027ccb",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 100,
"avg_line_length": 40.904761904761905,
"alnum_prop": 0.6061311602638727,
"repo_name": "Stratoscale/rackattack-virtual",
"id": "ddf2fca8b2dd5fc409c65c06acc6698e266623ad",... |
from Root import c
import unittest
class test3(unittest.TestCase):
def test_cc1(self):
self.assertEqual(c.bar1()+12,13)
def test_cc2(self):
self.assertEqual(c.bar2()*c.bar2(),4)
if __name__ == '__main__':
unittest.main()
| {
"content_hash": "a24d077550123af40f332837864b2390",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 39,
"avg_line_length": 25.333333333333332,
"alnum_prop": 0.6798245614035088,
"repo_name": "codeboardio/mantra",
"id": "4f1f39871da913f5f8b85005abbe45db6f123e2c",
"size": "22... |
"""
The flask application package.
"""
import logging
from flask import Flask
app = Flask(__name__, instance_relative_config=True)
app.config.from_object('jarvis_svc.default_settings')
app.config.from_pyfile('app.cfg', silent = True)
logging.basicConfig(filename='jarvis.log', level=logging.WARNING)
import jarvis_svc... | {
"content_hash": "5ae5bc996a090b5b494bce59934497f3",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 65,
"avg_line_length": 25.153846153846153,
"alnum_prop": 0.7614678899082569,
"repo_name": "ztepsic/jarvis",
"id": "02d1c670f400a067287555d9097310e7c0793ef2",
"size": "327",... |
"""
Copyright (C) 2017 Roberto Bruttomesso <roberto.bruttomesso@gmail.com>
This file is distributed under the terms of the 3-clause BSD License.
A copy of the license can be found in the root directory or at
https://opensource.org/licenses/BSD-3-Clause.
Author: Roberto Bruttomesso <roberto.bruttomesso@gmail.com>
Da... | {
"content_hash": "91459989d0dd58d555517229738159cb",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 70,
"avg_line_length": 31.020833333333332,
"alnum_prop": 0.6326393552719947,
"repo_name": "formalmethods/intrepyd",
"id": "88432fbd8c1c0fcc8dcf36530896b115c682ac1c",
"size"... |
from abc import abstractmethod, abstractproperty
from ebu_tt_live.utils import AutoRegisteringABCMeta, AbstractStaticMember, validate_types_only
# Interfaces
# ==========
class ICarriageMechanism(object, metaclass=AutoRegisteringABCMeta):
"""
Basic interface for the carrige mechanisms
"""
class IProduc... | {
"content_hash": "c4297d14c072680bf5183f4dcba28aeb",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 101,
"avg_line_length": 22.445454545454545,
"alnum_prop": 0.6103685702713649,
"repo_name": "bbc/ebu-tt-live-toolkit",
"id": "c445fd834390761a8a7c5baf74e7e70e2d7c5fef",
"si... |
import os
import numpy as np
from skimage.io import imread_collection
from skimage.transform import resize, rescale
def list_paths_labels(label_dir):
'''label_dir - a directory path
for data, where
directories act as a label,
data in directories
return paths_to_data_list, labels_list '''
... | {
"content_hash": "f31054145adb3e52d68f08f043193dde",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 98,
"avg_line_length": 33.32142857142857,
"alnum_prop": 0.5884244372990354,
"repo_name": "AugustasVol/Image_classification_produce",
"id": "f46ea29642ec440af8558470441a8b43c5... |
from octavia.common import constants
from octavia.common import data_models
from octavia.tests.common import constants as ut_constants
def generate_load_balancer_tree(additional_vips=None):
vip = generate_vip()
amps = [generate_amphora(), generate_amphora()]
lb = generate_load_balancer(vip=vip, amphorae=a... | {
"content_hash": "b4f2319d00cca2f5fef2f510a99c8fe9",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 79,
"avg_line_length": 34.641975308641975,
"alnum_prop": 0.5331432644333571,
"repo_name": "openstack/octavia",
"id": "0cc12c464b12905310a4eea24430b63a61829456",
"size": "34... |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_equal,
connect_nodes_bi,
initialize_chain_clean,
start_nodes,
wait_and_assert_operationid_status,
)
from decimal import Decimal
SAPLING_TREE_EMPTY_ROOT = "3e49b5f954aa9d3545bc6c37744661eea48d7c3... | {
"content_hash": "2ebd46015881dff41960241144e6e170",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 128,
"avg_line_length": 42.855172413793106,
"alnum_prop": 0.6483746379143869,
"repo_name": "litecoinz-project/litecoinz",
"id": "1842ef7dc0c9e2315125148edac6d57b08dc169b",
... |
from django_sqlalchemy.test import *
from django_sqlalchemy.backend import metadata
from django.db import models
# An example of a custom manager called "objects".
class PersonManager(models.Manager):
def get_fun_people(self):
return self.filter(fun=True)
class Person(models.Model):
first_name = mode... | {
"content_hash": "f376e9ba9b888e08369ece50dacc78a1",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 90,
"avg_line_length": 32.244680851063826,
"alnum_prop": 0.6954800395908941,
"repo_name": "brosner/django-sqlalchemy",
"id": "eaca64e35014042a9f7e5fd5db5aa4ea086467ed",
"si... |
"""
Utility functions for evaluating processing modules.
"""
import sets, math
from nltk.chktype import chktype
def accuracy(reference, test):
"""
Given a list of reference values and a corresponding list of test
values, return the percentage of corresponding values that are
equal. In particular, ret... | {
"content_hash": "da70c45f370d3977863ef155d4f6dd54",
"timestamp": "",
"source": "github",
"line_count": 290,
"max_line_length": 75,
"avg_line_length": 36,
"alnum_prop": 0.5837164750957854,
"repo_name": "ronaldahmed/robot-navigation",
"id": "70f9382a62e10f8ea92781fb1fcbe28bf75ac773",
"size": "10705"... |
"""
gspread.models
~~~~~~~~~~~~~~
This module contains common spreadsheets' models
"""
import re
from collections import defaultdict
from itertools import chain
from xml.etree import ElementTree
from xml.etree.ElementTree import Element, SubElement
from . import urlencode
from .ns import _ns, _ns1, _ns2, ATOM_NS, ... | {
"content_hash": "fa342a716106a72014a5464b50ed00f1",
"timestamp": "",
"source": "github",
"line_count": 685,
"max_line_length": 92,
"avg_line_length": 30.88029197080292,
"alnum_prop": 0.5559022360894436,
"repo_name": "brakhane/gspread",
"id": "533a8e63b11ca2322b9ac0c729111fc0602fba62",
"size": "211... |
############################################################################
##
## Copyright (C) 2005-2005 Trolltech AS. All rights reserved.
##
## This file is part of the example classes of the Qt Toolkit.
##
## This file may be used under the terms of the GNU General Public
## License version 2.0 as publish... | {
"content_hash": "70070746a488c89487c77b5282f480fc",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 114,
"avg_line_length": 34.55113636363637,
"alnum_prop": 0.577372142739681,
"repo_name": "cherry-wb/SideTools",
"id": "c82afa9e98f6f0ab7f46cad8c0283d993164fdc2",
"size": "... |
"""
Print the NCBI taxonomy as a spreadsheet
"""
from taxon import get_taxonomy_db, get_taxonomy, all_species_ids
want = ['superkingdom', 'kingdom', 'phylum', 'class', 'order', 'family', 'genus', 'species']
def printtaxa(i, c):
"""
Print out the taxonomy
:param i: identifier
:param c: database connec... | {
"content_hash": "3788f3a822750d502fd832106a0b84be",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 92,
"avg_line_length": 24.875,
"alnum_prop": 0.5590452261306532,
"repo_name": "linsalrob/EdwardsLab",
"id": "bb3cd0a91ddc13c238cbf86fd7472cc443801faf",
"size": "796",
"bi... |
import rospy
from naoqi_sensors.naoqi_camera import NaoqiCam
if __name__ == "__main__":
naocam = NaoqiCam()
naocam.start()
rospy.spin()
| {
"content_hash": "34e1610d5c132f162d4176b04e5872c0",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 47,
"avg_line_length": 20.428571428571427,
"alnum_prop": 0.6713286713286714,
"repo_name": "lsouchet/naoqi_bridge",
"id": "b174c8698e60a85225a80fede25eadaaed2b1265",
"size": ... |
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
DESCRIPTOR = _descriptor.FileDescriptor(
name='messages.proto',
package='',
... | {
"content_hash": "8e6c2ca9c454b8fde52c6db72811562a",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 148,
"avg_line_length": 25.179775280898877,
"alnum_prop": 0.7014725568942436,
"repo_name": "sashafrey/python_cpp_interop",
"id": "07a6a6b0ac476e8842ca8dd8dabed3c1ae221288",
... |
"""
pybench2.py: Test speed of one or more Pythons on a set of simple
code-string benchmarks. A function, to allow stmts to vary.
This system itself runs on both 2.X and 3.X, and may spawn both.
Version 2: adds setup statement support, with extra stmts list slot.
Uses timeit to test either the Python running this s... | {
"content_hash": "c984c7851fcc6e8f8907e6a63e5a8d56",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 94,
"avg_line_length": 44.453125,
"alnum_prop": 0.6200351493848858,
"repo_name": "dreadrel/UWF_2014_spring_COP3990C-2507",
"id": "01eb698620ab6fe822d1a619570fa7e9741e7ebe",
... |
"""Container for Google Cloud Bigtable Cells and Streaming Row Contents."""
import copy
import six
import grpc
from google.api_core import exceptions
from google.api_core import retry
from google.cloud._helpers import _datetime_from_microseconds
from google.cloud._helpers import _to_bytes
from google.cloud.bigtable... | {
"content_hash": "dbf3bf8f4e849b039f9996eb42fd9bab",
"timestamp": "",
"source": "github",
"line_count": 685,
"max_line_length": 88,
"avg_line_length": 35.25985401459854,
"alnum_prop": 0.5914379166149133,
"repo_name": "tswast/google-cloud-python",
"id": "24078b8496d891f79a605d04f74cbfad139ecfd6",
"s... |
"""Builds the eye network.
Summary of available functions:
# Compute input images and labels for training. If you would like to run
# evaluations, use inputs() instead.
inputs, labels = distorted_inputs()
# Compute inference on the model inputs to make a prediction.
predictions = inference(inputs)
# Compute t... | {
"content_hash": "3b04fbb572e6604d141e4c0c82bfd19f",
"timestamp": "",
"source": "github",
"line_count": 389,
"max_line_length": 99,
"avg_line_length": 37.97943444730077,
"alnum_prop": 0.6082983619872749,
"repo_name": "callofdutyops/YXH2016724098982",
"id": "bc024592c453029dee9f2241e1aa2ec2b68f61c4",
... |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import django_mc.mixins
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
migrations.swappable_dependency(settings.MC_LAYOUT_... | {
"content_hash": "38f06a9a7edf6f2340932c0ada5ee59e",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 289,
"avg_line_length": 44.483333333333334,
"alnum_prop": 0.5680029973772949,
"repo_name": "team23/django_mc",
"id": "ef39ab9a34593e1f94d44fba7fe89e46f63b7a96",
"size": "26... |
"""
celery.canvas
~~~~~~~~~~~~~
Composing task workflows.
Documentation for some of these types are in :mod:`celery`.
You should import these from :mod:`celery` and not this module.
"""
from __future__ import absolute_import
from copy import deepcopy
from functools import partial as _partial, r... | {
"content_hash": "47b63fb95c5561daf5602844ebfb835b",
"timestamp": "",
"source": "github",
"line_count": 607,
"max_line_length": 79,
"avg_line_length": 31.769357495881383,
"alnum_prop": 0.5698506533914126,
"repo_name": "sivaprakashniet/push_pull",
"id": "ef18dd976790751a82cf2c450f4277ea38a564c8",
"s... |
import logging
from experiment_setup import ExperimentSetup
from model_learn import ModelLearn
from plot_results import PlotOutput
from multiprocessing.pool import Pool
class ExperimentRunner:
def __init__(self):
pass
@staticmethod
def get_configs():
"""
Builds an array of config... | {
"content_hash": "f925fa2e20738ae571a9d7f1c2c92881",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 119,
"avg_line_length": 37.04639175257732,
"alnum_prop": 0.5135661611242521,
"repo_name": "adezfouli/savigp",
"id": "bc9a29309063f20499b9d4de7b6a33571ff92185",
"size": "71... |
"""Family module for Translate Wiki."""
from __future__ import absolute_import, unicode_literals
__version__ = '$Id$'
from pywikibot import family
# The Wikimedia i18n family
class Family(family.SingleSiteFamily):
"""Family class for Translate Wiki."""
name = 'i18n'
domain = 'translatewiki.net'
d... | {
"content_hash": "5bfbbe04066fa45bdec0020c0dfb334e",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 59,
"avg_line_length": 22.526315789473685,
"alnum_prop": 0.6682242990654206,
"repo_name": "smalyshev/pywikibot-core",
"id": "6647623502ba3349622f7b3d56334fdcc4865744",
"siz... |
from sqlalchemy import (
Column,
Integer,
Text,
)
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import (
scoped_session,
sessionmaker,
)
from zope.sqlalchemy import ZopeTransactionExtension
DBSession = scoped_session(sessionmaker(extension=ZopeTransactionExt... | {
"content_hash": "9b81b16af8bd799fd833b5c65455df32",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 78,
"avg_line_length": 22.181818181818183,
"alnum_prop": 0.7213114754098361,
"repo_name": "miohtama/pyramid_celery",
"id": "0a232ffeb6cc405e197470b94842ee785fd43ff0",
"size... |
import re
calls="/lscr2/andersenlab/kml436/git_repos2/Transposons2/results/kinship/kin_C_matrix_full.txt"
CALLS=open(calls,"r")
absences={}
references={}
call={}
first_line=True
for line in CALLS:
line=line.rstrip('\n')
items=re.split("[\t]",line)
strain=items[0]
if first_line:
ab=items.index('absent_TRANS_CER... | {
"content_hash": "e3b252d3666525f042a3287b578b7f82",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 114,
"avg_line_length": 33.07462686567164,
"alnum_prop": 0.6358303249097473,
"repo_name": "klaricch/Transposons2",
"id": "1a6921fca2e74ace65435f08fadcceb5f7882e47",
"size":... |
"""Defines access permissions for the API."""
from __future__ import absolute_import
from rest_framework import permissions
from readthedocs.core.permissions import AdminPermission
class IsOwner(permissions.BasePermission):
"""Custom permission to only allow owners of an object to edit it."""
def has_obj... | {
"content_hash": "2d9ede7e8d34d25254909ba3dcae41e3",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 80,
"avg_line_length": 34.23809523809524,
"alnum_prop": 0.6981919332406119,
"repo_name": "safwanrahman/readthedocs.org",
"id": "615872d307e9af98d5d91660dbac03ab32e5e173",
"... |
# Copyright (c) 2009-2014, Mario Vilas
# 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 o... | {
"content_hash": "5300b89e1ef425e6dbbb76afd49ee7e9",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 78,
"avg_line_length": 40.98571428571429,
"alnum_prop": 0.7434646218194493,
"repo_name": "SlicerRt/SlicerDebuggingTools",
"id": "e716bf3e96129db5507a1c44a7f36c684d77ae18",
... |
"""
Created on Mon Mar 9 14:58:39 2015
@author: jpk
This script produces a report of observations taken the last 7 days at SALT
and print it out on the terminal and writes it to a file.
The script runs from today and queries the sdb for data going back 7 days.
"""
global __version__
__version__ = "1.0"
__date__ ... | {
"content_hash": "e63403bea407d8329e7e72f6ada70e59",
"timestamp": "",
"source": "github",
"line_count": 343,
"max_line_length": 82,
"avg_line_length": 29.682215743440235,
"alnum_prop": 0.5596699734800118,
"repo_name": "hettlage/saltefficiency",
"id": "81c2cd31a85ebda0d00fea308d7d4d447532ccb5",
"siz... |
from __future__ import unicode_literals
from django.db import models, migrations
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('main', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='AmaraVideo',
fields=[
... | {
"content_hash": "b520f3a2d2c03e443cb5a3c0db452173",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 114,
"avg_line_length": 31.620689655172413,
"alnum_prop": 0.5463467829880043,
"repo_name": "anjalymehla/airmozilla",
"id": "afc5b3ba8f1070161cebc35b19e0e75f4df173bd",
"size... |
"""
Module implementing an XYZ file object class.
"""
import re
from io import StringIO
import pandas as pd
from monty.io import zopen
from pymatgen.core.structure import Molecule
class XYZ:
"""
Basic class for importing and exporting Molecules or Structures in XYZ
format.
.. note::
Export... | {
"content_hash": "506491294ba76722a1b672201f2679c6",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 114,
"avg_line_length": 29.954838709677418,
"alnum_prop": 0.5285375834589705,
"repo_name": "gmatteo/pymatgen",
"id": "2fa144a2de5fd80f950cb9cefbdbc4fd05eda76e",
"size": "4... |
from django.db import models
from django.contrib.auth.models import User
# TODO: Create index on email
class Contact(models.Model):
email = models.CharField(max_length=200)
validated = models.BooleanField()
def __unicode__(self):
return self.email
class Admin:
pass
# TODO: Create index on in_reply_to
cl... | {
"content_hash": "d62fa2d207f373f02ffe7fdf0a252bd6",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 51,
"avg_line_length": 22.723076923076924,
"alnum_prop": 0.7298578199052133,
"repo_name": "jeztek/youbama",
"id": "c3ef33f172b49450ed24c14c2bde550f4172c8b6",
"size": "1477"... |
from opsgenie_base_test_case import OpsGenieBaseActionTestCase
from list_groups import ListGroupsAction
class ListGroupsTestCase(OpsGenieBaseActionTestCase):
__test__ = True
action_cls = ListGroupsAction
def test_run_api_404(self):
action, adapter = self._get_action_status_code(
'GET... | {
"content_hash": "c886fa812229055542e7e0bf973081c5",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 79,
"avg_line_length": 32.25714285714286,
"alnum_prop": 0.5863596102745793,
"repo_name": "StackStorm/st2contrib",
"id": "88109ee4c1981aa344183e8e0d4d082ccf287279",
"size": ... |
import simulation_job_config as config
import threading
import subprocess
import json
class SimulationJob:
@staticmethod
def simulate(job):
json_input = job.data
returncode = 1
stderr = ""
stdout = "" # mirror back input in case of errors
try:
process = subprocess.Popen(config.simulation_path_pr... | {
"content_hash": "fbd436dfa72bb8b36fb30a9546d17e04",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 150,
"avg_line_length": 26.305555555555557,
"alnum_prop": 0.6779303062302007,
"repo_name": "walachey/football-worldcup-simulator",
"id": "dde0c53e231e200cf2bb0f2ee90600c8a839... |
"""
A Python module that provides simple object-oriented abstraction layer for creating command-line interfaces.
Read README.md for usage documentation
"""
##
## argcommand
## https://github.com/avinoamr/argcommand
##
## This module was orginally developed at Win (win.com) by:
## Roi Avinoam <avinoamr@gmail.com>... | {
"content_hash": "6371c8b5cbde1439a0c60b31b2464d29",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 113,
"avg_line_length": 37.10752688172043,
"alnum_prop": 0.6506809620399884,
"repo_name": "avinoamr/argcommand",
"id": "21433e320e7ec4eea7dc5c764cd63797e1a3eb87",
"size": ... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ringapp', '0037_suggestion_response'),
]
operations = [
migrations.CreateModel(
name='News',
fields=[
('id',... | {
"content_hash": "42c3fc6edcee45a4b6e3385ee6644023",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 114,
"avg_line_length": 26.55,
"alnum_prop": 0.5800376647834274,
"repo_name": "rschwiebert/RingApp",
"id": "1cb7e82d99f9839508b9f08a82d623aa268d8ab6",
"size": "603",
"bin... |
from collections import Sequence # noqa
import logging
from django.conf import settings
from horizon import exceptions
import six
__all__ = ('APIResourceWrapper', 'APIDictWrapper',
'get_service_from_catalog', 'url_for',)
LOG = logging.getLogger(__name__)
class APIVersionManager(object):
"""Obje... | {
"content_hash": "0b1dbcd38bd492033ad0c93edcc0a95f",
"timestamp": "",
"source": "github",
"line_count": 308,
"max_line_length": 79,
"avg_line_length": 34.09090909090909,
"alnum_prop": 0.5815238095238096,
"repo_name": "orbitfp7/horizon",
"id": "675c9b5d7c46384fc54465c5b78fc40b18cac366",
"size": "112... |
def reverse(data):
for index in range(len(data)-1, -1, -1):
yield data[index]
if __name__ == "__main__":
import sys
for char in reverse('golf'):
print char
print "gtest" | {
"content_hash": "c5fec4dd21b32d020c7e8fde7e0fca90",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 44,
"avg_line_length": 21.6,
"alnum_prop": 0.5138888888888888,
"repo_name": "sarpulas/idLog",
"id": "5b87c5a71cd2a9ca101f810e20249a76e2ce3d4e",
"size": "216",
"binary": f... |
import json
import six
import webob
import wsgiservice
def test_mount():
"""mount decorator adds the path as an attribute _path."""
@wsgiservice.mount('/{id}')
class Document(wsgiservice.Resource):
pass
assert Document.__name__ == 'Document'
assert Document._path == '/{id}'
def test_... | {
"content_hash": "b764b681b203379f31a985fd631f9dfb",
"timestamp": "",
"source": "github",
"line_count": 363,
"max_line_length": 78,
"avg_line_length": 28.046831955922865,
"alnum_prop": 0.5901188488360671,
"repo_name": "pneff/wsgiservice",
"id": "f3a1035cbcd9c2f5a23b9db60222610870c2895a",
"size": "1... |
""" This module contains the base class for handlers as used by the
Dispatcher """
class Handler(object):
"""
The base class for all update handlers. You can create your own handlers
by inheriting from this class.
Args:
callback (function): A function that takes ``bot, update`` as
... | {
"content_hash": "1cf2e4bd95c3c0d461cf952a7385c583",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 99,
"avg_line_length": 43.395833333333336,
"alnum_prop": 0.6178588574171867,
"repo_name": "thonkify/thonkify",
"id": "97a544f1a61851cb16c0b02112bbf41134dc2e91",
"size": "49... |
"""HTTP Client for asyncio."""
import asyncio
import base64
import hashlib
import os
import sys
import traceback
import warnings
from multidict import CIMultiDict, MultiDict, MultiDictProxy, istr
from yarl import URL
import aiohttp
from . import hdrs, helpers
from ._ws_impl import WS_KEY, WebSocketParser, WebSocket... | {
"content_hash": "5940175baa4d7608d58abec52064e17f",
"timestamp": "",
"source": "github",
"line_count": 778,
"max_line_length": 79,
"avg_line_length": 33.2814910025707,
"alnum_prop": 0.5255474452554745,
"repo_name": "moden-py/aiohttp",
"id": "94e5e41742332bb4826f7f799032d27d2fbbeb56",
"size": "2589... |
try:
import urllib.request as urllib_request
import urllib.error as urllib_error
except ImportError:
import urllib2 as urllib_request
import urllib2 as urllib_error
try:
from cStringIO import StringIO
except ImportError:
from io import BytesIO as StringIO
from .twitter_globals import POST_ACTI... | {
"content_hash": "fc262bcb975d6cd730b07bccfbba961d",
"timestamp": "",
"source": "github",
"line_count": 365,
"max_line_length": 77,
"avg_line_length": 30.676712328767124,
"alnum_prop": 0.5648834509243548,
"repo_name": "atpaino/socialsonar",
"id": "0ebc814e1954d5881dfefbdf65393cbc77d9a5d2",
"size": ... |
import requests_unixsocket
import json
from utils.utils import Utils
u = Utils()
#https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/
class Ids():
def __init__(self):
self.base = "http+unix://%2Fvar%2Frun%2Fdocker.sock"
self.url = "/containers/json"
self... | {
"content_hash": "556cc96d6746d694e6c3fb3a5e06e507",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 76,
"avg_line_length": 29.333333333333332,
"alnum_prop": 0.5772727272727273,
"repo_name": "eon01/DoMonit",
"id": "54030b286ba9893a88cf285f929dc2441015852f",
"size": "880",
... |
import re
from BeautifulSoup import BeautifulSoup
def YesNo(answer):
while (re.search(r'([Yy][Ee]*[Ss]*)|([Nn][Oo]*)', answer) is None):
answer = raw_input("Please Enter a Valid Answer: ")
if re.search(r'[Yy][Ee]*[Ss]*', answer):
return "Yes"
else:
return "No"
class ErrorCheck(... | {
"content_hash": "636a4a7387cec9ff45290604c4b57adb",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 147,
"avg_line_length": 31.496124031007753,
"alnum_prop": 0.485601772089589,
"repo_name": "ajn123/VT-Python-Class-Add",
"id": "1a6bca0a8d3b5c75da29b863990b395120a9e11b",
"... |
'''OpenGL extension NV.float_buffer
Automatically generated by the get_gl_extensions script, do not edit!
'''
from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_NV_float_buffer'
_DEPRECATED = False
GL_FLOAT_R_NV = consta... | {
"content_hash": "662fa895180332b0e68c942d4685fdc4",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 94,
"avg_line_length": 51.09375,
"alnum_prop": 0.7412844036697248,
"repo_name": "Universal-Model-Converter/UMC3.0a",
"id": "49a8cae34454c257f6e849b62b7db00eb679107a",
"size... |
"""
Cocktail Sort
-------------
A bidirectional bubble sort. Walks the elements bidirectionally, swapping
neighbors if one should come before/after the other.
Time Complexity: O(n**2)
Space Complexity: O(1) Auxiliary
Stable: Yes
Psuedo Code: http://en.wikipedia.org/wiki/Cocktail_sort... | {
"content_hash": "4c1c28fadb73f54ab7b1fc348424ec8d",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 77,
"avg_line_length": 25.155555555555555,
"alnum_prop": 0.5432862190812721,
"repo_name": "rexshihaoren/algorithms",
"id": "635da03a1c8ab82f8ef890ef90c2844729e54f54",
"size... |
import logging
from dplace_app.models import Variable, Category, CodeDescription
from sources import get_source
def load_vars(repos):
categories, count = {}, 0
for ds in repos.datasets:
for var in ds.variables:
count += load_var(ds, var, categories)
return count
def load_var(ds, var... | {
"content_hash": "a3f91f62f1f7c96798226837de9ee79d",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 86,
"avg_line_length": 32.23913043478261,
"alnum_prop": 0.6331759946055293,
"repo_name": "stefelisabeth/dplace",
"id": "729d6b1fdf0210a1a4f9fa67f8e45da947436ace",
"size": "... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import os
import weakref
import six
from tensorflow.python.eager import backprop
from tensorflow.python.eager import context
from tensorflow.python.eager import def_function
from tensorflow.p... | {
"content_hash": "9a93de68c0a7ee51526e157c0cf8dbd2",
"timestamp": "",
"source": "github",
"line_count": 925,
"max_line_length": 80,
"avg_line_length": 43.97081081081081,
"alnum_prop": 0.6565289012366926,
"repo_name": "freedomtan/tensorflow",
"id": "ed0bb17adbd523bd6b299e78473d0584cf5ed1a0",
"size":... |
import pytest
from api.base.settings.defaults import API_BASE
from osf_tests.factories import (
AuthUserFactory,
PreprintProviderFactory,
)
from osf.utils import permissions
@pytest.mark.enable_quickfiles_creation
class ProviderModeratorDetailTestClass:
@pytest.fixture()
def admin(self, provider):
... | {
"content_hash": "d819477e64107cf7f40d4cc0fb38fe66",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 119,
"avg_line_length": 43.10582010582011,
"alnum_prop": 0.578617896158095,
"repo_name": "baylee-d/osf.io",
"id": "b6379f17b6af6507993037451eaaf07e912ebd6b",
"size": "8147... |
"""
Windows Command Prompt (DOS) shell.
"""
from rez.config import config
from rez.rex import RexExecutor, expandable, OutputStyle, EscapedString
from rez.shells import Shell
from rez.system import system
from rez.utils.execution import Popen
from rez.utils.platform_ import platform_
from rez.vendor.six import six
from... | {
"content_hash": "8d7a15b4883e653b8cb7bb0952651b43",
"timestamp": "",
"source": "github",
"line_count": 339,
"max_line_length": 91,
"avg_line_length": 34.07079646017699,
"alnum_prop": 0.5631168831168831,
"repo_name": "nerdvegas/rez",
"id": "c3afdcc01e48d57592a467ff649cf267cfaab48c",
"size": "11634"... |
from __future__ import print_function
from __future__ import absolute_import
# System modules
import argparse
import sys
import multiprocessing
import os
import textwrap
# Third-party modules
# LLDB modules
from . import configuration
class ArgParseNamespace(object):
pass
def parse_args(parser, argv):
""... | {
"content_hash": "aeb7450ea8502c818dc9fc0eaae90f2f",
"timestamp": "",
"source": "github",
"line_count": 316,
"max_line_length": 213,
"avg_line_length": 41.4873417721519,
"alnum_prop": 0.6324942791762014,
"repo_name": "youtube/cobalt_sandbox",
"id": "58190d8c75eebf99f27c9fb0f7afa61da8bb35b4",
"size"... |
from __future__ import print_function
import unittest
import numpy as np
from op_test import OpTest
import paddle.fluid as fluid
def crop(data, offsets, crop_shape):
def indexOf(shape, index):
result = []
for dim in reversed(shape):
result.append(index % dim)
index = index... | {
"content_hash": "c2a011568a0cfa70bb1c7b5898d797bf",
"timestamp": "",
"source": "github",
"line_count": 251,
"max_line_length": 80,
"avg_line_length": 32.330677290836654,
"alnum_prop": 0.5566235366605052,
"repo_name": "chengduoZH/Paddle",
"id": "5864e15df132766992271301bdccb058fdc5d781",
"size": "8... |
"""
Scan multiple DNSBLs for IP addresss or domain.
Copyright (c) 2012, 2013 Rob Cakebread
All rights reserved.
If you give the domain, musubi will try to find all your IP addresses
for each mail server by querying MX DNS records and then doing a lookup
for the IPs. If your mail server uses round-robin DNS, this of... | {
"content_hash": "38aabcdd51676270b1bdacc046fa0613",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 79,
"avg_line_length": 29.81651376146789,
"alnum_prop": 0.576,
"repo_name": "cakebread/musubi",
"id": "3a6bf0d09b3c529abc9d6d52f3bd8dc5e927cf8a",
"size": "3251",
"binary... |
"""Helper utilities and decorators."""
from flask import flash
from flask_login import current_user
from functools import wraps
from flask import g, request, redirect, url_for
from op_mon.user.models import User
def flash_errors(form, category='warning'):
"""Flash all errors for a form."""
for field, errors in for... | {
"content_hash": "9c387bf719426f5876e2368d233420eb",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 78,
"avg_line_length": 30.76923076923077,
"alnum_prop": 0.72,
"repo_name": "joyider/op_mon",
"id": "2d2e28eeabe5b71d2053cb2f5a5c641c6f48daed",
"size": "824",
"binary": fa... |
"""Lovelace dashboard support."""
from abc import ABC, abstractmethod
import logging
import os
from pathlib import Path
import time
from typing import Optional, cast
import voluptuous as vol
from homeassistant.components.frontend import DATA_PANELS
from homeassistant.const import CONF_FILENAME
from homeassistant.core... | {
"content_hash": "572d4fdd528c6c861ac210ba219c263b",
"timestamp": "",
"source": "github",
"line_count": 276,
"max_line_length": 85,
"avg_line_length": 29.152173913043477,
"alnum_prop": 0.6005468555804127,
"repo_name": "partofthething/home-assistant",
"id": "c6f4726724bcb6a1d025329f66898fd4e5d67e01",
... |
"""Run Performance Test Bisect Tool
This script is used by a trybot to run the src/tools/bisect-perf-regression.py
script with the parameters specified in run-bisect-perf-regression.cfg. It will
check out a copy of the depot in a subdirectory 'bisect' of the working
directory provided, and run the bisect-perf-regressi... | {
"content_hash": "996b5355006eafcda7740645e016ac12",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 80,
"avg_line_length": 29.257142857142856,
"alnum_prop": 0.6656901041666666,
"repo_name": "zcbenz/cefode-chromium",
"id": "c43dde970817895c2fcdbfffc1afe913f606536b",
"size... |
from django import template
import logging
from django.utils.translation import ugettext_lazy as _
from horizon import tables
LOG = logging.getLogger(__name__)
def render_versions(plugin):
template_name = 'plugins/_versions_list.html'
context = {"plugin": plugin}
return template.loader.render_to_strin... | {
"content_hash": "391ae1fdee1bb828f042a7049fac0324",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 73,
"avg_line_length": 27.515151515151516,
"alnum_prop": 0.6057268722466961,
"repo_name": "denismakogon/savanna-dashboard",
"id": "9c0b00c0d5ecf22c657d1566494d078af4ee4ab2",
... |
from django import forms
from journeyman.projects.models import Project
class RepositoryForm(forms.Form):
name = forms.CharField(
help_text='What\'s the name of your awesome project?')
repository = forms.CharField(
help_text='Please enter a valid repository url \
(e.g. git+git://github.... | {
"content_hash": "e6be89c05c10eeb1e375351a1c0ddc3c",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 78,
"avg_line_length": 44.075,
"alnum_prop": 0.6812251843448667,
"repo_name": "stephrdev/loetwerk",
"id": "409bd9769b54f11f3f9d7a90b883bcb38d91bacd",
"size": "1763",
"bin... |
julia_whitespace_factory = util.BuildFactory()
julia_whitespace_factory.useProgress = True
julia_whitespace_factory.addSteps([
# Fetch first (allowing failure if no existing clone is present)
steps.ShellCommand(
name="git fetch",
command=["git", "fetch", "--tags", "--all", "--force"],
fl... | {
"content_hash": "1f31e7dcf6dc2e8ff16322bb2a741f6b",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 92,
"avg_line_length": 32.18181818181818,
"alnum_prop": 0.6307506053268765,
"repo_name": "staticfloat/julia-buildbot",
"id": "c69e3a81f18401f7ce7ae8d90e09c7f2a73549f6",
"si... |
"""Run all infrastructure-related tests."""
import os
import subprocess
import sys
INFRA_BOTS_DIR = os.path.dirname(os.path.realpath(__file__))
SKIA_DIR = os.path.abspath(os.path.join(INFRA_BOTS_DIR, os.pardir, os.pardir))
def test(cmd, cwd):
try:
subprocess.check_output(cmd, cwd=cwd, stderr=subprocess.STDO... | {
"content_hash": "2af299b342aa12dc2dde34cc38f6b58a",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 78,
"avg_line_length": 22.430232558139537,
"alnum_prop": 0.5775012960082945,
"repo_name": "Hikari-no-Tenshi/android_external_skia",
"id": "10546ed7223813aa65262358417e784cb2c... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0009_auto_20170206_0059'),
]
operations = [
migrations.AddField(
model_name='userprofile',
name='multiple_org',
... | {
"content_hash": "09642b8225c4b0b053e9d657657dcf1f",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 53,
"avg_line_length": 21.555555555555557,
"alnum_prop": 0.6005154639175257,
"repo_name": "awemulya/fieldsight-kobocat",
"id": "e19b04897f6e3ab2f576ca086c8a6bededd6c5f1",
"... |
import jinja2
import pytest
def test_list_templates(site):
assert site.aips[62].env.list_templates() == ['en', 'generic']
assert site.aips[38].env.list_templates() == ['generic']
def test_get_template(site):
assert isinstance(
site.aips[62].env.get_template('generic'),
jinja2.Template,
... | {
"content_hash": "382f39cc7815c198658bf6e1e3fb95ea",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 66,
"avg_line_length": 25.74074074074074,
"alnum_prop": 0.6258992805755396,
"repo_name": "aip-dev/site-generator",
"id": "92be77cc7c77ecf9637ad1fef8a4327db45cda70",
"size":... |
from panda3d.core import *
from panda3d.direct import *
from direct.showbase import DirectObject
from direct.fsm import ClassicFSM, State
from toontown.toonbase import ToontownGlobals
from toontown.coghq import CountryClubRoomSpecs
from direct.directnotify import DirectNotifyGlobal
import random
class CountryClubRoom(... | {
"content_hash": "55ecc7d883773f6e78f92df84307c927",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 351,
"avg_line_length": 33.524193548387096,
"alnum_prop": 0.6382006254510464,
"repo_name": "silly-wacky-3-town-toon/SOURCE-COD",
"id": "973af7d3c06cfcf8dd14bfee50a8357d4ffdf... |
import os,math
import Tkinter as Tk
from tiasgatfuncs import *
def doit(fn,dp,mt):
""" JHT: this is the module that analyses an ALFOSC pinhole spectrum
with a Vertical Grism, and recommends an alignment offset to the
current GRISM WHEEL stepper motor units."""
## First check if da... | {
"content_hash": "637d76da9dbddc8ff4bc407334148b2b",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 94,
"avg_line_length": 38.25443786982248,
"alnum_prop": 0.6536736272235112,
"repo_name": "sniemi/SamPy",
"id": "c6f7ef04035cf05bb8e3e49103a54116d00cab72",
"size": "6613",
... |
"""Logger classes and a few convenience methods."""
import os
import sys
import platform
import logging
import tempfile
import shutil
import subprocess
import warnings
def is_str(string):
"""
Python 2 and 3 compatible string checker.
Args:
string (str | basestring): the string to check
Retu... | {
"content_hash": "e9c9b5ba00b4fe171bdb89bc56b4c09d",
"timestamp": "",
"source": "github",
"line_count": 388,
"max_line_length": 79,
"avg_line_length": 27.804123711340207,
"alnum_prop": 0.6081757508342603,
"repo_name": "stnava/ITK",
"id": "cf6279fd350b8dab7a550cb8cc684ef02ef81b06",
"size": "10983",
... |
def ensure_dir(dir_path, overwrite=False):
from shutil import rmtree
from os.path import isdir, exists
from os import makedirs
if exists(dir_path):
if not isdir(dir_path):
raise ValueError("%s is a file..." % dir_path)
if overwrite:
rmtree(dir_path)
if not exi... | {
"content_hash": "5aa6ef24cb2d52cbc24af56359c8ba3e",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 89,
"avg_line_length": 29.085714285714285,
"alnum_prop": 0.5987229862475442,
"repo_name": "beOn/varys",
"id": "ae987f82ebac59c40dc8f85cf5cac35f8b7cdb5e",
"size": "2036",
... |
import sys
sys.path.insert(1, "../../")
import h2o, tests
def test_locate():
iris_path = h2o.locate("smalldata/iris/iris.csv")
try:
h2o.locate("smalldata/iris/afilethatdoesnotexist.csv")
assert False, "Expected h2o.locate to raise a ValueError"
except ValueError:
assert True
if _... | {
"content_hash": "f2ec2fc94737b5d917b8954795a1117e",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 65,
"avg_line_length": 24.0625,
"alnum_prop": 0.6415584415584416,
"repo_name": "printedheart/h2o-3",
"id": "640849e72db15c21a6fcd5c1a76f48479537f2c0",
"size": "385",
"bin... |
from __future__ import annotations
import pytest
from pants.backend.docker.target_types import DockerImageTarget
from pants.backend.docker.util_rules.docker_build_args import docker_build_args
from pants.backend.docker.util_rules.docker_build_env import (
DockerBuildEnvironment,
DockerBuildEnvironmentRequest,... | {
"content_hash": "bf2bbbb6e90d8fd1a66cf2cd79aa4dab",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 91,
"avg_line_length": 24.90909090909091,
"alnum_prop": 0.5234619395203337,
"repo_name": "benjyw/pants",
"id": "988b57f633930465cd71869a4d36b4d76f128e74",
"size": "2050",
... |
#!/usr/bin/env python3
#
# Copyright (c) 2017 Intel Corporation.
#
# SPDX-License-Identifier: Apache-2.0
#
"""
This script scans a specified object file and generates a header file
that defined macros for the offsets of various found structure members
(particularly symbols ending with ``_OFFSET`` or ``_SIZEOF``), prim... | {
"content_hash": "a0f4df52913d0cf597f8f8c131add049",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 77,
"avg_line_length": 27.035714285714285,
"alnum_prop": 0.6318802289740203,
"repo_name": "Vudentz/zephyr",
"id": "11cb7227f78d02ec9a7393a34ded4d4fadd87f64",
"size": "2271"... |
import sys
try:
from setuptools import Extension, setup
except ImportError:
from distutils.core import Extension, setup
NAME = 'pysendfile'
VERSION = '2.0.1'
if sys.version_info < (2, 5):
sys.exit('python version not supported (< 2.5)')
if 'sunos' in sys.platform:
libraries = ["sendfile"]
else:
... | {
"content_hash": "0700eb19b9bb312e6de586a13d437027",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 66,
"avg_line_length": 37.23529411764706,
"alnum_prop": 0.5181674565560821,
"repo_name": "giampaolo/pysendfile",
"id": "54a991a385bd9da3a9f26780efab2ed38b49007b",
"size": "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.