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
credativUK/connector-magento
__unported__/magentoerpconnect/partner.py
1
25089
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
agpl-3.0
-4,476,961,058,515,787,300
37.539171
79
0.544781
false
4.363304
false
false
false
luotao1/Paddle
python/paddle/static/io.py
1
30947
# Copyright (c) 2018 PaddlePaddle 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 app...
apache-2.0
-2,991,404,676,168,279,000
36.602673
144
0.626587
false
4.095144
false
false
false
Erotemic/hotspotter
hsgui/_frontend/EditPrefSkel.py
1
2626
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/home/joncrall/code/hotspotter/hsgui/_frontend/EditPrefSkel.ui' # # Created: Mon Feb 10 13:40:41 2014 # by: PyQt4 UI code generator 4.9.1 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: ...
apache-2.0
-1,449,345,158,768,102,100
45.070175
161
0.739147
false
3.844802
false
false
false
thomas-maurice/docker-minecraft-webapp
webapp/lib/mcrcon.py
1
1703
import socket import select import struct class MCRconException(Exception): pass class MCRcon: socket = None def connect(self, host, port): self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.socket.connect((host, port)) def disconnect(self): self.socket.close...
gpl-3.0
6,767,356,456,409,357,000
31.132075
93
0.571932
false
3.818386
false
false
false
danidee10/Votr
api/api.py
1
3600
from os import getenv from models import db, Users, Polls, Topics, Options, UserPolls from flask import Blueprint, request, jsonify, session from datetime import datetime from config import SQLALCHEMY_DATABASE_URI if getenv('APP_MODE') == 'PRODUCTION': from production_settings import SQLALCHEMY_DATABASE_URI api...
gpl-3.0
-3,323,841,830,138,290,700
32.962264
127
0.648889
false
3.654822
false
false
false
jamesmunns/wate_backend
prototyping/create_schema.py
1
1046
import psycopg2 import getpass username = getpass.getuser() password = getpass.getpass("Database password for {}: ".format(username)) database = "wate" def create_user_table(cursor): user_schema = """ CREATE TABLE users ( id serial PRIMARY KEY, name text NOT NULL, use...
mit
-8,867,129,375,044,253,000
27.27027
81
0.632887
false
3.932331
false
false
false
Wilo/barcampMilagro2015
pushfeed/pushfeed/pipelines.py
1
1083
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html import logging from scrapy.conf import settings from scrapy.exceptions import DropItem import rethinkdb as r #class Pushfeed...
mit
595,242,613,530,834,000
31.818182
83
0.649123
false
3.61
false
false
false
hmpf/nav
python/nav/web/portadmin/urls.py
1
1470
# # Copyright (C) 2011, 2013-2015 Uninett AS # # This file is part of Network Administration Visualized (NAV). # # NAV is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License version 3 as published by # the Free Software Foundation. # # This program is distributed ...
gpl-3.0
2,910,476,749,803,089,400
32.409091
79
0.667347
false
3.62069
false
false
false
bmcage/centrifuge-1d
centrifuge1d/modules/direct_consolidation_saturated/options.py
1
7263
from __future__ import division, print_function import sys from ..shared.functions import lagrangian_derivative_coefs from numpy import linspace, power, empty, array, log from ..shared.consolidation import (create_CON, CON_SLURRY, CON_GOMPERTZ, CON_FREEFORM, CON_SLURRY_CC, CON_SLURR...
gpl-2.0
4,322,076,158,088,722,400
37.226316
101
0.514801
false
3.082767
false
false
false
Notxor/Neuronal
neuronal/neuromotor.py
1
3081
# -*- coding: utf-8 -*- # Neuronal - Framework for Neural Networks and Artificial Intelligence # # Copyright (C) 2012 dddddd <dddddd@pyphiverses.org> # Copyright (C) 2012 Notxor <gnotxor@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General P...
agpl-3.0
-3,130,294,366,610,631,700
40.486486
80
0.669381
false
3.178054
false
false
false
dlenski/stravacli
stravacli/QueryGrabber.py
1
1046
from http.server import HTTPServer, BaseHTTPRequestHandler import socket from urllib.parse import parse_qs class handler(BaseHTTPRequestHandler): def do_GET(self): self.server.received = parse_qs(self.path.split('?',1)[1]) self.send_response(200) self.end_headers() self.wfile.write(...
gpl-3.0
-4,080,119,067,574,555,600
33.866667
75
0.554493
false
4.376569
false
false
false
failys/CAIRIS
cairis/tools/PseudoClasses.py
1
16629
# 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...
apache-2.0
-6,147,163,597,620,550,000
29.234545
112
0.682783
false
3.527577
false
false
false
ZoranPavlovic/kombu
kombu/utils/objects.py
1
1945
"""Object Utilities.""" class cached_property: """Cached property descriptor. Caches the return value of the get method on first call. Examples: .. code-block:: python @cached_property def connection(self): return Connection() @connection.set...
bsd-3-clause
-138,779,550,533,933,420
29.390625
70
0.515681
false
4.256018
false
false
false
Fuzen-py/BladeAndSoulAPI
BladeAndSoul/bns.py
1
21211
import asyncio import json import aiohttp from bs4 import BeautifulSoup from .errors import (CharacterNotFound, FailedToParse, InvalidData, ServiceUnavialable) try: import lxml parser = 'lxml' except ImportError: parser = 'html.parser' # types of weapons in game VALID_WEAPONS = ['d...
mit
8,555,198,700,855,818,000
42.542094
173
0.564395
false
3.531224
false
false
false
Llamatech/sis-fibo
model/vos/cuenta.py
1
2245
#-*- coding:iso-8859-1 -*- """ Clase que modela la información de una cuenta en el sistema """ # NUMERO.SALDO.TIPO_CUENTA,CERRADA,CLIENTE,OFICINA class Cuenta(object): def __init__(self, numero, saldo, tipo_cuenta, cerrada, cliente, oficina): self.numero = numero self.saldo = saldo ...
gpl-2.0
7,610,641,571,238,857,000
33.619048
136
0.536988
false
3.004016
false
false
false
99cloud/keystone_register
openstack_dashboard/dashboards/project/access_and_security/security_groups/forms.py
1
12028
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
apache-2.0
-5,296,865,002,722,064,000
47.305221
79
0.427835
false
5.617936
false
false
false
IanDoarn/zbsmsa
tests/loans.py
1
15622
""" loans.py Final working version of the mutation automation Mutates items from special excel file from inventory type CI - Centralized Inventory to type ZDI - Zimmer Distributor Inventory Written by: Ian Doarn Maintained by: Ian Doarn """ from zbsmsa.site import Site from zbsmsa.inventory.stock import Stock, Produ...
apache-2.0
6,084,375,937,478,261,000
44.150289
117
0.475355
false
4.379591
false
false
false
LAIRLAB/qr_trees
src/python/run_ilqr_diffdrive.py
1
2328
#!/usr/bin/env python # # Arun Venkatraman (arunvenk@cs.cmu.edu) # December 2016 # # If we are not running from the build directory, then add lib to path from # build assuming we are running from the python folder import os full_path = os.path.realpath(__file__) if full_path.count("src/python") > 0: import sys ...
bsd-3-clause
9,018,473,560,120,826,000
28.468354
94
0.614691
false
2.818402
false
true
false
mcvidomi/poim2motif
run_svm_real.py
1
1483
''' Created on 08.06.2015 @author: marinavidovic ''' import os import pdb import utils_svm import pickle import numpy as np import copy import genQ import makePOIM import view import matplotlib matplotlib.use('Agg') if __name__ == '__main__': read_data = 1 datapath = "/home/mvidovic/POIM...
mit
-5,112,159,067,973,785,000
25.017544
93
0.665543
false
2.977912
false
true
false
SevereOverfl0w/MCDirectory
migrations/versions/10723b632a87_.py
1
1036
"""empty message Revision ID: 10723b632a87 Revises: 3d7ce850941c Create Date: 2013-11-12 22:18:26.482191 """ # revision identifiers, used by Alembic. revision = '10723b632a87' down_revision = '3d7ce850941c' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - ...
mit
5,601,540,713,512,676,000
27.777778
63
0.664093
false
3.419142
false
false
false
oculusstorystudio/kraken
Python/kraken/ui/GraphView/pyflowgraph/node.py
1
13604
# # Copyright 2015-2017 Eric Thivierge # import math import json from kraken.ui.Qt import QtWidgets, QtGui, QtCore from port import InputPort, OutputPort, IOPort class NodeTitle(QtWidgets.QGraphicsWidget): __color = QtGui.QColor(25, 25, 25) __font = QtGui.QFont('Roboto', 14) __font.setLetterSpacing(QtG...
bsd-3-clause
-1,098,339,499,066,316,300
31.625899
115
0.600485
false
4.132442
false
false
false
sebmolinari/los-kpos
app/mod_auth/controllers.py
1
4029
#Flask imports from flask import Blueprint, render_template, flash, redirect, url_for, abort from flask.ext.login import LoginManager, login_required, logout_user, login_user #App imports from app import app from app.mod_auth.forms import LoginForm, UserForm, EmailForm, PasswordForm from app.mod_auth.models import Use...
gpl-3.0
-7,708,140,034,764,960,000
28.844444
81
0.63316
false
3.590909
false
false
false
SRI-CSL/ETB
demos/allsatlive/yices_parse.py
1
2665
#Defines grammar for reading yices files; used in the include <file> api for yices. from pyparsing import * #Grammar for s-expressions which is used to parse Yices expressions token = Word(alphanums + "-./_:*+=!<>") LPAR = "(" RPAR = ")" #Yices comments are ignored; parentheses are retained since Yices expressions a...
gpl-3.0
-756,669,965,276,283,000
26.193878
155
0.670544
false
3.153846
false
false
false
Gabotero/GNURadioNext
gr-blocks/python/qa_tagged_stream_mux.py
1
3562
#!/usr/bin/env python # # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # ...
gpl-3.0
8,027,701,689,082,090,000
31.09009
87
0.576081
false
3.226449
true
false
false
phev8/dataset_tools
experiment_handler/time_synchronisation.py
1
1444
import os import pandas as pd def read_synchronisation_file(experiment_root): filepath = os.path.join(experiment_root, "labels", "synchronisation.csv") return pd.read_csv(filepath) def convert_timestamps(experiment_root, timestamps, from_reference, to_reference): """ Convert numeric timestamps (seco...
mit
1,236,938,527,149,042,200
33.404762
171
0.702216
false
4.161383
false
false
false
xfaxca/pygaero
example/tmax_peakfind_example.py
1
4986
# tmax_peakfind_example.py """ Demonstration of some of the primary functions in pygaero, including Tmax finding and elemental analysis. """ # Module import from pygaero import pio from pygaero import therm from pygaero import gen_chem import os import matplotlib.pyplot as plt def example1(): # -----------------...
gpl-3.0
1,347,200,790,599,786,200
53.791209
117
0.606899
false
3.252446
false
false
false
AIFDR/inasafe-django
django_project/realtime/helpers/base_indicator.py
2
2769
# coding=utf-8 from builtins import range from builtins import object from datetime import datetime, timedelta from math import isnan from django.utils.translation import ugettext as _ import numpy import pytz from realtime.models.earthquake import Earthquake __author__ = 'Rizky Maulana Nugraha "lucernae" <lana.pcfre@...
bsd-2-clause
-3,732,841,021,557,332,000
26.415842
75
0.660166
false
3.955714
false
false
false
morinted/plover
plover/gui_qt/dictionary_editor.py
1
13523
from operator import attrgetter, itemgetter from collections import namedtuple from itertools import chain from PyQt5.QtCore import ( QAbstractTableModel, QModelIndex, Qt, ) from PyQt5.QtWidgets import ( QComboBox, QDialog, QStyledItemDelegate, ) from plover.translation import escape_translat...
gpl-2.0
-4,029,928,462,594,560,500
34.124675
89
0.569844
false
4.330131
false
false
false
RyanJenkins/ISS
ISS/templatetags/pagination.py
1
3715
import urlparse import urllib from django import template register = template.Library() def unfuck_percent_encoded_utf8(fucked_unicode_str): # OK So... *dramatic pause* # (((Some))) browsers insist on transforming unicode characters outside of # the ASCII range to their UTF-8 encoding, and then url encod...
gpl-3.0
8,622,333,044,276,108,000
38.946237
106
0.679139
false
3.763931
false
false
false
Azure/azure-sdk-for-python
sdk/servermanager/azure-mgmt-servermanager/azure/mgmt/servermanager/models/session_parameters.py
1
2295
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
2,877,594,313,000,630,300
45.836735
114
0.659695
false
4.388145
false
false
false
ermo/privateer_wcu
modules/missions/cargo_mission.py
1
8981
from go_somewhere_significant import * from go_to_adjacent_systems import * import Briefing import Director import VS import debug import faction_ships import launch import quest import unit import universe import vsrandom class cargo_mission (Director.Mission): def initbriefing(self): VS.IOmessage (0,"ca...
gpl-2.0
812,984,243,763,449,700
48.894444
169
0.620755
false
3.417428
false
false
false
AASHE/hub
hub/apps/metadata/migrations/0001_initial.py
1
2996
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('iss', '__first__'), ] operations = [ migrations.CreateModel( name='AcademicDiscipline', fields=[ ...
mit
-6,569,062,075,885,106,000
34.247059
114
0.480975
false
4.688576
false
false
false
googleapis/googleapis-gen
google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/enums/types/manager_link_status.py
1
1226
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
-1,836,098,244,861,664,500
27.511628
74
0.672104
false
4.006536
false
false
false
LividInstruments/LiveRemoteScripts
Launchpad_M4L/LaunchpadM4L.py
1
4621
# http://lividinstruments.com from __future__ import with_statement import Live import math """ _Framework files """ from _Framework.ButtonElement import ButtonElement # Class representing a button a the controller from _Framework.ButtonMatrixElement import ButtonMatrixElement # Class representing a 2-dimensional set...
mit
2,758,905,294,441,095,000
59.815789
235
0.752651
false
3.863712
false
false
false
StellarCN/py-stellar-base
stellar_sdk/signer_key.py
1
3956
from . import xdr as stellar_xdr from .__version__ import __issues__ from .exceptions import ValueError from .strkey import StrKey __all__ = ["SignerKey"] class SignerKey: """The :class:`SignerKey` object, which represents an account signer key on Stellar's network. :param signer_key: The XDR signer object ...
apache-2.0
-7,404,016,642,933,082,000
38.959596
139
0.638524
false
3.30217
false
false
false
songeater/SONGSHTR
soundfunc.py
1
4391
import numpy as np from scipy.fftpack import dct, idct import sys ''' ---------- FUNCTIONS ---------- ''' def get_config(): config = {} config['sound_file'] = "harvestmoon-mono-hp500.wav" config['save_file'] = config['sound_file'] + "_modelsave_" config['blocksize']=13000 config['comp...
agpl-3.0
5,898,696,401,641,609,000
33.128
110
0.578228
false
3.053547
true
false
false
mvcsantos/QGIS
python/plugins/processing/algs/qgis/RandomPointsAlongLines.py
1
5227
# -*- coding: utf-8 -*- """ *************************************************************************** RandomPointsAlongLines.py --------------------- Date : April 2014 Copyright : (C) 2014 by Alexander Bruy Email : alexander dot bruy at gmail dot com ****...
gpl-2.0
-8,700,106,233,471,537,000
37.718519
135
0.545246
false
4.506034
false
false
false
saneyuki/servo
python/servo/bootstrap_commands.py
1
22544
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your #...
mpl-2.0
885,229,770,263,548,800
44.821138
118
0.522489
false
4.233615
false
false
false
cabanm/project-euler
Problem 23/problem23.py
1
1277
# Find the sum of all the positive integers which # cannot be written as the sum of two abundant numbers. # # Facts: # All integers greater than 28123 can be # written as the sum of two abundant numbers. # Abundant number = sum of proper divisors of n exceed n. # # Find all abundant numbers up to and including ...
gpl-2.0
7,158,230,133,010,168,000
29.146341
82
0.645262
false
3.107056
false
false
false
mapbox/atom-shell
script/create-dist.py
1
7365
#!/usr/bin/env python import argparse import os import re import shutil import subprocess import sys import tarfile from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, NODE_VERSION, \ TARGET_PLATFORM, DIST_ARCH from lib.util import scoped_cwd, rm_rf, get_atom_shell_version, make_zip, \ ...
mit
4,588,913,929,787,219,500
27.326923
78
0.621453
false
3.329566
false
false
false
afh/cmakedash
cmakedash.py
1
1690
#!/usr/bin/env python # # cmakedash - a dash docset generator for CMake import os import re import subprocess from bs4 import BeautifulSoup, NavigableString, Tag from docsetgenerator import DocsetGenerator class CMakeDocsetGenerator (DocsetGenerator): def __init__(self): DocsetGenerator.__init__(self) self....
mit
-1,009,468,933,443,884,300
27.644068
77
0.621302
false
3.814898
false
false
false
hjanime/VisTrails
vistrails/db/versions/v0_9_3/domain/workflow.py
1
7277
############################################################################### ## ## Copyright (C) 2014-2015, New York University. ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## ...
bsd-3-clause
-6,573,125,723,641,042,000
41.063584
79
0.578123
false
3.963508
false
false
false
semanticize/semanticizest
semanticizest/parse_wikidump/__init__.py
1
11223
"""Parsing utilities for Wikipedia database dumps.""" from __future__ import print_function from os.path import basename from bz2 import BZ2File from collections import Counter, namedtuple import gzip from HTMLParser import HTMLParser from itertools import chain import logging import re import xml.etree.ElementTree a...
apache-2.0
3,747,019,002,081,521,700
32.008824
79
0.557605
false
4.03125
false
false
false
KelSolaar/sIBL_GUI
sibl_gui/components/core/inspector/models.py
1
2265
#!/usr/bin/env python # -*- coding: utf-8 -*- """ **models.py** **Platform:** Windows, Linux, Mac Os X. **Description:** Defines the :class:`sibl_gui.components.core.inspector.inspector.Inspector` Component Interface class Models. **Others:** """ from __future__ import unicode_literals import foundat...
gpl-3.0
2,661,083,915,787,938,300
27.670886
100
0.587638
false
4.001767
false
false
false
sekikn/ambari
ambari-common/src/main/python/ambari_ws4py/server/wsgirefserver.py
2
5353
# -*- coding: utf-8 -*- __doc__ = """ Add WebSocket support to the built-in WSGI server provided by the :py:mod:`wsgiref`. This is clearly not meant to be a production server so please consider this only for testing purpose. Mostly, this module overrides bits and pieces of the built-in classes so that it supports the ...
apache-2.0
4,859,754,912,478,700,000
33.095541
89
0.653092
false
4.330906
false
false
false
fishroot/nemoa
nemoa/dataset/commons/labels/__init__.py
1
2018
# -*- coding: utf-8 -*- __author__ = 'Patrick Michl' __email__ = 'frootlab@gmail.com' __license__ = 'GPLv3' import nemoa import numpy import importlib def convert(list, input, output = None, filter = False): generic_types = ['number', 'string', 'float'] if isinstance(list, (numpy.ndarray)): list = ...
gpl-3.0
-1,435,464,430,566,239,200
31.031746
69
0.600099
false
3.779026
false
false
false
marado/youtube-dl
youtube_dl/extractor/npo.py
1
12656
from __future__ import unicode_literals from .subtitles import SubtitlesInfoExtractor from .common import InfoExtractor from ..utils import ( fix_xml_ampersands, parse_duration, qualities, strip_jsonp, unified_strdate, url_basename, ) class NPOBaseIE(SubtitlesInfoExtractor): def _get_toke...
unlicense
-5,777,262,629,636,759,000
33.579235
111
0.477323
false
3.51751
false
false
false
googleapis/googleapis-gen
google/ads/googleads/v6/googleads-py/google/ads/googleads/v6/resources/types/mobile_device_constant.py
1
2416
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
-6,480,759,131,112,648,000
27.423529
90
0.627897
false
4.151203
false
false
false
6/GeoDJ
geodj/settings.py
1
5663
import os # Override these on production env os.environ.setdefault("APP_ENV", "development") os.environ.setdefault("SECRET_KEY", "^uhrm48x9y=1f&+$bg=oc(#23mp0*g5k%8+si9tdz7&4_xk&lf") if os.environ["APP_ENV"] == "development": try: # Add secret ENV varibales for development (e.g. API keys) to secrets.py ...
mit
8,175,222,836,632,787,000
31.545977
89
0.693449
false
3.586447
false
false
false
userzimmermann/python-moretools
moretools/_types.py
1
2808
# python-moretools # # many more basic tools for python 2/3 # extending itertools, functools and operator # # Copyright (C) 2011-2016 Stefan Zimmermann <zimmermann.code@gmail.com> # # python-moretools is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License a...
gpl-3.0
2,180,999,676,987,541,200
20.112782
77
0.742877
false
3.549937
false
false
false
petry/kanboard
apps/core/migrations/0001_initial.py
1
1775
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Board' db.create_table(u'core_board', ( (u'id...
apache-2.0
3,847,779,870,579,923,000
35.244898
102
0.56169
false
3.585859
false
false
false
izapolsk/integration_tests
cfme/roles.py
1
28996
from cfme.utils.log import logger def _remove_page(roles, group, pages): if group in roles: for page in pages: if page in roles[group]: roles[group].remove(page) else: logger.info("Page %s attempted to be removed from role %s, " ...
gpl-2.0
-6,055,738,492,595,354,000
31.32553
100
0.453373
false
4.588701
true
false
false
HopeFOAM/HopeFOAM
ThirdParty-0.1/ParaView-5.0.1/Examples/Catalyst/PythonDolfinExample/simulation-catalyst-step6.py
1
8271
"""This demo program solves the incompressible Navier-Stokes equations on an L-shaped domain using Chorin's splitting method.""" # Copyright (C) 2010-2011 Anders Logg # # This file is part of DOLFIN. # # DOLFIN is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Publi...
gpl-3.0
-5,108,514,945,316,003,000
29.977528
355
0.685407
false
3.050904
false
false
false
progdupeupl/pdp_website
pdp/forum/migrations/0001_initial.py
1
5896
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import datetime class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ m...
agpl-3.0
5,790,191,699,543,362,000
48.855932
150
0.556009
false
4.217204
false
false
false
racmariano/skidom
backend/resorts/models/conditions.py
1
2431
# -*- coding: utf-8 -*- from __future__ import unicode_literals from .resort import Resort from django.db import models from django.contrib.postgres.fields import ArrayField from dynamic_scraper.models import Scraper, SchedulerRuntime from scrapy_djangoitem import DjangoItem import datetime # Past and...
mit
-8,431,988,466,548,880,000
42.2
122
0.673797
false
3.601481
false
false
false
justinmeister/spaceinvaders-spyral
game/level.py
1
1501
import os import spyral from .sprites import sprite from . import collision WIDTH = 1200 HEIGHT = 900 WHITE = (255, 255, 255) SIZE = (WIDTH, HEIGHT) GREEN = (60, 179, 113) RED = (255, 0, 0) BLACKBLUE = (19, 15, 48) BG_COLOR = BLACKBLUE ENEMYGAP = 30 XMARGIN = 175 YMARGIN = 100 MOVEX = 15 MOVEY = 20 ENEMYSIDE = 50 BA...
mit
-697,301,725,593,934,000
25.803571
75
0.632245
false
3.284464
false
false
false
nakamura-akifumi/kassis_orange
app_search/helpers/paginate_helper.py
1
1579
import math class Paginate: def __init__(self, pagetab_count = 5, per_page = 10): pass self.pagetab_count = pagetab_count self.per_page = per_page def paginate(self, result_count, current_page): paginate_list = [] pagetab_count = self.pagetab_count per_page = se...
mit
1,459,151,800,332,375,000
32.595745
75
0.513616
false
3.532438
false
false
false
willemt/docopt2ragel
setup.py
1
1202
from setuptools import setup, find_packages import codecs from os import path here = path.abspath(path.dirname(__file__)) def long_description(): with codecs.open('README.rst', encoding='utf8') as f: return f.read() setup( name='docopt2ragel', version='0.1.3', description='Convert your doco...
bsd-3-clause
-9,220,080,780,478,510,000
26.318182
66
0.608153
false
3.779874
false
false
false
KamLii/Databaes
Databaes/urls.py
1
1369
"""Databaes URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-b...
mit
7,490,611,764,296,033,000
40.484848
79
0.705625
false
3.51928
false
false
false
Makki1/old-svn
avr/sketchbook/GiraRM_Debug/freebus/freebus_ets/software/freebus-ets/src/GUI/FB_ProgramFrame.py
1
10920
#!/usr/bin/ #-*- coding: iso-8859-1 -*- #=============================================================================== # __________ ________________ __ _______ # / ____/ __ \/ ____/ ____/ __ )/ / / / ___/ # / /_ / /_/ / __/ / __/ / __ / / / /\__ \ # / __/ / _, _/ /___/ /___/ /_/ / /_/ /___/ /...
gpl-3.0
865,511,498,934,486,400
39.83908
111
0.554487
false
4.284033
false
false
false
rapidpro/chatpro
chatpro/profiles/models.py
1
4753
from __future__ import absolute_import, unicode_literals from chatpro.rooms.models import Room from dash.orgs.models import Org from dash.utils import intersection from dash.utils.sync import ChangeType from django.contrib.auth.models import User from django.db import models from django.utils.translation import ugette...
bsd-3-clause
4,602,666,662,489,233,000
36.132813
118
0.622554
false
3.895902
false
false
false
AlandSailingRobots/sailingrobot
update_config.py
1
1807
#!/usr/bin/python3 # Updates the configuration in the json to the database # Can run without argument for using standard file # Or specify the file by passing it as a argument import json import sqlite3 import sys if len(sys.argv) > 1: if str(sys.argv[1]) == 'ASPire': filename = 'config_ASPire.json' ...
gpl-2.0
8,881,442,081,132,022,000
28.145161
143
0.556724
false
3.571146
false
false
false
xu6148152/Binea_Python_Project
PythonCookbook/text_str/strs_and_text.py
1
7706
# !python3 import re def test_re_split(): line = 'asdf fjdk; dfjkaf, fdjksf, jdksf, foo' print(re.split(r'[;,\s]\s*', line)) fields = re.split(r'(;|,|\s)\s*', line) print(fields) values = fields[::2] print(values) delimiter = fields[1::2] + [''] print(delimiter) print(re.split(...
mit
9,049,429,624,892,995,000
22.530675
94
0.580574
false
3.023256
true
false
false
andrewderekjackson/python_lcd_menu
lcd_menu/menu.py
1
4202
import os class MenuItem(object): '''A single menu item which can contain child menu items''' def __init__(self, title, items=None, refresh_callback=None, refresh_callback_args = None): self._title = title self._items = items self._refresh_callback = refresh_callback self._refr...
mit
5,973,343,013,663,982,000
24.011905
95
0.565445
false
4.210421
false
false
false
daniel-kurushin/iisu
biu/khc.py
1
6304
import sys from struct import pack, unpack from time import sleep class KHC(object): NAME = 'KHC' cmd_inc_engine = b'\xae\xae\x01\x00\x01\x08\x00' # увеличить обороты и подтвердить результат cmd_dec_engine = b'\xae\xae\x01\x00\x02\x08\x00' # уменьшить обороты и подтвердить результат cmd_stop_engine = b'\x...
gpl-3.0
1,060,215,723,341,621,400
28.781095
96
0.589208
false
2.267424
false
false
false
markgw/jazzparser
src/jazzparser/utils/latex.py
1
1979
"""Latex output utility functions to help with producing valid Latex files. Utility functions for handling processing and output of Latex. """ """ ============================== License ======================================== Copyright (C) 2008, 2010-12 University of Edinburgh, Mark Granroth-Wilding This file is...
gpl-3.0
-1,280,402,752,457,710,600
34.339286
80
0.622537
false
4.014199
false
false
false
landier/imdb-crawler
crawler/libs/sqlalchemy/orm/deprecated_interfaces.py
1
21785
# orm/deprecated_interfaces.py # Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from sqlalchemy import event, util from .interfaces import EXT_CONTINUE ...
gpl-3.0
4,175,316,921,779,378,000
35.923729
84
0.629653
false
4.954514
false
false
false
Haynie-Research-and-Development/jarvis
deps/lib/python3.4/site-packages/netdisco/discoverables/__init__.py
1
5004
"""Provides helpful stuff for discoverables.""" # pylint: disable=abstract-method import ipaddress from urllib.parse import urlparse from ..const import ( ATTR_NAME, ATTR_MODEL_NAME, ATTR_HOST, ATTR_PORT, ATTR_SSDP_DESCRIPTION, ATTR_SERIAL, ATTR_MODEL_NUMBER, ATTR_HOSTNAME, ATTR_MAC_ADDRESS, ATTR_PROPERTIE...
gpl-2.0
-675,812,168,902,687,900
30.275
76
0.609712
false
4.074919
false
false
false
jsidabras/GA-PMR
HFSS-loadbest.py
1
1771
# ---------------------------------------------- # Script Written by Jason W. Sidabras (jason.sidabras@cec.mpg.de) # requires jsidabras/hycohanz as of 20-04-2017 # Loads a file with a list of 1s and 0s and implements it to HFSS as Silv/Vac # used to load the best results per generation or final # ----------------...
mit
856,297,286,986,434,200
27.032787
91
0.629588
false
2.917628
false
false
false
eeriks/velo.lv
velo/payment/forms.py
1
19328
from django import forms from django.contrib import messages from django.utils import timezone from django.core.urlresolvers import reverse from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from crispy_forms.layout import Layout, Div, HTML, Field from crispy_forms.he...
gpl-3.0
-5,545,904,322,587,059,000
41.946667
593
0.506623
false
4.65799
false
false
false
saffsd/assignmentprint
assignmentprint.py
1
15044
""" Utility funtions and classes for preparing project marking bundles for student assignments. Marco Lui <saffsd@gmail.com>, November 2012 """ import os, sys, csv, re import tokenize, textwrap, token import trace, threading import imp import contextlib from cStringIO import StringIO from pprint import pformat impor...
gpl-3.0
-6,263,825,766,030,460,000
30.276507
101
0.590335
false
3.655005
false
false
false
artificialnull/IshanBoot
aliasbot.py
1
9126
#!/usr/bin/python3 import requests import json import os import time import random as rand import subprocess #telegram bot stuff url = "https://api.telegram.org/bot%s/%s" token = open("token.txt").read().replace('\n', '') print(url % (token, "getUpdates")) path = os.path.dirname(__file__) #globals locked = [] aliase...
gpl-3.0
-6,381,240,377,747,982,000
28.432258
112
0.49463
false
4.093315
false
false
false
persepolisdm/translation-API
pdm_api/views/default.py
1
1257
from pyramid.response import Response from pyramid.view import view_config from pyramid.httpexceptions import HTTPForbidden from pyramid import request from sqlalchemy.exc import DBAPIError from ..models.mymodel import MyModel, request_log, access_log, banlist from ..settings import get_settings import datetime @view...
gpl-3.0
-3,306,338,348,368,249,300
33.916667
74
0.739857
false
3.820669
false
false
false
AbhilashReddyM/GeometricMultigrid
mgd3d.py
1
4921
""" 2017 (c) A. R. Malipeddi 3D geometric multigrid code for poissons equation in a cube. - Finite difference method - 7pt operator - trilinear interpolation - Two-color Gauss Seidel smoothing """ import numpy as np def GSrelax(nx,ny,nz,u,f,iters=1,flag=1): ''' Red-Black Gauss Seidel smoothing flag : 1 ...
mit
-4,327,896,811,227,233,300
28.291667
154
0.470839
false
1.799927
false
false
false
aalien/mib
mib.py
1
7386
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # mib: Modular irc bot # Copyright Antti Laine <antti.a.laine@tut.fi> # # 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 ...
mit
7,265,648,255,817,794,000
37.670157
79
0.558218
false
4.51467
true
false
false
team-vigir/vigir_behaviors
vigir_flexbe_states/src/vigir_flexbe_states/read_dynamic_parameter_state.py
1
2586
#!/usr/bin/env python from flexbe_core import EventState, Logger import rospy from dynamic_reconfigure.client import Client """ Created on 11/03/2014 @author: Philipp Schillinger """ class ReadDynamicParameterState(EventState): """ Reads a given trajectory controller parameter. """ LEFT_ARM_WRX = ['left_arm_t...
bsd-3-clause
9,053,889,298,215,037,000
30.536585
143
0.664346
false
2.905618
false
false
false
will-iam/Variant
script/process/ergodicity_scaling.py
1
4083
#!/usr/bin/python3 # -*- coding:utf-8 -*- import __future__ import parser import sys import matplotlib.pyplot as plt #plt.style.use('ggplot') import numpy as np import operator from collections import * caseSize = (8192, 8192) if parser.args.res: maxAvailableNode = parser.args.res else: maxAvailableNode = 8 ...
mit
3,501,576,982,939,167,000
30.898438
137
0.62552
false
2.93319
false
false
false
rfleschenberg/django-shop
example/myshop/migrations/polymorphic/0003_add_polymorphic.py
1
9751
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import cms.models.fields import djangocms_text_ckeditor.fields class Migration(migrations.Migration): dependencies = [ ('cms', '0013_urlconfrevision'), ('cont...
bsd-3-clause
-1,009,144,222,055,504,600
44.565421
169
0.573172
false
4.428247
false
false
false
elastic/elasticsearch-py
test_elasticsearch/test_types/async_types.py
1
3095
# Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use ...
apache-2.0
6,571,657,479,850,991,000
27.394495
83
0.625202
false
3.582176
false
false
false
gemagomez/keepnote
keepnote/gui/main_window.py
1
52638
""" KeepNote Graphical User Interface for KeepNote Application """ # # KeepNote # Copyright (c) 2008-2009 Matt Rasmussen # Author: Matt Rasmussen <rasmus@mit.edu> # # 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...
gpl-2.0
-3,410,582,267,432,658,000
30.576485
87
0.520195
false
4.294175
false
false
false
heytcass/homeassistant-config
deps/cherrypy/_cpreqbody.py
1
37427
"""Request body processing for CherryPy. .. versionadded:: 3.2 Application authors have complete control over the parsing of HTTP request entities. In short, :attr:`cherrypy.request.body<cherrypy._cprequest.Request.body>` is now always set to an instance of :class:`RequestBody<cherrypy._cpreqbody.RequestBody>`, and *...
mit
8,550,716,814,100,659,000
35.765226
84
0.58538
false
4.25017
false
false
false
lykops/lykops
lykops/urls.py
1
5817
"""lykops URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-bas...
apache-2.0
4,648,493,441,235,367,000
63.595506
132
0.744651
false
3.179757
false
false
false
google/tmppy
_py2tmp/ir0_optimization/_expression_simplification.py
1
17752
# Copyright 2017 Google 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 by applicable law or...
apache-2.0
-2,463,025,841,349,026,000
44.634961
171
0.534193
false
3.903254
false
false
false
melmothx/jsonbot
jsb/plugs/wave/gadget.py
1
4625
# jsb.plugs.wave/gadget.py # # ## jsb imports from jsb.lib.commands import cmnds from jsb.lib.examples import examples from jsb.lib.persist import PlugPersist gadgeturls = PlugPersist('gadgeturls') gadgeturls.data['gadget'] = 'https://jsonbot.appspot.com/gadget.xml' gadgeturls.data['poll'] = 'https://jsonbot.appspo...
mit
9,067,515,519,668,668,000
28.647436
111
0.644108
false
3.200692
false
false
false
mellowizz/ocny_tax_info
qgis_show_ocny_tax_info.py
1
1143
from qgis.core import * from qgis.gui import * import mechanize import cookielib @qgsfunction(args='auto', group='Custom') def show_tax_info(pin, feature, parent): br = mechanize.Browser() # Cookie Jar cj = cookielib.LWPCookieJar() br.set_cookiejar(cj) br.set_handle_equiv(True) br.set_handle...
gpl-3.0
-1,176,792,807,719,864,800
26.214286
79
0.64392
false
3.05615
false
false
false
AlexWoo/pyed
pysys/pycmdserver.py
1
1693
from pyevent.event import event from pyevent.tcpserver import tcpserver from pyevent.tcpconnection import tcpconnection class cmdserver(tcpserver): def __init__(self, pesys): self.evs = pesys.evs self.tms = pesys.tms self.log = pesys.log self.proc = pesys.proc self.proc.set...
bsd-2-clause
-195,326,906,366,246,620
32.196078
94
0.594802
false
3.352475
false
false
false
NCI-Cloud/cloud-tools
check-defunct-instances.py
1
1214
#!/usr/bin/env python # # Take a list of instance UUIDs and check their status. If the last activity # recorded for them is more than six months ago mark them as defunct. from util import get_nova_client, get_keystone_client from util import get_instance, is_instance_to_be_expired from util import output_report from u...
gpl-3.0
3,662,251,379,629,455,400
27.904762
77
0.584843
false
4.019868
false
false
false
maeltac/hazanet
sense.py
1
1881
import pdb """ Each sensor that uses this will follow these rules: calling sensor.startup() function will initialize and calibrate the sensor. It will return 'Green' on success, 'Red' on failure calling sensor.read() will return a float for that tick calling sensor.reset() will attempt to reset the sensor, returning 0...
apache-2.0
-8,357,207,316,017,917,000
16.416667
127
0.5832
false
3.747012
false
false
false
Hossein-Noroozpour/PyHDM
hml/classification/HNearestNeighborsClassifier.py
1
2014
#!/usr/bin/python3.3 # coding=utf-8 """ Module for K nearest neighbours. """ __author__ = 'Hossein Noroozpour Thany Abady' #from math3d import sqrt import numpy class HNearestNeighboursClassifier(): """ Class for K nearest neighbors algorithm. """ def __init__(self, n_neighbors=5, weight_function=l...
mit
3,813,939,173,336,904,000
25.866667
120
0.478153
false
3.688645
false
false
false
ybonjour/nuus
services/indexing/Indexer.py
1
3702
__author__ = 'Yves Bonjour' from Tokenizer import create_tokenizer import redis import uuid def create_indexer(redis_host, redis_port): tokenizer = create_tokenizer() redis_db = redis.Redis(redis_host, redis_port) store = RedisIndexStore(redis_db) return Indexer(store, tokenizer) class Indexer: ...
mit
5,113,585,835,216,535,000
29.105691
93
0.642896
false
3.820433
false
false
false
cria/microSICol
import_db.py
1
7329
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Script to import XML data to current SICol database # Obs: This script must be executed on root directory # Author:Renato Arnellas Coelho renatoac at gmail dot com import sys import os from xml.dom.minidom import Document,parse def importSQLite(xml,sqlite_path='./db/sql...
gpl-2.0
-555,823,517,836,128,260
39.716667
127
0.617137
false
3.573379
false
false
false
GoogleCloudPlatform/professional-services
examples/bq-email-exports/export_query_results_function/main.py
1
2698
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
-1,615,927,224,140,515,800
34.973333
84
0.659748
false
3.854286
false
false
false
hustodemon/spacewalk
backend/server/rhnServer/server_hardware.py
1
34703
# # Copyright (c) 2008--2014 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
gpl-2.0
-6,922,134,149,411,319,000
32.757782
109
0.51788
false
3.919471
false
false
false
iffy/eliot
benchmarks/logwriter.py
1
1041
""" A benchmark for eliot.logwriter. """ import tempfile import time from twisted.internet.task import react from twisted.python.filepath import FilePath from eliot.logwriter import ThreadedFileWriter LENGTH = 100 MESSAGES = 100000 def main(reactor): print "Message size: %d bytes Num messages: %d" % (LENGT...
apache-2.0
-6,183,397,444,295,994,000
20.6875
74
0.622478
false
3.57732
false
false
false
hirofumi0810/tensorflow_end2end_speech_recognition
utils/dataset/xe.py
1
5444
#! /usr/bin/env python # -*- coding: utf-8 -*- """Base class for loading dataset for the frame-wise model. In this class, all data will be loaded at each step. You can use the multi-GPU version. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function imp...
mit
-3,416,920,738,480,581,600
35.536913
93
0.549596
false
3.850071
false
false
false
cs591B1-Project/Social-Media-Impact-on-Stock-Market-and-Price
data/25 verizon/getDataAutoQuery.py
1
3761
import webhose; import time; from datetime import datetime, timedelta from lxml import html import requests import unirest webhose.config(token='c6052904-f312-436b-a6d8-d915084ac866') days_back = 30 date_days_ago = datetime.now() - timedelta(days=days_back) organization = 'verizon' lang = 'english' country = 'US' #...
mit
3,822,441,865,177,565,000
26.253623
208
0.686785
false
2.71945
false
false
false
jumpserver/jumpserver
apps/perms/serializers/asset/permission.py
1
5347
# -*- coding: utf-8 -*- # from rest_framework import serializers from django.utils.translation import ugettext_lazy as _ from django.db.models import Prefetch, Q from orgs.mixins.serializers import BulkOrgResourceModelSerializer from perms.models import AssetPermission, Action from assets.models import Asset, Node,...
gpl-2.0
-1,230,686,421,651,684,400
40.913386
125
0.622957
false
3.940044
false
false
false
brainstorm/bcbio-nextgen
tests/bcbio_vm/test_docker.py
1
3019
import os import subprocess import pytest from tests.conftest import make_workdir from tests.conftest import get_post_process_yaml @pytest.marks('docker') def test_docker(install_test_files, data_dir): """Run an analysis with code and tools inside a docker container. Requires https://github.com/chapmanb/bc...
mit
-4,401,909,337,369,498,600
34.940476
87
0.576019
false
3.430682
true
false
false
chromium/chromium
buildtools/checkdeps/rules.py
5
7044
# Copyright 2012 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. """Base classes to represent dependency rules, used by checkdeps.py""" import os import re class Rule(object): """Specifies a single rule for an includ...
bsd-3-clause
3,845,343,916,866,982,000
36.870968
80
0.66113
false
3.90899
false
false
false
anhaidgroup/py_entitymatching
py_entitymatching/dask/dask_extract_features.py
1
9597
import logging import os import pandas as pd import multiprocessing import numpy as np import dask from dask.diagnostics import ProgressBar from dask import delayed from cloudpickle import cloudpickle import tempfile import py_entitymatching.catalog.catalog_manager as cm import py_entitymatching.utils.catalog_helpe...
bsd-3-clause
4,681,506,796,973,360,000
38.012195
115
0.624153
false
4.129518
false
false
false