text stringlengths 4 1.02M | meta dict |
|---|---|
"""ML Fairness gym loan environment.
This environment is meant to be a hello-world example to the gym as well as
serve as a template for writing future environments.
In each step step, the agent decides whether to accept or reject an application.
Applicant features are generated by a mixture model which also determi... | {
"content_hash": "e928adb0278c34b255ed83bc0f15a166",
"timestamp": "",
"source": "github",
"line_count": 346,
"max_line_length": 81,
"avg_line_length": 34.69364161849711,
"alnum_prop": 0.6824391869376875,
"repo_name": "google/ml-fairness-gym",
"id": "9600d2fa6a8d1c8fcbe940baa51d9b6063dbd5a2",
"size"... |
import argparse
parser = argparse.ArgumentParser(description="Quick and easy commandline wrapper for converting markdown to word, html, and pdf formats.")
parser.add_argument("infile", help="the markdown file containing the document")
parser.add_argument("type", help="the type of output: html, word, or pdf")
parser.ad... | {
"content_hash": "90098a2be5f2ec9babe3e754cd58538a",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 162,
"avg_line_length": 41.135802469135804,
"alnum_prop": 0.6668667466986795,
"repo_name": "sahmed95/sahmed95.github.io",
"id": "a35d520fb74099aed97b91b48f978f20d11309d3",
... |
from menpo.groupalign.procrustes import GeneralizedProcrustesAnalysis
| {
"content_hash": "cade5c3c701a929045aed18b12918477",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 69,
"avg_line_length": 70,
"alnum_prop": 0.9142857142857143,
"repo_name": "jabooth/menpo-archive",
"id": "42f76083d7371f7b31f36587b2489dbf08fb27b1",
"size": "70",
"binary"... |
"""code generator for GL/GLES extension wrangler."""
import optparse
import os
import collections
import re
import platform
import sys
from subprocess import call
from collections import namedtuple
HEADER_PATHS = [
'../../third_party/khronos',
'../../third_party/mesa/src/include',
'.',
'../../gpu',
]
UNCONDI... | {
"content_hash": "3645e7e603358a718718fb573adae944",
"timestamp": "",
"source": "github",
"line_count": 2745,
"max_line_length": 89,
"avg_line_length": 38.71876138433515,
"alnum_prop": 0.6234204905770443,
"repo_name": "Workday/OpenFrame",
"id": "d5019b8b8feffdd6aeefc8d63c0b21041ed84b2a",
"size": "1... |
import functools
import unittest
from test import test_support
from weakref import proxy
@staticmethod
def PythonPartial(func, *args, **keywords):
'Pure Python approximation of partial()'
def newfunc(*fargs, **fkeywords):
newkeywords = keywords.copy()
newkeywords.update(fkeywords)
retur... | {
"content_hash": "d85751be957dff7402444e24e8886ffc",
"timestamp": "",
"source": "github",
"line_count": 293,
"max_line_length": 81,
"avg_line_length": 33.641638225255974,
"alnum_prop": 0.5662980622907579,
"repo_name": "TathagataChakraborti/resource-conflicts",
"id": "6012f9f8551803eb4ef7c3c2716c70f51... |
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine
import json
Base = declarative_base()
class Puppy(Base):
__tablename__ = 'puppy'
name =Column(String(80), nullable = False)
id = Column(Integer, primary_key = True)... | {
"content_hash": "cd272fde42ba5ea8f97a2ddb343b9b47",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 69,
"avg_line_length": 25.68,
"alnum_prop": 0.705607476635514,
"repo_name": "AtmaMani/pyChakras",
"id": "6a2005185efef83321c16bd4d48a21c69ed4f08d",
"size": "642",
"binary... |
"""
MoinMoin - MoinMoin.userform.admin Tests
@copyright: 2009 MoinMoin:DmitrijsMilajevs
@license: GNU GPL, see COPYING for details.
"""
from MoinMoin.userform.admin import do_user_browser
from MoinMoin.datastruct import ConfigGroups
from MoinMoin.user import User
from MoinMoin.Page import Page... | {
"content_hash": "05c252b0bc7d83bd9202d305bce0f50c",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 67,
"avg_line_length": 26.893617021276597,
"alnum_prop": 0.6384493670886076,
"repo_name": "Glottotopia/aagd",
"id": "0223168de18bd9b69c30c1e6db1285e1a919835a",
"size": "129... |
import requests
import json
import io
import sys
from datetime import datetime,timezone
import os
import google_calendar
DATA_FOLDER = os.path.join(os.path.dirname(os.path.realpath(__file__)),'data')
def download_fixtures_file(teamname):
url_file = open(os.path.join(DATA_FOLDER,'metadata.json'),'r')
url_data ... | {
"content_hash": "ae4d8627265a2fb8ff93892607669edb",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 167,
"avg_line_length": 37.91447368421053,
"alnum_prop": 0.6205101509630401,
"repo_name": "shivendratandon/cricket-fixtures",
"id": "e5861be73c6641a82213bbf5ca90674334112bb2... |
import sys,re,random
class BondMovie:
actor = ''
year = ''
name = ''
watched = 0
def __init__(self,t0 ='',t1 = '',t2 = '', t3 = 0):
if t0 != '' and t1 != '' and t2 != '':
self.name = t0
self.year = t1
self.actor = t2
self.watched = t3
try:
movieNumber = int(sys.argv[1])
if movieNumber != 1 and mo... | {
"content_hash": "2c665744560bc74d8d21654dfc7c33b1",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 150,
"avg_line_length": 35.735632183908045,
"alnum_prop": 0.6249597941460276,
"repo_name": "FireElementalNE/jamesbond",
"id": "b5bc5bc0be6b8e71c855a77a0bc345383f9a5fd0",
"s... |
"""Easy to use object-oriented thread pool framework.
A thread pool is an object that maintains a pool of worker threads to perform
time consuming operations in parallel. It assigns jobs to the threads
by putting them in a work request queue, where they are picked up by the
next available thread. This then performs th... | {
"content_hash": "d573f8d9960ca29a2bdc14b8e16098bb",
"timestamp": "",
"source": "github",
"line_count": 419,
"max_line_length": 89,
"avg_line_length": 37.55847255369928,
"alnum_prop": 0.6269301645802885,
"repo_name": "ptphp/PyLib",
"id": "f49cadcb6daf0a29583d247fc9944be21ba60fd6",
"size": "15761",
... |
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.common.action_chains import ActionChains
import time, unittest
def is_alert_present(wd):
try:
wd.switch_to_alert().text
return True
except:
return False
class test_1(unittest.TestCase):
def setUp(sel... | {
"content_hash": "1d1777c3a2cbf797e7a831db069d15db",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 85,
"avg_line_length": 35.26315789473684,
"alnum_prop": 0.6313432835820896,
"repo_name": "ivanSchistov/Python_tranings_new",
"id": "c0bf76d6ed22d896f6634fbcea34eaaa8308cadb",... |
def pr(data, start=0, end=None):
"""
Pretty print a sequence of data items
@param data: the data stream to print
@type data: C{sequence} or C{iterator}
@param start: the start position
@type start: C{int}
@param end: the end position
@type end: C{int}
"""
from pprint import ppri... | {
"content_hash": "3c25646c5091839d16f745c093c8737e",
"timestamp": "",
"source": "github",
"line_count": 228,
"max_line_length": 78,
"avg_line_length": 34.51754385964912,
"alnum_prop": 0.5527318932655655,
"repo_name": "rossgoodwin/drgonzo",
"id": "1a5c6a48d04a9cdc9c5cfe03b10e9659337c665b",
"size": "... |
"""Extracts bounding boxes from a list of images, saving them to files.
The images must be in JPG format. The program checks if boxes already
exist, and skips computation for those.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import... | {
"content_hash": "f2d80e58c6af91cc5432e932fef5cd7d",
"timestamp": "",
"source": "github",
"line_count": 241,
"max_line_length": 80,
"avg_line_length": 32.83817427385892,
"alnum_prop": 0.6178923426838514,
"repo_name": "alexgorban/models",
"id": "6e315d178e49141722a3ffe78d6e7e37ce193708",
"size": "86... |
'''
Media.py
Calcula a média entre dois valores
Entrada: duas variáveis do tipo float
Saída: a média, tipo float
Autor: Fabrício Olivetti de França
Disciplina Processamento da Informação
Universidade Federal do ABC
'''
x = float(raw_input("Entre o primeiro valor: "))
y = float(raw_input("Entre o segundo valor: "))
m... | {
"content_hash": "3327aa3135f266cda4aa0a2a94a887f0",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 48,
"avg_line_length": 22.75,
"alnum_prop": 0.7307692307692307,
"repo_name": "folivetti/PI-UFABC",
"id": "6bbf116bf34d6e72390c278e8f435aea4f1b2c29",
"size": "389",
"binar... |
"""distutils
The main package for the Python Module Distribution Utilities. Normally
used from a setup script as
from distutils.core import setup
setup (...)
"""
# This module should be kept compatible with Python 1.5.2.
__revision__ = "$Id: __init__.py,v 1.23 2002/11/19 13:12:26 akuchling Exp $"
__version... | {
"content_hash": "5d18013c0d6d6f9e74fa4a537cf991e2",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 76,
"avg_line_length": 22.2,
"alnum_prop": 0.6786786786786787,
"repo_name": "OS2World/APP-INTERNET-torpak_2",
"id": "3a8fab75fce3cb58f5a51122a774535011ab4981",
"size": "333... |
from barbicanclient import client as barbicanclient
from keystoneauth1 import loading
from oslo_config import cfg
class BarbicanClient(object):
"""Barbican client wrapper so we can encapsulate logic in one place."""
def __init__(self, verify=True):
self._admin_client = None
@property
def ad... | {
"content_hash": "821d132e1934e3e8b22bdd7621581690",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 75,
"avg_line_length": 33.53846153846154,
"alnum_prop": 0.6662844036697247,
"repo_name": "stackforge/solum",
"id": "9c4a4e82d517ddab560d7ec3843b5a2d94bc895a",
"size": "1451... |
from django.http import HttpResponse, Http404, HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.contrib.auth.models import User
import datetime, random, re, os, csv, time
from django.template import Context, Template, loader
from django.shortcuts import render_to_response, get_object_or_4... | {
"content_hash": "35744cec4de3160c39ac90be5d5a419a",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 79,
"avg_line_length": 22.41025641025641,
"alnum_prop": 0.6848970251716248,
"repo_name": "netzary/Kaline",
"id": "54ba0c7fe55dfda1f99dc3d6facc0e7c362bd90c",
"size": "4370"... |
import os
import sys
import optparse
import re
import fnmatch
import glob
import subprocess
revision = "## RevTag:: r458 ##".strip('# ').replace('RevTag::', 'revision')
field_processor = re.compile(
r'''
^ # Start of the line
(?P<keyword>.*?) # Capture the first field: everything up to the first ta... | {
"content_hash": "c52fade3baccb078aa7314e687af16fc",
"timestamp": "",
"source": "github",
"line_count": 878,
"max_line_length": 142,
"avg_line_length": 27.361047835990888,
"alnum_prop": 0.6497106939183283,
"repo_name": "lcycon/.vim",
"id": "b6ef292730d25ce3350f00e1b73437ba4b63e03b",
"size": "24143"... |
"""
Simple timer class
"""
class IannaTimer():
def __init__ (self):
self.timer = 0
self.active = False
def activate (self):
self.active = True
def deactivate (self):
self.active = False
def isactive (self):
return self.active
def tick(self):
if self.active:
self.timer = self.timer - 1
if sel... | {
"content_hash": "98321a9796217cd7ccc1ee33523d44e1",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 30,
"avg_line_length": 15.235294117647058,
"alnum_prop": 0.6447876447876448,
"repo_name": "fjpena/sword-of-ianna-zx",
"id": "5a977126ebe0d7fd411e59fa92f21819d6e82959",
"siz... |
try:
import ConfigParser as configparser
except ImportError:
# python 3
import configparser
import os.path
from bash import bash
class bash_no_errors(bash):
def bash(self, cmd):
super(bash_no_errors, self).bash(cmd)
if self.stderr:
raise Exception(self.stderr)
re... | {
"content_hash": "a7c424de9e6366b09e1f9eae79ffd5be",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 79,
"avg_line_length": 27.84251968503937,
"alnum_prop": 0.5789027149321267,
"repo_name": "alexcouper/captainhook",
"id": "8e58854c28fc07b306e84c4a1a38c5c1e5e29fdb",
"size"... |
"""
Render a Versa model as [Mermaid](https://mermaid-js.github.io/)
Note: you'll probably want something like mermaid-cli
"""
# Need npm to install mermaid-cli, so see: https://nodejs.org/en/
import sys
from slugify import slugify # pip install python-slugify
from amara3 import iri
from versa import I, VERSA_BA... | {
"content_hash": "75e400cc8ba4cb0e4ee908d7562eb031",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 92,
"avg_line_length": 28.203883495145632,
"alnum_prop": 0.5783132530120482,
"repo_name": "uogbuji/versa",
"id": "8185c34aa16e2bd294b9327eb638eb8d3f18cabb",
"size": "2929"... |
import idaapi
g_description = "plugin that prevents some obsolete opcode to be created as code"
g_comment = "Use on compiled binaries only"
g_bytecodes = [] * 256
#--------------------------------------------------------------------------
class dumbx86hook(idaapi.IDP_Hooks):
def __init__(self):
... | {
"content_hash": "7b4c9fdebb7e0aa7f779ad6e2ac354a3",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 81,
"avg_line_length": 29.654545454545456,
"alnum_prop": 0.48252605763335377,
"repo_name": "angea/corkami",
"id": "31a6351face0d211ee603d34adbf22a6e2477eb5",
"size": "1684"... |
import os
os.environ["CUDA_VISIBLE_DEVICES"]="0"
import socket
import sys
import tensorflow as tf
import numpy as np
from vae.data_loaders.lab_imageloader import lab_imageloader
from vae.arch.vae_skipconn import vae_skipconn as vae
from vae.arch.network import network
from third_party.save_zhang_feats import save_zhan... | {
"content_hash": "26c5af5dda48dc7cac4c806d63a7f49d",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 82,
"avg_line_length": 34.96052631578947,
"alnum_prop": 0.6740684983063605,
"repo_name": "aditya12agd5/divcolor",
"id": "70518d58df001843eef5ac4f4ca993e92f02547d",
"size": ... |
"""do2things URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-b... | {
"content_hash": "fbbb05920db3c5cc231faf8e34536324",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 77,
"avg_line_length": 38.583333333333336,
"alnum_prop": 0.6954643628509719,
"repo_name": "tlake/do2things",
"id": "975928e056df70e28e9e06a6da6200ebbd539499",
"size": "926"... |
"""
.. todo::
WRITEME
"""
import logging
import warnings
from .general import is_iterable, contains_nan, contains_inf, isfinite
import theano
from theano.compat.six.moves import input, zip as izip
# Delay import of pylearn2.config.yaml_parse and pylearn2.datasets.control
# to avoid circular imports
yaml_parse = N... | {
"content_hash": "b4181c580063526d13f1da7a0a76f30f",
"timestamp": "",
"source": "github",
"line_count": 656,
"max_line_length": 78,
"avg_line_length": 26.0015243902439,
"alnum_prop": 0.5767133728088175,
"repo_name": "JesseLivezey/plankton",
"id": "170b6160265dcd7db106bae9f66c550a574d3d13",
"size": ... |
import numpy
import urllib2
from decimal import getcontext
from sparse.core import Sparse
def download_matrix(url):
"""Download information from url"""
request = urllib2.Request(url)
try:
request_handler = urllib2.urlopen(request)
except urllib2.HTTPError as exc:
print "[x] Fail to dow... | {
"content_hash": "0441a161579653e7c36456b8c808868a",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 71,
"avg_line_length": 26.653846153846153,
"alnum_prop": 0.5555555555555556,
"repo_name": "c-square/homework",
"id": "82e764f70577f2d61888aaa0229b1e6ebd1c3ddd",
"size": "14... |
from .kernel import Kernel
from .linear import Linear
from .mlp import MLP
from .mlpext import MLPext
from .additive import Additive
from .compound import Compound
from .constant import Constant
from .identity import Identity
from .piecewise_linear import PiecewiseLinear
| {
"content_hash": "1e0bf1670190317b3ba08302275f5c8b",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 45,
"avg_line_length": 27.3,
"alnum_prop": 0.8278388278388278,
"repo_name": "esiivola/GPYgradients",
"id": "795352afe007d411067caa41e58b4c96efc917ea",
"size": "392",
"bin... |
from .GlobalData import global_data
from .Projects import all_projects
from .Apps import all_apps
from .Pods import all_pods
from .Task import Task
from .Session import Session
from .CustomizedTask import customizedTask
from .CerberusIntegration import cerberusIntegration
from .utils.SlackIntegration import slackIntegr... | {
"content_hash": "3a8e6458d400ab50b627046e972d5418",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 182,
"avg_line_length": 48.759803921568626,
"alnum_prop": 0.5961596461244596,
"repo_name": "mffiedler/svt",
"id": "140f73bd49482905dabc92b0fdf15a9c7287e581",
"size": "9947... |
import datetime
from decimal import Decimal
from typing import Any, Dict
import pytz
from dirtyfields import DirtyFieldsMixin
from django.conf import settings
from django.db import models, transaction
from django.db.models.signals import pre_save
from django.dispatch import receiver
from django.forms.models import mod... | {
"content_hash": "086c822a80b39d44d741f141b2e1ce6e",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 88,
"avg_line_length": 36.11702127659574,
"alnum_prop": 0.6318114874815906,
"repo_name": "networklocum/django-changes-on-save",
"id": "8a4e34542450fbbfeedd7471549681f1272bbd8... |
import logging
import eventlet
from errors import ExpectedException
try:
import json
except ImportError:
import simplejson as json
import datetime
def get_now():
return datetime.datetime.now().strftime('%Y-%m-%dT%H:%M:%S')
class User(object):
logger = logging.getLogger('HookboxUser')
_options =... | {
"content_hash": "75780bc7baf55a7b6939f335bfd8cf7b",
"timestamp": "",
"source": "github",
"line_count": 224,
"max_line_length": 170,
"avg_line_length": 43.49107142857143,
"alnum_prop": 0.5656949291726545,
"repo_name": "hookbox/hookbox",
"id": "94965606e325df4d997419477932df39a175cbd8",
"size": "974... |
import mock
import os
from oslo_config import cfg
from oslo_middleware import request_id
import webob
from senlin.common import context
from senlin.common import exception
from senlin.tests.common import base
policy_path = os.path.dirname(os.path.realpath(__file__)) + "/policy/"
class TestRequestContext(base.Senlin... | {
"content_hash": "3d2140e7f4637de751f129812cae9b52",
"timestamp": "",
"source": "github",
"line_count": 232,
"max_line_length": 77,
"avg_line_length": 38.58620689655172,
"alnum_prop": 0.5179848078641645,
"repo_name": "tengqm/senlin",
"id": "4636a4639220e087cd4448374c1edb17e1e2d73c",
"size": "9501",... |
__author__ = 'mpetyx'
from collections import OrderedDict
import json
import requests
from Parser import Parser
from pyapi.entities import APIRoot, APIResource, APIMethod, APIQueryParameter
class SwaggerParser(Parser):
api = APIRoot(raml_version=str(0.8))
def parse(self, location):
# self.api.g_ve... | {
"content_hash": "af15254927503aaa413e57646e3a5cf4",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 96,
"avg_line_length": 35.21641791044776,
"alnum_prop": 0.5293494384403475,
"repo_name": "mpetyx/pyapi",
"id": "9350f64f928d854f8bdd3a5ff13ca91bbafaa15e",
"size": "4719",
... |
"""
Testing for the base mechanics and methods of replicas.
"""
##########################################################################
## Imports
##########################################################################
import unittest
try:
from unittest import mock
except ImportError:
import mock
fro... | {
"content_hash": "a940db666bb602bdd3e6aae9b0b6e512",
"timestamp": "",
"source": "github",
"line_count": 315,
"max_line_length": 118,
"avg_line_length": 38.12380952380953,
"alnum_prop": 0.6166208676825714,
"repo_name": "bbengfort/cloudscope",
"id": "467691b5a66b0d7a75209106f7330c901bf1f75d",
"size":... |
import platform
import mock
from os_brick.initiator import connector
from nova.objects import fields as obj_fields
from nova.tests.unit.virt.libvirt.volume import test_volume
from nova.virt.libvirt.volume import fibrechannel
class LibvirtFibreChannelVolumeDriverTestCase(
test_volume.LibvirtVolumeBaseTestCas... | {
"content_hash": "ad099a2c000d9540ee80c41ed8b8b695",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 79,
"avg_line_length": 44.161764705882355,
"alnum_prop": 0.6177156177156177,
"repo_name": "phenoxim/nova",
"id": "4289ac5aefb6b340c06408e040b25c1f39197e47",
"size": "3576",... |
"""Setup script for Concurrent_AP, a scalable and concurrent programming
implementation of Affinity Propagation clustering.
Affinity Propagation is a clustering algorithm based on passing
messages between data-points.
Storing and updating matrices of 'affinities', 'responsibilities'
and 'similarities' between sam... | {
"content_hash": "e07b6f1038609f1bb89e2e4c347f2213",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 106,
"avg_line_length": 38.025,
"alnum_prop": 0.6314924391847468,
"repo_name": "GGiecold/Concurrent_AP",
"id": "fee98fe2c98d51dd7587aba890b57e490f29ee99",
"size": "3234",
... |
import datetime
from django.conf import settings
from rest_framework.settings import APISettings
USER_SETTINGS = getattr(settings, 'JWT_AUTH', None)
DEFAULTS = {
'JWT_ENCODE_HANDLER':
'rest_framework_jwt.utils.jwt_encode_handler',
'JWT_DECODE_HANDLER':
'rest_framework_jwt.utils.jwt_decode_handler',... | {
"content_hash": "391f42561c6d2350f6cb2b54b2d7acfd",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 69,
"avg_line_length": 27.90740740740741,
"alnum_prop": 0.6914399469143995,
"repo_name": "sandipbgt/django-rest-framework-jwt",
"id": "65ca6a80e1c65c61f2fdf4ab75faa06c912e946... |
from __future__ import unicode_literals
from __future__ import print_function
from django.db import migrations
from django.contrib.postgres.operations import TrigramExtension, UnaccentExtension
from django.conf import settings
class Migration(migrations.Migration):
# Install the postgres extensions in dev only
... | {
"content_hash": "1b9a483f66ed5d680fb69d507051b6d0",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 88,
"avg_line_length": 32.57142857142857,
"alnum_prop": 0.685672514619883,
"repo_name": "onepercentclub/bluebottle",
"id": "6a2d748547fb4c5c0dcdc744df63fc45d8488ef9",
"size... |
import os
import json
class CredentialStore(object):
"""
Load Credentials from local store
"""
creds = None
def __init__(self):
super(CredentialStore, self).__init__()
if CredentialStore.creds is None:
module_dir = os.path.dirname(__file__)
file_path = os.path.join(module_dir, ... | {
"content_hash": "d02bd98799fc87b0e0cecd91d02b8dae",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 65,
"avg_line_length": 27,
"alnum_prop": 0.6186556927297668,
"repo_name": "watson-developer-cloud/python-primer-companion-code",
"id": "4c8931efcca6a0b67ccd57a6875aadb7c8144d... |
from ... colors import gamma
from .. channel_order import ChannelOrder
from . base import SPIBase
class APA102(SPIBase):
"""Driver for APA102/SK9822 based LED strips on devices like
the Raspberry Pi and BeagleBone
Provides the same parameters as
:py:class:`bibliopixel.drivers.SPI.SPIBase`
"""
... | {
"content_hash": "20b5fcad0f1233d7178f7341c0a750e7",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 80,
"avg_line_length": 42.490566037735846,
"alnum_prop": 0.622113676731794,
"repo_name": "rec/BiblioPixel",
"id": "46e311d92999d21c1733a5ef10e4db77cf646c71",
"size": "2252"... |
'''
Generate dummy data, and compare output from scikit-learn's DBSCAN.
Example code based on:
http://scikit-learn.org/stable/auto_examples/cluster/plot_dbscan.html#sphx-glr-auto-examples-cluster-plot-dbscan-py
Run with pytest, e.g.:
py.test test.py
'''
import os
import shutil
import subprocess
from sklearn.... | {
"content_hash": "ccc81786388c77ac2b56c714f9af56fc",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 117,
"avg_line_length": 28.21311475409836,
"alnum_prop": 0.6693782684485764,
"repo_name": "jlas/ml.q",
"id": "cb6f44a5d2fe2d527d241196a158c299f2bc82a6",
"size": "1721",
"... |
""" Module for motif activity prediction """
from __future__ import print_function
def warn(*args, **kwargs):
pass
import warnings
warnings.warn = warn
import os
import sys
import shutil
from functools import partial
try:
from itertools import izip
except:
izip = zip
import itertools
import logging
fr... | {
"content_hash": "58ec10b65490e38a853623b8b0c31e10",
"timestamp": "",
"source": "github",
"line_count": 950,
"max_line_length": 137,
"avg_line_length": 33.76421052631579,
"alnum_prop": 0.542118718044644,
"repo_name": "simonvh/gimmemotifs",
"id": "0dd892455f97153f28a19ff94a2a702a521d24a2",
"size": "... |
from zope.interface import implements
from norm.interface import IAsyncCursor
from norm.orm.base import (classInfo, objectInfo, Converter, BaseOperator)
from norm.orm.props import String, Unicode
from norm.orm.expr import compiler, Compiler
def translateSQL(sql):
# this is naive
return sql.replace('?', '%s')... | {
"content_hash": "5b392babeb962ada882b93d361823eb8",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 78,
"avg_line_length": 22.99264705882353,
"alnum_prop": 0.6002558362647905,
"repo_name": "iffy/norm",
"id": "77330ad59cffe6928cdfd932b962d6e68594381e",
"size": "3185",
"... |
from swgpy.object import *
def create(kernel):
result = Installation()
result.template = "object/installation/battlefield/destructible/shared_small_turret.iff"
result.attribute_template_id = -1
result.stfName("battlefield","small_turret")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
retur... | {
"content_hash": "af3c99daa8befcc57b31336fbf03ad55",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 89,
"avg_line_length": 25.23076923076923,
"alnum_prop": 0.7195121951219512,
"repo_name": "anhstudios/swganh",
"id": "90dd2da70b91eb66cc8fc1891f35e1d14adaf731",
"size": "473... |
"""
This is the cmdset for Player (OOC) commands. These are
stored on the Player object and should thus be able to handle getting
a Player object as caller rather than a Character.
Note - in order for session-rerouting (in MULTISESSION_MODE=2) to
function, all commands in this cmdset should use the self.msg()
comman... | {
"content_hash": "0ebfbce6123e826eb1d9ec2756418480",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 69,
"avg_line_length": 29.675675675675677,
"alnum_prop": 0.6302367941712204,
"repo_name": "Pathel/deuterium",
"id": "81e1485f3c2920195807f70b3d2b93da7a82e1a7",
"size": "219... |
import numpy as np
from pandas import date_range
import pandas._testing as tm
class TestSplit:
def test_split_non_utc(self):
# GH#14042
indices = date_range("2016-01-01 00:00:00+0200", freq="S", periods=10)
result = np.split(indices, indices_or_sections=[])[0]
expected = indices._... | {
"content_hash": "f94c1b85345e246bd58b4eb009f9a8a0",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 78,
"avg_line_length": 29.53846153846154,
"alnum_prop": 0.6536458333333334,
"repo_name": "gfyoung/pandas",
"id": "301466c0da41c1f369cd735d19dcb7f78f207517",
"size": "384",
... |
print "Edson Lopes Portal"
print "Tiago"
| {
"content_hash": "d5b9540d5fedcaa252e8f0ae601c0c76",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 26,
"avg_line_length": 20.5,
"alnum_prop": 0.7560975609756098,
"repo_name": "mateusportal/testandogit",
"id": "be52ef5b2b1cab25df88a4177a6011ea72cf3ede",
"size": "42",
"bi... |
import itertools
import re
from sqlalchemy import Column, Integer, MetaData, String, Table
from sqlalchemy.sql.expression import select
from nova.openstack.common import log as logging
from oslo.config import cfg
CONF = cfg.CONF
CONF.import_opt('default_ephemeral_format', 'nova.virt.driver')
LOG = logging.getLogger... | {
"content_hash": "4c959b085596392506ec86fca2487cbb",
"timestamp": "",
"source": "github",
"line_count": 254,
"max_line_length": 79,
"avg_line_length": 37.40944881889764,
"alnum_prop": 0.590612502631025,
"repo_name": "DirectXMan12/nova-hacking",
"id": "e8b9a1570f21feb001ccebaedbd6f4156b54c5aa",
"siz... |
import sys, 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.
#sys.path.insert(0, os.path.abspath('.'))
# Get the project root ... | {
"content_hash": "5e59afc2dd60eddcb39725a1b257dd8d",
"timestamp": "",
"source": "github",
"line_count": 246,
"max_line_length": 80,
"avg_line_length": 32.28861788617886,
"alnum_prop": 0.7064081581266524,
"repo_name": "pydanny/watdarepo",
"id": "e19dd6bbcb36e9757d1188716ea755781095cae9",
"size": "83... |
"""Simple script for creating symbolic links for an arbitrary number of path pairs."""
import argparse
import errno
import json
import os
import sys
def main(args):
parser = argparse.ArgumentParser(description='Create symlinks')
parser.add_argument("--link-json",
help="Simple JSON mapping o... | {
"content_hash": "f7133f845b416c64685a4ba5359c8cad",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 86,
"avg_line_length": 26.128205128205128,
"alnum_prop": 0.6359175662414132,
"repo_name": "luci/recipes-py",
"id": "e1b7d3e28799bb1f50535786ea9626f0484baf11",
"size": "1216... |
import sys
import colorama
from colorama import Fore, Back, Style
mapping = {
'fg_green' : Fore.GREEN,
'fg_red' : Fore.RED,
}
# initialize colorama
def initialize(on=True):
if on:
colorama.init(autoreset=True, convert=None, strip=None, wrap=True)
else:
colorama.init(autoreset=True, c... | {
"content_hash": "854120b43bf1e4534cdbdbac9b6e102d",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 74,
"avg_line_length": 19.375,
"alnum_prop": 0.6370967741935484,
"repo_name": "sharethis-github/sgwarden",
"id": "cb91c5249c233f456b3ff601648fa43744fb8d73",
"size": "620",
... |
__version__=''' $Id$ '''
__doc__="""
The Canvas object is the primary interface for creating PDF files. See
doc/reportlab-userguide.pdf for copious examples.
"""
__all__ = ['Canvas']
ENABLE_TRACKING = 1 # turn this off to do profile testing w/o tracking
import os
import sys
import re
import hashlib
from string import... | {
"content_hash": "3adeca65a0b89d7f4d89a1e425448c0a",
"timestamp": "",
"source": "github",
"line_count": 1863,
"max_line_length": 151,
"avg_line_length": 41.088566827697264,
"alnum_prop": 0.5927653237184511,
"repo_name": "mollstam/UnrealPy",
"id": "f4f59b9801684bc1a0cbf7fe5b3d19a112a0d6d4",
"size": ... |
from django.db import transaction
from django import forms
from registration.forms import RegistrationForm
from cmdrs.models import Commander
class SignupForm(RegistrationForm):
commander_name = forms.CharField(
help_text='This should match your in-game Commander Name (minus the '
'CMD... | {
"content_hash": "c99a53b8d1347e05e7059196b79d28e5",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 77,
"avg_line_length": 26.96153846153846,
"alnum_prop": 0.6148359486447932,
"repo_name": "toastdriven/eliteracing",
"id": "faf83c58ee3aec7eddd03c85ba93693defc7b095",
"size"... |
"""
=====================================
Blind source separation using FastICA
=====================================
:ref:`ICA` is used to estimate sources given noisy measurements.
Imagine 2 instruments playing simultaneously and 2 microphones
recording the mixed signals. ICA is used to recover the sources
ie. what ... | {
"content_hash": "49acf8d4a1678a36a3b068034c0cff29",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 79,
"avg_line_length": 29.647058823529413,
"alnum_prop": 0.583994708994709,
"repo_name": "jmargeta/scikit-learn",
"id": "dda2dd2d0ea60e3c3373d376a1a371b7308a42ef",
"size": ... |
from xml.sax import make_parser
from xml.sax.handler import ContentHandler
import smallsmilhandler
import sys
import json
from urllib.request import urlretrieve
class KaraokeLocal():
def __init__(self, fich):
parser = make_parser()
cHandler = smallsmilhandler.SmallSMILHandler()
parser.setC... | {
"content_hash": "3e86bba4f6221b34ca5e326ac25f63b6",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 63,
"avg_line_length": 30.79310344827586,
"alnum_prop": 0.5319148936170213,
"repo_name": "Wendycarolina/ptavi-p3",
"id": "64aa833b1269657650c61cd55bc48e5315902faf",
"size":... |
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
import settings
from django.contrib import admin
admin.autodiscover()
import views
urlpatterns = patterns('',
url(r'^$', views.index),
url(r'^main/$', views.main),
url(r'^admin/', admin.site.urls),
... | {
"content_hash": "8244bb31362f132824bf9dd2d874aa15",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 82,
"avg_line_length": 34.523809523809526,
"alnum_prop": 0.663448275862069,
"repo_name": "odingrey/Django-Wink",
"id": "e6536f268aed2836f647d8d52c405897992e9eba",
"size": "... |
from parlai.core.teachers import FbDeprecatedDialogTeacher
from .build import build
import copy
import os
def _path(opt, filtered):
# Build the data if it doesn't exist.
build(opt)
dt = opt['datatype'].split(':')[0]
return os.path.join(opt['datapath'], 'SimpleQuestions', 'sq', dt + '.txt')
class De... | {
"content_hash": "a2f02de7b3b0550f0bd5ecd2c8155dca",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 78,
"avg_line_length": 27.105263157894736,
"alnum_prop": 0.6485436893203883,
"repo_name": "facebookresearch/ParlAI",
"id": "bb9f7964e8445c67989d884e0c5c71761de731d2",
"size... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Client',
fields=[
('id', models.AutoField(auto_crea... | {
"content_hash": "9664e0ae330777555ec4dc0ea9e70302",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 663,
"avg_line_length": 60.47222222222222,
"alnum_prop": 0.5507579237482775,
"repo_name": "dhelbegor/client-crud",
"id": "0d2bc196969df68c03091fe28d8eae5e64132990",
"size":... |
def get_instance_objs (ec2, opts, filterDict={}):
if opts['instance_name']:
filterDict = {'tag:Name': opts['instance_name']}
elif opts['instance_id']:
filterDict = {'instance-id': opts['instance_id']}
try:
reservations = ec2.get_all_instances(filters=filterDict)
except:
print "Error getting all... | {
"content_hash": "40320a943dc4648b7033fd270ebdd606",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 100,
"avg_line_length": 30.322580645161292,
"alnum_prop": 0.5648936170212766,
"repo_name": "robertpearce/aws-manager",
"id": "ba099abf6373b038ea24a76154a80c8354528d32",
"si... |
'''@file test.py
this file will run the test script
usage: run test --expdir=<expdir> --recipe=<recipe> --computing=<computing>'''
import sys
import os
sys.path.append(os.getcwd())
import shutil
import subprocess
from six.moves import configparser
import tensorflow as tf
from test import test
def main(expdir, recipe... | {
"content_hash": "e7540b6aac3a14a41daca068f999627e",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 79,
"avg_line_length": 35.08247422680412,
"alnum_prop": 0.5780193946517779,
"repo_name": "vrenkens/nabu",
"id": "7e7fa5080bc99e4907009d9a40047491fb28ea71",
"size": "3403",
... |
"""MySQL to GCS operator."""
import base64
import calendar
from datetime import date, datetime, timedelta
from decimal import Decimal
from typing import Dict
from MySQLdb.constants import FIELD_TYPE
from airflow.providers.google.cloud.transfers.sql_to_gcs import BaseSQLToGCSOperator
from airflow.providers.mysql.hook... | {
"content_hash": "4795f194e541832dcb412107006a1e04",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 91,
"avg_line_length": 37.53389830508475,
"alnum_prop": 0.6161661774666968,
"repo_name": "sekikn/incubator-airflow",
"id": "6f5c4c20d6df11c61193d7d959dcd3e92a21a89e",
"siz... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "reciprocity.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "ed2aa0db72f71354ac93e17fd6a62d1f",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 75,
"avg_line_length": 25.77777777777778,
"alnum_prop": 0.7155172413793104,
"repo_name": "TeamReciprocity/reciprocity",
"id": "19faabb92c934947bc8b0d1b5f6afc6a02a2c9be",
"si... |
from ..parsed_result import ParsedResult
from ..parsed_result import ParsedComponent
class Refiner(object):
def refine(self, results, text, options):
return results
| {
"content_hash": "c4adbc4ad37ed3df88487805f845a4fd",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 45,
"avg_line_length": 23,
"alnum_prop": 0.7228260869565217,
"repo_name": "wanasit/chrono-python",
"id": "eeaa764d516ce72578e829e152dba65d7e7cdc78",
"size": "230",
"binary... |
from django.shortcuts import render, redirect
from django.contrib.auth.forms import UserCreationForm, AuthenticationForm
from django.contrib.auth import authenticate, login, logout
from django.views.generic import View
from django.contrib.auth.mixins import LoginRequiredMixin
class LoginRegister(View):
template_n... | {
"content_hash": "7254e6e97572f132526854ad91be2a77",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 81,
"avg_line_length": 33.241379310344826,
"alnum_prop": 0.6123789764868603,
"repo_name": "the-kid89/LearningWithWebsockets",
"id": "dce416a272e61e2d899cbbc005b1e642ea04f607"... |
from django.core.management.base import BaseCommand, CommandError
from core.models import Game, Company
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('game')
parser.add_argument('name')
parser.add_argument('--cash', type=int, default=0)
parser.add_... | {
"content_hash": "4bb6c72768a6a4246c3329f984dbe5e1",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 78,
"avg_line_length": 46.42857142857143,
"alnum_prop": 0.6230769230769231,
"repo_name": "XeryusTC/18xx-accountant",
"id": "83655d9e2e13e7cae25b913e2d45caa084e70bfa",
"size... |
import argparse
import brightnessmonitorclient
from brightnessmonitorclient import __version__
from brightnessmonitorclient.raspberry.main import start
def get_parser():
"""
Creates a new argument parser.
"""
parser = argparse.ArgumentParser('BrightnessMonitorClient')
version = '%(prog)s ' + __ver... | {
"content_hash": "1076b1155f061efb3000b5f9ff3b444c",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 78,
"avg_line_length": 23.264705882352942,
"alnum_prop": 0.6422250316055625,
"repo_name": "BrightnessMonitor/BrightnessMonitorClient",
"id": "3a025f3f68e7c4035ed0b1d1ce0375b4... |
import os
import time
import pytest
from mapproxy.client.http import HTTPClient, HTTPClientError, supports_ssl_default_context
from mapproxy.client.tile import TileClient, TileURLTemplate
from mapproxy.client.wms import WMSClient, WMSInfoClient
from mapproxy.grid import tile_grid
from mapproxy.layer import MapQuery, ... | {
"content_hash": "8e7c38cd64a7191f429b6d4d00024a47",
"timestamp": "",
"source": "github",
"line_count": 456,
"max_line_length": 249,
"avg_line_length": 46.125,
"alnum_prop": 0.6311510483525888,
"repo_name": "camptocamp/mapproxy",
"id": "8a35be718abac9ef4e2245c764e99b518183be5f",
"size": "21683",
... |
import unittest
from hashlib import sha1
from magicfolder.server import calculate_merge, FileItem
def make_file_item(file_path, file_data):
return FileItem(file_path, sha1(file_data).hexdigest(), len(file_data), 0)
f1 = make_file_item('file_1', 'some data')
f2 = make_file_item('file_2', 'more data')
f3 = make_fi... | {
"content_hash": "24bb3348bb5dd80304ea564ae3684d72",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 78,
"avg_line_length": 40.55833333333333,
"alnum_prop": 0.5627696733100472,
"repo_name": "mgax/MagicFolder",
"id": "fc0a8939b4ebea8b933163344c7a789e315af44a",
"size": "486... |
from __future__ import unicode_literals
from django.contrib import admin
from symposion.schedule.models import Schedule, Day, Room, SlotKind, Slot, SlotRoom, Presentation, Session, SessionRole, Track
class DayInline(admin.StackedInline):
model = Day
extra = 2
class SlotKindInline(admin.StackedInline):
... | {
"content_hash": "8e00a19979ca453514babb86c5fc7606",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 126,
"avg_line_length": 24.155172413793103,
"alnum_prop": 0.7201998572448252,
"repo_name": "pyconau2017/symposion",
"id": "7cf59ecbd5beaf068758a3a5e0afa5b5b80ec2e8",
"size"... |
"""
Test suites for 'common' code used throughout the OpenStack HTTP API.
"""
import mock
from testtools import matchers
import webob
import webob.exc
from cinder.api import common
from cinder import test
NS = "{http://docs.openstack.org/compute/api/v1.1}"
ATOMNS = "{http://www.w3.org/2005/Atom}"
class LimiterTes... | {
"content_hash": "f841b7a41d31d4607ddec277481bdeec",
"timestamp": "",
"source": "github",
"line_count": 534,
"max_line_length": 79,
"avg_line_length": 43.254681647940075,
"alnum_prop": 0.5831673737985973,
"repo_name": "yanheven/cinder",
"id": "75ef32894a800a3279596249d6cd58e1eef5fd47",
"size": "237... |
from typing import Any
from typing import Generic
from typing import TypeVar
import attr
from _pytest.compat import TYPE_CHECKING
if TYPE_CHECKING:
from typing import Type # noqa: F401 (used in type string)
class PytestWarning(UserWarning):
"""Base class for all warnings emitted by pytest."""
__modul... | {
"content_hash": "a380902b3f795ee26f84ff806a7b1f90",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 90,
"avg_line_length": 25.69811320754717,
"alnum_prop": 0.6956681350954479,
"repo_name": "alfredodeza/pytest",
"id": "ee437cc9746ad6002b5095fd9c8eb45f784af9c3",
"size": "2... |
from ..excel_comparison_test import ExcelComparisonTest
from datetime import datetime
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""
Test file created by XlsxWriter against a file created by Excel.
"""
def setUp(self):
self.set_filename('default_date_f... | {
"content_hash": "c6f9d4f9e93068eb0de06a28544d7907",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 89,
"avg_line_length": 26.405940594059405,
"alnum_prop": 0.6205474315710536,
"repo_name": "jmcnamara/XlsxWriter",
"id": "52c19d0c6d235f948aeeed8980318b722304dd7c",
"size":... |
from monthlyReportNew import getData
import nose.tools as nTools
import warnings
warnings.filterwarnings("ignore")
# nose.tools.TimeExpired nose.tools.assert_items_equal nose.tools.assert_set_equal
# nose.tools.assert_almost_equal nose.tools.assert_less nose.tool... | {
"content_hash": "6f90f802eb7357403954639eed6389fe",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 111,
"avg_line_length": 56.625,
"alnum_prop": 0.6582781456953642,
"repo_name": "Holmusk/glycoleapMonthlyReportNew",
"id": "fd1a65a4bbaa60c7f41e2a6972556047939dd270",
"size"... |
a = """
multiline "unicode" string \
\xf1 \u1234aaaa \U1234aaaa
\N{BLACK SPADE SUIT}
"""
a : source.python
: source.python
= : keyword.operator.assignment.python, source.python
: source.python
""" : punctuation.definition.string.begin.python, so... | {
"content_hash": "ae154d21a914e4f1d14dec168cfe7459",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 101,
"avg_line_length": 47.82142857142857,
"alnum_prop": 0.671396564600448,
"repo_name": "MagicStack/MagicPython",
"id": "985bb4cfe447ee61bdacebd18c43e754af4c41fb",
"size":... |
"""
os-release - File ``/etc/os-release``
=====================================
This module provides plugins access to file ``/etc/os-release``.
Typical content of file ``/etc/os-release`` is::
NAME="Red Hat Enterprise Linux Server"
VERSION="7.2 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="7.2... | {
"content_hash": "aeceb6723f0b9e162b3a579e0964d24d",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 75,
"avg_line_length": 31.29090909090909,
"alnum_prop": 0.6153399186519466,
"repo_name": "PaulWay/insights-core",
"id": "ecf52786400cbdd8823b21514f6ac635e66bf4cf",
"size": ... |
"""Test that forward declaration of a data structure gets resolved correctly."""
import lldb
from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *
import lldbsuite.test.lldbutil as lldbutil
class ForwardDeclarationTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def do... | {
"content_hash": "f1c082d816fd2c6f5a9d36ec57967b28",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 97,
"avg_line_length": 33.83076923076923,
"alnum_prop": 0.5802637562528422,
"repo_name": "endlessm/chromium-browser",
"id": "f955d013bc900e5cb926700a7652b4d6add8d11b",
"siz... |
import logging
from maintain.release.base import Releaser
from maintain.release.hooks import HookReleaser
from maintain.release.version_file import VersionFileReleaser
from maintain.release.python import PythonReleaser
from maintain.release.cocoapods import CocoaPodsReleaser
from maintain.release.npm import NPMRelease... | {
"content_hash": "b7432a1a8acca32ad849c21dbea6534a",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 98,
"avg_line_length": 30.22222222222222,
"alnum_prop": 0.6088235294117647,
"repo_name": "kylef/maintain",
"id": "614f3ab5f28ac7548b1a797be4f928765a33f72d",
"size": "4080"... |
import sys
import requests
import json
import sets
from urlparse import urlparse
from prettytable import PrettyTable
import os
import urllib
import datetime, time
import pprint
from parse import compile
from gremlin import ApplicationGraph, A8FailureGenerator, A8AssertionChecker
def passOrfail(result):
if result:
... | {
"content_hash": "e6ea75b4bfbc4b4d95cb9be719c296ad",
"timestamp": "",
"source": "github",
"line_count": 1054,
"max_line_length": 236,
"avg_line_length": 35.63377609108159,
"alnum_prop": 0.5522658288513765,
"repo_name": "amalgam8/a8ctl",
"id": "0619aea724f3b5938abc82d9f0f3a40fd16d2e10",
"size": "382... |
import os
import pyinotify
from ConfigParser import SafeConfigParser, NoOptionError, NoSectionError
from pipelines.logger import PipelineJobLogger
from pipelines.paths import *
class PipelineConfigError(Exception): # TODO: implement
def __init__(self, msg):
super(PipelineConfigError, self).__init__()
self.msg =... | {
"content_hash": "ee8555cc7468f25ae9462a2e77528bc0",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 174,
"avg_line_length": 28.06040268456376,
"alnum_prop": 0.6792633341305908,
"repo_name": "isb-cgc/ISB-CGC-pipelines",
"id": "c65e29b85e80d607ab882dec9b9c60f36c4daf1b",
"s... |
"""
Copyright 2017 Pani Networks Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | {
"content_hash": "53dd101142e54194a6131dd828f1e317",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 78,
"avg_line_length": 33.3027027027027,
"alnum_prop": 0.5624086998863821,
"repo_name": "romana/vpc-router",
"id": "8cd689d298e6c149f36a0aa2537754d3cd359316",
"size": "616... |
'''
Created on Nov 15, 2018
'''
from __future__ import print_function
from __future__ import unicode_literals
import unittest
from pprint import pprint
from weblyzard_api.client import OGER_API_URL
from weblyzard_api.client.ontogene import OgerClient
from weblyzard_api.client.recognize import Recognize
from weblyza... | {
"content_hash": "553d415cea603b8dd2599847fec3a191",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 174,
"avg_line_length": 34.075,
"alnum_prop": 0.6845194424064563,
"repo_name": "weblyzard/weblyzard_api",
"id": "861f8e256135e78c1f55674f1a379b4dcd46d136",
"size": "1405",
... |
import numpy as np
import requests
from PIL import Image
from bokeh.plotting import *
class MapArea:
def __init__(self, image, min_lon, max_lon, min_lat, max_lat):
self.image = image
self.min_lon = min_lon
self.min_lat = min_lat
self.max_lon = max_lon
self.max_lat = max_lat
... | {
"content_hash": "b515cc0e89c9b4dde6652a66d7c75696",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 161,
"avg_line_length": 34.324074074074076,
"alnum_prop": 0.6215268411114109,
"repo_name": "dchudz/bokeh-maps",
"id": "9035eefb7fbfcc5e444001e1baf323c98c228339",
"size": "... |
"""
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:
get and set.
get(key) - Get the value (will always be positive) of the key if the key exists in the cache, otherwise return -1.
set(key, value) - Set or insert the value if the key is not alread... | {
"content_hash": "0177c8b2a0cf69fe8ed225ccc80f4200",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 192,
"avg_line_length": 20.59016393442623,
"alnum_prop": 0.6564490445859873,
"repo_name": "Ahmed--Mohsen/leetcode",
"id": "2d2a95cd469923bc21eea75c86eaa96113423d61",
"size... |
"""A few things that didn't seem to fit anywhere else."""
import os
import os.path
import pwd
import tempfile
import fcntl
import errno
import threading
import subprocess
import shutil
import sys
import signal
import logger
PID_FILE = '/var/run/nodemanager.pid'
####################
def get_default_if():
inter... | {
"content_hash": "3459c2b54d33e46501bb8188b508a780",
"timestamp": "",
"source": "github",
"line_count": 650,
"max_line_length": 103,
"avg_line_length": 32.78153846153846,
"alnum_prop": 0.5556598460672048,
"repo_name": "dreibh/planetlab-lxc-nodemanager",
"id": "ba6e44a33b9ba8962f0174b2713a755a15286223... |
"""Collection of classifiers intended to work with text data."""
import numpy as np
from sklearn.base import BaseEstimator
from dstoolbox.data import load_w2v_format
from dstoolbox.utils import normalize_matrix
from dstoolbox.utils import fast_argsort
class W2VClassifier(BaseEstimator):
"""Word2Vec classifier t... | {
"content_hash": "804094141eba3994bdb256b3baeca0ec",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 77,
"avg_line_length": 33.55980861244019,
"alnum_prop": 0.6099230111206159,
"repo_name": "ottogroup/dstoolbox",
"id": "f8c11d0ff59f10e6f8508f8aec74f657873be73f",
"size": "... |
import flask_login
from flask_mail import Mail
from flask import current_app
from flask_migrate import Migrate
from flask.ext.sqlalchemy import SQLAlchemy
from celery import Celery
from celery import task as ctask
from flask_assets import Environment
from app.config import task
login_manager = flask_login.LoginMana... | {
"content_hash": "41d440e65da471271ef531d651283ed4",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 61,
"avg_line_length": 23.136363636363637,
"alnum_prop": 0.7917485265225933,
"repo_name": "atulmishra-one/dairy_manager",
"id": "f9cd3bf3cb2f23def83fc80af84e8557de92490f",
... |
def capitals_first(string):
return ' '.join(sorted((a for a in string.split() if a[0].isalpha()),
key=str.islower))
| {
"content_hash": "8440e0052d654e7dab7bff6a40926e9a",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 73,
"avg_line_length": 49,
"alnum_prop": 0.54421768707483,
"repo_name": "the-zebulan/CodeWars",
"id": "c3af4fa1ff425215b5c6ddb6ffb96d3f93c8950c",
"size": "147",
"binary": ... |
import warnings
warnings.filterwarnings("ignore")
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import matplotlib.pyplot as plt
import sys,os
import subprocess
import numpy as np
import random
import time
import cv2 as cv
import pyfits
from pyfits import getheader
import multiprocessing, Queue
impo... | {
"content_hash": "ec23fb9c5228aaf9cd5fc2318c706e7b",
"timestamp": "",
"source": "github",
"line_count": 258,
"max_line_length": 941,
"avg_line_length": 32.27906976744186,
"alnum_prop": 0.6605427473583093,
"repo_name": "rpmunoz/DECam",
"id": "01ce327943c642863fe63a20c68d2e128741080c",
"size": "8352"... |
"""
Created on Sun Jun 07 22:15:15 2015
@author: Paco
"""
from api import API
class Instagram(API):
_class_name = 'Instagram'
_category = 'Picture'
_help_url = 'https://instagram.com/developer/endpoints/'
_version = '1'
_api_url = 'https://api.instagram.com/v' + _version + '/'
def __init__(... | {
"content_hash": "d0cbb6d388157c9d41b18f3402e33b3a",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 152,
"avg_line_length": 43.95402298850575,
"alnum_prop": 0.5800209205020921,
"repo_name": "franblas/pyAPI",
"id": "c409704f4d77e250513b0fce59691a39c2752f20",
"size": "3848"... |
from __future__ import print_function
import tensorflow as tf
import argparse
from antk.core import config
from antk.core import generic_model
from antk.core import loader
from antk.models import dsaddmodel
def return_parser():
parser = argparse.ArgumentParser(description="For testing")
parser.add_argument("da... | {
"content_hash": "75b246e65e5fad1d37c453f709bea524",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 115,
"avg_line_length": 53.73770491803279,
"alnum_prop": 0.6070774862721171,
"repo_name": "aarontuor/antk",
"id": "f2d3b15359c9e4be4fc5349693b1aa5149a219e2",
"size": "3278"... |
class strToList :
def __init__(self,options,saveState=False):
#self.interest={"[":newList,"]":"closeList"}
# allows for
self.saveState=saveState
ints=["newList","closeList","setState","skipChar"]
posibs={"newList":self.newList ,"closeList":self.closeList ,"setState":self.set... | {
"content_hash": "f5ad7770b4594361b168584da4aba512",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 118,
"avg_line_length": 34.2375,
"alnum_prop": 0.5151515151515151,
"repo_name": "alexjgriffith/alpha-score",
"id": "b31baf1675da78fe92a7e21677fa9d2974d654c5",
"size": "3122... |
from ddosso.handlers import DdossoHandlerMixin
import firenado.conf
import firenado.tornadoweb
from firenado import service
from tornado.auth import FacebookGraphMixin
from tornado.escape import json_encode, json_decode, url_escape
import tornado.web
class FacebookHandlerMixin:
SESSION_KEY = 'facebook_user'
... | {
"content_hash": "3ac5d5cacf08bce4a335ce780b46df1d",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 79,
"avg_line_length": 39.76543209876543,
"alnum_prop": 0.5638000620925179,
"repo_name": "piraz/ddosso",
"id": "bac849c0bf5c85efce3622cb518b9e5dc0013af8",
"size": "3828",
... |
from base import BaseTest
import json
import os
import shutil
import subprocess
class Test(BaseTest):
def test_base(self):
"""
Basic test with exiting Mockbeat normally
"""
self.render_config_template(
)
proc = self.start_beat()
self.wait_until(lambda: se... | {
"content_hash": "8dbdf5392da781709ecd7c90c41efc12",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 79,
"avg_line_length": 32.26288659793814,
"alnum_prop": 0.5435373062789584,
"repo_name": "taitan-org/inflog",
"id": "5af2181b9bd8c6ed6e76ff82a3432ca9b5acff3c",
"size": "62... |
import helpers
def plot():
import matplotlib
from matplotlib import pyplot as plt
import numpy as np
fig = plt.figure()
# pylint: disable=invalid-slice-index
x, y = np.ogrid[-10:10:100j, -10:10:100j]
extent = (x.min(), x.max(), y.min(), y.max())
cmap = matplotlib.cm.get_cmap('gray')
... | {
"content_hash": "bc5038476385c67815951fe10ee8ea25",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 65,
"avg_line_length": 23.363636363636363,
"alnum_prop": 0.6303501945525292,
"repo_name": "danielhkl/matplotlib2tikz",
"id": "90deb261a08777c5aaaa8aeb006883eba3c2cc09",
"si... |
import interpreter, messages, udpresponselistener, udpconnector, tcpfileclient, tcpfilesocket
| {
"content_hash": "42393ee343faa919ed25c14de4a04870",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 93,
"avg_line_length": 94,
"alnum_prop": 0.8723404255319149,
"repo_name": "xserty/piDS",
"id": "abe83614d54fc5b7951f5d3f7470cd238e9aaeae",
"size": "94",
"binary": false,
... |
"""
Sumy - automatic text summarizer.
Usage:
sumy (luhn | edmundson | lsa | text-rank | lex-rank | sum-basic | kl) [--length=<length>] [--language=<lang>] [--stopwords=<file_path>] [--format=<format>]
sumy (luhn | edmundson | lsa | text-rank | lex-rank | sum-basic | kl) [--length=<length>] [--language=<lang>] ... | {
"content_hash": "02f52d81441dfd6119ecdec8acff6cbb",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 178,
"avg_line_length": 38.237037037037034,
"alnum_prop": 0.6555598605191786,
"repo_name": "miso-belica/sumy",
"id": "e0ad2c390ef344baaa137e9857e8558a06a00e8c",
"size": "5... |
import os, sys, base64, hashlib
def parentOf(path, n=1):
return '/'.join(path.rstrip('/').split('/')[:-n])
REPO = parentOf(os.path.abspath(__file__), n=2)
sys.path.append('%s/impl' % REPO)
#### Tests
import unittest
from unittest import TestCase
from spriteutils import *
with open('%s/examples/raw/initial.cs... | {
"content_hash": "710cad1aa70031931b5fa0cdca29f73b",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 263,
"avg_line_length": 29.91764705882353,
"alnum_prop": 0.5454187966968148,
"repo_name": "andrewschaaf/spriteutils",
"id": "89e859df904ff1be639531c267d6ded000623527",
"siz... |
## This python script will convert a TASSEL hapmap to a file input
# used by fastPHASE
# Import libraries
import argparse
#####
# Define the arguments
#####
# Description
DESC = """A Python program to convert the output from fastPHASE to a TASSEL-encoded
hapmap file.\n"""
# Argument parser
parser ... | {
"content_hash": "3206e598f95a64b969e14d7097775f90",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 125,
"avg_line_length": 24.577319587628867,
"alnum_prop": 0.6273070469798657,
"repo_name": "neyhartj/bioinformatic-utils",
"id": "63afaee3c23be183e951de2da599c373fddd1fb0",
... |
import _plotly_utils.basevalidators
class ShowlegendValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="showlegend", parent_name="scattercarpet", **kwargs):
super(ShowlegendValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_... | {
"content_hash": "dc867a7534fa965b35e78af655ce825c",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 88,
"avg_line_length": 38.166666666666664,
"alnum_prop": 0.6222707423580786,
"repo_name": "plotly/python-api",
"id": "3f25c5ff2d431c3bee230e81b97b1f7d577af79a",
"size": "45... |
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.
#sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0,... | {
"content_hash": "37f058188f9168b983dd476a8fffb28b",
"timestamp": "",
"source": "github",
"line_count": 243,
"max_line_length": 148,
"avg_line_length": 32.8724279835391,
"alnum_prop": 0.7001752628943415,
"repo_name": "teozkr/Flask-Pushrod",
"id": "003b1b0f0141b49801d4c84b786b816cbd821127",
"size": ... |
import deepchem as dc
import tempfile
import numpy as np
import os
def test_copy():
"""Test that copy works correctly."""
num_datapoints = 100
num_features = 10
num_tasks = 10
# Generate data
X = np.random.rand(num_datapoints, num_features)
y = np.random.randint(2, size=(num_datapoints, num_tasks))
w ... | {
"content_hash": "27e89ccf16d883305c9f83144bb88586",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 72,
"avg_line_length": 33.78947368421053,
"alnum_prop": 0.6780893042575286,
"repo_name": "lilleswing/deepchem",
"id": "881019446108bc3ee5ea2e503c6cb2f0ad27c572",
"size": "1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.