repo_name stringlengths 6 61 | path stringlengths 4 230 | copies stringlengths 1 3 | size stringlengths 4 6 | text stringlengths 1.01k 850k | license stringclasses 15
values | hash int64 -9,220,477,234,079,998,000 9,219,060,020B | line_mean float64 11.6 96.6 | line_max int64 32 939 | alpha_frac float64 0.26 0.9 | autogenerated bool 1
class | ratio float64 1.62 6.1 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
naturalness/sensibility | sensibility/__main__.py | 1 | 3308 | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# Copyright 2017 Eddie Antonio Santos <easantos@ualberta.ca>
#
# 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/licens... | apache-2.0 | -7,140,425,813,645,337,000 | 25.894309 | 75 | 0.635127 | false | 3.564655 | false | false | false |
lyft/incubator-airflow | airflow/providers/google/cloud/example_dags/example_automl_video_intelligence_classification.py | 5 | 3497 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 | -2,503,223,521,123,196,000 | 31.990566 | 88 | 0.711467 | false | 3.511044 | false | false | false |
Mchakravartula/rockstor-core | src/rockstor/cli/iscsi_console.py | 6 | 1777 | """
Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor 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 la... | gpl-3.0 | 1,379,702,315,604,901,400 | 31.907407 | 72 | 0.667417 | false | 3.709812 | false | false | false |
vincentbernat/QCss-3 | qcss3/collector/database.py | 1 | 7154 | """
Database dumping of in-memory datastore for QCss3
This module writes to database the content of a memory datastore using
adapters. For example, if we want to write an object representing an a
load balancer (implementing C{ILoadBalancer} interface), we will use
C{IDatabaseWriter(lb).write(txn)} where C{lb} is the l... | gpl-3.0 | -3,035,962,816,937,538,000 | 40.114943 | 94 | 0.558708 | false | 4.283832 | false | false | false |
waipu/bakawipe | lib/beon/regexp.py | 1 | 2519 | ''' '''
# targetregexp = r'\/{forum}\/(\d*)-(\d*)\-[\w|\-]*([vb]-?i*-?r-?t|se(?:x|ks|kas)|eb(?:at|i)|t-?r-?a-?h|(?:-ja|ischu)-(?:m\-|j\-|zh\-|devushk|par(?:en|nja)|hozja)|ots[o|\-]s|rolevit|-sis[\-|e][kc]|v(?:-pop|du(?:i\-|va))|rabyn|droch|[ob]?liz(?:at\-|va[it])|hentai|shlju(?:hu|shk)|kisk[au]-(?:vsja|mokr)|do-orgazm|... | gpl-3.0 | -8,834,536,637,641,971,000 | 60.25 | 416 | 0.509796 | false | 2.106621 | false | false | false |
sgongar/Herschel-PACS-Toolbox-Red-Leak | pipeline_tests/case_FFRange_Sel.py | 1 | 8434 | # coding = utf-8
# specflatfielding range
# excludeleak = false
# range = [198.0, 203.0]
print "Processing second case"
lineSpec = isLineSpec(slicedCubes)
shortRange = isShortRange(obs)
slicedFrames = specFlatFieldRange(slicedFrames, useSplinesModel=True,
excludeLeaks=False, calTre... | lgpl-3.0 | 892,825,352,011,702,500 | 49.807229 | 155 | 0.602798 | false | 3.935604 | false | false | false |
fretboardfreak/space | lib/model/update.py | 1 | 4960 | # Copyright 2015 Curtis Sand
#
# 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,945,588,662,346,634,000 | 34.177305 | 79 | 0.65625 | false | 4.206955 | false | false | false |
abdoosh00/edraak | common/lib/xmodule/xmodule/modulestore/inheritance.py | 2 | 8205 | """
Support for inheritance of fields down an XBlock hierarchy.
"""
from datetime import datetime
from pytz import UTC
from xmodule.partitions.partitions import UserPartition
from xblock.fields import Scope, Boolean, String, Float, XBlockMixin, Dict, Integer, List
from xblock.runtime import KeyValueStore, KvsFieldDat... | agpl-3.0 | 2,126,278,373,199,145,500 | 36.126697 | 202 | 0.664595 | false | 4.423181 | false | false | false |
cprov/snapcraft | snapcraft/internal/build_providers/_multipass/_multipass.py | 1 | 4486 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2018 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... | gpl-3.0 | -473,096,161,636,848,000 | 38.699115 | 86 | 0.649354 | false | 3.844045 | false | false | false |
box-samples/user-management | box_manage_users/scripts/script.py | 1 | 2088 | # coding: utf-8
from __future__ import unicode_literals
import os
from py.io import TerminalWriter
from box_manage_users.tc_client import TCClient
from box_manage_users.util import setup_logging
class Script(object):
"""
Script base class.
Configures logging and outputs duck ascii art.
"""
_title... | apache-2.0 | 3,649,809,080,674,029,000 | 38.396226 | 118 | 0.598659 | false | 3.715302 | false | false | false |
tbenthompson/quadracheer | quadracheer/piessens.py | 1 | 2265 | import numpy as np
from map import map_pts_wts
from gaussian_quad import gaussxw
def piessens(N, x0, nonsingular_N = -1):
"""
Quadrature points and weights for integrating a function with form
f(x) / (x - x0)
on the interval [-1, 1]
Uses the 2N point gauss rule derived in Piessens (1970) Almost cer... | mit | 3,262,751,747,561,430,000 | 31.357143 | 76 | 0.607947 | false | 3.10274 | false | false | false |
msullivan/advent-of-code | 2020/12a.py | 1 | 1105 | #!/usr/bin/env python3
import sys
import re
def extract(s):
return [int(x) for x in re.findall(r'-?\d+', s)]
UP = (0, -1)
DOWN = (0, 1)
LEFT = (-1, 0)
RIGHT = (1, 0)
DIRS = { 'E': RIGHT, 'W': LEFT, 'N': UP, 'S': DOWN }
ROT = 'NESW'
def add(v1, v2):
return tuple(x + y for x, y in zip(v1, v2))
def mul(k, v2... | mit | 3,101,922,182,427,441,000 | 21.1 | 68 | 0.478733 | false | 2.662651 | false | false | false |
ibhubs/sketch-components | sketch_components/engines/react/native/components/image.py | 1 | 5573 | """
.. code-block:: javascript
import { Image } from 'react-native'
A Layer Group with Bitmap as child or a Shape Layer with an Image as a fill
can be tagged as **Image**. The name of the layer will be the name of the
image source generated.
"""
from sketch_components.utils import combine_styles, small_camel_cas... | mit | 5,057,059,149,163,134,000 | 42.539063 | 79 | 0.575991 | false | 4.053091 | false | false | false |
konrads/spudblog-app-engine | spudblog/views.py | 1 | 3956 | """Views, both for UI presentation and for api calls.
UI views have no prefix, api calls are prefixed with 'api'
"""
from functools import wraps
from django.shortcuts import render
from django.http import (HttpResponse, HttpResponseNotAllowed,
HttpResponseRedirect, HttpResponseForbidden,
... | bsd-3-clause | 5,498,022,839,492,439,000 | 31.966667 | 75 | 0.628665 | false | 3.874633 | false | false | false |
orgads/msys2-runtime | newlib/doc/chapter-texi2docbook.py | 9 | 1510 | #!/usr/bin/env python3
#
# python script to convert the handwritten chapter .texi files, which include
# the generated files for each function, to DocBook XML
#
# all we care about is the content of the refentries, so all this needs to do is
# convert the @include of the makedoc generated .def files to xi:include of th... | gpl-2.0 | 1,336,451,028,471,773,200 | 32.555556 | 129 | 0.554967 | false | 3.519814 | false | false | false |
darcyfdu/findlicense | src/formattedcode/format.py | 1 | 12904 | #
# Copyright (c) 2016 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... | apache-2.0 | -3,150,960,963,537,207,000 | 34.844444 | 124 | 0.640809 | false | 3.744631 | false | false | false |
StryKaizer/Brew | djangoproject/brew/migrations/0015_auto__del_field_mashlog_status__add_field_mashlog_active_mashing_step_.py | 1 | 3182 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'MashLog.status'
db.delete_column('brew_mashlog', 'status')
# Adding field 'MashLo... | isc | -7,723,776,558,796,714,000 | 47.969231 | 121 | 0.561596 | false | 3.620023 | false | false | false |
kmike/django-generic-images | generic_images/models.py | 1 | 8243 | #coding: utf-8
import os
#import random
from django.db import models
from django.contrib.auth.models import User
from django.core.files.storage import default_storage
from django.db.models import Max
from django.utils.translation import ugettext_lazy as _
from generic_images.signals import image_saved, image_deleted
... | mit | 1,550,361,170,257,904,400 | 33.927966 | 80 | 0.576247 | false | 4.389244 | false | false | false |
DataBassDroppers/291ProjectOne | Patient_Info_Update.py | 1 | 18073 | import cx_Oracle
import getpass #gets password without echoing
import random
import datetime
class Patient_Info_Update():
def __init__(self):
pass
def main(self, credentials):
self.con = cx_Oracle.connect(credentials[0] + '/' + \
credentials[... | apache-2.0 | -2,980,646,853,998,649,300 | 35.73374 | 214 | 0.409893 | false | 5.175544 | true | false | false |
our-city-app/oca-backend | src/solutions/flex/handlers.py | 1 | 18390 | # -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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 appl... | apache-2.0 | -8,495,946,109,372,370,000 | 40.418919 | 118 | 0.627569 | false | 3.914432 | false | false | false |
danielfreeman11/convex-nets | LaunchScripts/ConnectedCompsCalcWide_Debug.py | 1 | 22575 | import numpy as np
import sys
#Usage:
#python thisprog.py threshold numofnetworks
#Will randomly initialize numofnetworks neural networks and train them until the error on a training set is less than threshold
#Will then try to interpolate between these networks while keeping error below that of threshold.
#Will ... | mit | 6,229,132,581,789,846,000 | 31.896396 | 165 | 0.51247 | false | 3.336043 | true | false | false |
jephdo/grigri | grigri/tools.py | 1 | 3758 | # -*- coding: utf-8 -*-
"""
grigri.tools
~~~~~~~~~~~~~~~~~~
Miscellaneous functions for dealing with type-checking.
"""
from datetime import datetime, date
from math import pi, sin, cos, atan2, sqrt, floor, ceil
import pandas as pd
from dateutil.parser import parse
def is_null(*args):
"""
Retu... | mit | -1,809,279,128,360,851,200 | 23.887417 | 84 | 0.600585 | false | 4.089227 | false | false | false |
vimilimiv/weibo-popularity_judge-and-content_optimization | 数据处理/get_keyword_feature.py | 1 | 3446 | #-------------------------------------------------------------------------------
# coding=utf8
# Name: 模块1
# Purpose:
#
# Author: zhx
#
# Created: 10/05/2016
# Copyright: (c) zhx 2016
# Licence: <your licence>
#-------------------------------------------------------------------------------
import ... | mit | 5,607,186,483,168,549,000 | 33.707071 | 80 | 0.502619 | false | 3.26616 | false | false | false |
digmore/pypushed | pushed/pushed.py | 1 | 5114 | # encoding: utf-8
import json
import requests
BASE_URL = 'https://api.pushed.co'
API_VERSION = '1'
PUSH = 'push'
OAUTH = 'oauth'
ACCESS_TOKEN = 'oauth/access_token'
USER_AGENT = 'python-pushed/0.1.4'
class Pushed(object):
'''Pushed.co API client class.
Param: app_key -> A Pushed.co application key
... | mit | -2,296,525,638,792,235,800 | 32.86755 | 76 | 0.564333 | false | 4.319257 | false | false | false |
schluedj/bayleaf | bayleaf/likelihoods.py | 1 | 12712 | ### Likelihood storage for bayleaf
### Author: David Schlueter
### Vanderbilt University Department of Biostatistics
### July 10, 2017
import theano.tensor as tt
import numpy as np
import theano.tensor as tt
from pymc3.distributions import Continuous, draw_values, generate_samples, Bound, transforms
## Base class f... | mit | 1,360,070,279,587,922,400 | 38.962264 | 152 | 0.509443 | false | 3.299922 | false | false | false |
willmcgugan/rich | rich/live_render.py | 1 | 3658 | import sys
from typing import Optional, Tuple
if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions import Literal # pragma: no cover
from ._loop import loop_last
from .console import Console, ConsoleOptions, RenderableType, RenderResult
from .control import Control
from .se... | mit | 6,486,358,692,883,061,000 | 31.371681 | 98 | 0.556862 | false | 4.444714 | false | false | false |
micfan/dinner | src/public/migrations/0004_auto_20160124_0351.py | 1 | 2313 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-23 19:51
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('public', '0003_auto_2015051... | mit | 5,651,005,434,688,837,000 | 42.641509 | 256 | 0.60441 | false | 3.810544 | false | false | false |
esatterly/splunk-cassandra | bin/extern.py | 1 | 1279 | #!/usr/bin/env python
#
# Copyright 2011 Splunk, 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 ... | apache-2.0 | 4,965,296,529,155,139,000 | 32.657895 | 76 | 0.723221 | false | 3.97205 | false | false | false |
FactomProject/Testing | examples/python/libs/mnemonic.py | 1 | 4220 | #
# Copyright (c) 2013 Pavol Rusnak
#
# 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, modify, merge, publish, dist... | mit | 7,408,913,559,512,287,000 | 35.37931 | 133 | 0.690521 | false | 3.187311 | false | false | false |
DroneSimon/inteligencia_visual | generarImagenes.py | 1 | 2005 |
import cv2
from Perceptron1 import predict
import numpy as np
import subsampling
import Blur
def generarImagenesVideo(video,tamx,tamy):
cap = cv2.VideoCapture(video)
i = 1
while True:
ret, frame = cap.read()
i += 1
#Probar cambiando el tiempo
if i%5 ==0:
gray... | mit | -252,583,283,261,075,620 | 27.642857 | 98 | 0.47581 | false | 3.325041 | false | false | false |
fmichea/srddl | srddl/core/frontends/fe_curses.py | 1 | 6148 | import sys
import time
import string
CURSES_ON = True
try:
import urwid
except ImportError:
CURSES_ON = False
import srddl.core.frontend_loader as scf
import srddl.core.helpers as sch
import srddl.data as sd
LOGS = open('/tmp/curses_logs.txt', 'w')
def _write(*args):
LOGS.write(' '.join(str(s) for s in... | bsd-3-clause | 1,060,420,255,881,414,000 | 30.367347 | 83 | 0.523585 | false | 3.757946 | false | false | false |
necrolyte2/getshipmass | getshipstat.py | 1 | 1198 | import re
import sys
import requests
from bs4 import BeautifulSoup
URL = 'https://wiki.eveonline.com/en/wiki'
STEELPLATEMASS = 2812500
MWDMASS = 50000000
def fetch_stat(statname, shipname):
r = requests.get(URL + '/' + shipname)
soup = BeautifulSoup(r.text)
paragraphs = soup.find_all('p')
p = '{0}\s+... | mit | -5,794,873,514,477,937,000 | 26.860465 | 60 | 0.614357 | false | 2.995 | false | false | false |
onedata/web-client | bamboos/docker/environment/s3.py | 2 | 1219 | # coding=utf-8
"""Author: Krzysztof Trzepla
Copyright (C) 2015 ACK CYFRONET AGH
This software is released under the MIT license cited in 'LICENSE.txt'
Brings up a S3 storage.
"""
from boto.s3.connection import S3Connection, OrdinaryCallingFormat
from . import common, docker
def _node_up(image, buckets, name, uid):... | mit | -3,361,023,189,771,634,000 | 26.088889 | 73 | 0.61936 | false | 3.627976 | false | false | false |
idlesign/django-firebird | firebird/base.py | 1 | 14281 | """
Firebird database backend for Django.
Requires KInterbasDB 3.3+:
http://www.firebirdsql.org/index.php?op=devel&sub=python
"""
import re
import sys
import base64
try:
import kinterbasdb as Database
except ImportError, e:
from django.core.exceptions import ImproperlyConfigured
raise ImproperlyConfigur... | bsd-3-clause | -4,105,446,912,383,823,400 | 37.6 | 149 | 0.589735 | false | 3.994685 | false | false | false |
area3001/ares | sw/games/test_game_1/test1.py | 1 | 6624 | import pyglet
from pyglet.window import key
import cocos
from cocos import actions, layer, sprite, scene
from cocos.director import director
import cocos.euclid as eu
import cocos.collision_model as cm
import math
import paho.mqtt.client as mqtt
import json
MAP_SIZE = (600, 600)
VELOCITY_MAX = 400
VELOCITY_INERTIA = ... | mit | 6,703,829,673,079,058,000 | 32.80102 | 119 | 0.647796 | false | 3.393443 | false | false | false |
kevgraham7/toolbox | python/restdriver/restdriver/rest_driver.py | 1 | 6408 | #!/usr/bin/env python3
# Dependent packages:
import json
import logging as log
import os
import requests
import yaml
import sys
from restdriver import cli
__author__ = 'kgraham'
__version__ = '0.0.0-0'
def init_defaults():
cwd = os.getcwd()
root = os.path.abspath('/')
defaults = dict(config_file=os.pat... | apache-2.0 | -7,151,217,311,790,520,000 | 34.403315 | 114 | 0.59535 | false | 3.689119 | true | false | false |
maxamillion/dnf | dnf/query.py | 5 | 1587 | # query.py
# Implements Query.
#
# Copyright (C) 2012-2016 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is dist... | gpl-2.0 | -8,465,437,484,022,581,000 | 33.5 | 77 | 0.73472 | false | 3.805755 | false | false | false |
cbentes/texta | task_manager/language_model_manager/language_model_manager.py | 1 | 5898 | import json
import logging
import os
import platform
from datetime import datetime
from gensim.models import word2vec
from searcher.models import Search
from task_manager.models import Task
from texta.settings import ERROR_LOGGER, INFO_LOGGER, MODELS_DIR
from utils.datasets import Datasets
from utils.es_manager impor... | gpl-3.0 | -5,002,534,108,965,422,000 | 29.246154 | 160 | 0.678535 | false | 3.147279 | false | false | false |
PyCQA/pylint | tests/input/similar_lines_b.py | 2 | 1172 | """ The sister file of similar_lines_a, another file designed to have lines of
similarity when compared to its sister file
As with the sister file, we use lorm-ipsum to generate 'random' code. """
# Copyright (c) 2020 Frank Harrison <frank@doublethefish.com>
class Nulla:
tortor = "ultrices quis porta in"
sag... | gpl-2.0 | 5,301,449,111,242,282,000 | 31.555556 | 82 | 0.629693 | false | 2.997442 | false | false | false |
dmdm/PySite | pysite/scripts/pysite_sassc.py | 1 | 1541 | # -*- coding: utf-8 -*-
import transaction
import argparse
from pprint import pprint
import datetime
import sys
import os
import pysite.lib
import pysite.cli
import pysite.authmgr.const
import pysite.vmailmgr.manager as vmailmanager
from pysite.exc import PySiteError
class PySiteSasscCli(pysite.cli.Cli):
def ... | agpl-3.0 | 4,563,246,747,042,835,000 | 25.568966 | 77 | 0.641142 | false | 3.534404 | false | false | false |
DMPwerkzeug/DMPwerkzeug | rdmo/options/migrations/0006_refactoring.py | 2 | 4475 | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-01-25 11:34
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('options', '0005_refactoring'),
]
operations = [
... | apache-2.0 | 9,142,807,684,476,936,000 | 46.105263 | 231 | 0.610503 | false | 4.382958 | false | false | false |
alexykot/bitfund | bitfund/project/views/charts.py | 1 | 9451 | from decimal import Decimal
import os
import re
import cairoplot
from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from bitfund.core.settings_split.project import (ARGB_DONUT_CHART_PLEDGES,
ARGB_DONUT_CHART_REDONATIONS,
... | gpl-3.0 | -2,881,084,951,697,107,000 | 47.968912 | 230 | 0.624061 | false | 3.628023 | false | false | false |
mn1del/rpi_cnc_img | helpy.py | 1 | 2984 | #!/usr/bin/env python
# helphelp.py
# utility helper functions
import re
import shutil
import os
import subprocess
# chginfile() - replaces strFrom with strTo in file strFilePath
# takes simple string input for strFrom
def chginfile(strFilePath, strFrom, strTo):
"replaces strFrom with strTo in file strFilePath"
... | gpl-3.0 | -6,394,695,533,283,493,000 | 39.876712 | 102 | 0.688673 | false | 3.683951 | false | false | false |
sudkannan/xen-hv | dist/install/usr/lib64/python2.6/site-packages/xen/xend/server/BlktapController.py | 13 | 10561 | # Copyright (c) 2005, XenSource Ltd.
import string, re, os
from xen.xend.server.blkif import BlkifController
from xen.xend.XendLogging import log
from xen.util.xpopen import xPopen3
phantomDev = 0;
phantomId = 0;
blktap1_disk_types = [
'aio',
'sync',
'vmdk',
'ram',
'qcow',
'qcow2',
'ioemu... | gpl-2.0 | 952,386,985,070,820,100 | 32.849359 | 86 | 0.528832 | false | 4.003412 | true | false | false |
flavour/eden | modules/templates/BRCMS/idcards.py | 9 | 11359 | # -*- coding: utf-8 -*-
import os
from reportlab.lib.colors import HexColor
from reportlab.platypus import Paragraph
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.lib.enums import TA_CENTER
from gluon import current
from s3.codecs.card import S3PDFCardLayout
from s3 import s3_format_fullname, ... | mit | 5,628,638,435,310,537,000 | 33.525836 | 92 | 0.46122 | false | 4.634435 | false | false | false |
apocalyptech/pyinvedit | pyinveditlib/minecraft.py | 1 | 8671 | #!/usr/bin/env python
# vim: set expandtab tabstop=4 shiftwidth=4:
#
# Copyright (c) 2012, Christopher J. Kucera
# 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 c... | isc | -6,467,950,144,855,455,000 | 37.198238 | 94 | 0.597855 | false | 4.001384 | false | false | false |
ryosuzuki/crowdsource-platform | crowdsourcing/serializers/worker.py | 2 | 8045 | __author__ = 'elsabakiu, dmorina, neilthemathguy, megha, asmita'
from crowdsourcing import models
from rest_framework import serializers
from crowdsourcing.serializers.template import TemplateItemSerializer
from crowdsourcing.serializers.dynamic import DynamicFieldsModelSerializer
from rest_framework.exceptions import... | mit | 3,688,710,145,697,652,000 | 42.486486 | 170 | 0.661653 | false | 4.028543 | false | false | false |
inonit/wagtail | wagtail/wagtailadmin/tests/test_userbar.py | 3 | 5225 | from django.test import TestCase
from django.test.client import RequestFactory
from django.core.urlresolvers import reverse
from django.template import Template, Context
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser
from wagtail.tests.utils import WagtailTestUtils
... | bsd-3-clause | 7,109,178,911,511,505,000 | 38.285714 | 120 | 0.664115 | false | 3.994648 | true | false | false |
mnickey/emails-with-attachments | log_reader.py | 1 | 4019 | # coding=utf-8
__author__ = 'Michael Nickey'
"""
REQUEST:
On a Host that is connected to a LAN, you have a log-file that contains a list of users who have
logged onto some of the machines on the network,
in the past 24 hrs. Write a script that searches for computers on the network that are currently online,
and then s... | mit | -7,436,426,573,632,817,000 | 35.853211 | 133 | 0.680607 | false | 3.911392 | false | false | false |
conda/kapsel | conda_kapsel/commands/test/test_activate.py | 1 | 7491 | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Copyright © 2016, Continuum Analytics, Inc. All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -------------------------------------------------------------------... | bsd-3-clause | -3,643,867,649,094,397,000 | 33.516129 | 120 | 0.657944 | false | 3.64832 | true | false | false |
yuanagain/seniorthesis | src/4by4viz2.py | 2 | 1518 | # Plot of the Lorenz Attractor based on Edward Lorenz's 1963 "Deterministic
# Nonperiodic Flow" publication.
# http://journals.ametsoc.org/doi/abs/10.1175/1520-0469%281963%29020%3C0130%3ADNF%3E2.0.CO%3B2
#
# Note: Because this is a simple non-linear ODE, it would be more easily
# done using SciPy's ode solver, bu... | mit | -1,375,077,003,969,293,000 | 21.656716 | 94 | 0.620553 | false | 2.324655 | false | false | false |
krosenfeld/scatterbrane | scatterbrane/brane.py | 1 | 19596 | """
.. module:: brane
:platform: Unix
:synopsis: Simulate effect of anisotropic scattering.
.. moduleauthor:: Katherine Rosenfeld <krosenf@gmail.com>
.. moduleauthor:: Michael Johnson
Default settings are appropriate for Sgr A*
Resources:
Bower et al. (2004, 2006)
"""
from __future__ import print_function... | mit | 3,471,398,328,925,831,000 | 39.740125 | 177 | 0.597928 | false | 3.167286 | false | false | false |
jopohl/urh | src/urh/awre/Preprocessor.py | 1 | 11419 | import itertools
import math
import os
import time
from collections import defaultdict
import numpy as np
from urh.cythonext import awre_util
from urh.signalprocessing.FieldType import FieldType
class Preprocessor(object):
"""
This class preprocesses the messages in the following ways
1) Identify preamb... | gpl-3.0 | -6,106,701,050,303,925,000 | 41.136531 | 120 | 0.602154 | false | 4.116438 | false | false | false |
ksu-svt/svt-event-web-app | event_manager/models.py | 1 | 1860 | from django.db import models
from django.contrib.auth.models import User
from django.contrib import admin
from django.contrib.auth.models import User
from django.contrib.auth.admin import UserAdmin as AuthUserAdmin
from django.http import HttpRequest
class Member(models.Model):
user = models.ForeignKey(User,on_del... | mit | -8,321,106,513,214,914,000 | 30.525424 | 97 | 0.715591 | false | 3.757576 | false | false | false |
macarthur-lab/xbrowse | breakpoint_search/models.py | 1 | 2451 |
from django.db import models
from xbrowse_server.base.models import Project, Individual
from xbrowse.core import genomeloc
class BreakpointFile(models.Model):
project = models.ForeignKey(Project, blank=True)
file_path = models.CharField(max_length=500, default="", blank=True)
class Meta:
db_tabl... | agpl-3.0 | -226,880,252,465,269,630 | 29.259259 | 110 | 0.609955 | false | 3.641902 | false | false | false |
lamby/python-social-auth | examples/pyramid_example/example/__init__.py | 54 | 1248 | import sys
sys.path.append('../..')
from pyramid.config import Configurator
from pyramid.session import UnencryptedCookieSessionFactoryConfig
from sqlalchemy import engine_from_config
from social.apps.pyramid_app.models import init_social
from .models import DBSession, Base
def main(global_config, **settings):
... | bsd-3-clause | -2,521,684,883,802,776,600 | 35.705882 | 76 | 0.706731 | false | 3.863777 | true | false | false |
Legilibre/SedLex | sedlex/AddGitLabIssueVisitor.py | 1 | 2028 | # -*- coding: utf-8 -*-
from duralex.AbstractVisitor import AbstractVisitor
from . import template
from duralex.alinea_parser import *
import gitlab
class AddGitLabIssueVisitor(AbstractVisitor):
def __init__(self, args):
self.gitlab = gitlab.Gitlab('https://gitlab.com', args.gitlab_token)
self.r... | agpl-3.0 | 8,291,171,328,780,894,000 | 39.56 | 122 | 0.57643 | false | 4.155738 | false | false | false |
tridc/django_local_library | locallibrary/settings.py | 1 | 3964 | """
Django settings for locallibrary project.
Generated by 'django-admin startproject' using Django 1.11.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import... | gpl-3.0 | 8,768,230,256,608,004,000 | 27.314286 | 102 | 0.7056 | false | 3.396744 | false | false | false |
ryfeus/lambda-packs | Keras_tensorflow/source/keras/regularizers.py | 9 | 2034 | from __future__ import absolute_import
import six
from . import backend as K
from .utils.generic_utils import serialize_keras_object
from .utils.generic_utils import deserialize_keras_object
class Regularizer(object):
"""Regularizer base class.
"""
def __call__(self, x):
return 0.
@classmeth... | mit | -123,960,795,711,041,810 | 23.506024 | 72 | 0.593412 | false | 3.698182 | true | false | false |
NLHEALTHCARE/PYELT | pyelt/mappings/transformations.py | 1 | 5537 | from pyelt.datalayers.dwh import Dwh
__author__ = 'hvreenen'
# class FieldTransformationType():
# INLINE = 'INLINE' #type: str
# FUNCTION = 'FUNCTION'#type: str
#
# class FunctionLanguage():
# PLSQL = 'PLSQL'#type: str
# PLPYTHON = 'PLPYTHON'#type: str
class FieldTransformation():
def __init__(se... | gpl-3.0 | -7,576,310,073,809,948,000 | 32.762195 | 112 | 0.513274 | false | 3.511097 | false | false | false |
arruda/cloudfuzzy | fuzzy_modeling/models/defuzzifys.py | 1 | 3626 | # -*- coding: utf-8 -*-
import inspect
from django.db import models
from django.contrib.contenttypes import generic
from django.utils.translation import ugettext_lazy as _
from fuzzy_modeling.utils import get_class_by_python_path, get_choices_from_python_path_listing
from fuzzy_modeling.models.norms import NormMo... | mit | -7,038,179,230,675,926,000 | 29.728814 | 95 | 0.566189 | false | 3.633267 | false | false | false |
carletes/vagrant-environment | vagrant/core.py | 1 | 4786 | # Copyright (c) 2015 Carlos Valiente
#
# 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, modify, merge, publish, dis... | mit | 2,155,889,464,656,060,200 | 30.486842 | 79 | 0.59486 | false | 4.187227 | false | false | false |
Karspexet/Karspexet | karspexet/venue/models.py | 1 | 1209 | from django.contrib.postgres.fields import HStoreField
from django.db import models
class Venue(models.Model):
name = models.CharField(max_length=100)
description = models.TextField(blank=True)
address = models.TextField(blank=True)
map_address = models.CharField(blank=True, max_length=255)
seat_m... | mit | 216,008,215,363,029,280 | 31.675676 | 95 | 0.705542 | false | 3.464183 | false | false | false |
ProkopHapala/SimpleSimulationEngine | cpp/apps/OrbitalWar/py/RocktGun.py | 1 | 1577 | #!/usr/bin/python
import numpy as np
import matplotlib.pyplot as plt
def linearPowerLimitedRocket_dist( t, F, ve=10000, m0=1.0 ):
A = m0*ve
B = np.log( F*t - A )
return F*ve*( t/F + A*B/F**2 ) - t*ve*B
def getAccFT( F=None, ve=10000, P=1e+9, m0=1.0, fmass=0.1 ):
if F is None:
F = P/ve ... | mit | -2,502,383,001,833,996,300 | 29.941176 | 93 | 0.521877 | false | 2.119624 | false | false | false |
noba3/KoTos | addons/plugin.video.ardmediathek_de/resources/lib/subtitle.py | 1 | 5962 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import xbmc
import re
import resources.lib.utils as utils
import xbmcaddon
import HTMLParser
import xbmcvfs
addonID = 'plugin.video.ardmediathek_de'
addon = xbmcaddon.Addon(id=addonID)
subFile = xbmc.translatePath(xbmcaddon.Addon().getAddonInfo('profile')+'/sub.srt').... | gpl-2.0 | 6,460,534,141,782,706,000 | 33.871345 | 203 | 0.575646 | false | 2.796435 | false | false | false |
buaabarty/dpark | dpark/decorator.py | 2 | 1107 | # -*- coding: utf-8 -*-
class LazyJIT(object):
this = None
def __init__(self, decorator, f, *args, **kwargs):
self.f = f
self.args = args
self.kwargs = kwargs
self.decorator = decorator
def __call__(self, *args, **kwargs):
if self.this is None:
try:
... | bsd-3-clause | 4,109,995,176,437,829,000 | 30.628571 | 68 | 0.534779 | false | 3.778157 | false | false | false |
ox-it/humfrey | humfrey/pingback/extraction.py | 1 | 2807 | """
Contains functions with extract triples from external resources.
"""
from __future__ import with_statement
import functools
import urlparse
import lxml
import pytz
import rdflib
from django.conf import settings
from humfrey.utils.namespaces import NS
__all__ = ['extractors']
class NoLinkFoundError(Exception):... | bsd-3-clause | -1,017,957,257,831,237,400 | 29.846154 | 140 | 0.644817 | false | 3.650195 | false | false | false |
stvstnfrd/edx-platform | common/lib/xmodule/xmodule/modulestore/tests/test_assetstore.py | 1 | 34490 | """
Tests for assetstore using any of the modulestores for metadata. May extend to testing the storage options
too.
"""
import unittest
from datetime import datetime, timedelta
import pytest
import ddt
import pytz
import six
from django.test import TestCase
from opaque_keys.edx.keys import CourseKey
from opaque_keys... | agpl-3.0 | -2,249,754,757,599,794,000 | 46.704011 | 172 | 0.597478 | false | 3.848471 | true | false | false |
dbarbier/privot | python/test/t_FunctionalChaos_ishigami.py | 1 | 6841 | #! /usr/bin/env python
from openturns import *
from math import *
TESTPREAMBLE()
RandomGenerator().SetSeed(0)
try :
# Problem parameters
dimension = 3
a = 7.0
b = 0.1
# Reference analytical values
meanTh = a/2
covTh = (b**2 * pi**8) / 18.0 + (b * pi**4) / 5.0 + (a**2) / 8.0 + 1.0 / 2.0
... | lgpl-3.0 | -7,455,507,249,196,285,000 | 47.864286 | 142 | 0.618769 | false | 3.479654 | false | false | false |
kynikos/outspline | src/outspline/extensions/copypaste/queries.py | 1 | 1459 | # Outspline - A highly modular and extensible outliner.
# Copyright (C) 2011 Dario Giovannetti <dev@dariogiovannetti.net>
#
# This file is part of Outspline.
#
# Outspline 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 F... | gpl-3.0 | 3,803,032,165,900,533,000 | 40.685714 | 76 | 0.641535 | false | 3.78961 | false | false | false |
aptivate/ckanext-mapactionevent | ckanext/mapactionevent/controllers/event_groupcontroller.py | 1 | 1738 | import re
import ckan.lib.base as base
import ckan.controllers.group as group
import ckan.model as model
import ckan.logic as logic
from ckan.common import c, _
abort = base.abort
NotAuthorized = logic.NotAuthorized
NotFound = logic.NotFound
class EventGroupController(group.GroupController):
group_types = ['e... | agpl-3.0 | 6,376,609,578,868,277,000 | 33.078431 | 92 | 0.623705 | false | 4.004608 | false | false | false |
mapr/hue | desktop/core/ext-py/pysaml2-2.4.0/src/saml2/cache.py | 32 | 5624 | #!/usr/bin/env python
import shelve
from saml2.ident import code, decode
from saml2 import time_util, SAMLError
import logging
logger = logging.getLogger(__name__)
# The assumption is that any subject may consist of data
# gathered from several different sources, all with their own
# timeout time.
class ToOld(SAML... | apache-2.0 | -6,052,578,660,948,278,000 | 31.508671 | 78 | 0.573257 | false | 4.23494 | false | false | false |
paulfurley/unstructured-data-parser | extract_tags/test_hostname.py | 1 | 2191 |
import re
def main():
TLD_GROUP = (
r'(XN--CLCHC0EA0B2G2A9GCD|XN--HGBK6AJ7F53BBA|XN--HLCJ6AYA9ESC7A|'
'XN--11B5BS3A9AJ6G|XN--MGBERP4A5D4AR|XN--XKC2DL3A5EE0H|'
'XN--80AKHBYKNJ4F|XN--XKC2AL3HYE2A|XN--LGBBAT1AD8J|XN--MGBC0A9AZCG|'
'XN--9T4B11YI5A|XN--MGBAAM7A8H|XN--MGB... | mit | -1,720,534,985,402,122,800 | 45.617021 | 80 | 0.573711 | false | 1.815244 | false | false | false |
zouppen/simulavr | regress/timertest/timer_16bit_normal.py | 5 | 2481 | from vcdtestutil import VCDTestCase, VCDTestLoader, mSec
class TestCase(VCDTestCase):
p2irq = {
"atmega128": "IRQ.VECTOR14",
"at90s4433": "IRQ.VECTOR5",
"at90s8515": "IRQ.VECTOR6",
"atmega48": "IRQ.VECTOR13",
}
def setUp(self):
self.getVCD()
self.setClock(4000000)
self.processo... | gpl-2.0 | -4,561,736,661,851,272,700 | 28.535714 | 91 | 0.646514 | false | 2.981971 | true | false | false |
schinckel/django-boardinghouse | boardinghouse/contrib/demo/models.py | 1 | 3666 | import datetime
from django.conf import settings
from django.db import models
from django.utils import six, timezone
from django.utils.functional import cached_property
from django.utils.timesince import timesince, timeuntil
from django.utils.translation import ugettext as _
import pytz
from boardinghouse.base impor... | bsd-3-clause | -4,153,517,286,524,997,600 | 32.944444 | 118 | 0.639116 | false | 4.189714 | false | false | false |
jeremiak/regulations-site | regulations/generator/layers/formatting.py | 2 | 3033 | from itertools import dropwhile, takewhile
import re
from django.template import loader, Context
class FormattingLayer(object):
shorthand = 'formatting'
def __init__(self, layer_data):
self.layer_data = layer_data
self.table_tpl = loader.get_template('regulations/layers/table.html')
... | cc0-1.0 | 1,645,014,395,746,222,300 | 40.547945 | 78 | 0.521925 | false | 4.382948 | false | false | false |
yuzhangcmu/Python-Study | Concept_Implement/MapReduce.py | 2 | 4345 | #word_count.py
import string
import map_reduce
def mapper(input_key,input_value):
return [(word,1) for word in
remove_punctuation(input_value.lower()).split()]
"""
After Mapper, we have this
[('the', 1), ('quick', 1), ('brown', 1), ('fox', 1),
('jumped', 1), ('over', 1), ('the', 1), ('lazy', 1), ('g... | mit | 856,955,800,107,694,100 | 34.909091 | 165 | 0.599079 | false | 2.99862 | false | false | false |
msfrank/cifparser | cifparser/namespace.py | 1 | 6514 | # Copyright 2015 Michael Frank <msfrank@syntaxjockey.com>
#
# This file is part of cifparser. cifparser is BSD-licensed software;
# for copyright information see the LICENSE file.
from cifparser.converters import *
def or_default(default, fn, *args, **kwargs):
try:
return fn(*args, **kwargs)
except K... | bsd-2-clause | -6,926,594,170,818,973,000 | 35.595506 | 89 | 0.655204 | false | 3.398018 | false | false | false |
StanczakDominik/PythonPIC | pythonpic/tests/test_charge_interpolation.py | 1 | 3565 | # # coding=utf-8
# import matplotlib.pyplot as plt
# import numpy as np
# import pytest
#
# from ..algorithms.field_interpolation import PeriodicInterpolateField
# from ..classes import Species, PeriodicGrid
#
# @pytest.mark.parametrize("power", range(6))
# def test_poly(power, plotting=False):
# NG = 16
# NG_p... | bsd-3-clause | 226,414,916,271,088,860 | 30.830357 | 132 | 0.601683 | false | 2.824881 | true | false | false |
forseti-security/forseti-security | google/cloud/forseti/common/gcp_type/cloudsql_instance.py | 1 | 3326 | # Copyright 2017 The Forseti Security Authors. All rights reserved.
#
# 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 ap... | apache-2.0 | 7,918,750,074,306,586,000 | 34.763441 | 80 | 0.61816 | false | 4.359109 | false | false | false |
sanglass/sandglass.time | setup.py | 1 | 1300 | from setuptools import find_packages
from setuptools import setup
setup(
name='sandglass.time',
version='0.1.0',
packages=find_packages(),
namespace_packages=['sandglass'],
zip_safe=False,
include_package_data=True,
install_requires=[
'gunicorn',
'pyramid==1.5',
'py... | bsd-3-clause | 2,986,097,353,548,480,500 | 24 | 55 | 0.509231 | false | 3.571429 | false | false | false |
ajaska/code-snippets | fontName.py | 1 | 1040 | import struct
def fontName(path):
tags = {}
ntoffset, offset, records = None, None, None
with open(path, 'rb') as f:
data = f.read()
tables = struct.unpack_from('>H', data, 4)[0]
for i in range(tables):
tag = data[i*16 + 12:i*16 + 16]
if tag == b"name":
ntoffset... | mit | 3,033,834,519,379,990,500 | 33.666667 | 72 | 0.548077 | false | 3.25 | false | false | false |
alfredoavanzosc/odoomrp-wip-1 | machine_manager_preventive/models/preventive_operation.py | 12 | 6586 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# 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 th... | agpl-3.0 | 4,377,930,631,046,565,400 | 44.42069 | 79 | 0.59505 | false | 4.254522 | false | false | false |
ecustacm/ecustacm.github.io | assets/2017-05-08/a/solution/main.py | 1 | 4094 | from fractions import Fraction
from copy import deepcopy
z_val = {}
def gcd(a, b):
if b == 0:
return a
return gcd(b, a%b)
def lcm(a, b):
return a * b / gcd(a, b)
class PolyTerm(object):
def __init__(self, frac=Fraction(0, 1)):
self.coef = frac
self.a = [] # a_i^j sub & pow [... | mit | -4,697,172,123,889,366,000 | 19.994872 | 77 | 0.443332 | false | 3.24663 | false | false | false |
haylesr/angr | angr/analyses/cfg_base.py | 1 | 8889 | import networkx
import logging
from ..errors import AngrCFGError
l = logging.getLogger(name="angr.cfg_base")
class CFGBase(object):
"""
The base class for control flow graphs.
"""
def __init__(self, project, context_sensitivity_level):
self._project = project
# Initialization
... | bsd-2-clause | 5,258,722,314,853,719,000 | 32.798479 | 119 | 0.58173 | false | 4.144056 | false | false | false |
dandb/hacklog | hacklog/entities.py | 1 | 3730 | from sqlalchemy import *
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from datetime import date, datetime
from session import Session
db = None
Base = declarative_base()
def enum(**enums):
return type('Enum', (), enums)
def create_db_engine(server):
global ... | gpl-3.0 | 3,588,870,365,465,080,000 | 26.226277 | 64 | 0.680697 | false | 3.400182 | false | false | false |
bchappet/dnfpy | src/dnfpyUtils/optimisation/psoDNFLin.py | 1 | 3303 | from psoDNF import PSODNF
from pso import QtApp
from PyQt4 import QtGui
from dnfpyUtils.models.modelNSpike import ModelNSpike
import numpy as np
from dnfpyUtils.scenarios.scenarioRobustness import ScenarioRobustness
import dnfpy.controller.runner as runner
from dnfpyUtils.scenarios.scenarioSwitch import ScenarioSwitch
... | gpl-2.0 | 6,273,942,784,654,214,000 | 38.795181 | 109 | 0.665153 | false | 3.521322 | false | false | false |
oknuutti/visnav-py | visnav/algo/absnet.py | 1 | 6037 | import cv2
import numpy as np
import torch
from torchvision import transforms
from PIL import Image
from visnav.algo import tools
from visnav.algo.base import AlgorithmBase
from visnav.algo.image import ImageProc
from visnav.algo.tools import Stopwatch, PositioningException
from poseilluminet import PoseIllu... | mit | -4,335,682,116,186,066,400 | 41.121429 | 123 | 0.574458 | false | 3.49971 | false | false | false |
CARocha/mapafinca | encuestas/migrations/0015_auto_20170502_2209.py | 1 | 2971 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import multiselectfield.db.fields
class Migration(migrations.Migration):
dependencies = [
('encuestas', '0014_encuesta_estacion'),
]
operations = [
migrations.CreateModel(
... | mit | 678,143,037,716,315,300 | 44.015152 | 336 | 0.578256 | false | 3.422811 | false | false | false |
Parrot-Developers/alchemy | scripts/host.py | 1 | 1083 | #!/usr/bin/env python3
import sys
import platform
def getinfo(name):
if name == "OS":
val = platform.system().lower()
if "msys" in val or "mingw" in val:
return "windows"
return val
elif name == "ARCH":
is64bit = platform.architecture()[0] == "64bit"
val = p... | bsd-3-clause | -1,814,906,651,461,402,000 | 29.942857 | 87 | 0.519852 | false | 3.416404 | false | false | false |
mrocklin/streams | streamz/core.py | 1 | 56658 | from __future__ import absolute_import, division, print_function
from collections import deque, defaultdict
from datetime import timedelta
import functools
import logging
import six
import sys
import threading
from time import time
import weakref
import toolz
from tornado import gen
from tornado.locks import Conditio... | bsd-3-clause | -9,161,140,651,931,675,000 | 29.926856 | 90 | 0.566434 | false | 4.155945 | false | false | false |
TouK/vumi | vumi/blinkenlights/tests/test_metrics.py | 3 | 17835 | import time
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks, Deferred
from vumi.blinkenlights import metrics
from vumi.tests.utils import get_stubbed_channel
from vumi.message import Message
from vumi.service import Worker
from vumi.tests.helpers import VumiTestCase, WorkerHelp... | bsd-3-clause | -3,814,275,998,903,326,700 | 34.67 | 79 | 0.605495 | false | 3.617647 | true | false | false |
MRtrix3/mrtrix3 | lib/mrtrix3/dwi2response/tax.py | 1 | 7374 | # Copyright (c) 2008-2021 the MRtrix3 contributors.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Covered Software is provided under this License on an "as is"
#... | mpl-2.0 | 183,440,786,461,445,730 | 48.16 | 226 | 0.676024 | false | 3.167526 | false | false | false |
MartinThoma/LaTeX-examples | documents/Programmierparadigmen/scripts/python/n-damen.py | 1 | 1249 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
def get_next(n, i, damen_pos):
for i in range(n):
candidates = set(list(range(n)))
candidates -= set(damen_pos)
candidates -= set(list(range(damen_pos[i]+1)))
candidates = list(candidates)
if len(candidates) > 0:
dam... | mit | 5,815,788,792,761,971,000 | 25 | 64 | 0.52484 | false | 2.791946 | false | false | false |
valdergallo/pyconst | pyconst/const.py | 1 | 2021 | # encoding: utf-8
from __future__ import unicode_literals, absolute_import
from .slug import slugify as s
from .slug import slugify_attr as s_attr
import enum
class PyConstString(str):
def __new__(cls, name=None, value=None):
if not value:
value = name
else:
value = s(value... | gpl-3.0 | -344,034,119,650,024,000 | 25.246753 | 66 | 0.528946 | false | 3.715074 | false | false | false |
Kwpolska/pkgbuilder | pkgbuilder/package.py | 1 | 5090 | # -*- encoding: utf-8 -*-
# PKGBUILDer v4.3.0
# An AUR helper (and library) in Python 3.
# Copyright © 2011-2021, Chris Warrick.
# See /LICENSE for licensing information.
"""
The Package class, the most important class in PKGBUILDer.
:Copyright: © 2011-2021, Chris Warrick.
:License: BSD (see /LICENSE).
"""
from . im... | bsd-3-clause | -633,215,422,135,197,200 | 28.229885 | 81 | 0.518482 | false | 3.9033 | false | false | false |
mila-udem/blocks-extras | tests/bricks/test_attention.py | 1 | 4696 | import numpy
import theano
from numpy.testing import assert_allclose
from theano import tensor
from blocks.bricks import Identity
from blocks.bricks.recurrent import SimpleRecurrent
from blocks.bricks.attention import SequenceContentAttention
from blocks.initialization import IsotropicGaussian, Constant
from blocks_ex... | mit | -8,633,155,055,716,963,000 | 39.834783 | 75 | 0.670358 | false | 3.601227 | false | false | false |
google-research/google-research | tf3d/object_detection/data_preparation_utils.py | 1 | 25222 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# 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 applicab... | apache-2.0 | -7,792,968,965,668,784,000 | 43.879004 | 80 | 0.672667 | false | 3.791642 | false | false | false |
jezdez-archive/django-ticker | ticker/views.py | 1 | 2240 | from django.shortcuts import render_to_response, get_object_or_404
from django.template.context import RequestContext
from ticker.models import Entry
from tagging.models import Tag, TaggedItem
def overview(request, num_latest=10, template_name='ticker/overview.html', extra_context={}):
"""Show the 10 latest entrie... | bsd-3-clause | 8,860,472,621,819,965,000 | 42.921569 | 95 | 0.647768 | false | 3.950617 | false | false | false |
haamoon/tensorpack | tensorpack/RL/envbase.py | 1 | 3524 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: envbase.py
# Author: Yuxin Wu <ppwwyyxxc@gmail.com>
from abc import abstractmethod, ABCMeta
from collections import defaultdict
import six
from ..utils import get_rng
__all__ = ['RLEnvironment', 'ProxyPlayer',
'DiscreteActionSpace']
@six.add_metaclas... | apache-2.0 | 1,491,384,573,628,866,300 | 22.184211 | 81 | 0.575199 | false | 4.027429 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.