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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jivesoftware/platform_cli | platform_cli/service.py | 1 | 18900 | #!/usr/bin/env python
# Copyright (C) 2013 Jive Software. All rights reserved.
"""Define commands for managing processes.
"""
import getpass
import os
import shlex
import sys
import psutil
import time
from . import template, protected_file_path
from clint.textui import colored, puts
class Error(Exception):
"""Base... | apache-2.0 | -1,817,678,964,286,315,300 | 41.376682 | 98 | 0.600317 | false | 3.987342 | false | false | false |
libAtoms/matscipy | matscipy/angle_distribution.py | 1 | 1590 | # ======================================================================
# matscipy - Python materials science tools
# https://github.com/libAtoms/matscipy
#
# Copyright (2014) James Kermode, King's College London
# Lars Pastewka, Karlsruhe Institute of Technology
#
# This program is free software: you... | gpl-2.0 | -2,517,439,653,004,377,000 | 36.857143 | 78 | 0.627673 | false | 4.228723 | false | false | false |
rexhunt/Crypt-money | Forecast.py | 1 | 4530 | #Read/Write DB
import mysql.connector as mariadb
#Work with Times & Dates
import datetime
#Exit gracefully on ctrl-c
import sys, signal
#Delay to slow down forecasting
import time
#Round to nearest time
#Grabbed from https://stackoverflow.com/questions/3463930/how-to-round-the-minute-of-a-datetime-object-python/108540... | apache-2.0 | -3,030,173,893,054,195,000 | 37.067227 | 127 | 0.635099 | false | 3.50348 | false | false | false |
sniemi/SamPy | sandbox/src1/pca/pcaMod.py | 2 | 3795 | # Class: PCA
#
# Oliver Tomic
# 15.07.2005
from Numeric import *
from MLab import svd, std, cov
class PCA:
def __init__(self, inputMatrix, meancenter):
"""
This class carries out Principal Component Analysis on (numeric/numarray)
matrices.
use:
analysis = PCA(Matr... | bsd-2-clause | 1,898,038,308,621,085,700 | 30.625 | 107 | 0.571014 | false | 4.454225 | false | false | false |
liftoff/onoff | onoff.py | 1 | 6346 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Liftoff Software Corporation
#
# For license information see LICENSE.txt
# Meta
__version__ = '1.0.1'
__version_info__ = (1, 0, 1)
__license__ = "Apache 2.0 (see LICENSE.txt)"
__author__ = 'Dan McDougall <daniel.mcdougall@liftoffsoftware.com>'
__d... | apache-2.0 | 5,882,311,419,125,386,000 | 36.77381 | 80 | 0.555153 | false | 4.139596 | false | false | false |
blackberry/ALF | alf/fuzz/BinaryFuzz.py | 1 | 11581 | ################################################################################
# Name : BinaryFuzz.py
# Author : Tyson Smith & Jesse Schwartzentruber
#
# Copyright 2014 BlackBerry Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Li... | apache-2.0 | 1,991,081,405,564,180,700 | 42.867424 | 121 | 0.562732 | false | 3.72859 | false | false | false |
laurivosandi/compiler-construction | toolchain/coder.py | 1 | 8241 | # coding: utf-8
"""
µ-Opal to UEBB machine instruction set compiler
"""
import sys
import lexer
from parser import Parser
from ctxcheck import context_check
import absy
import ir
import builtin
BUILTIN_MAPPING = {
builtin.DefinitionEq: ir.Eq,
builtin.DefinitionLessThan: ir.Lt,
builtin.Definition... | mit | 3,086,612,278,012,672,000 | 41.25641 | 189 | 0.580461 | false | 4.109726 | false | false | false |
tknapen/eyetracking_course | experiments/LR_IM/trial.py | 1 | 2155 | from exptools.core.trial import Trial
import os
import exptools
import json
from psychopy import logging, visual, event
import numpy as np
class LR_IMTrial(Trial):
def __init__(self, ti, config, parameters, *args, **kwargs):
self.ID = ti
# self.parameters = parameters
phase_durations = ... | mit | -7,857,127,529,871,212,000 | 33.206349 | 109 | 0.500696 | false | 4.144231 | false | false | false |
o11c/shiboken2 | tests/otherbinding/conversion_operator_for_class_without_implicit_conversions_test.py | 6 | 3527 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of the Shiboken Python Bindings Generator project.
#
# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
#
# Contact: PySide team <contact@pyside.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms... | gpl-2.0 | 3,508,468,453,159,578,000 | 50.867647 | 127 | 0.783669 | false | 4.17891 | true | false | false |
waveform80/umansysprop | umansysprop/html.py | 1 | 5511 | # vim: set et sw=4 sts=4 fileencoding=utf-8:
#
# Copyright 2014 Dave Jones <dave@waveform.org.uk>.
#
# This file is part of umansysprop.
#
# umansysprop 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 v... | gpl-2.0 | 1,242,119,213,917,183,500 | 29.447514 | 89 | 0.562874 | false | 4.106557 | false | false | false |
coruus/pylibtiff | libtiff/tests/test_tiff_file.py | 11 | 1135 |
import os
import atexit
from tempfile import mktemp
from numpy import *
from libtiff import TIFF
from libtiff import TIFFfile, TIFFimage
def test_write_read():
for compression in [None, 'lzw']:
for itype in [uint8, uint16, uint32, uint64,
int8, int16, int32, int64,
... | bsd-3-clause | -8,796,483,404,691,798,000 | 30.527778 | 75 | 0.507489 | false | 3.795987 | false | false | false |
harperjiang/enc-selector | src/main/python/ndnn/sgd.py | 1 | 4672 | import numpy as np
etaDefault = 0.5
etaDecay = 1
gradClip = -1
epsilon = np.float64(1e-8)
momentumKey = "momentum"
mAlpha = 0.9
adagradKey = "adagrad"
rmspropKey = "rmsprop"
rmspropBeta = 0.9
adammeanKey = "adammean"
adamvarKey = "adamvar"
adamAlpha = 0.9
adamBeta = 0.999
class UpdatePolicy(object):
def __... | apache-2.0 | -3,449,696,995,940,846,600 | 25.850575 | 100 | 0.586473 | false | 3.518072 | false | false | false |
keishi/chromium | third_party/mesa/MesaLib/src/gallium/auxiliary/util/u_half.py | 35 | 4613 | # Copyright 2010 Luca Barbieri
#
# 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,
# distrib... | bsd-3-clause | 8,309,302,555,429,052,000 | 24.77095 | 76 | 0.698244 | false | 3.183575 | false | false | false |
SamuelTM/univapi | stm/univapi/controladores/boletos.py | 1 | 3072 | import json
from bs4 import BeautifulSoup
from urllib3.exceptions import ProtocolError
from stm.univapi.auxiliares import paginas
from stm.univapi.auxiliares.controlador import Controlador
from stm.univapi.auxiliares.paginas import Pagina
from stm.univapi.modelos.boleto import Boleto
class Boletos(Controlador):
... | mit | 5,532,948,794,313,844,000 | 39.263158 | 116 | 0.596078 | false | 3.333333 | false | false | false |
SWE574-Nerds/friendly-eureka | backend/eureka/post/migrations/0004_auto_20171130_2016.py | 1 | 1372 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-11-30 20:16
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('post', '0003_auto_20171130_1641'),
]
operations = ... | mit | -6,596,555,051,159,224,000 | 35.105263 | 122 | 0.5707 | false | 4.208589 | false | false | false |
shiminasai/plataforma_fadcanic | mapeo/migrations/0005_auto_20160225_1600.py | 3 | 1151 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('mapeo', '0004_auto_20160126_2007'),
]
operations = [
migrations.CreateModel(
name='Info_Organizaciones',
... | mit | 3,712,933,787,132,707,000 | 33.878788 | 118 | 0.58384 | false | 3.82392 | false | false | false |
vithd/vithd.github.io | django/mysite/polls/migrations/0005_auto_20170815_0447.py | 1 | 1213 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-15 04:47
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('polls', '0004_auto_20170811_0444'),
]
operations = [
migrations.RemoveField... | mit | 6,750,671,243,825,806,000 | 27.880952 | 127 | 0.536686 | false | 4.15411 | false | false | false |
johanvdw/niche_vlaanderen | niche_vlaanderen/acidity.py | 1 | 5249 | from pkg_resources import resource_filename
import numpy as np
import pandas as pd
from .codetables import validate_tables_acidity, check_codes_used
class Acidity(object):
'''
'''
nodata = 255 # uint8 data type
def __init__(self, ct_acidity=None,
ct_soil_mlw_class=None,
... | mit | -4,388,377,100,834,391,600 | 39.068702 | 78 | 0.564869 | false | 3.315856 | false | false | false |
mozman/ezdxf | src/ezdxf/addons/text2path.py | 1 | 12266 | # Copyright (c) 2021, Manfred Moitzi
# License: MIT License
from typing import Union, List, Dict, Tuple
import enum
from matplotlib.textpath import TextPath
from matplotlib.font_manager import FontProperties, findfont
from ezdxf.entities import Text, Attrib, Hatch
from ezdxf.lldxf import const
from ezdxf.math import... | mit | 8,852,192,044,467,430,000 | 32.422343 | 92 | 0.642671 | false | 3.620425 | false | false | false |
aziele/alfpy | alfpy/word_sets_distance.py | 1 | 2434 | """Distance methods measuring dissimilarity between sets of words.
These methods are also implemented in numpy and provided in the
`word_bool_distance` module. However, here are their faster
implemetations based on python sets.
"""
from .utils import distance
def _getwords(seq, word_size):
"""Return a set of wo... | mit | 2,472,424,517,335,046,700 | 28.325301 | 78 | 0.611339 | false | 3.399441 | false | false | false |
Transkribus/TranskribusDU | TranskribusDU/tasks/TablePrototypes/DU_ABPTableGrid.py | 1 | 9084 | # -*- coding: utf-8 -*-
"""
Map a grid to the annotated table separators
Copyright Naver Labs Europe 2018
JL Meunier
Developed for the EU project READ. The READ project has received funding
from the European Union's Horizon 2020 research and innovation programme
under grant ... | bsd-3-clause | -8,364,477,861,198,329,000 | 35.481928 | 88 | 0.535887 | false | 3.799247 | false | false | false |
jrconlin/pushsrv_ws | pushsrv_ws/views.py | 1 | 3848 | # 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/.
import json
import time
import tornado.web
import traceback
from .constants import LOG
from .storage import StorageExcep... | mpl-2.0 | 4,484,818,677,023,659,000 | 34.962617 | 79 | 0.58316 | false | 3.882947 | false | false | false |
swpease/Flavify | flavors/migrations/0002_auto_20170505_1130.py | 1 | 1246 | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-05 18:30
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('flavors', '0001_initial'),
]
operations = [
... | mit | -2,021,450,075,216,892,700 | 28.666667 | 114 | 0.557785 | false | 4.209459 | false | false | false |
dhondta/misc-tools | get-audio-phrase.py | 1 | 4520 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
__author__ = "Alexandre D'Hondt"
__version__ = "2.0"
__copyright__ = "AGPLv3 (http://www.gnu.org/licenses/agpl.html)"
__doc__ = """
This simple tool, based on PyDub, allows to append audio files, filter the
result as voice frequency and alter the playback speed.
"""
__e... | agpl-3.0 | 7,926,268,092,288,141,000 | 33.769231 | 80 | 0.577212 | false | 3.876501 | false | false | false |
danrg/RGT-tool | src/RGT/XML/SVG/Attribs/documentEventAttributes.py | 1 | 2728 | from RGT.XML.SVG.Attribs.basicSvgAttribute import BasicSvgAttribute
from types import StringType
class DocumentEventAttributes(BasicSvgAttribute):
ATTRIBUTE_ON_UNLOAD = 'onunload'
ATTRIBUTE_ON_ABORT = 'onabort'
ATTRIBUTE_ON_ERROR = 'onerror'
ATTRIBUTE_ON_RESIZE = 'onresize'
ATTRIBUTE_ON_S... | mit | 3,715,975,123,738,220,500 | 30.5 | 67 | 0.58871 | false | 4.047478 | false | false | false |
ludo237/euler-problems | Problems/Problem 3/Python/problem_3.py | 1 | 1126 | '''
Problem 3 from Project Euler
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
This file is made with Sublime Text using Python 2.7.4 on Linux.
PLEASE NOTE
In order to work you should have at least Python 2.5.x+ (Python 2.7.x+ is better)
REGARDING THE ... | gpl-2.0 | -5,394,198,342,709,491,000 | 21.52 | 128 | 0.674067 | false | 3.412121 | false | false | false |
DaanHoogland/cloudstack | test/selenium/common/shared.py | 7 | 6017 | # 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 u... | apache-2.0 | 4,910,722,807,439,888,000 | 39.38255 | 123 | 0.650989 | false | 3.907143 | false | false | false |
chimkentec/KodiMODo_rep | script.module.torrent2http/lib/torrent2http/engine.py | 1 | 22725 | # -*- coding: utf-8 -*-
import json
import os
import socket
import stat
import subprocess
import sys
import time
import urllib2
import httplib
from os.path import dirname
from download import LibraryManager
import logpipe
import mimetypes
import xbmc
from error import Error
from platform import Platform
from . import ... | gpl-3.0 | -2,578,841,136,828,366,300 | 45.567623 | 119 | 0.599648 | false | 4.175854 | false | false | false |
jolene-esposito/osf.io | website/addons/badges/views/render.py | 59 | 2040 | import httplib as http
from framework.exceptions import HTTPError
from website.project.views.node import _view_project
from website.project.decorators import ( # noqa
must_be_contributor_or_public,
must_have_addon, must_not_be_registration,
must_be_valid_project,
must_have_permission,
)
from ..model... | apache-2.0 | 8,008,360,089,546,848,000 | 25.842105 | 58 | 0.630882 | false | 3.317073 | false | false | false |
karllessard/tensorflow | tensorflow/python/keras/benchmarks/benchmark_util.py | 5 | 6208 | # Copyright 2020 The TensorFlow 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 applica... | apache-2.0 | -578,803,869,433,276,200 | 35.517647 | 80 | 0.641753 | false | 3.787675 | false | false | false |
curtisalexander/fc | fc/utils.py | 1 | 9177 | from collections import namedtuple
import datetime
import json
import logging
import os
import random
import time
logger = logging.getLogger()
def compare_namedtuples(items_base, items_compare, dedupe):
""" Return named tuples in a base list against a comparison list
Comparison is based on elements of the pa... | mit | 6,096,030,557,373,165,000 | 27.949527 | 78 | 0.591806 | false | 3.883623 | false | false | false |
swistakm/python-gmaps | setup.py | 1 | 1862 | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import os
def get_version(version_tuple):
if not isinstance(version_tuple[-1], int):
return '.'.join(map(str, version_tuple[:-1])) + version_tuple[-1]
return '.'.join(map(str, version_tuple))
try:
from pypandoc import convert
... | bsd-2-clause | 6,492,478,997,852,318,000 | 27.19697 | 79 | 0.607738 | false | 3.64902 | false | false | false |
wclark3/machine-learning | final-project/code/partition.py | 1 | 3426 | #!/usr/bin/env python
'''Functions and classes for partitioning the dataset.
'''
import cPickle as pickle
import os
import numpy as np
class Partitioner(object):
'''Partitions a Dataset into classes based on the label-size dictionary
'''
def __init__(self, dataset, labels_sizes, cache_file, shuffle=True... | mit | 6,548,853,390,700,996,000 | 34.319588 | 78 | 0.567134 | false | 4.214022 | false | false | false |
cderwin/maps | api/util/file_cache.py | 1 | 2112 | import os.path
import json
from flask import current_app as app
from functools import reduce
from .mapping import distance
class FileCache(object):
def __init__(self, name, base_dir=None, meta_func=None):
base_dir = base_dir or app.config['TMP_DIR']
self.base = os.path.join(base_dir, name)
... | mit | 5,784,607,909,210,181,000 | 29.171429 | 81 | 0.511364 | false | 3.84 | false | false | false |
LabD/wagtail-personalisation | tests/unit/test_adapter_session.py | 1 | 3351 | import pytest
from tests.factories.segment import SegmentFactory
from wagtail_personalisation import adapters
@pytest.mark.django_db
def test_get_segments(rf):
request = rf.get('/')
adapter = adapters.SessionSegmentsAdapter(request)
segment_1 = SegmentFactory(name='segment-1', persistent=True)
segm... | mit | 6,633,955,421,834,177,000 | 27.159664 | 80 | 0.701283 | false | 3.519958 | true | false | false |
irfansharif/how-late | tools/svg2pdc.py | 1 | 19738 | #
# Copyright (c) 2015 Pebble Technology
#
'''
SVG2PDC converts SVG images to a PDC (Pebble Draw Command) binary format image or sequence. The PDC file format
consists of a header, followed by the binary representation of a PDC image or sequence.
The file header is as follows:
Magic Word (4 bytes) - 'PDCI' for image, '... | mit | -8,232,872,607,133,554,000 | 32.625213 | 120 | 0.563684 | false | 3.879324 | false | false | false |
jkandasa/integration_tests | cfme/services/catalogs/__init__.py | 1 | 1986 | from navmazing import NavigateToSibling
from widgetastic.widget import View
from widgetastic_manageiq import Accordion, ManageIQTree
from widgetastic_patternfly import Dropdown, FlashMessages
from cfme.base.login import BaseLoggedInPage
from cfme.base import Server
from cfme.utils.appliance.implementations.ui import n... | gpl-2.0 | 5,656,936,596,626,491,000 | 27.371429 | 84 | 0.691339 | false | 3.909449 | false | false | false |
jansel/opentuner | opentuner/search/differentialevolution.py | 1 | 5038 | from __future__ import division
from __future__ import absolute_import
from builtins import map
from builtins import range
from past.utils import old_div
from builtins import object
import random
import time
import logging
from fn import _
from .technique import register
from .technique import SearchTechnique
log = lo... | mit | -3,871,385,504,525,184,000 | 31.928105 | 94 | 0.674474 | false | 3.839939 | true | false | false |
nsubiron/SublimeSuricate | lib/searchbar.py | 1 | 1801 | # Sublime Suricate Copyright (C) 2013 N. Subiron
#
# This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you
# are welcome to redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either
# version 3 of the License, or (a... | gpl-3.0 | -2,841,215,671,137,338,000 | 32.981132 | 80 | 0.696835 | false | 3.341373 | false | false | false |
f0rki/cb-multios | original-challenges/PTaaS/support/support.py | 1 | 5896 | # Copyright (C) 2014 Narf Industries <info@narfindustries.com>
#
# 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... | mit | 6,830,202,574,395,265,000 | 32.310734 | 100 | 0.600407 | false | 3.67581 | false | false | false |
kk47/Python | django/td2.0/app/getdata.py | 1 | 4105 | # coding: utf-8
#!/usr/bin/python
import os,sys
from django.core.management import setup_environ
import netsnmp
#import rrdtool
ROOT_PATH = os.path.split(os.path.abspath(os.path.dirname(__file__)))
string = 'public'
snmpport = '161'
ver = 2
def updaterrd():
set = os.environ.setdefault("DJANGO_SETTINGS_MODULE"... | lgpl-3.0 | 8,506,691,878,634,478,000 | 32.92562 | 115 | 0.587089 | false | 2.915483 | false | false | false |
yausern/stlab | devices/Tektronics_Sequencer/viewer.py | 2 | 1329 | # module for visualizing sequences.
#
# author: Wolfgang Pfaff
# Modified by: Sarwan Peiter
import numpy as numpy
from matplotlib import pyplot as plt
def show_element_stlab(element, delay = True, channels = 'all', ax = None):
if ax is None:
add_extra_labs = True
fig, ax1 = plt.subplots(1,1, figsize = (16,8))
... | gpl-3.0 | 7,832,635,883,363,768,000 | 24.075472 | 75 | 0.648608 | false | 2.679435 | false | false | false |
desihub/desispec | py/desispec/quicklook/quickfiberflat.py | 1 | 2203 | """
desispec.quickfiberflat
Here will be the fiberflat routines specific to quicklook.
G. Dhungana, 2016
"""
import numpy as np
from desiutil.log import get_logger
def compute_fiberflat():
"""
computes fiberflat: A boss like algorithm writing in progress and will fit in here.
Args:
"""
def app... | bsd-3-clause | 281,860,459,915,200,960 | 33.421875 | 163 | 0.667272 | false | 3.327795 | false | false | false |
unmeshpro/easyPost | migrations/versions/b2b7b8c6e096_.py | 1 | 1146 | """empty message
Revision ID: b2b7b8c6e096
Revises: fbbe04b71eab
Create Date: 2016-11-01 09:15:03.450434
"""
# revision identifiers, used by Alembic.
revision = 'b2b7b8c6e096'
down_revision = 'fbbe04b71eab'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ... | mit | 444,604,655,876,124,160 | 29.972973 | 77 | 0.657068 | false | 3.255682 | false | false | false |
82Flex/DCRM | WEIPDCRM/apis/gallery.py | 1 | 1652 | # coding=utf-8
"""
DCRM - Darwin Cydia Repository Manager
Copyright (C) 2017 WU Zheng <i.82@me.com>
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 yo... | agpl-3.0 | 943,967,486,019,742,600 | 34.148936 | 73 | 0.756053 | false | 4.079012 | false | false | false |
jirikuncar/invenio-deposit | invenio_deposit/helpers.py | 7 | 2578 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013, 2014, 2015 CERN.
#
# Invenio 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 optio... | gpl-2.0 | -7,234,727,641,877,050,000 | 26.72043 | 76 | 0.642358 | false | 4.003106 | false | false | false |
Star2Billing/did-control | did_control/did/function_def.py | 1 | 2949 | from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from prefix_country.models import Country
from did.models import *
from user_profile.models import UserProfile
from dateutil.relativedelta import *
from dateutil.rrule import *
from dateutil.parser import *
from datetime... | agpl-3.0 | 1,947,879,673,813,878,800 | 26.820755 | 68 | 0.587657 | false | 3.640741 | false | false | false |
costastf/python_library_cookiecutter | {{cookiecutter.project_slug}}/_CI/configuration/configuration.py | 1 | 2630 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: configuration.py
#
# Copyright 2018 Costas Tyfoxylos
#
# 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 w... | mit | -2,052,064,021,714,985,200 | 42.114754 | 101 | 0.648669 | false | 3.99696 | false | false | false |
pudo/dataset | dataset/chunked.py | 1 | 2485 | import itertools
class InvalidCallback(ValueError):
pass
class _Chunker(object):
def __init__(self, table, chunksize, callback):
self.queue = []
self.table = table
self.chunksize = chunksize
if callback and not callable(callback):
raise InvalidCallback
sel... | mit | 2,112,014,644,847,049,200 | 28.235294 | 77 | 0.624145 | false | 4.10066 | false | false | false |
farr/carma_pack | cpp_tests/analyze_test_data.py | 2 | 2137 | __author__ = 'brandonkelly'
import numpy as np
import matplotlib.pyplot as plt
from os import environ
from scipy.misc import comb
import carmcmc
# true values
p = 5 # order of AR polynomial
sigmay = 2.3
qpo_width = np.array([1.0/100.0, 1.0/100.0, 1.0/500.0])
qpo_cent = np.array([1.0/5.0, 1.0/50.0])
ar_roots = carmcm... | mit | -1,445,658,283,519,073,300 | 32.936508 | 108 | 0.70613 | false | 2.493582 | false | true | false |
domovilam/pimucha | piHAcontrollers/tools/ftditools.py | 1 | 2731 | # ----------------------------------------------------------------------------
# Copyright (C) 2013-2014 Huynh Vi Lam <domovilam@gmail.com>
#
# This file is part of pimucha.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pu... | gpl-3.0 | 5,060,815,153,294,155,000 | 33.56962 | 89 | 0.549249 | false | 3.901429 | false | false | false |
bharadwajyarlagadda/pydash | setup.py | 1 | 1580 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def parse_requirements(filename):
return [line.strip()
for line in read(filename).strip().split('\n')
... | mit | 4,439,842,110,215,677,000 | 29.384615 | 71 | 0.606962 | false | 4.114583 | false | false | false |
Parallel-in-Time/pySDC | pySDC/implementations/sweeper_classes/multi_implicit.py | 1 | 5089 | from pySDC.core.Sweeper import sweeper
class multi_implicit(sweeper):
"""
Custom sweeper class, implements Sweeper.py
First-order multi-implicit sweeper for two components
Attributes:
Q1: implicit integration matrix for the first component
Q2: implicit integration matrix for the seco... | bsd-2-clause | -6,981,228,469,401,359,000 | 32.480263 | 119 | 0.531342 | false | 3.502409 | false | false | false |
russellgeoff/blog | InvKin/ArmPlot.py | 5 | 2750 | '''
Copyright (C) 2013 Travis DeWolf
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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope t... | gpl-3.0 | -8,091,488,739,331,627,000 | 34.25641 | 77 | 0.605091 | false | 3.17552 | false | false | false |
markbrough/maedi-projects | maediprojects/query/user.py | 1 | 3190 | from maediprojects import db, models
from werkzeug.security import generate_password_hash, check_password_hash
import datetime, time
from flask.ext.login import current_user
def user(user_id=None):
if user_id:
user = models.User.query.filter_by(id=user_id
).first()
return user
... | agpl-3.0 | -6,055,687,544,115,127,000 | 30.91 | 76 | 0.614107 | false | 3.962733 | false | false | false |
kohnle-lernmodule/KITexe201based | nevow/url.py | 14 | 16868 | # -*- test-case-name: "nevow.test.test_url" -*-
# Copyright (c) 2004 Divmod.
# See LICENSE for details.
"""URL parsing, construction and rendering.
"""
from __future__ import generators
import weakref
from nevow import inevow
from nevow.stan import raw
from nevow.flat import flatten, serialize
from nevow.context imp... | gpl-2.0 | 1,009,170,624,124,058,500 | 30.766478 | 182 | 0.571378 | false | 4.076365 | false | false | false |
dav1x/ansible | lib/ansible/modules/storage/netapp/na_cdot_svm.py | 69 | 8674 | #!/usr/bin/python
# (c) 2017, NetApp, Inc
#
# This file is part of Ansible
#
# Ansible 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 3 of the License, or
# (at your option) any later version.... | gpl-3.0 | 2,694,164,125,472,073,700 | 33.015686 | 123 | 0.549689 | false | 4.40752 | false | false | false |
alexschiller/osf.io | website/addons/s3/model.py | 1 | 4869 | # -*- coding: utf-8 -*-
from modularodm import fields
from framework.auth.core import Auth
from website.addons.base import exceptions
from website.addons.base import AddonOAuthUserSettingsBase, AddonOAuthNodeSettingsBase
from website.addons.base import StorageAddonBase
from addons.s3.provider import S3Provider
from... | apache-2.0 | 7,315,608,196,838,105,000 | 31.677852 | 109 | 0.604231 | false | 4.091597 | false | false | false |
jesseklein406/django-imager | imagersite/imager_images/templatetags/images_filters.py | 1 | 1080 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import template
from imager_images.models import Photo, Album
from django.db.models import Q
register = template.Library()
@register.filter
def authorized_albums(albums, user):
return albums.filter(
Q(user... | mit | -5,284,042,267,728,997,000 | 26 | 78 | 0.664815 | false | 3.38558 | false | false | false |
jtyr/ansible-modules-extras | messaging/rabbitmq_queue.py | 29 | 9468 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Manuel Sousa <manuel.sousa@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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 3 of the... | gpl-3.0 | -6,747,696,595,846,376,000 | 35 | 174 | 0.578792 | false | 4.270636 | false | false | false |
neurokernel/antenna | setup.py | 1 | 2524 | #!/usr/bin/env python
import sys, os
from glob import glob
# Install setuptools if it isn't available:
try:
import setuptools
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from distutils.command.install import INSTALL_SCHEMES
from distutils.command.install_headers import instal... | bsd-3-clause | -5,378,243,789,658,474,000 | 30.949367 | 107 | 0.631537 | false | 3.949922 | false | false | false |
tung18tht/ICDAR-2017-Post-OCR-Correction | errors_detection/find_suspicious_fr_words.py | 1 | 2224 | import os, linecache, re, json
work_directory_path = os.path.dirname(os.path.realpath(__file__))
fr_words_file = open(work_directory_path + "/fr_words.txt", "rU", encoding="ISO-8859-1")
fr_words = set()
for word in fr_words_file:
fr_words |= {word.rstrip()}
data_directory_path = work_directory_path + "/ICDAR2017_d... | mit | -4,131,689,037,633,296,000 | 33.765625 | 105 | 0.583183 | false | 3.232558 | false | false | false |
google-research/morph-net | morph_net/op_regularizers/gamma_l1_regularizer.py | 1 | 1168 | """An OpRegularizer that applies L1 regularization on batch-norm gammas."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from morph_net.framework import generic_regularizers
from morph_net.framework import tpu_util
import tensorflow.compat.v1 as tf
cla... | apache-2.0 | 4,904,675,211,820,868,000 | 31.444444 | 75 | 0.718322 | false | 3.86755 | false | false | false |
R33D3M33R/qhar | Qhar_main_ui.py | 1 | 16497 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Qhar_main.ui'
#
# Created: Thu Dec 11 11:26:43 2014
# by: PyQt4 UI code generator 4.11.2
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Attr... | gpl-3.0 | -7,775,698,222,574,981,000 | 57.708185 | 102 | 0.70334 | false | 3.85534 | false | false | false |
ecowan/mlb-realtime | realtime/parse.py | 1 | 1393 | import requests
import xml.etree.ElementTree as ET
# TODO: We need to handle case where no game has started yet,
# i.e. the url returns a 404 not found error. Currently
# this returns a ET.ParseError
class MlbParser:
def __init__(self, url):
self.url = url
self.last_play = None
... | gpl-2.0 | -497,927,747,539,198,600 | 29.955556 | 87 | 0.559225 | false | 3.869444 | false | false | false |
zhcong/personal-file-sharing-center | magic/compatability.py | 1 | 1446 | """Compatability wrapper between str and unicode."""
import sys
from functools import wraps
if sys.version_info[0] >= 3:
unicode_t = str
bytes_t = bytes
decode_result = True
else:
unicode_t = unicode
bytes_t = str
decode_result = False
def byte_args(positions):
"""Ensure argument at given... | gpl-2.0 | -6,964,410,158,609,894,000 | 24.368421 | 70 | 0.587137 | false | 4.435583 | false | false | false |
fasaas/owne-coursera | documentation/Crafting-Quality-Code/Program_Planning/restaurants.py | 2 | 3841 | """
A restaurant recommendation system.
Here are some example dictionaries. These correspond to the information in
restaurants_small.txt.
Restaurant name to rating:
# dict of {str: int}
{'Georgie Porgie': 87,
'Queen St. Cafe': 82,
'Dumplings R Us': 71,
'Mexican Grill': 85,
'Deep Fried Everything': 52}
Price to ... | apache-2.0 | -1,828,414,777,290,235,600 | 32.99115 | 106 | 0.636813 | false | 3.062998 | false | false | false |
CiwPython/Ciw | ciw/tests/test_arrival_node.py | 2 | 18468 | import unittest
import ciw
class TimeDependentBatches(ciw.dists.Distribution):
def sample(self, t, ind=None):
if t < 11.0:
return 5
return 1
class TestArrivalNode(unittest.TestCase):
def test_init_method(self):
ciw.seed(5)
Q = ciw.Simulation(ciw.create_network_from_... | mit | 6,364,626,305,327,265,000 | 45.873096 | 125 | 0.570609 | false | 3.190739 | true | false | false |
smaiLee/smarthome | plugins/elro/__init__.py | 3 | 3575 | #!/usr/bin/env python3
# vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab
#
# Copyright 2014 Brootux (https://github.com/Brootux) as GNU-GPL
#
# This file is part of SmartHome.py. http://mknx.github.io/smarthome/
#
# SmartHome.py is free software: you can redistribute it and/or modify
# it ... | gpl-3.0 | -6,896,574,476,492,061,000 | 33.375 | 74 | 0.579301 | false | 3.735632 | false | false | false |
vasalf/ejcompstand | scripts/std_timedacm.py | 1 | 1054 | #!/usr/bin/python3
duration = int(input())
n = int(input())
m = int(input())
ok = [False for i in range(n)]
tries = [0 for i in range(n)]
time = [-1 for i in range(n)]
times_of_tries = [[] for i in range(n)]
for i in range(m):
prob, status, submit_time = map(int, input().split())
prob -= 1
if submit_tim... | bsd-3-clause | -2,234,675,880,471,784,700 | 22.954545 | 77 | 0.517078 | false | 2.871935 | false | false | false |
wrwrwr/mezzanine | mezzanine/core/migrations/0004_set_site_permissions.py | 1 | 4778 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
# Note: Remember to use orm['appname.ModelName'] rather than "from appname.mo... | bsd-2-clause | 4,936,421,294,539,311,000 | 62.706667 | 182 | 0.552532 | false | 3.753339 | false | false | false |
waitingkuo/taipei-open-data-hackathon | data/data.taipei/import.py | 1 | 1126 | import json
from pymongo import MongoClient
if __name__ == '__main__':
f = open('taipei.json')
j = json.load(f)
db = MongoClient('localhost',3001).meteor
source = 'data.taipei'
db.resources.remove({'source': source})
for r in j['result']['results']:
r['meta'] = r['title']
... | mit | -7,876,759,132,949,716,000 | 32.117647 | 116 | 0.492007 | false | 4.035842 | false | false | false |
exercism/xpython | exercises/minesweeper/example.py | 4 | 1234 | def annotate(minefield):
if(minefield == []):
return []
verify_board(minefield)
row_len = len(minefield[0])
col_len = len(minefield)
board = [list(row) for row in minefield]
for index1 in range(col_len):
for index2 in range(row_len):
if board[index1][index2] != ' ':
... | mit | -3,102,937,047,358,679,000 | 29.85 | 68 | 0.545381 | false | 3.694611 | false | false | false |
alexarnautu/deenux | src/components/player/trackcontrols/Trackcontrols.py | 1 | 2705 | from PyQt5 import QtWidgets, QtCore
from src.components.View import View
from src.components.player.trackcontrols.TrackcontrolsController import TrackcontrolsController
class Trackcontrols(QtWidgets.QWidget, View):
def __init__(self, context, *args):
QtWidgets.QWidget.__init__(self, *args)
View.... | gpl-3.0 | 95,980,159,324,285,000 | 32.7375 | 95 | 0.670989 | false | 3.677112 | false | false | false |
dallasdata/crime | setup.py | 1 | 1407 | # The MIT License (MIT)
#
# Copyright (c) 2015 dallasdata
#
# 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... | mit | 5,182,357,057,436,817,000 | 38.083333 | 80 | 0.736318 | false | 4.138235 | false | false | false |
echoi/snac_bmi | pythia-0.8/packages/opal/opal/applications/CGI.py | 2 | 4224 | #!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Michael A.G. Aivazis
# California Institute of Technology
# (C) 1998-2005 All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~... | gpl-2.0 | -8,066,258,901,390,599,000 | 24.756098 | 92 | 0.529356 | false | 4.693333 | false | false | false |
ericd/redeem | redeem/Delta.py | 2 | 1897 | """
Author: Elias Bakken
email: elias(dot)bakken(at)gmail(dot)com
Website: http://www.thing-printer.com
License: GNU GPL v3: http://www.gnu.org/copyleft/gpl.html
This work in this file has been heavily influenced by the work of Steve Graves
from his document on Delta printer kinematics: https://groups.google.com/for... | gpl-3.0 | 605,561,338,134,076,500 | 41.155556 | 108 | 0.605166 | false | 3.927536 | false | false | false |
benzrf/Lispnoria | parthial_ext.py | 1 | 3208 | import supybot.callbacks as callbacks
import supybot.ircutils as ircutils
import supybot.ircmsgs as ircmsgs
from parthial.vals import LispSymbol, LispList, LispFunc, LispBuiltin
from parthial.errs import LimitationError
from parthial import built_ins
import re
import threading
parseMessage = re.compile('%s: (?P<conten... | gpl-3.0 | -1,047,872,181,088,591,500 | 30.145631 | 84 | 0.583541 | false | 3.529153 | false | false | false |
Lana-B/Pheno4T | tools/ReportGenerator/Services/string_tools.py | 1 | 2803 | ################################################################################
#
# Copyright (C) 2012-2013 Eric Conte, Benjamin Fuks
# The MadAnalysis development team, email: <ma5team@iphc.cnrs.fr>
#
# This file is part of MadAnalysis 5.
# Official website: <https://launchpad.net/madanalysis5>
#
# MadAnal... | gpl-3.0 | -1,721,519,820,828,732,400 | 25.951923 | 80 | 0.511238 | false | 4.841105 | false | false | false |
jiaaro/django-alert | alert/migrations/0001_initial.py | 1 | 3500 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django
from django.db import models, migrations
from django.conf import settings
import django.utils.timezone
import alert.models
def sites_patch_django17(apps, schema_editor):
if django.VERSION[:2] == (1,7):
from django.contrib.site... | mit | -8,464,625,067,597,986,000 | 41.682927 | 150 | 0.572857 | false | 4.424779 | false | false | false |
mohierf/flask-webui | alignak_webui/__init__.py | 1 | 2311 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2015:
# Frederic Mohier, frederic.mohier@gmail.com
#
# This file is part of (WebUI).
#
# (WebUI) 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 Foundati... | agpl-3.0 | -8,260,741,001,354,973,000 | 30.202703 | 81 | 0.693807 | false | 3.430906 | false | false | false |
oceansystemslab/bvt_pantilt | src/driver_pantilt.py | 1 | 11293 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Software License Agreement (BSD License)
#
# Copyright (c) 2014, Ocean Systems Laboratory, Heriot-Watt University, UK.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follow... | bsd-3-clause | -1,886,751,699,498,028,500 | 31.733333 | 93 | 0.576552 | false | 3.541235 | false | false | false |
niwinz/django-logstream | setup.py | 1 | 1216 | from setuptools import setup, find_packages
description="""
Multiprocess log collector for python/django-logging
"""
long_description = """
* **Documentation**: http://readthedocs.org/docs/django-logstream/en/latest/
"""
setup(
name="django-logstream",
version=':versiontools:django_logstream:',
url='htt... | bsd-3-clause | 8,453,825,354,075,990,000 | 26.636364 | 76 | 0.613487 | false | 3.788162 | false | false | false |
henriquegemignani/randovania | test/gui/test_generate_seed_tab.py | 1 | 2708 | import pytest
from PySide2 import QtWidgets
from mock import MagicMock, AsyncMock
from randovania.games.game import RandovaniaGame
from randovania.gui.generate_seed_tab import GenerateSeedTab
from randovania.gui.generated.main_window_ui import Ui_MainWindow
@pytest.fixture(name="tab")
def _tab(skip_qtbot):
class... | gpl-3.0 | -8,930,177,483,659,823,000 | 32.432099 | 112 | 0.728951 | false | 3.326781 | true | false | false |
oilshell/blog-code | ddmin/ddmin.py | 1 | 2082 | #!/usr/bin/env python
# $Id: ddmin.py,v 2.2 2005/05/12 22:01:18 zeller Exp $
from split import split
from listsets import listminus
import re
PASS = "PASS"
FAIL = "FAIL"
UNRESOLVED = "UNRESOLVED"
def ddmin(circumstances, test):
"""Return a sublist of CIRCUMSTANCES that is a relevant configuration
... | apache-2.0 | -654,397,492,973,077,900 | 22.931034 | 78 | 0.506724 | false | 3.704626 | true | false | false |
haohanshi/HackCMU217 | server.py | 1 | 3221 | from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from SocketServer import ThreadingMixIn
import threading
import cgi
import json
from distutils.util import strtobool
from main import *
class Handler(BaseHTTPRequestHandler):
def do_GET(self):
rootdir = '/Users/Alex/Desktop/HackCMU217' #fi... | mit | -4,147,825,290,045,501,000 | 32.905263 | 124 | 0.560385 | false | 3.904242 | false | false | false |
rbsec/bsparser | bsparser.py | 1 | 4663 | #!/usr/bin/python
#
# bsparser copyright (C) 2013 rbsec
# Licensed under GPLv3, see LICENSE for details
#
import base64
import re
import platform
import os
import sys
try:
import urlparse
except ImportError:
import urllib.parse as urlparse
try: # Use faster C implementation if we can
import xml.etree.... | gpl-3.0 | -1,789,367,969,113,593,000 | 32.789855 | 148 | 0.562084 | false | 3.797231 | false | false | false |
bumrush/everythinglocation.py | tests/test_geocode.py | 2 | 1430 | # -*- coding: utf-8 -*-
"""
test_geocode
~~~~~~~~~~~~~~~
This unittest module tests the everythinglocation Geocode process
:copyright: (c) 2015 by Justin Cano
:license: MIT, see LICENSE for more details
"""
import vcr
import requests
import unittest
import everythinglocation
class TestGeocode(unit... | mit | -8,537,882,039,194,170,000 | 26.039216 | 69 | 0.601399 | false | 3.994413 | true | false | false |
hckjck/django-mailto | mailto/models.py | 1 | 10210 | # -*- coding: utf-8 -*-
import json
import logging
import uuid
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core.exceptions import ObjectDoesNotExist
from django.core.mail import EmailMessage, get_connection
from django.core.mail.... | bsd-3-clause | -6,998,056,287,505,839,000 | 31.519108 | 120 | 0.59951 | false | 4.194741 | false | false | false |
NervanaSystems/coach | rl_coach/utilities/carla_dataset_to_replay_buffer.py | 1 | 4565 | #
# Copyright (c) 2017 Intel Corporation
#
# 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... | apache-2.0 | -8,665,225,079,152,468,000 | 43.320388 | 121 | 0.651041 | false | 3.657853 | false | false | false |
GunnerJnr/_CodeInstitute | Stream-3/Full-Stack-Development/20.Deployment/4.Populating-our-database/we_are_social/settings/staging.py | 1 | 1125 | """
Staging.py:
"""
from base import *
import dj_database_url
DEBUG = False
# Load the ClearDB connection details from the environment variable
DATABASES = {
'default': dj_database_url.config('CLEARDB_DATABASE_URL')
}
# disqus shortname
DISQUS_WEBSITE_SHORTNAME = 'gunner'
# Stripe environment variables
STRIPE_P... | mit | -4,415,575,511,591,904,000 | 24.568182 | 88 | 0.672 | false | 2.984085 | false | true | false |
rubund/debian-pyvisa | pyvisa/shell.py | 1 | 10444 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
pyvisa.shell
~~~~~~~~~~~~
Shell for interactive testing.
This file is taken from the Lantz Project.
:copyright: (c) 2014 by PyVISA Authors, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import... | mit | -4,921,033,341,775,816,000 | 30.938838 | 98 | 0.494638 | false | 4.570678 | false | false | false |
Ecialo/imsoflexible | server.py | 1 | 4579 | #! /usr/bin/python2
# -*- coding: utf-8 -*-
import tornado
import tornado.ioloop
from tornado import gen
from tornado.queues import Queue
import tornado.web
import os, uuid, random, string, json
from rolling_shutter import unblockable_rolling_shutter
UPLOAD_DIR = "upload/"
BUF_SIZE = 4096
SID_LEN = 32
q = Queue()
ta... | mit | -4,125,769,616,314,943,000 | 26.419162 | 115 | 0.546408 | false | 3.737959 | false | false | false |
dvro/UnbalancedDataset | imblearn/under_sampling/tomek_links.py | 2 | 6211 | """Class to perform under-sampling by removing Tomek's links."""
from __future__ import print_function
from __future__ import division
import numpy as np
from collections import Counter
from sklearn.neighbors import NearestNeighbors
from ..base import BaseBinarySampler
class TomekLinks(BaseBinarySampler):
"""... | mit | -6,170,317,838,854,091,000 | 33.893258 | 80 | 0.600708 | false | 4.094265 | false | false | false |
ovidiub13/MoneyManager | old_django/mm_transactions/migrations/0017_auto_20141201_2245.py | 1 | 1988 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('mm_transactions', '0016_auto_20141201_2241'),
]
operations = [
migrati... | gpl-3.0 | 5,449,932,930,055,146,000 | 33.275862 | 111 | 0.577465 | false | 4.340611 | false | false | false |
matthewoliver/swift | swift/common/middleware/staticweb.py | 3 | 23912 | # Copyright (c) 2010-2016 OpenStack Foundation
#
# 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 agree... | apache-2.0 | 6,689,792,890,340,805,000 | 42.635036 | 79 | 0.576614 | false | 3.968138 | true | false | false |
tdfischer/organizer | sync/management/commands/import.py | 1 | 2334 | from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from importlib import import_module
from tqdm import tqdm
import sys
from organizer.importing import get_importer_class, collect_importers
from sync import models
import logging
from django.utils import timezone
log = lo... | agpl-3.0 | 5,572,788,926,236,111,000 | 41.436364 | 79 | 0.559126 | false | 4.33829 | false | false | false |
tigerking/pyvision | src/pyvision/optimize/testsuite.py | 3 | 14782 | '''
Copyright David S. Bolme
Created on Feb 28, 2011
@author: bolme
'''
import unittest
import pyvision as pv
import pyvision.optimize.genetic as ga
import scipy as sp
import numpy as np
import random
def callback(population):
plot = pv.Plot(xrange=[0,10],yrange=[0,10])
pts = [ [each[1][0].value,each[1][1].... | bsd-3-clause | 9,182,088,782,525,430,000 | 42.225146 | 161 | 0.584562 | false | 2.948145 | true | false | false |
gram003/picking_demo | picking.py | 1 | 9860 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
try:
from PySide import QtGui
except ImportError:
from PyQt4 import QtGui
from picking_ui import Ui_PickingDlg
from opencmiss.zinc.context import Context
from opencmiss.zinc.field import Field
from opencmiss.zinc.glyph import Glyph
from opencmiss.zinc.elemen... | mit | 3,690,106,603,374,462,000 | 41.136752 | 115 | 0.65213 | false | 4.155078 | false | false | false |
tschmorleiz/amcat | api/rest/resources/project.py | 2 | 2163 | ###########################################################################
# (C) Vrije Universiteit, Amsterdam (the Netherlands) #
# #
# This file is part of AmCAT - The Amsterdam Content Analysis Toolkit #
# ... | agpl-3.0 | 1,620,192,657,595,284,200 | 55.921053 | 113 | 0.52982 | false | 4.828125 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.