repo_name stringlengths 6 90 | path stringlengths 4 230 | copies stringlengths 1 4 | size stringlengths 4 7 | content stringlengths 734 985k | license stringclasses 15
values | hash int64 -9,223,303,126,770,100,000 9,223,233,360B | line_mean float64 3.79 99.6 | line_max int64 19 999 | alpha_frac float64 0.25 0.96 | autogenerated bool 1
class | ratio float64 1.5 8.06 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
adamcik/oauthclientbridge | tests/authorize_test.py | 1 | 7063 | import pytest
from oauthclientbridge import app, compat, crypto, db, errors
def test_authorize_redirects(client):
resp = client.get('/')
location = compat.urlsplit(resp.location)
with client.session_transaction() as session:
assert resp.status_code == 302
assert location.netloc == 'provi... | apache-2.0 | 4,887,078,647,104,090,000 | 32.794258 | 79 | 0.62523 | false | 3.750929 | true | false | false |
millere/bugs | nodes/bug.py | 1 | 6838 | #!/usr/bin/env python
import math
import sys
import roslib; roslib.load_manifest('bugs')
import rospy
import tf.transformations as transform
from geometry_msgs.msg import Twist
from sensor_msgs.msg import LaserScan
from nav_msgs.msg import Odometry
from location import Location, necessary_heading
from dist import Di... | mit | 8,358,930,858,393,479,000 | 28.991228 | 85 | 0.569172 | false | 3.412176 | false | false | false |
saitoha/canossa | canossa/mouse.py | 1 | 19848 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# ***** BEGIN LICENSE BLOCK *****
# Copyright (C) 2012-2014, Hayaki Saito
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction... | mit | -3,302,990,505,926,424,000 | 36.378531 | 88 | 0.501814 | false | 4.203304 | false | false | false |
matllubos/django-is-core | example/dj/apps/issue_tracker/models.py | 1 | 1786 | from django.db import models
from django.conf import settings
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from is_core.utils.decorators import relation
AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
class Issue(mod... | bsd-3-clause | 8,033,065,673,662,795,000 | 41.52381 | 103 | 0.674132 | false | 3.832618 | false | false | false |
JaDogg/__py_playground | reference/sketchbook/parsing/precedence_climbing.py | 1 | 3222 | """
Parse infix expressions by precedence climbing. N.B. Not quite identical to
http://en.wikipedia.org/wiki/Operator-precedence_parser#Precedence_climbing_method
so maybe I should rename this. I learned this method from Dave Gillespie.
It's coded with procedure parameters to make it possible (at least sometimes)
to ... | mit | -1,558,837,793,861,225,700 | 29.980769 | 82 | 0.6018 | false | 3.438634 | false | false | false |
grnet/icaas | icaas/utils.py | 1 | 2536 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | agpl-3.0 | 4,265,192,529,479,383,600 | 31.935065 | 78 | 0.661672 | false | 3.901538 | false | false | false |
commaai/openpilot | tools/replay/unlogger.py | 1 | 17143 | #!/usr/bin/env python3
import argparse
import os
import sys
import zmq
import time
import signal
import multiprocessing
from uuid import uuid4
from collections import namedtuple
from collections import deque
from datetime import datetime
from cereal import log as capnp_log
from cereal.services import service_list
from... | mit | 3,209,388,510,002,954,000 | 33.492958 | 127 | 0.648545 | false | 3.525915 | false | false | false |
MediaMath/t1-python | terminalone/models/agency.py | 3 | 1238 | # -*- coding: utf-8 -*-
"""Provides agency object."""
from __future__ import absolute_import
from .. import t1types
from ..entity import Entity
class Agency(Entity):
"""Agency entity."""
collection = 'agencies'
resource = 'agency'
_relations = {
'organization', 'billing_contact', 'sales_conta... | apache-2.0 | -670,922,887,804,188,000 | 27.790698 | 70 | 0.560582 | false | 3.41989 | false | false | false |
nathantspencer/webknossos_toolkit | swc_tools/swc_center.py | 1 | 1295 | import sys
def center(swc_path):
f = open(swc_path, 'r')
lines = f.readlines()
f.close()
radii = {}
parents = {}
xs = {}
ys = {}
zs = {}
x_avg = 0
y_avg = 0
z_avg = 0
for line in lines:
radii[int(line.split(' ')[0])] = float(line.split(' ')[5].strip())
... | mit | -1,866,390,406,634,079,500 | 29.116279 | 113 | 0.466409 | false | 2.732068 | false | false | false |
zverevalexei/trex-http-proxy | trex_client/external_libs/pyzmq-14.5.0/python2/cel59/32bit/zmq/auth/certs.py | 20 | 3917 | """0MQ authentication related functions and classes."""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import datetime
import glob
import io
import os
import zmq
from zmq.utils.strtypes import bytes, unicode, b, u
_cert_secret_banner = u("""# **** Generated on {0} by... | mit | -4,911,266,959,411,470,000 | 31.915966 | 104 | 0.603523 | false | 3.723384 | false | false | false |
haikouxuege/better-ctf-tools | CTFtools.py | 1 | 5449 | # _*_ coding:UTF-8 _*_
from source import md5_moudle,MD5_online_crack,b64_moudle,caesar,Railfence,ascii_brute_moudle,rot13_moudle,RGB2pic_moudle,factorization_moudle,num_to_QR_moudle
from source.morse_moudle import Morse
import urllib.request
def begin():
print('''
_ _ _ ____ _____ _____ __... | mit | 7,816,815,781,460,995,000 | 25.146465 | 159 | 0.416264 | false | 2.980426 | false | false | false |
stvstnfrd/edx-platform | lms/djangoapps/grades/config/models.py | 1 | 3966 | """
Models for configuration of the feature flags
controlling persistent grades.
"""
from config_models.models import ConfigurationModel
from django.conf import settings
from django.db.models import BooleanField, IntegerField, TextField
from django.utils.encoding import python_2_unicode_compatible
from opaque_keys.ed... | agpl-3.0 | 8,665,069,643,683,600,000 | 35.054545 | 119 | 0.695663 | false | 4.246253 | true | false | false |
Udzu/pudzu | dataviz/euarea.py | 1 | 2299 | from pudzu.charts import *
from pudzu.sandbox.bamboo import *
atlas = pd.read_csv("datasets/countries.csv").split_columns('country', "|").explode('country').set_index('country')
df = pd.read_csv("datasets/euarea.csv").set_index("country").assign_rows(ratio=lambda d: d.european / d.overall).sort_values("ratio", asc... | mit | 3,400,759,957,661,525,500 | 72.096774 | 210 | 0.673203 | false | 2.809058 | false | false | false |
xu2243051/easyui-menu | polls/views.py | 1 | 1903 | from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.views import generic
from django.utils import timezone
from polls.models import Choice, Question
class IndexView(generic.ListView):
template_name = 'polls/in... | apache-2.0 | -8,126,373,097,918,521,000 | 33.6 | 75 | 0.657909 | false | 4.182418 | false | false | false |
NORDUnet/opennsa | opennsa/plugins/canarie.py | 1 | 1103 | """
Plugin for Canarie specific behaviour in OpenNSA.
It creates connection ids to match the Canarie circuit id specification
Author: Henrik Thostrup Jensen < htj at nordu dot net >
Copyright: NORDUnet A/S (2017)
"""
from zope.interface import implements
from twisted.internet import defer
from twisted.python import... | bsd-3-clause | -1,350,997,038,126,927,600 | 24.651163 | 124 | 0.702629 | false | 3.777397 | false | false | false |
Sriee/Mutex | cleanup.py | 1 | 1626 | from parser import Parser
import logging
import os
import sys
class Cleanup(Parser):
nodes = None
def __init__(self, logger=None):
Parser.__init__(self, logger)
def run_cleanup(self):
if self.nodes is None:
logging.debug("Node list is None")
sys.exit(-1)
... | mit | -223,401,920,007,644,800 | 27.526316 | 68 | 0.550431 | false | 3.678733 | true | false | false |
open-austin/influence-texas | src/influencetx/tpj/migrations/0002_auto_20190311_2131.py | 1 | 2307 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-03-11 21:31
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('tpj', '0001_initial'),
]
operations = [
m... | gpl-2.0 | -2,983,531,894,821,546,000 | 40.196429 | 185 | 0.614651 | false | 3.870805 | false | false | false |
jadore801120/attention-is-all-you-need-pytorch | transformer/Layers.py | 1 | 1684 | ''' Define the Layers '''
import torch.nn as nn
import torch
from transformer.SubLayers import MultiHeadAttention, PositionwiseFeedForward
__author__ = "Yu-Hsiang Huang"
class EncoderLayer(nn.Module):
''' Compose with two layers '''
def __init__(self, d_model, d_inner, n_head, d_k, d_v, dropout=0.1):
... | mit | -8,069,912,694,578,107,000 | 39.095238 | 86 | 0.640736 | false | 2.918544 | false | false | false |
yoe/veyepar | dj/scripts/enc_gst.py | 1 | 25155 | #!/usr/bin/python
"""
assembles raw cuts into final, titles, tweaks audio, encodes to format for upload.
"""
import re
import os
import sys
import subprocess
import xml.etree.ElementTree
from mk_mlt import mk_mlt
import pprint
from process import process
from main.models import Client, Show, Location, Episode, Raw_... | mit | 8,673,503,086,801,956,000 | 36.600897 | 397 | 0.487259 | false | 4.017087 | false | false | false |
markriedl/easygen | image_modules.py | 1 | 27162 | from module import *
import requests
import os
import re
import time
import random
import pickle
import numpy as np
import math
import copy
from torchvision import transforms
from torchvision import utils
from PIL import Image
import shutil
import pdb
import subprocess
import sys
#aaah
#############################... | mit | 6,701,619,012,741,807,000 | 39.299703 | 157 | 0.542154 | false | 4.114831 | false | false | false |
gwecho/pony | pony/orm/tests/test_diagram_attribute.py | 1 | 24841 | from __future__ import absolute_import, print_function, division
from datetime import date
import unittest
from pony.orm.core import *
from pony.orm.core import Attribute
from pony.orm.tests.testutils import *
class TestAttribute(unittest.TestCase):
@raises_exception(TypeError, "Attribute Entity1.id has unknown... | agpl-3.0 | 6,420,091,538,188,851,000 | 37.935737 | 143 | 0.593656 | false | 3.835263 | true | false | false |
zekearneodo/ephys-tools | ephysScripts/analysis/stimulus.py | 1 | 25666 | import numpy as np
import scipy.io as sio
import scipy as sp
import os
import socket
import sys
import matplotlib.pyplot as plt
import matplotlib
comp_name=socket.gethostname()
if comp_name == 'Ezequiels-MacBook-Pro.local':
print 'Computer: ' + comp_name
sys.path.append('/Users/zeke/experiment/ephysDataManage... | gpl-2.0 | -8,904,007,205,171,076,000 | 39.548183 | 168 | 0.551352 | false | 3.060577 | false | false | false |
scavarda/mysql-dbcompare | mysql-utilities-1.6.0/mysql/fabric/checkpoint.py | 1 | 18840 | #
# Copyright (c) 2013,2014, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the... | apache-2.0 | -6,920,952,479,140,812,000 | 35.582524 | 79 | 0.607219 | false | 4.277929 | false | false | false |
pombreda/https-gitorious.org-appstream-figment | cptmatch/distro/fedora.py | 1 | 1867 |
from distro import *
import requests
import os
import json
BASE_URL = "https://apps.fedoraproject.org/packages/fcomm_connector"
def _make_request(path, query):
""" Internal util function to make a request of the connector API. """
query_as_json = json.dumps(query)
url = "/".join([BASE_URL, path, query_as... | gpl-3.0 | 1,644,396,117,969,292,300 | 28.171875 | 89 | 0.54151 | false | 3.963907 | false | false | false |
erdincay/pyload | module/plugins/hoster/EuroshareEu.py | 6 | 2197 | # -*- coding: utf-8 -*-
import re
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class EuroshareEu(SimpleHoster):
__name__ = "EuroshareEu"
__type__ = "hoster"
__version__ = "0.30"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?euroshare\.(eu|sk|cz|... | gpl-3.0 | -4,623,037,890,310,080,000 | 34.387097 | 116 | 0.574294 | false | 3.085795 | false | false | false |
JamesMura/elections | apollo/manage/permissions.py | 1 | 3138 | from flask import g
from flask.ext.script import Command, prompt_choices
from flask.ext.principal import Permission
from ..frontend import permissions
from .. import models, services
class AddPermissionToRole(Command):
'''Adds a specified permission to a role'''
def run(self):
deployments = models.De... | gpl-3.0 | 3,551,673,377,935,599,000 | 35.068966 | 74 | 0.607075 | false | 3.96713 | false | false | false |
coder006/BinPy | BinPy/examples/Sequential/TFlipFlop.py | 1 | 2462 | # Example for TFlipFlop
from __future__ import print_function
from BinPy.Sequential.sequential import TFlipFlop
from BinPy.tools.digital import Clock
from BinPy.Gates import Connector
from BinPy.tools.oscilloscope import Oscilloscope
toggle = Connector(1)
p = Connector(0)
q = Connector(1)
# Initialize the clock
clo... | bsd-3-clause | -5,724,406,418,794,348,000 | 20.596491 | 57 | 0.630788 | false | 3.144317 | false | false | false |
wcmitchell/insights-core | insights/parsers/tests/test_nsswitch_conf.py | 2 | 2028 | from insights.parsers.nsswitch_conf import NSSwitchConf
from insights.tests import context_wrap
NSSWITCH = """
# To use db, put the "db" in front of "files" for entries you want to be
# looked up first in the databases
#
# Example:
#passwd: db files nisplus nis
#shadow: db files nisplus nis
#group: db files ... | apache-2.0 | -7,201,680,289,910,969,000 | 27.56338 | 79 | 0.658284 | false | 3.144186 | false | false | false |
poeliu/Pinso | script/src/proto/core/static_info_pb2.py | 1 | 7432 | # Generated by the protocol buffer compiler. DO NOT EDIT!
from google.protobuf import descriptor
from google.protobuf import message
from google.protobuf import reflection
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
DESCRIPTOR = descriptor.FileDescriptor(
name='core/static_info... | apache-2.0 | 667,179,297,198,939,400 | 33.091743 | 627 | 0.69887 | false | 3.1639 | false | false | false |
bit-ml/pytorch-hacks | async-optimization/shared-optim.py | 1 | 13924 | """This script demonstrates multi-process optimization using one of
the following:
- Adadelta
- Adagrad
- Adam
- ASGD
- SGD
- Rprop
- RMSprop
This script doesn't work with:
- LBFGS - it requires a closure function
- Adamax - uses a new tensor for `exp_inf`
The async version uses locks in order to replicat... | mit | -8,492,672,524,522,462,000 | 32.073634 | 80 | 0.561477 | false | 3.801256 | false | false | false |
OCHA-DAP/dap-scrapers | echo.py | 1 | 1728 | import dl
import messytables
import xypath
import orm
from header import headerheader
"""Value: dsID, region, indID, period, value, source, is_number
DataSet: dsID, last_updated, last_scraped, name
Indicator: indID, name, units
"""
baseurl = 'http://ec.europa.eu/echo/files/policies/strategy/gna_2012_2013.xls... | unlicense | -5,935,813,037,597,532,000 | 30.418182 | 89 | 0.612847 | false | 3.031579 | false | false | false |
zaycev/wikiref | scripts/run_index_class_search.py | 1 | 2687 | #!/usr/bin/env python
# coding: utf-8
# Copyright (C) USC Information Sciences Institute
# Author: Vladimir M. Zaytsev <zaytsev@usc.edu>
# URL: <http://nlg.isi.edu/>
# For more information, see README.md
# For license information, see LICENSE
"""
This scripts creates inverted index which maps from label words into ya... | mit | -107,452,611,317,921,060 | 27 | 110 | 0.685895 | false | 3.241255 | false | false | false |
ConPaaS-team/conpaas | conpaas-director/cpsdirector/idp.py | 1 | 9821 | """
cpsdirector.idp
=======================
ConPaaS director: interface with (OpenID) identification/authentication/authorization providers
:copyright: (C) 2014 by Contrail Consortium.
"""
import ConfigParser
import pprint
from flask import Blueprint
import flask_openid
#from flask import Flask, ren... | bsd-3-clause | 5,230,973,888,278,553,000 | 39.25 | 122 | 0.594848 | false | 3.559623 | false | false | false |
kinow-io/kinow-python-sdk | kinow_client/models/product_price_prices.py | 1 | 4320 | # coding: utf-8
"""
Kinow API
Client API for Kinow back-office
OpenAPI spec version: 1.4.18
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class ProductPricePrices(object):
"""
NO... | apache-2.0 | 6,097,378,070,101,319,000 | 25 | 77 | 0.516898 | false | 4.385787 | false | false | false |
pombredanne/srvup-rest-framework | src/srvup/settings.py | 2 | 5110 | """
Django settings for srvup project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
impo... | apache-2.0 | -3,717,764,330,451,802,000 | 24.678392 | 273 | 0.700783 | false | 3.085749 | false | false | false |
nortikin/sverchok | utils/geom.py | 1 | 77963 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | gpl-3.0 | 7,191,595,973,804,418,000 | 31.430532 | 130 | 0.556418 | false | 3.316869 | false | false | false |
moorescloud/holideck | iotas/toggler.py | 3 | 1898 | #!/usr/bin/python
#
"""
Poll the switch on GPIO0, when changes, send an event out via HTTP.
Homepage and documentation: http://dev.moorescloud.com/
Copyright (c) 2013, Mark Pesce.
License: MIT (see LICENSE for details)
"""
__author__ = 'Mark Pesce'
__version__ = '0.01-dev'
__license__ = 'MIT'#
#
# Implementation sp... | mit | -4,831,292,321,315,226,000 | 24.648649 | 83 | 0.64647 | false | 2.727011 | false | false | false |
Jumpscale/jumpscale_core8 | lib/JumpScale/clients/influxdb_/Influxdb2.py | 1 | 1863 | from JumpScale import j
from influxdb import client as influxdb
import requests
from requests.auth import HTTPBasicAuth
class InfluxdbFactory:
"""
"""
def __init__(self):
self.__jslocation__ = "j.clients.influxdb"
pass
def get(self, host='localhost', port=8086, username='root', pas... | apache-2.0 | -4,430,096,092,738,017,300 | 39.5 | 124 | 0.629093 | false | 3.541825 | false | false | false |
jamestwebber/scipy | scipy/optimize/_minimize.py | 1 | 36974 | """
Unified interfaces to minimization algorithms.
Functions
---------
- minimize : minimization of a function of several variables.
- minimize_scalar : minimization of a function of one variable.
"""
from __future__ import division, print_function, absolute_import
__all__ = ['minimize', 'minimize_scalar']
from wa... | bsd-3-clause | 6,960,430,552,332,295,000 | 43.600724 | 89 | 0.639368 | false | 3.973563 | false | false | false |
adityaatluri/Urutu | samples/black_scholes.py | 2 | 1693 | """
This file runs BlackScholes algorithm on GPU
Created by: Aditya Atluri
"""
from Urutu import *
import numpy as np
@Urutu("gpu")
def black_scholes(si, xi, ti, d1, d2, call_result, put_result, sqrt_ti):
A1 = 0.31938153
A2 = -0.356563782
A3 = 1.781477937
A4 = -1.821255978
A5 = 1.330274429
RSQRT2PI = 0.398942280... | apache-2.0 | 6,313,500,952,509,067,000 | 31.557692 | 101 | 0.587123 | false | 1.989424 | false | false | false |
botswana-harvard/edc-call-manager | edc_call_manager/actions.py | 1 | 1064 | from django.apps import apps as django_apps
from django.contrib import messages
from django.contrib.messages.constants import WARNING
from django.core.urlresolvers import reverse
from django.http.response import HttpResponseRedirect
def call_participant(modeladmin, request, queryset):
"""
Redirects to a new o... | gpl-2.0 | -5,189,245,422,672,569,000 | 45.26087 | 118 | 0.675752 | false | 3.81362 | false | false | false |
adamdempsey90/fargo3d | utils/python/fargo3d.py | 1 | 7933 | import matplotlib.pyplot as plt
import numpy as np
from matplotlib.mlab import griddata
class field:
"""This class allows "allocate and plot" a 2D FARGO3D scalar field."""
def __init__(self, input_file):
"""input_file = String, FARGO3D output field
option = XY, XZ, YZ
"""
sel... | gpl-3.0 | -4,808,296,697,327,549,000 | 39.269036 | 104 | 0.494895 | false | 3.260584 | false | false | false |
VDBWRAIR/miseq_sync | redsample/redsample/test/common.py | 1 | 4178 | from mock import Mock, patch, MagicMock
from nose.tools import eq_, ok_, raises, timed
from nose.plugins.attrib import attr
import tempfile
from os.path import *
import sys
import os
TEST_PROJECT = {
'id': 20,
'name': 'Redmine Samples',
'identifier': 'redsampletest',
}
from StringIO import StringIO
issu... | gpl-2.0 | 5,423,600,379,129,693,000 | 31.387597 | 115 | 0.477741 | false | 3.861368 | false | false | false |
openpolis/open_municipio | open_municipio/om/management/commands/importvotations.py | 1 | 9466 | # -*- coding: utf-8 -*-
## DEPRECATED - use import tasks in instances
from optparse import make_option
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from django.core.management.base import LabelCommand, CommandError, BaseCommand
from lxml import etree
from os import path
from open_mu... | agpl-3.0 | -6,021,447,218,563,054,000 | 40.517544 | 120 | 0.521234 | false | 4.103164 | false | false | false |
lemire/PeachPy | codegen/x86_64_nacl_test.py | 6 | 4026 | # This file is part of Peach-Py package and is licensed under the Simplified BSD license.
# See license.rst for the full text of the license.
from __future__ import print_function
from opcodes.x86_64 import *
from codegen.code import CodeWriter, CodeBlock
import operator
import json
instruction_set = read_instruc... | bsd-2-clause | -9,080,630,073,920,570,000 | 34.324561 | 139 | 0.554645 | false | 3.252019 | false | false | false |
franklingu/leetcode-solutions | questions/first-bad-version/Solution.py | 1 | 1499 | """
You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are also bad.
Suppose you have n versions [1, 2, ..., n] an... | mit | -8,286,148,983,256,359,000 | 26.703704 | 269 | 0.616722 | false | 3.944591 | false | false | false |
bodacea/opendatatools | ckandump/ckan_calls.py | 1 | 3584 | #!/usr/bin/env python
'''
Add and access data in CKAN2.0 instance (e.g. datahub.io)
References include:
* http://docs.ckan.org/en/ckan-2.0/api.html
* http://ckan.readthedocs.org/en/ckan-1.7.1/using-data-api.html
Sara-Jayne Terp, 2013
'''
import urllib2
import urllib
import json
import pickle
import ckanclient
import... | gpl-3.0 | 4,392,138,272,782,993,400 | 26.151515 | 81 | 0.688058 | false | 3.097666 | false | false | false |
jbeyerstedt/RIOT-OTA-update | examples/ota_update/test3.py | 1 | 10207 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2017 Jannik Beyerstedt <jannik.beyerstedt@haw-hamburg.de>
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
# module for integration in ... | lgpl-2.1 | -1,237,689,363,706,966,300 | 34.440972 | 142 | 0.631625 | false | 3.522084 | true | false | false |
ychen820/microblog | flask/lib/python2.7/site-packages/setuptools/tests/test_markerlib.py | 148 | 2057 | import os
import pytest
class TestMarkerlib:
@pytest.mark.importorskip('ast')
def test_markers(self):
from _markerlib import interpret, default_environment, compile
os_name = os.name
assert interpret("")
assert interpret("os.name != 'buuuu'")
assert interpret("os_n... | bsd-3-clause | 5,256,952,237,440,545,000 | 31.650794 | 78 | 0.561497 | false | 4.321429 | true | false | false |
Asurada2015/TFAPI_translation | array_ops/tf_split.py | 1 | 2512 | """def split(value, num_or_size_splits, axis=0, num=None, name="split"):
Splits a tensor into sub tensors.
If `num_or_size_splits` is a scalar, `num_split`, then splits `value` along
dimension `axis` into `num_split` smaller tensors.
Requires that `num_split` evenly divides `value.shape[axis]`.
If `num_or_s... | apache-2.0 | -5,398,992,077,907,985,000 | 39.872727 | 79 | 0.684164 | false | 2.623104 | false | false | false |
sharmaashish/datacafe | documentation/conf.py | 1 | 10848 | # -*- coding: utf-8 -*-
#
# ISB Cancer Genomics Cloud documentation build configuration file, created by
# sphinx-quickstart on Mon Dec 21 07:12:04 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogen... | apache-2.0 | -8,875,353,667,722,748,000 | 32.174312 | 90 | 0.697179 | false | 3.613591 | true | false | false |
tyb0807/angr | angr/engines/vex/statements/loadg.py | 1 | 2419 | from .... import sim_options as o
from ....state_plugins.sim_action_object import SimActionObject
from ....state_plugins.sim_action import SimActionData
from . import SimIRStmt, SimStatementError
class SimIRStmt_LoadG(SimIRStmt):
def _execute(self):
addr = self._translate_expr(self.stmt.addr)
alt ... | bsd-2-clause | -1,183,747,510,038,469,000 | 50.468085 | 162 | 0.622158 | false | 3.440967 | false | false | false |
SheffieldML/GPyOpt | GPyOpt/experiment_design/random_design.py | 1 | 3162 | import numpy as np
from .base import ExperimentDesign
from ..core.task.variables import BanditVariable, DiscreteVariable, CategoricalVariable
class RandomDesign(ExperimentDesign):
"""
Random experiment design.
Random values for all variables within the given bounds.
"""
def __init__(self, space):... | bsd-3-clause | -1,849,097,804,386,503,200 | 40.077922 | 110 | 0.652119 | false | 4.090556 | false | false | false |
ZeitOnline/zeit.content.quiz | src/zeit/content/quiz/question.py | 1 | 1712 | import lxml.etree
import rwproperty
import zeit.cms.content.property
import zeit.content.quiz.container
import zeit.content.quiz.interfaces
import zeit.content.quiz.quiz
import zeit.wysiwyg.html
import zope.app.container.interfaces
import zope.component
import zope.interface
QUESTION_TEMPLATE = u"""\
<question xmlns:... | bsd-3-clause | -3,418,430,081,019,524,600 | 28.016949 | 71 | 0.680491 | false | 3.61945 | false | false | false |
emsrc/daeso-framework | lib/daeso/thirdparty/GenericCache/decorators.py | 1 | 1815 | ## -*- coding: utf-8 -*-
################################################################
## Author : Gaël Le Mignot
## Email : gael@pilotsystems.net
################################################################
__author__ = "gael@pilotsystems.net"
__format__ = "plaintext"
__version__ = "$Id: decorators.py 1269 201... | gpl-3.0 | -5,026,744,118,094,486,000 | 28.737705 | 94 | 0.521499 | false | 3.85138 | false | false | false |
crockeo/treestuff | trie_in_py/boggle.py | 1 | 1450 | import datrie
import string
board = [
'tllboi',
'eonvz',
'tomws',
'agnup',
'sdijt']
dictionary = '../dictionaries/dictionary.txt'
words = {}
trie = datrie.Trie(string.ascii_lowercase)
first_letters = {}
with open(dictionary, 'r') as f:
for line in f.readlines():
line = line.strip()
... | mit | -2,260,983,717,363,542,000 | 22.387097 | 80 | 0.55931 | false | 3.280543 | false | false | false |
erdc/proteus | proteus/tests/test_CompQuad.py | 1 | 10373 | from __future__ import division
from builtins import range
from past.utils import old_div
from proteus import (Comm, Profiling, Quadrature)
from proteus.Profiling import logEvent
import os
import sys
comm = Comm.get()
Profiling.procID = comm.rank()
Profiling.logFile = sys.stdout
Profiling.logLevel = 2
Profiling.verbos... | mit | 8,107,873,759,965,472,000 | 31.619497 | 103 | 0.509689 | false | 3.3014 | true | false | false |
tcarver/django-elastic | elastic/management/loaders/criteria.py | 2 | 7497 | ''' Old web-site criteria builder. '''
from elastic.management.loaders.loader import JSONLoader, MappingProperties
import requests
import logging
# Get an instance of a logger
logger = logging.getLogger(__name__)
class CriteriaManager(JSONLoader):
''' Code to generate criteria index used in the old web-site. '''... | gpl-3.0 | -2,356,819,968,906,480,600 | 39.524324 | 116 | 0.54982 | false | 3.746627 | false | false | false |
mverwe/JetRecoValidation | PuThresholdTuning/python/akPu2CaloJetSequence05_cff.py | 1 | 1328 | import FWCore.ParameterSet.Config as cms
from HeavyIonsAnalysis.JetAnalysis.jets.akPu2CaloJetSequence_PbPb_mc_cff import *
#PU jets: type 05
akPu2Calomatch05 = akPu2Calomatch.clone(src = cms.InputTag("akPu2CaloJets05"))
akPu2Caloparton05 = akPu2Caloparton.clone(src = cms.InputTag("akPu2CaloJets05"))
akPu2Calocorr05 =... | cc0-1.0 | -5,037,889,387,695,933,000 | 54.333333 | 136 | 0.568524 | false | 3.295285 | false | true | false |
jjaner/essentia-musicbricks | packaging/darwin/extras/python_version.py | 10 | 1129 | #!/usr/bin/env python
# Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation (FSF), e... | agpl-3.0 | 6,871,705,763,842,626,000 | 31.257143 | 79 | 0.720106 | false | 3.701639 | false | false | false |
molobrakos/home-assistant | tests/components/openalpr_local/test_image_processing.py | 8 | 5261 | """The tests for the openalpr local platform."""
import asyncio
from unittest.mock import patch, PropertyMock, MagicMock
from homeassistant.core import callback
from homeassistant.const import ATTR_ENTITY_PICTURE
from homeassistant.setup import setup_component
import homeassistant.components.image_processing as ip
fr... | apache-2.0 | -4,282,292,395,106,367,000 | 30.692771 | 78 | 0.552366 | false | 4.116588 | true | false | false |
RaulButuc/MachineLearning | ConvolutionalNeuralNetworks/ObjectRecognition-10/train.py | 1 | 2902 | import time
import build_model
import tensorflow as tf
from datetime import datetime
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_string('train_dir', '/tmp/cnn-object-recognition-10_train',
'''Directory where to write event logs '''
'''and checkpoint''')
tf.app.... | mit | 4,531,028,286,430,515,000 | 32.356322 | 79 | 0.606823 | false | 3.838624 | false | false | false |
argaen/aiocache | examples/optimistic_lock.py | 1 | 1360 | import asyncio
import logging
import random
from aiocache import Cache
from aiocache.lock import OptimisticLock, OptimisticLockError
logger = logging.getLogger(__name__)
cache = Cache(Cache.REDIS, endpoint='127.0.0.1', port=6379, namespace='main')
async def expensive_function():
logger.warning('Expensive is be... | bsd-3-clause | 2,668,939,670,850,364,000 | 27.93617 | 93 | 0.677941 | false | 3.919308 | false | false | false |
tartavull/google-cloud-python | pubsub/google/cloud/pubsub/client.py | 1 | 11347 | # Copyright 2015 Google 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, ... | apache-2.0 | -8,498,135,206,974,078,000 | 38.814035 | 86 | 0.617079 | false | 4.474369 | false | false | false |
scikit-optimize/scikit-optimize | skopt/learning/tests/test_gbrt.py | 1 | 3289 | import numpy as np
import pytest
from scipy import stats
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.ensemble import RandomForestRegressor
from numpy.testing import assert_equal
from numpy.testing import assert_array_equal
from numpy.testing import assert_almost_equal
from skopt.learning imp... | bsd-3-clause | -6,867,972,686,880,386,000 | 28.106195 | 73 | 0.660383 | false | 3.298897 | true | false | false |
josephharrington/ClusterRunner | app/util/secret.py | 2 | 2419 | import hmac
class Secret:
DIGEST_HEADER_KEY = 'Clusterrunner-Message-Authentication-Digest'
_secret = None
@classmethod
def get(cls):
"""
:return: The secret that was set with the set(secret) method
:rtype: str
"""
return cls._secret
@classmethod
def s... | apache-2.0 | 1,278,138,903,581,759,700 | 34.573529 | 115 | 0.625878 | false | 4.51306 | false | false | false |
dgnorth/drift | drift/management/commands/ami.py | 1 | 28249 | """
Build an AWS AMI for this service
"""
import os
import sys
import time
import subprocess
import operator
import pkg_resources
import json
from datetime import datetime, timedelta
import pytz
import random
import shlex
import tempfile
from click import echo, secho
import six
from six import print_
try:
# boto ... | mit | 8,783,450,152,855,522,000 | 34.848985 | 134 | 0.596694 | false | 3.749038 | true | false | false |
dayatz/taiga-back | taiga/importers/services.py | 1 | 2128 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can r... | agpl-3.0 | -2,474,317,548,121,811,500 | 39.884615 | 84 | 0.671214 | false | 3.749559 | false | false | false |
Flex0s/LD38 | src/enemy.py | 1 | 2092 | '''
Created on 23.04.2017
@author: Flex
'''
# be careful, change also in enemy.py! not global!
ENEMY_INFO = ['low', 'medium', 'hard', 'flying', 'boss']
CONST_ENEMY_DAMAGE = [0.5, 0.6, 1, 0.6, 5]
CONST_ENEMY_RANGE = [40, 40, 40, 40, 40]
CONST_ENEMY_SPEED = [0.4, 0.8, 0.5, 0.6, 0.2]
CONST_ENEMY_LOOT = [2, 5, 4, 7, 35]
C... | mit | 2,552,924,774,566,718,000 | 22.516854 | 133 | 0.561185 | false | 3.228395 | false | false | false |
sjhonatan/intro-python | 20-class/arquivos.py | 1 | 1374 | """
Jhonatan da Silva
Last Updated version :
Tue Jan 31 22:35:52 2017
Number of code lines:
45
"""
class Arquivos():
def __init__(self):
self.path = './arquivosTexto/'
def criarDir(self):
import os
print('criar diretorio : ',self.path)
print('[s | n]')
op = inp... | mit | -287,161,348,163,801,300 | 25.423077 | 49 | 0.431587 | false | 3.892351 | false | false | false |
mxtthias/mcomix | mcomix/edit_image_area.py | 1 | 5115 | """edit_image_area.py - The area of the editing archive window that displays images."""
import os
import gtk
from mcomix import i18n
from mcomix import image_tools
from mcomix import thumbnail_tools
class _ImageArea(gtk.ScrolledWindow):
"""The area used for displaying and handling image files."""
def __ini... | gpl-2.0 | -7,008,885,080,636,634,000 | 35.276596 | 87 | 0.615054 | false | 3.728134 | false | false | false |
beniwohli/apm-agent-python | tests/instrumentation/cassandra_tests.py | 1 | 6423 | # BSD 3-Clause License
#
# Copyright (c) 2019, Elasticsearch BV
# 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, t... | bsd-3-clause | 8,677,407,193,698,500,000 | 38.164634 | 121 | 0.705901 | false | 3.911693 | true | false | false |
teeheee/RobocupSoccerSimulator | RobotPrograms/hard_python/main.py | 1 | 4308 | import numpy as np
from robotRemote import RobotControl
#TODO make a realy good robot program
class Position:
def __init__(self,x,y,px,py):
self.x = x
self.y = y
self.px = px
self.py = py
class SensorValues:
def __init__(self,robot:RobotControl):
self.robot = robot
... | gpl-3.0 | 848,302,606,373,074,400 | 29.764286 | 83 | 0.557826 | false | 2.990278 | false | false | false |
jjuanda/dict_differ | dict_differ/DictDiffer.py | 1 | 2191 |
class DictDiffer(object):
"""docstring for DictDiffer"""
def __init__(self, dbase, dnew, ign_keys=[]):
super(DictDiffer, self).__init__()
self.dbase = dbase
self.dnew = dnew
self.ccmp = None
self.ign_keys = ign_keys
def compare(self):
kbase = s... | gpl-2.0 | 5,545,556,967,417,956,000 | 29.859155 | 94 | 0.552716 | false | 2.997264 | false | false | false |
fcecin/infinitum | qa/rpc-tests/mempool_resurrect_test.py | 1 | 3173 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test resurrection of mined transactions when
# the blockchain is re-organized.
#
from test_framework... | mit | 748,412,070,169,354,900 | 38.17284 | 105 | 0.638197 | false | 3.622146 | true | false | false |
steppenwolf-sro/callback-schedule | setup.py | 1 | 1195 | import os
from setuptools import find_packages, setup
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-callback',
ve... | mit | -4,918,865,981,952,828,000 | 33.142857 | 78 | 0.625105 | false | 3.905229 | false | false | false |
nuclear-wizard/moose | python/peacock/Input/ParamsByGroup.py | 15 | 4680 | #* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgpl-2.1.html
from PyQt5.... | lgpl-2.1 | -6,271,035,675,181,856,000 | 31.5 | 78 | 0.595299 | false | 3.919598 | false | false | false |
sunlightlabs/calloncongress | calloncongress/settings.py | 1 | 1695 | import os
# Define any global settings here
DEBUG = True
LANGUAGES = (
('en', 'English'),
('es', 'Spanish'),
('eo', 'Esperanto'),
)
DEFAULT_LANGUAGE = 'en'
DEFAULT_VOICE = 'female'
UPCOMING_BILL_DAYS = 14
INPUT_TIMEOUT = 10
PROJECT_ROOT = os.path.dirname(os.path.realpath(__file__))
import sunlight.services... | bsd-3-clause | 2,972,325,472,487,173,000 | 34.3125 | 100 | 0.539233 | false | 4.026128 | false | false | false |
nlextract/NLExtract | bag/src/geocode/GeoCode-pc-hn-hl-tv.py | 2 | 9909 | import os
import io
import csv
#import time
import codecs
import psycopg2
from psycopg2.extensions import AsIs
from decimal import Decimal
import sys
#set default args as -h , if no args:
if len(sys.argv) == 1: sys.argv[1:] = ["-h"]
if sys.argv[1] == "-h":
print('Usage: '+os.path.basename(sys.argv[0])+' <input f... | gpl-3.0 | -8,388,635,066,686,844,000 | 47.336585 | 432 | 0.632153 | false | 2.7525 | false | false | false |
RCollins13/10XWGS | getMolecules.py | 1 | 4205 | #!/usr/bin/env python
# Copyright (c) 2016 Ryan Collins <rcollins@chgr.mgh.harvard.edu>
# Distributed under terms of the MIT license.
"""
Estimate original molecule sizes and coordinates from 10X linked-read WGS barcodes
"""
import argparse
from collections import defaultdict, Counter, namedtuple
from subprocess imp... | mit | 8,945,344,350,440,825,000 | 34.635593 | 86 | 0.605707 | false | 3.982008 | false | false | false |
moto-timo/robotframework | utest/utils/test_etreesource.py | 1 | 1821 | import os
import unittest
from robot.utils.asserts import assert_equals, assert_true
from robot.utils.etreewrapper import ETSource, ET
from robot.utils import IRONPYTHON, PY3
PATH = os.path.join(os.path.dirname(__file__), 'test_etreesource.py')
if PY3:
unicode = str
class TestETSource(unittest.TestCase):
... | apache-2.0 | 7,466,027,437,537,654,000 | 30.396552 | 70 | 0.627128 | false | 3.620278 | true | false | false |
barentsen/dave | blsCode/bls_generic.py | 1 | 5011 | from __future__ import division, print_function
import numpy as np
import yash_bls
def doSearch(time, flux, minPeriod, maxPeriod, ):
SNR, period, epoch, duration, depth, transitModel, period_guesses, \
convolved_bls = yash_bls.do_bls_and_fit(time, flux, minPeriod, maxPeriod)
phase, phasedFlux = ... | mit | 7,950,799,135,358,470,000 | 44.563636 | 132 | 0.632209 | false | 2.738251 | false | false | false |
ericdill/pyqtgraph | examples/multiprocess.py | 28 | 1531 | # -*- coding: utf-8 -*-
import initExample ## Add path to library (just for examples; you do not need this)
import numpy as np
import pyqtgraph.multiprocess as mp
import pyqtgraph as pg
import time
print("\n=================\nStart Process")
proc = mp.Process()
import os
print("parent:", os.getpid(), "child:", proc... | mit | 2,862,581,501,480,114,700 | 24.949153 | 83 | 0.676029 | false | 3.196242 | false | false | false |
syci/domsense-agilebg-addons | account_voucher_cash_basis/account_voucher.py | 1 | 6141 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012 Domsense s.r.l. (<http://www.domsense.com>).
# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
#
# This program is ... | gpl-2.0 | -347,204,133,144,679,100 | 49.336066 | 178 | 0.567009 | false | 4.129792 | false | false | false |
npmccallum/sssd | src/tests/intg/ds.py | 6 | 2011 | #
# Abstract directory server instance class
#
# Copyright (c) 2015 Red Hat, Inc.
# Author: Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; e... | gpl-3.0 | 445,551,972,707,020,350 | 33.084746 | 78 | 0.636499 | false | 4.07085 | false | false | false |
luci/luci-py | client/third_party/google/oauth2/_service_account_async.py | 4 | 5131 | # Copyright 2020 Google LLC
#
# 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, ... | apache-2.0 | -6,960,403,226,066,628,000 | 37.871212 | 88 | 0.708244 | false | 4.552795 | false | false | false |
kadhikari/navitia | source/jormungandr/jormungandr/georef.py | 2 | 5482 | # Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public t... | agpl-3.0 | -1,343,113,957,046,464,500 | 40.847328 | 95 | 0.64429 | false | 3.691582 | false | false | false |
PredictiveScienceLab/cluster-opt-bgo | geometry.py | 1 | 4262 | """
Some functions that deal with the geometry of clusters.
Author:
Ilias Bilionis
Date:
7/18/2015
"""
__all__ = ['sample_coordinates', 'sample_many_coordinates',
'get_distance_matrices', 'usample', 'floyd', 'mme',
'usample_many']
import numpy as np
import scipy.spatial as spt
impo... | mit | 9,072,518,647,239,756,000 | 26.503226 | 83 | 0.4458 | false | 2.822517 | false | false | false |
deapplegate/wtgpipeline | dump_cat_filters_pickles.py | 1 | 1651 | #!/usr/bin/env python
#########################
# Read a catalog, and dump all filters that match
# Instrum-config-chipid-filter pattern
#########################
import utilities, sys, ldac, re
from optparse import OptionParser
##########################
__cvs_id__ = "$Id: dump_cat_filters_pickles.py,v 1.1 201... | mit | 7,164,544,609,390,291,000 | 23.279412 | 84 | 0.568746 | false | 3.769406 | false | false | false |
robcarver17/pysystemtrade | sysdata/production/trade_limits.py | 1 | 7262 | """
We want to limit the number of trades we expect to do in a given period (usually a day, but could be longer if
eg going on holiday)
Limits per contract don't make sense, but it makes sense to limit (a) the number of times a given instrument
within a strategy can be traded and (b) the number of times an instru... | gpl-3.0 | -2,095,590,583,733,698,000 | 37.221053 | 110 | 0.678739 | false | 3.99011 | false | false | false |
williain/scratchtest | scripts/threadtest.py | 1 | 1505 | #!/usr/bin/env python
import time
import threading
import multiprocessing
class nothread(object):
def foo(self):
start=time.time()
b=[]
for i in range(1000000):
b.append(i*i)
print type(self),"Timing",str(time.time()-start)+'s'
class threaded(nothread):
def foo(sel... | bsd-2-clause | -3,356,726,196,413,431,300 | 24.083333 | 67 | 0.560797 | false | 3.532864 | false | false | false |
ski7777/ftcommunity-apps | packages/barometer-bmp180/Adafruit_GPIO/GPIO.py | 13 | 17147 | # Copyright (c) 2014 Adafruit Industries
# Author: Tony DiCola
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, m... | gpl-3.0 | 3,554,363,038,379,411,000 | 39.251174 | 100 | 0.617951 | false | 3.866291 | false | false | false |
OpenEdgeComputing/elijah-openstack | dashboard/images/forms.py | 2 | 5649 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | apache-2.0 | 9,060,359,720,257,803,000 | 43.833333 | 105 | 0.465038 | false | 5.405742 | false | false | false |
celery/kombu | t/unit/asynchronous/aws/test_connection.py | 2 | 9131 | from io import StringIO
import pytest
from contextlib import contextmanager
from unittest.mock import Mock
from vine.abstract import Thenable
from kombu.exceptions import HttpError
from kombu.asynchronous import http
from kombu.asynchronous.aws.connection import (
AsyncHTTPSConnection,
AsyncHTTPResponse,
... | bsd-3-clause | 6,099,404,881,378,503,000 | 31.151408 | 79 | 0.612529 | false | 3.830117 | true | false | false |
hparik11/Deep-Learning-Nanodegree-Foundation-Repository | reinforcement/gym/gym/envs/tests/test_registration.py | 4 | 1378 | # -*- coding: utf-8 -*-
from gym import error, envs
from gym.envs import registration
from gym.envs.classic_control import cartpole
def test_make():
env = envs.make('CartPole-v0')
assert env.spec.id == 'CartPole-v0'
assert isinstance(env.unwrapped, cartpole.CartPoleEnv)
def test_make_deprecated():
try... | mit | -6,783,490,305,008,143,000 | 26.48 | 95 | 0.647016 | false | 3.435 | true | false | false |
goldeneye-source/ges-python | stubs/GEAiCond.py | 1 | 2615 | ################ Copyright 2005-2016 Team GoldenEye: Source #################
#
# This file is part of GoldenEye: Source's Python Library.
#
# GoldenEye: Source's Python Library is free software: you can redistribute
# it and/or modify it under the terms of the GNU General Public License as
# published by the Free So... | gpl-3.0 | -2,413,276,382,795,445,000 | 28.382022 | 78 | 0.638241 | false | 2.968218 | false | false | false |
hoechenberger/psychopy | psychopy/app/connections/updates.py | 1 | 27550 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2018 Jonathan Peirce
# Distributed under the terms of the GNU General Public License (GPL).
from __future__ import absolute_import, division, print_function
from builtins import object
import sys
import re
import glob
import... | gpl-3.0 | -1,160,379,440,864,769,300 | 42.114241 | 95 | 0.563267 | false | 4.205465 | true | false | false |
MisterGlass/SVStatus | getData.py | 1 | 1647 | #!/usr/bin/python
import MySQLdb as mdb
def logPlanetCount(player):
con = mdb.connect('localhost', 'user', 'password', 'dbname')
cur = con.cursor()
if(cur.execute("select * from planet_stats where round=%d and tic=%d and username='%s'" % (player['round'],player['tic'],player['username'])) == 0):
cur.e... | gpl-3.0 | -7,077,016,245,850,647,000 | 40.230769 | 201 | 0.679417 | false | 3.395876 | false | false | false |
drewsonne/yum2s3 | yum2s3/__init__.py | 1 | 1819 | from yum2s3 import auth
from yum2s3.path import expand
from yum2s3.syncer import Syncer
__author__ = 'drews'
import click
@click.command()
@click.option('--aws-access-key-id', envvar='AWS_ACCESS_KEY_ID', help='AWS access key')
@click.option('--aws-secret-access-key', envvar='AWS_SECRET_ACCESS_KEY',
he... | gpl-2.0 | -6,174,751,183,124,977,000 | 40.340909 | 133 | 0.671798 | false | 3.742798 | true | false | false |
crainiarc/poker-ai-planner | poker_game.py | 1 | 14757 | import random
import copy
import logging
import collections
import traceback
from cards import Deck, n_card_rank
from messages import Event, Action
from pot import Pot
from bot_wrapper import BotWrapper
# TODO: correct handling of heads_up -> button selection etc
# TODO: logging module
# TODO: player wrapper with cr... | mit | -3,118,732,777,774,598,000 | 42.026239 | 146 | 0.557159 | false | 3.991615 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.