repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
ocefpaf/cartopy
lib/cartopy/io/img_tiles.py
1
22922
# (C) British Crown Copyright 2011 - 2019, Met Office # # This file is part of cartopy. # # cartopy is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option)...
lgpl-3.0
-7,582,404,670,517,037,000
35.097638
79
0.563345
false
3.676933
false
false
false
hobson/pug-dj
pug/dj/sqlserver.py
1
7833
from django.db import connections #, transaction from collections import OrderedDict, namedtuple from django.conf import settings from django.db import DatabaseError from traceback import print_exc from ansi.constants import field_type_name def dictfetchall(cursor): """Returns all rows from a cursor as a dict (r...
mit
-6,840,538,291,162,996,000
40.231579
275
0.650198
false
3.568565
false
false
false
rajathkumarmp/robocomp
tools/rcmaster/test/test.py
1
6886
import pexpect, sys from os import environ , path from time import sleep from copy import deepcopy import unittest class Comp: def __init__(self, name, cmd): self.init_name = name self.name = self.init_name self.cmd = cmd self.staus = 0 self.output = '' self.extra_p...
gpl-3.0
-3,446,347,255,780,175,000
34.132653
120
0.58176
false
3.83835
true
false
false
shaftoe/home-assistant
homeassistant/components/zwave/node_entity.py
1
5871
"""Entity class that represents Z-Wave node.""" import logging from homeassistant.core import callback from homeassistant.const import ATTR_BATTERY_LEVEL, ATTR_WAKEUP from homeassistant.helpers.entity import Entity from homeassistant.util import slugify from .const import ATTR_NODE_ID, DOMAIN, COMMAND_CLASS_WAKE_UP f...
apache-2.0
-6,447,722,180,573,683,000
32.169492
79
0.616931
false
4.023989
false
false
false
saullocastro/compmech
theory/func/bardell/print_bardell_integrals_to_fortran.py
2
2549
import os import glob from ast import literal_eval import numpy as np import sympy from sympy import pi, sin, cos, var var('xi1, xi2') var('x1t, x1r, x2t, x2r') var('y1t, y1r, y2t, y2r') subs = { } def List(*e): return list(e) printstr_12 = '' printstr_full = '' for i, filepath in enumerate( glo...
bsd-3-clause
-3,921,367,220,447,581,700
35.942029
117
0.511573
false
2.940023
false
false
false
yausern/stlab
devices/Keithley_6430.py
1
1068
import visa import numpy as np from stlab.devices.instrument import instrument import time class keithley6430(instrument): def __init__(self,addr = "TCPIP::192.168.1.212::1470::SOCKET", reset = True, verb=True, read_termination='\r\n'): #Needs \r\n line termination super().__init__(addr,reset...
gpl-3.0
1,634,099,699,270,036,200
30.411765
117
0.63015
false
3.571906
false
false
false
mandoku/mdweb
app/main/errors.py
1
1045
# -*- coding: utf-8 -*- from flask import render_template, request, jsonify from . import main @main.app_errorhandler(403) def forbidden(e): if request.accept_mimetypes.accept_json and \ not request.accept_mimetypes.accept_html: response = jsonify({'error': 'forbidden'}) response.st...
mit
-4,551,379,110,060,904,000
30.666667
62
0.662201
false
3.899254
false
false
false
auto-mat/klub
apps/aklub/autocom.py
1
6964
# -*- coding: utf-8 -*- # Author: Hynek Hanke <hynek.hanke@auto-mat.cz> # # Copyright (C) 2010 o.s. Auto*Mat # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or...
gpl-3.0
9,162,069,310,918,358,000
37.263736
133
0.597071
false
4.020785
false
false
false
opennode/waldur-mastermind
src/waldur_core/structure/tests/unittests/test_handlers.py
1
5755
from unittest import mock from django.test import TestCase from waldur_core.structure import models as structure_models from waldur_core.structure.tests import factories, fixtures class LogProjectSaveTest(TestCase): @mock.patch('waldur_core.structure.handlers.event_logger') def test_logger_called_once_on_pr...
mit
251,253,752,996,053,730
38.689655
108
0.563684
false
4.389779
true
false
false
bonus-tm/euforia
events/distribute.py
1
2523
# Распределение зерна на еду и на посев import re import data, ask, act from event import Event class Distribute(Event): """Распределение зерна""" # def start(self): """docstring for start""" self.min_for_food = data.resources['peasant'] + data.resources['soldier'] + 1 self.min...
mit
-968,450,527,075,147,000
31.2
104
0.501775
false
2.912145
false
false
false
challenge19/conpy
classify/classify_node.py
1
2070
#!/usr/bin/env python # -*- coding: utf-8 -*- # import networkx as nx import numpy as np import random import Lib_gen_Graph as lig import Lib_cal_control as lcc import classify_by_add_node as can import classify_by_renorm.classify_by_renorm_undirected as cru #import StructuralRenorm.package.Lib_struct_renorm as lsr ...
mit
2,258,245,540,786,862,300
32.387097
123
0.584541
false
2.512136
false
false
false
algorhythms/LeetCode
527 Word Abbreviation.py
1
1679
#!/usr/bin/python3 """ premium question """ from typing import List from collections import defaultdict class Solution: def wordsAbbreviation(self, words: List[str]) -> List[str]: """ Sort the word, check prefix and last word Group by first and last char, group by prefix and last char ...
mit
-8,415,701,674,983,687,000
27.948276
206
0.481834
false
3.706402
false
false
false
katrielalex/rate-equations-odeint
redirect_std.py
1
1258
# http://stackoverflow.com/a/22434262/398968 import os import sys import contextlib def fileno(file_or_fd): fd = getattr(file_or_fd, 'fileno', lambda: file_or_fd)() if not isinstance(fd, int): raise ValueError("Expected a file (`.fileno()`) or a file descriptor") return fd @contextlib.contextmana...
gpl-3.0
9,220,618,834,503,481,000
36
80
0.628776
false
3.789157
false
false
false
ksetyadi/Sahana-Eden
models/06_supply.py
1
5661
# -*- coding: utf-8 -*- """ Supply @author: Michael Howden (michael@sahanafoundation.org) @date-created: 2010-08-16 Generic Supply functionality such as catalogs and items that will be used across multiple modules """ module = "supply" if deployment_settings.has_module("logs"): #================...
mit
-1,531,580,686,840,160,000
43.574803
207
0.512454
false
3.942201
false
false
false
falcondai/svcrawl
models.py
1
2640
# description: download Google StreetViews images and save them # the Google StreeView API is documented here: # https://developers.google.com/maps/documentation/streetview/ # author: Falcon Dai import cStringIO import mongoengine as me from PIL import Image from google_streetview_api import * class Pano(me.Document...
mit
8,110,197,922,455,155,000
31.195122
141
0.625758
false
3.393316
false
false
false
sdanielf/dictate
setup.py
1
5131
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2013 S. Daniel Francis <francis@sugarlabs.org> # # 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, ...
gpl-3.0
951,621,605,844,470,300
37.871212
78
0.573572
false
3.849212
false
false
false
mhoffman/kmos
kmos/cli.py
1
16514
#!/usr/bin/env python """Entry point module for the command-line interface. The kmos executable should be on the program path, import this modules main function and run it. To call kmos command as you would from the shell, use :: kmos.cli.main('...') Every command can be shortened as long as...
gpl-3.0
-7,991,788,097,576,638,000
31.253906
142
0.548504
false
4.046557
false
false
false
gperciva/artifastring
interactive/tuning_pitch.py
1
1587
#!/usr/bin/env python ## # Copyright 2010--2013 Graham Percival # This file is part of Artifastring. # # Artifastring 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...
gpl-3.0
-3,633,596,735,271,529,000
27.339286
65
0.612476
false
3.928218
false
false
false
ondrejch/FSM
scripts/mk1/surfaces.py
1
2678
#!/usr/bin/env python3 # # Generate surfaces, pins, and lattice for FastDrum Serpent deck # Ondrej Chvala, ochvala@utk.edu # 2016-08-02 import math def write_surfaces(N, r, refl): '''Function to write material cards for Serpent input deck. Inputs: N: size of the N x N checkerboard lattice ...
gpl-3.0
-1,026,238,962,245,229,800
34.236842
115
0.533607
false
3.039728
false
false
false
pegasus-isi/pegasus
packages/pegasus-python/src/Pegasus/service/monitoring/errors.py
1
1894
import logging from flask import make_response from sqlalchemy.orm.exc import NoResultFound from Pegasus.service._query import InvalidQueryError from Pegasus.service._serialize import jsonify from Pegasus.service._sort import InvalidSortError from Pegasus.service.base import ErrorResponse, InvalidJSONError from Pegas...
apache-2.0
-8,742,466,944,660,014,000
23.921053
86
0.683738
false
3.58034
false
false
false
samuelbustamante/dirinfo
tickets/models.py
1
2476
# coding=utf-8 from django.db import models from django.contrib.auth.models import User from django.core.urlresolvers import reverse STATUS_OPEN = 0 STATUS_ON_HOLD = 1 STATUS_BELATED = 2 STATUS_RESOLVED = 3 STATUS_CLOSED = 4 PRIORITY_LOW = 0 PRIORITY_NORMAL = 1 PRIORITY_HIGHT = 2 PERMISSION_CAN_ASSIGNED = "can_assign...
apache-2.0
-6,085,948,790,724,800,000
30.341772
73
0.620355
false
3.768645
false
false
false
nhmc/LAE
python_modules/cloudy/utils.py
1
11349
from barak.utilities import between from barak.io import parse_config, readtxt from scipy.integrate import simps import numpy as np from barak.constants import Ryd_Ang, pi, hplanck import os def get_data_path(): """ Return the path to the data directory for this package. """ return os.path.abspath(__file_...
mit
-1,258,561,087,993,598,200
28.025575
76
0.573707
false
3.09828
false
false
false
beni55/rinohtype
rinoh/inline.py
1
1880
# This file is part of RinohType, the Python document preparation system. # # Copyright (c) Brecht Machiels. # # Use of this source code is subject to the terms of the GNU Affero General # Public License v3. See the LICENSE file or http://www.gnu.org/licenses/. from .element import DocumentElement from .flowable impo...
agpl-3.0
4,611,793,927,843,337,000
23.736842
76
0.678191
false
4.060475
false
false
false
cfehring/slack-onnow
slack-onnow.py
1
6863
''' This function handles a Slack slash command named "/onnow" and echoes the details back to the Slack user. Follow these steps to configure the slash command in Slack: 1. Navigate to https://<your-team-domain>.slack.com/services/new 2. Search for and select "Slash Commands". 3. Enter a name for your command...
gpl-3.0
-218,650,652,733,150,340
35.897849
369
0.641556
false
3.532167
false
false
false
leiferikb/bitpop
src/tools/telemetry/telemetry/core/platform/power_monitor/android_ds2784_power_monitor.py
1
4983
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import os from telemetry import decorators from telemetry.core.platform.profiler import android_prebuilt_profiler_helper import telemetry.cor...
gpl-3.0
-5,266,683,894,114,779,000
38.23622
79
0.645595
false
3.821319
false
false
false
reinbach/finance
api/finance/views/account.py
1
3764
import json from flask import abort, jsonify, request, Response from flask.views import MethodView import config from finance import utils, db from finance.forms.account import AccountForm from finance.models.account import Account from finance.stats import STATS class AccountAPI(MethodView): """Account Views"...
bsd-3-clause
152,536,387,370,015,520
32.607143
77
0.529224
false
4.612745
false
false
false
FRESNA/vresutils
test/test_transfer.py
1
1167
from __future__ import absolute_import import pytest import numpy as np from numpy.testing import assert_allclose import scipy.sparse as sparse from vresutils import transfer @pytest.fixture def orig(): return np.array(((0., 0.), (1., 1.))) @pytest.fixture def dest(): return np.array(((1.5, 1.), (0., 0.5),...
gpl-3.0
-2,421,937,108,105,041,400
28.175
70
0.537275
false
3.864238
true
false
false
hep-gc/panda-autopyfactory
bin/factory.py
1
6335
#! /usr/bin/env python # # Simple(ish) python condor_g factory for panda pilots # # $Id$ # # # Copyright (C) 2007,2008,2009 Graeme Andrew Stewart # # 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 Founda...
gpl-3.0
-1,333,859,866,517,586,400
45.580882
137
0.679084
false
3.820869
false
false
false
asayler/tutamen-pytutamen
pytutamen/base.py
1
5612
# -*- coding: utf-8 -*- # Andy Sayler # 2015 # pytutamen Package # Tutamen Client Library ### Imports ### from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install...
lgpl-2.1
6,913,057,864,763,884,000
27.343434
95
0.590164
false
3.865014
false
false
false
pombredanne/https-git.fedorahosted.org-git-kobo
kobo/http.py
1
4351
# -*- coding: utf-8 -*- # based on: http://code.activestate.com/recipes/146306/ import httplib import mimetypes import os from kobo.shortcuts import random_string class POSTTransport(object): """ POST transport. USAGE: >>> import kobo.http t = kobo.http.POSTTransport() t.add_vari...
lgpl-2.1
-2,957,594,066,260,830,000
29.215278
112
0.535969
false
3.991743
false
false
false
2Guys1Python/Project-Cacophonum
data/states/player_menu.py
1
2099
""" This is the state where the player can look at his inventory, equip items and check stats. Most of the logic is in menugui.MenuGUI() """ import pygame as pg from .. import tools, setup, menugui from .. import constants as c class Player_Menu(object): def __init__(self, game_data, level): inventory = g...
mit
-6,648,040,916,525,575,000
30.80303
67
0.608861
false
3.618966
false
false
false
evangelistalab/forte
forte/solvers/active_space_solver.py
1
6737
from forte.core import flog from forte.solvers.solver import Feature, Solver from forte.forte import ForteOptions from forte import to_state_nroots_map from forte import forte_options from forte.forte import make_active_space_ints, make_active_space_solver class ActiveSpaceSolver(Solver): """ A class to dia...
lgpl-3.0
-2,397,025,364,970,134,000
39.584337
138
0.620751
false
3.937463
false
false
false
jhamman/mtclim5
mtclim/share.py
1
3374
''' share.py ''' # Mountain Climate Simulator, meteorological forcing disaggregator # Copyright (C) 2015 Joe Hamman # 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 Lic...
gpl-3.0
7,141,067,628,994,798,000
38.694118
71
0.613219
false
2.926279
false
false
false
davidak/satzgenerator
python/satzgenerator.py
1
1797
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Satzgenerator Referenzimplementierung """ import sys import random as r # Textdateien einlesen, Zeilen in Liste vornamen_m = open('../data/vornamen_m.txt', 'r').read().splitlines() vornamen_w = open('../data/vornamen_w.txt', 'r').read().splitlines() vornamen = vorna...
gpl-3.0
4,652,005,081,419,994,000
27.492063
143
0.594986
false
2.442177
false
false
false
cheddartv/stockstream.live
webapp/stockstream/api.py
1
5316
import config import robinhood import time import httputil import json def get_api_request(request): return httputil.get_json_object_from_url(config.SS_API_ENDPOINT + request) def post_api_request(request, obj): return httputil.post_object_to_url(config.SS_API_ENDPOINT + request, json.dumps(obj)) def get_...
mit
-351,231,517,994,377,860
25.187192
89
0.668548
false
3.221818
false
false
false
loganasherjones/python-logstash-async
logstash_async/memory_cache.py
1
3382
# -*- coding: utf-8 -*- # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE file for details. import uuid from logging import getLogger as get_logger from datetime import datetime, timedelta from logstash_async.cache import Cache class MemoryCache(Cache): """B...
mit
-257,946,098,770,652,860
40.753086
126
0.512714
false
4.658402
false
false
false
topnotchgeek/capnlog
apps/www/behaviors.py
1
1759
import markdown from django.db import models from django.utils.text import slugify from conf import settings class Permalinkable(models.Model): slug = models.SlugField() class Meta: abstract = True def get_url_kwargs(self, **kwargs): kwargs.update(getattr(self, 'url_kwargs', {})) ...
apache-2.0
4,012,738,729,876,496,400
22.453333
106
0.641842
false
3.766595
false
false
false
zimolzak/poker-experiments
pokermodules/convenience_hole.py
1
11895
import numpy from convenience import reduce_h, find_pcts_multi from deuces.deuces import Deck, Card from itertools import combinations, product import random all52 = Deck.GetFullDeck() all_hole_explicit = [] for h in combinations(all52, 2): all_hole_explicit += [list(h)] deck_choose_2 = len(all_hole_explicit) asse...
mit
6,878,339,368,544,250,000
33.181034
110
0.479781
false
2.153721
false
false
false
murat1985/bagpipe-bgp
bagpipe/bgp/engine/__init__.py
2
7221
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # encoding: utf-8 # Copyright 2014 Orange # # 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 # # Un...
apache-2.0
-6,958,950,871,063,271,000
32.430556
79
0.595485
false
4.077357
false
false
false
SkySchermer/uweclang
uweclang/query/grammar/QueryLexer.py
1
6565
# Generated from java-escape by ANTLR 4.5 # encoding: utf-8 from __future__ import print_function from antlr4 import * from io import StringIO def serializedATN(): with StringIO() as buf: buf.write(u"\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2") buf.write(u"\27\u00a4\b\1\4\2\t\2\4\3\t\3\4...
mit
-2,795,009,675,822,149,000
49.5
103
0.527494
false
1.73082
false
false
false
qguv/config
weechat/plugins/python/weestreamer.py
1
4152
# Copyright (c) 2015 by Miblo <miblodelcarpio@gmail.com> # All rights reserved # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later ...
gpl-3.0
-2,907,162,474,371,489,300
38.542857
104
0.622592
false
3.554795
false
false
false
daviur/py-cracking-the-coding-interview
trees-and-graphs/tg_traversal.py
1
4187
# The MIT License (MIT) # # Copyright (c) 2016 David I Urbina # # 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, mo...
mit
412,412,928,509,585,800
25.333333
80
0.567471
false
3.653578
false
false
false
jar398/tryphy
tests/test_sl_eol_get_links.py
1
2532
# 10. sl/eol/get_links # Parameter: list of species # Result: # input_species - repeats input (issue: flush this) # message, status_code as usual # meta_data - not very useful # species - list of blobs about species # eol_id # matched_name - contains authority # searched_name - presumably wha...
bsd-2-clause
1,020,772,690,744,866,700
31.883117
100
0.636256
false
3.430894
true
false
false
weechat/weechat.org
weechat/about/views.py
1
5180
# # Copyright (C) 2003-2021 Sébastien Helleu <flashcode@flashtux.org> # # This file is part of WeeChat.org. # # WeeChat.org 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 #...
gpl-3.0
-5,936,908,681,836,201,000
31.36875
77
0.595289
false
3.813697
false
false
false
Kyria/LazyBlacksmith
lbcmd/sde_import.py
1
4863
# -*- encoding: utf-8 -*- import bz2 import os import sqlite3 import requests from flask_script import Command, Option from lazyblacksmith.models import db from lbcmd.importer import Importer class SdeImport(Command): """ Manage SDE Data in lazyblacksmith. If all flags are specified, "clear" action is ...
bsd-3-clause
7,020,513,401,039,638,000
32.308219
79
0.522517
false
4.114213
false
false
false
mne-tools/mne-tools.github.io
0.15/_downloads/plot_custom_inverse_solver.py
1
6931
# -*- coding: utf-8 -*- """ ================================================ Source localization with a custom inverse solver ================================================ The objective of this example is to show how to plug a custom inverse solver in MNE in order to facilate empirical comparison with the methods M...
bsd-3-clause
-3,530,687,313,560,286,000
37.505556
79
0.633386
false
3.720344
false
false
false
PADAS/django-raster
raster/formulas.py
1
9578
import numpy from pyparsing import CaselessLiteral, Combine, Forward, Literal, Optional, Word, ZeroOrMore, alphas, nums from django.contrib.gis.gdal import GDALRaster from .const import ALGEBRA_PIXEL_TYPE_GDAL, ALGEBRA_PIXEL_TYPE_NUMPY class FormulaParser(object): """ Deconstruct mathematical algebra expres...
bsd-3-clause
-4,398,534,353,883,407,400
32.256944
125
0.54479
false
3.931856
false
false
false
roopali8/tempest
tempest/api/identity/admin/v3/test_projects.py
1
7635
# Copyright 2013 OpenStack, LLC # 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 b...
apache-2.0
4,873,065,670,767,485,000
41.653631
78
0.634578
false
3.65311
true
false
false
Netflix/sketchy
setup-nflx.py
1
1460
# Copyright 2014 Netflix, 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
8,699,107,894,296,933,000
30.73913
78
0.573973
false
3.443396
false
false
false
aptivate/invite-registration
registration/views.py
1
3680
from django.conf import settings from django.contrib import messages from django.contrib.auth.views import password_change from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.views.generic import FormView, RedirectView fro...
gpl-3.0
-4,675,061,321,014,097,000
36.938144
85
0.595924
false
4.526445
false
false
false
beernarrd/gramps
gramps/plugins/export/exportftree.py
1
6827
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2003-2006, 2008 Donald N. Allingham # Copyright (C) 2008 Brian G. Matherly # Copyright (C) 2010 Jakim Friant # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as...
gpl-2.0
-8,773,447,639,689,746,000
33.135
94
0.461989
false
4.329106
false
false
false
iCarto/siga
extScripting/scripts/jython/console/jintrospect.py
1
5168
"""Extend introspect.py for Java based Jython classes.""" from introspect import * import string __author__ = "Don Coleman <dcoleman@chariotsolutions.com>" __cvsid__ = "$Id$" def getAutoCompleteList(command='', locals=None, includeMagic=1, includeSingle=1, includeDouble=1): """Return lis...
gpl-3.0
-3,568,753,556,987,604,500
31.708861
109
0.583978
false
4.541301
false
false
false
edunham/toys
utilities/packingblocks.py
1
2505
#! /usr/bin/env python # From IRC: # # "I was thinking about a toy idea for my kid to teach multiplication through # area representation. 2x3 is a two-inch-by-three-inch slab of something with # lines on it, etc. I'd need 45 pieces (since AxB = BxA, you can drop almost # half) but if I wanted to put it away in almos...
mit
3,056,071,601,932,460,500
35.838235
130
0.678643
false
3.139098
false
false
false
wlawski/libmots
tests/monkeyrunner-tests/t0037-shared-elem-avoid-long-press-landscape.py
1
1970
# # The MIT License (MIT) # # Copyright (c) 2014 Wiktor Lawski <wiktor.lawski@gmail.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 th...
mit
950,680,015,119,411,700
34.818182
79
0.784264
false
3.893281
false
false
false
Maplecroft/Magellan
magellan/deps_utils.py
1
36288
import os import operator from pkg_resources import parse_version from pkg_resources import resource_filename as pkg_res_resource_filename from pprint import pformat import requests import json import logging # from terminaltables import AsciiTable as OutputTableType from terminaltables import SingleTable as OutputTab...
mit
1,562,727,707,134,273,500
35.543807
81
0.553351
false
4.239252
false
false
false
conates/my_site
frontend/templatetags/set_var.py
1
1670
from django import template register = template.Library() from backend.models import * slider_principal = WpPosts.objects.all().filter( post_status="publish", post_type="post", wptermrelationships__term_taxonomy__term__name="Slider Principal", ) slider_principal.filter(wppostmeta__meta_key__in=["data-icon","da...
apache-2.0
3,951,004,240,805,934,600
29.381818
158
0.756287
false
2.79732
false
false
false
ryanraaum/african-mtdna
popdata_sources/coelho2009/process.py
1
2502
from oldowan.mtconvert import seq2sites, sites2seq, str2sites from string import translate import pandas as pd import sys sys.path.append('../../scripts') from utils import * ## load metadata metadata = pd.read_csv('metadata.csv', index_col=0) regionparts = metadata.ix[0,'SeqRange'].split(';') region1 = range2region...
cc0-1.0
-2,315,007,006,943,837,000
27.770115
70
0.660671
false
2.582043
false
false
false
maximeolivier/pyCAF
pycaf/architecture/devices/server_features/file.py
1
2897
#| This file is part of pyCAF. | #| | #| pyCAF is free so...
gpl-3.0
-6,448,453,920,463,100,000
62
150
0.338281
false
6.098947
false
false
false
praveenkumar/dorrie
dorrie/comps/models.py
1
1663
# Dorrie - Web interface for building Fedora Spins/Remixes. # Copyright (C) 2009 Red Hat Inc. # Author: Shreyank Gupta <sgupta@redhat.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...
agpl-3.0
-1,699,943,516,922,952,700
37.674419
74
0.72279
false
3.912941
false
false
false
cad-lab/blog
pelicanconf.py
1
2136
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals AUTHOR = 'kmol' SITENAME = 'CADLab (虎尾科大MDE)' #SITEURL = 'http://cad-lab.github.io/blog/' # 不要用文章所在目錄作為類別 USE_FOLDER_AS_CATEGORY = False #PATH = 'content' #OUTPUT_PATH = 'output' TIMEZONE = 'Asia/Taipei' DEFAULT_LANG = 'en' #...
agpl-3.0
-7,971,731,043,801,654,000
25.92
88
0.659564
false
2.687084
false
false
false
botswana-harvard/bhp065_project
bhp065/apps/hnscc_subject/admin/enrollment_admin.py
1
1104
from django.contrib import admin from edc.base.modeladmin.admin import BaseModelAdmin from ..forms import EnrollmentForm from ..models import Enrollment class EnrollmentAdmin(BaseModelAdmin): dashboard_type = 'subject' form = EnrollmentForm def __init__(self, *args, **kwargs): super(Enrollment...
gpl-2.0
-6,335,565,765,146,285,000
33.5
83
0.557065
false
4.166038
false
false
false
Algomorph/gpxanalyzer
gpxanalyzer/filters/color_structure_pythonic.py
1
10874
''' Created on Apr 25, 2014 @author: Gregory Kramida @copyright: (c) Gregory Kramida 2014 @license: GNU v3 ''' import gpxanalyzer.gpxanalyzer_internals as gi import numpy as np import sys import math import timeit amplitude_thresholds = np.array([0.0, 0.000000000001, 0.037, 0.08, 0.195, 0.32],dtype=np.float64) n_ampl...
gpl-3.0
-3,584,973,421,014,598,000
35.009934
106
0.529704
false
3.063962
false
false
false
jszymon/pacal
pacal/vartransforms.py
1
10727
"""Variable transforms. Used for mapping to infinite intervals etc.""" from __future__ import print_function from numpy import Inf from numpy import hypot, sqrt, sign from numpy import array, asfarray, empty_like, isscalar, all, equal class VarTransform(object): """Base class for variable transforms.""" de...
gpl-3.0
6,725,443,334,583,879,000
35.362712
101
0.552624
false
3.239807
false
false
false
mrworf/multiremote
drivers/base.py
1
9963
# This file is part of multiRemote. # # multiRemote is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # multiRemote is distributed in t...
gpl-2.0
-6,278,120,524,581,041,000
33.003413
115
0.618488
false
4.202024
false
false
false
kotton21/PotteryOnline
server.py
1
2940
#!/usr/bin/env python import SimpleHTTPServer import SocketServer import PotGenerator import os import logging import logging.handlers import sys import time import rotate3D2 from urlparse import urlparse, parse_qs try: os.chdir('/home/pi/PotteryOnline/') except: print 'executing from current direcory' PORT = 80...
mit
3,274,926,346,818,852,400
27.269231
125
0.708163
false
3.111111
false
false
false
yv84/pyph
src/tests/integrate_tests/tcp_echo.py
1
5366
#!/usr/bin/env python3 """TCP echo server example.""" import argparse import asyncio import sys import os try: import signal except ImportError: signal = None from msg_log import Message from game_log import log ARGS = argparse.ArgumentParser(description="PyPh test fixtures.") ARGS.add_argument( '--se...
mit
-1,852,951,330,190,602,200
30.197674
100
0.591875
false
3.530263
false
false
false
yeming233/rally
tests/unit/plugins/openstack/scenarios/ironic/test_utils.py
1
2990
# Copyright 2015: Mirantis Inc. # 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 b...
apache-2.0
-4,327,295,516,294,357,500
41.714286
78
0.637458
false
3.78481
true
false
false
c-goosen/ctpug_11_july
flask/__init__.py
1
4174
from flask import Flask from flask_bootstrap import Bootstrap from flask import render_template import bootstrap import xmlrpclib from io import BytesIO import base64 app = Flask(__name__) import xmlrpclib username = 'username' #the user pwd = 'password' #the password of the user dbname = 'ctpug' #the databa...
cc0-1.0
-3,810,377,012,034,217,500
35.938053
344
0.674653
false
3.10104
false
false
false
infrared5/massroute-pi
features/steps/bus_approaching_blink_steps.py
1
1614
from time import sleep from app.component.modifier.blinker import Blinker PINS = [0,1,2,3] DELAY = 0.2 @given('A new Blinker instance provided with a Shifter reference') def blinker_setup_with_shifter(context): shifter = context.shifter blinker = Blinker(shifter) blinker.set_pins(PINS) shifter.set_pins = Mag...
mit
2,140,165,882,895,384,600
27.333333
66
0.740397
false
2.923913
false
false
false
FedoraScientific/salome-hexablock
src/TEST_PY/test_unit/test_cuve.py
1
2161
# -*- coding: latin-1 -*- # Copyright (C) 2009-2014 CEA/DEN, EDF R&D # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later...
lgpl-2.1
6,068,368,036,037,627,000
28.704225
95
0.643221
false
2.756378
false
false
false
Groupe24/CodeInSpace
tournoi/37/game_1.py
1
62455
# -*- coding: utf-8 -*- import random import shutil import time import socket def game_preparation(file): """ Prepare the data structures need to play the game based on a .mv file. Return ------ - field: list of lists containing the characters contained in each cases of the board (list). ...
mit
6,189,446,927,990,470,000
30.716457
177
0.546866
false
3.561737
false
false
false
allen-fdes/python_demo
cookbook/settings.py
1
2691
""" Django settings for cookbook project. Generated by 'django-admin startproject' using Django 1.8.3. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build pat...
mit
7,863,861,419,043,461,000
25.126214
71
0.691564
false
3.46332
false
false
false
rechner/Taxidi
dblib/postgres.py
1
40884
#!/usr/bin/env python #-*- coding:utf-8 -*- # dblib/postgres.py (spaces, not tabs) # PostgreSQL database driver for Taxídí. # Zac Sturgeon <admin@jkltech.net> # 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 Softwa...
gpl-3.0
-6,374,917,536,914,731,000
40.754852
129
0.538554
false
4.161458
false
false
false
pcubillos/MCcubed
examples/demo02/preamble.py
1
1385
#! /usr/bin/env python # This script generates input files used to run MCMC from the shell prompt. # Preamble # -------- # To correctly execute this script, one needs to set the correct paths # to the source code. The paths are given as if the Python session # runs from a 'run/' folder at the same level than the rep...
mit
-8,446,834,606,013,386,000
32.780488
75
0.67509
false
3.36983
false
false
false
mtwestra/akvo-wandelenvoorwater
wvw/W4W/models.py
1
6568
from django.db import models class school(models.Model): class Meta: verbose_name = "School" verbose_name_plural="Scholen" BRIN_NUMMER = models.CharField('BRIN code',max_length=15,blank=True, null=True) NAAM_VOLLEDIG = models.CharField('Naam school',max_length=100,blank=True, null=True) NAAM_STRAAT_VE...
agpl-3.0
8,242,833,113,469,371,000
51.544
101
0.759592
false
2.672091
false
false
false
kaday/cylc
lib/cylc/run.py
1
3790
#!/usr/bin/env python # THIS FILE IS PART OF THE CYLC SUITE ENGINE. # Copyright (C) 2008-2015 NIWA # # 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 yo...
gpl-3.0
8,647,605,763,508,552,000
29.32
79
0.587335
false
3.805221
false
false
false
aemerick/galaxy_analysis
method_paper_plots/star_abundances.py
1
26128
from galaxy_analysis.plot.plot_styles import * import matplotlib.pyplot as plt import glob import deepdish as dd import yt from galaxy_analysis.utilities import utilities import numpy as np from matplotlib.ticker import NullFormatter from galaxy_analysis.particle_analysis.abundances import single_MDF # from galaxy_anal...
mit
2,397,714,309,862,547,500
35.542657
121
0.530618
false
2.944
false
false
false
sernst/cauldron
cauldron/session/display/__init__.py
1
23013
import json as _json_io import textwrap import typing from datetime import timedelta import cauldron as _cd from cauldron import environ from cauldron import render from cauldron.render import plots as render_plots from cauldron.render import texts as render_texts from cauldron.session import report def _get_report(...
mit
8,871,468,498,856,755,000
33.502249
79
0.655629
false
4.223344
false
false
false
julienmalard/Tikon
pruebas/test_calibrador/test_spotpy.py
1
1920
import unittest from warnings import warn as avisar import scipy.stats as estad from pruebas.test_central.rcrs.modelo_calib import generar from tikon.calibrador.spotpy_ import EMV, RS, BDD, CMEDZ, MC, MLH, CAACAA, CAA, ECBUA, ERP, CMMC, CalibSpotPy from tikon.ecs.aprioris import APrioriDist class PruebaSpotPy(unitte...
agpl-3.0
-2,336,974,433,023,352,000
40.630435
109
0.544648
false
3.054226
true
false
false
fanchao01/spider
mini_spider/log.py
1
2513
#!/usr/bin/env python #-*- coding:utf-8 -*- """ This module provide configure file management service in i18n environment. """ import os import logging import logging.handlers _LOG_FORMAT = "%(levelname)s: %(asctime)s: %(filename)s:%(lineno)d * %(thread)d %(message)s" _LOG_DATEFMT = "%m-%d %H:%M:%S" def init_log(lo...
gpl-2.0
-2,805,531,497,963,570,700
34.9
98
0.524473
false
4.432099
false
false
false
stonewell/wxglterm
src/utils/app_config.py
1
1301
import os import json class DictQuery(dict): def get(self, path, default=None): try: return self.__get(path, default) except: import logging logging.exception('get failed') def __get(self, path, default=None): keys = path.split("/") val = No...
mit
-2,868,741,877,912,930,300
25.55102
69
0.520369
false
4.210356
true
false
false
Brian-Tomasik/leveraged_investing
TaxRates.py
1
1393
class TaxRates(object): """Investor's tax rates""" def __init__(self, short_term_cap_gains_rate=.28, long_term_cap_gains_rate=.15, state_income_tax=.05): self.__short_term_cap_gains_rate = short_term_cap_gains_rate self.__long_term_cap_gains_rate = long_term_cap_gains_rate ...
unlicense
-9,186,204,606,484,050,000
40
109
0.653984
false
3.356627
false
false
false
solo2101/Tilo-Menu
src/lib/tilo/backend.py
1
3706
#!/usr/bin/env python # This application is released under the GNU General Public License # v3 (or, at your option, any later version). You can find the full # text of the license under http://www.gnu.org/licenses/gpl.txt. # By using, editing and/or distributing this software you agree to # the terms and condition...
gpl-2.0
-6,273,977,392,544,399,000
24.040541
121
0.648948
false
3.037705
true
false
false
utecht/random-lines
random-lines.py
1
1121
#!/usr/bin/env python import random import argparse import sys parser = argparse.ArgumentParser(description='Return random lines of file') parser.add_argument('file', type=argparse.FileType('r'), help='the input file') parser.add_argument('-n', '--num', type=int, help='number of lines to return') parser.add_argument('...
gpl-2.0
-3,425,612,094,720,691,700
30.138889
110
0.693131
false
3.202857
false
false
false
ldiary/pytest-testbook
setup.py
1
1591
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import re import codecs from setuptools import setup directory_name = os.path.dirname(__file__) with codecs.open(os.path.join(directory_name, 'pytest_testbook', '__init__.py'), encoding='utf-8') as fd: VERSION = re.compile(r".*__version__ = '(.*?)'", re.S)....
mit
2,069,228,989,268,938,500
30.196078
105
0.616593
false
3.624146
true
false
false
matthewwardrop/formulaic
formulaic/materializers/transforms/scale.py
1
1389
import numpy import scipy.sparse as spsparse from formulaic.utils.stateful_transforms import stateful_transform @stateful_transform def scale(data, center=True, scale=True, ddof=1, _state=None): data = numpy.array(data) if 'ddof' not in _state: _state['ddof'] = ddof else: ddof = _state[...
mit
-7,119,373,598,480,839,000
26.78
95
0.596112
false
3.507576
false
false
false
erilyth/sugar
src/jarabe/view/pulsingicon.py
1
7328
# Copyright (C) 2008 One Laptop Per Child # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distribu...
gpl-2.0
-5,282,615,998,041,395,000
29.406639
79
0.602211
false
3.671343
false
false
false
rwgdrummer/maskgen
maskgen/analytics/dctAnalytic.py
1
17525
# ============================================================================= # Authors: PAR Government # Organization: DARPA # # Copyright (c) 2016 PAR Government # All rights reserved. # # # adapted from https://github.com/enmasse/jpeg_read #==========================================================================...
bsd-3-clause
4,658,638,402,282,503,000
29.06175
96
0.473096
false
3.849956
false
false
false
scikit-optimize/scikit-optimize
skopt/callbacks.py
1
9377
"""Monitor and influence the optimization procedure via callbacks. Callbacks are callables which are invoked after each iteration of the optimizer and are passed the results "so far". Callbacks can monitor progress, or stop the optimization early by returning `True`. """ try: from collections.abc import Callable ...
bsd-3-clause
9,038,504,553,052,238,000
28.394984
79
0.581743
false
4.163854
false
false
false
bjackman/workload-automation
wlauto/resource_getters/standard.py
1
23149
# Copyright 2013-2015 ARM Limited # # 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 w...
apache-2.0
-598,047,231,617,503,000
38.70669
121
0.615016
false
4.317232
false
false
false
eliezerfot123/django-with-angular
django_with_angular_je/django_with_angular_je/settings.py
1
2686
""" Django settings for django_with_angular_je project. Generated by 'django-admin startproject' using Django 1.8.2. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ ""...
gpl-2.0
8,488,484,638,799,005,000
25.333333
71
0.693596
false
3.452442
false
false
false
astraw/stdeb
stdeb/command/install_deb.py
1
1027
import glob import os import stdeb.util as util from distutils.core import Command __all__ = ['install_deb'] class install_deb(Command): description = 'distutils command to install debian binary package' user_options = [] boolean_options = [] def initialize_options(self): pass def fin...
mit
6,799,082,127,808,595,000
25.333333
74
0.620253
false
3.919847
false
false
false
yookoala/ibus-cangjie
src/engine.py
1
16581
# Copyright (c) 2012-2013 - The IBus Cangjie authors # # This file is part of ibus-cangjie, the IBus Cangjie input method engine. # # ibus-cangjie 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...
gpl-3.0
8,909,056,220,710,151,000
31.89881
88
0.58947
false
3.995422
true
false
false
VPAC/pytsm
pytsm/actions/__init__.py
1
1692
# Copyright 2012-2014 VPAC # # This file is part of pytsm. # # pytsm 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. # # pytsm is distr...
gpl-3.0
950,840,453,649,099,100
27.677966
76
0.685579
false
3.880734
false
false
false
pablo-co/insight-jobs
process_stops.py
1
3206
import sys import traceback from bhulan.processVehicles import importTrucks, initCompute from bhulan.processStops import saveComputedStops from bhulan.util import notify, getTime from pymongo import MongoClient from bhulan.constants import WATTS_DATA_DB_KEY from bhulan.inputOutput import saveStopsToFile import numpy as...
mit
367,163,636,033,930,430
24.046875
105
0.591391
false
3.462203
false
false
false
partizand/bankparser
setup.py
1
3023
#!/usr/bin/python3 """Setup """ #import distutils.cmd import re from setuptools import setup, find_packages # import build # import src.bankparser # class GenFiles(distutils.cmd.Command): # """Генерация некоторых файлов проекта и справки # """ # user_options = [] # description = 'generate .py and rea...
gpl-3.0
-2,226,578,515,833,647,000
26.847619
76
0.578659
false
3.448113
false
false
false
CloverHealth/airflow
airflow/contrib/kubernetes/kubernetes_request_factory/pod_request_factory.py
1
3983
# 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
7,108,266,722,964,942,000
31.917355
90
0.659302
false
3.644099
false
false
false
dwalton76/ev3dev-lang-python
tests/motor/motor_param_unittest.py
1
24419
#!/usr/bin/env python # Based on the parameterized test case technique described here: # # http://eli.thegreenplace.net/2011/08/02/python-unit-testing-parametrized-test-cases import unittest import time import sys import ev3dev.ev3 as ev3 import parameterizedtestcase as ptc from motor_info import motor_info clas...
mit
2,423,050,435,570,949,000
38.705691
119
0.653794
false
3.42819
true
false
false
lbin/nexar-2
lib/utils/visualization.py
1
3989
# -------------------------------------------------------- # Tensorflow Faster R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by Xinlei Chen # -------------------------------------------------------- from __future__ import absolute_import from __future__ import division from __future__ impor...
mit
5,248,297,059,724,088,000
44.329545
99
0.598646
false
2.979089
false
false
false
DXCanas/content-curation
contentcuration/contentcuration/viewsets/channelset.py
1
4021
from django.core.exceptions import PermissionDenied from django.db.models import CharField from django.db.models import Q from rest_framework import serializers from rest_framework.permissions import IsAuthenticated from contentcuration.models import Channel from contentcuration.models import ChannelSet from contentcu...
mit
6,839,614,447,070,985,000
35.554545
88
0.66476
false
4.413831
false
false
false