repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
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
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
Russell-Jones/django-wiki
wiki/migrations/0001_initial.py
1
18236
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: ...
gpl-3.0
-3,276,954,538,703,390,000
67.556391
209
0.592948
false
MrYsLab/razmq
razmq/motors/motors.py
1
5067
""" Copyright (c) 2016 Alan Yorinks All right 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 version. This library is distri...
gpl-3.0
8,621,895,000,938,363,000
31.273885
119
0.623051
false
kyhau/reko
reko/speechreko.py
1
3825
""" NOTE: this example requires PyAudio because it uses the Microphone class """ import os import speech_recognition as sr import time from playsound import playsound from reko.polly import Polly from reko.reko import Reko class SpeechReko(Reko): def __init__(self, profile, collection_id, audio_on=False): ...
mit
-4,202,663,694,091,020,300
31.692308
127
0.554248
false
travistang/late_fyt
ntm.py
1
1191
import tensorflow as tf import numpy as np class NTM(object): def __init__(self,session, mem_size, mem_dim,controller): self.sess = session self.memory_dim = mem_dim self.memory_length = mem_size # construct memory variables self.memory = [tf.Variable(np.zeros(self.memory_dim).astype(np.float32)) for _ in ...
mit
-5,308,125,148,231,301,000
28.073171
100
0.690176
false
kaushik94/sympy
sympy/interactive/session.py
1
15136
"""Tools for setting up interactive sessions. """ from __future__ import print_function, division from distutils.version import LooseVersion as V from sympy.external import import_module from sympy.interactive.printing import init_printing preexec_source = """\ from __future__ import division from sympy import * x,...
bsd-3-clause
-7,974,791,464,022,189,000
31.550538
111
0.583047
false
hp-storage/python-lefthandclient
hpelefthandclient/__init__.py
2
1185
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # (c) Copyright 2013-2016 Hewlett Packard Enterprise Development LP # 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 ...
apache-2.0
7,481,040,198,847,530,000
31.916667
78
0.714768
false
migimigi/bme280-1
docs/conf.py
2
8446
#!/usr/bin/env python # -*- coding: utf-8 -*- # # bme280 documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # auto...
bsd-3-clause
7,603,664,539,946,308,000
29.712727
76
0.705186
false
jeremiedecock/snippets
python/tkinter/python3/geometry_manager_pack_test_with_1_widget.py
1
6263
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2016 Jérémie DECOCK (http://www.jdhp.org) # 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 witho...
mit
4,548,765,682,759,385,600
40.190789
134
0.691902
false
fernandog/Medusa
medusa/providers/torrent/html/zooqle.py
1
5673
# coding=utf-8 """Provider code for Zooqle.""" from __future__ import unicode_literals import logging from medusa import tv from medusa.bs4_parser import BS4Parser from medusa.helper.common import ( convert_size, try_int, ) from medusa.logger.adapters.style import BraceAdapter from medusa.providers.torrent....
gpl-3.0
7,063,182,022,490,597,000
32.568047
94
0.482285
false
ncareol/qmicromap
tool_qmicromap.py
1
1595
import os import sys tools = ['qt5','spatialdb','doxygen','prefixoptions'] env = Environment(tools = ['default'] + tools) # qt modules qtModules = Split('QtCore QtGui QtSvg') env.EnableQtModules(qtModules) def win_qt_setup(env): # Windows needs an extra include path for Qt modules. qt5include = env['QT5DIR']...
bsd-3-clause
-6,514,323,080,600,594,000
24.725806
109
0.685266
false
ermongroup/a-nice-mc
a_nice_mc/objectives/expression/mog2.py
1
1170
import numpy as np import tensorflow as tf from a_nice_mc.objectives.expression import Expression from a_nice_mc.utils.logger import create_logger logger = create_logger(__name__) class MixtureOfGaussians(Expression): def __init__(self, name='mog2', display=True): super(MixtureOfGaussians, self).__init__...
mit
8,517,003,602,130,317,000
27.536585
76
0.54188
false
LynnCo/toolkit
graphVis/interface.py
1
3989
#Basic ''' import tkinter as tk class GUI(tk.Frame): def __init__(self, master=None): tk.Frame.__init__(self, master) self.grid() self.create() def create(self): w = tk.Canvas(self,width=600,height=400) # w.create_image = (image=vp) w.pack() ru...
mit
-7,537,670,444,090,344,000
26.142857
100
0.604161
false
rsms/smisk
admin/old_examples/testbed/process.py
1
3051
#!/usr/bin/env python # encoding: utf-8 import sys, os, platform from smisk import Application, Request, Response, request class MyRequest(Request): def accepts_charsets(self): '''Return a list of charsets which the client can handle, ordered by priority and appearing order.''' vv = [] if not 'HTTP_ACCEP...
mit
-5,327,384,261,450,466,000
28.621359
124
0.620125
false
eamontoyaa/pyCSS
validations/validation03-comparisonZhao.etal.,2014.py
1
5013
''' # Description. This is a minimal module in order to perform a circular arc slope stability analysis by the limit equilibrium model by Fellenius and Bishop symplified methods. ''' #------------------------------------------------------------------------------ ## Add functions directory import sys sys.pa...
bsd-2-clause
6,933,199,822,277,709,000
37.777778
79
0.656425
false
viewportvr/daysinvr
backend/remixvr/database.py
1
1343
# -*- coding: utf-8 -*- """Database module, including the SQLAlchemy database object and DB-related utilities.""" from sqlalchemy.orm import relationship from .compat import basestring from .extensions import db # Alias common SQLAlchemy names Column = db.Column relationship = relationship Model = db.Model # From Mi...
mit
9,041,744,562,209,402,000
28.195652
89
0.647059
false
BrownGLAMOR/JACK
web/ffad/urls.py
1
1176
# This program 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) any later version. # # This program is distributed in the hope that it will be usefu...
lgpl-3.0
-9,095,699,174,355,440,000
44.230769
79
0.701531
false
super-goose/orbit
space/planet.py
1
3201
import pygame import math class Planet: def __init__(self, surface, color, position, radius, center): self.radius = radius self.surface = surface self.color = color self.setPosition(position) self.center = center self.setOrbitOffset(0) self.setOrbitPeriod(1) ...
mit
-2,533,718,706,393,433,600
24.616
80
0.564199
false
krasnoperov/django-formalizr
formalizr/views.py
1
3769
import json from django.contrib import messages from django.http import HttpResponse from django.views.generic.edit import CreateView, UpdateView, FormView from django.core.serializers.json import DjangoJSONEncoder class AjaxFormMixin(object): """ Mixin which adds support of AJAX requests to the form. Ca...
bsd-3-clause
5,784,175,414,557,377,000
30.14876
109
0.59273
false
moelius/async-task-processor
async_task_processor/primitives/tarantool_task.py
1
1986
import asyncio from async_task_processor.primitives.base_task import BaseTask class TarantoolTask(BaseTask): conn_max_retries = None conn_retries = None conn_retry_countdown = None ack = True # Using to prevent tarantool ack task connection = None data = None queue_name = None _task ...
mit
-3,077,405,517,272,907,000
29.553846
114
0.6143
false
uncled1023/pygments
Pygments/pygments-lib/pygments/lexers/php.py
1
10730
# -*- coding: utf-8 -*- """ pygments.lexers.php ~~~~~~~~~~~~~~~~~~~ Lexers for PHP and related languages. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, bygroups, default, us...
bsd-2-clause
-9,095,089,548,564,730,000
39.187266
89
0.502703
false
rnirmal/savanna
savanna/tests/unit/plugins/hdp/validator_test.py
1
5193
# Copyright (c) 2013 Hortonworks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
apache-2.0
3,736,133,292,998,521,300
42.638655
69
0.494897
false
mateor/pants
src/python/pants/engine/engine.py
1
5985
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging from ...
apache-2.0
-4,252,687,880,089,084,000
35.717791
98
0.705263
false
nttks/edx-platform
common/djangoapps/student/models.py
1
77455
""" Models for User Information (students, staff, etc) Migration Notes If you make changes to this model, be sure to create an appropriate migration file and check it in at the same time as your model changes. To do that, 1. Go to the edx-platform dir 2. ./manage.py lms schemamigration student --auto description_of_...
agpl-3.0
-8,885,954,979,312,208,000
36.095307
142
0.640217
false
maas/maas
src/maasserver/websockets/handlers/domain.py
1
8142
# Copyright 2016-2019 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """The domain handler for the WebSocket connection.""" from django.core.exceptions import ValidationError from maasserver.forms.dnsdata import DNSDataForm from maasserver.f...
agpl-3.0
-6,462,518,231,539,437,000
35.348214
77
0.594203
false
h2oloopan/easymerge
EasyMerge/tests/reddit/r2/r2/controllers/error.py
1
8526
# The contents of this file are subject to the Common Public Attribution # License Version 1.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://code.reddit.com/LICENSE. The License is based on the Mozilla Public # License Version 1.1, ...
mit
9,156,844,164,749,541,000
35.75
94
0.604621
false
PnEcrins/GeoNature
backend/geonature/core/gn_permissions/tools.py
1
9278
import logging, json from flask import current_app, redirect, Response from itsdangerous import (TimedJSONWebSignatureSerializer as Serializer, SignatureExpired, BadSignature) import sqlalchemy as sa from sqlalchemy.sql.expression import func from pypnusershub.db.tools import ( Insuff...
bsd-2-clause
3,092,783,275,424,942,600
32.014235
124
0.612267
false
sYnfo/samba
python/samba/netcmd/ntacl.py
1
10204
# Manipulate file NT ACLs # # Copyright Matthieu Patou 2010 <mat@matws.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 Software Foundation; either version 3 of the License, or # (at your option) any later ver...
gpl-3.0
-2,287,516,163,640,824,300
37.946565
136
0.618875
false
lepisma/desky
desky.py
1
3731
""" Desky ----- Wrap your web app in desktop frame """ import sys, subprocess import socket import time from PyQt4.Qt import * import json MAX_PORT_SCAN_TRIES = 10 # 20 secs def print_help(): """ Prints help for commands """ print "Usage : `python desky.py` for running app" print "`python desky.py pack` fo...
mit
5,337,855,102,648,143,000
17.66
89
0.648352
false
allanliebold/data-structures
src/test_linked_list.py
1
2515
"""Tests for singly-linked list.""" import pytest def test_node_attributes(): """Test that node object has expected attributes.""" from linked_list import Node n = Node('test') assert n.data == 'test' and n.next_node is None def test_list_push(): """Test that linked_list has node pushed to it.""...
mit
2,257,836,508,669,859,300
26.944444
91
0.662028
false
fcbond/OMW
omw/__init__.py
1
28562
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os, sys, sqlite3, datetime, urllib, gzip, requests from time import sleep from flask import Flask, render_template, g, request, redirect, url_for, send_from_directory, session, flash, jsonify, make_response, Markup, Response from flask_login import LoginManager, Us...
mit
-2,032,441,808,575,662,300
33.165072
150
0.51418
false
schef/schef.github.io
source/07/mc-7-4-tp-cde-md.py
1
2572
#!/usr/bin/python # Written by Stjepan Horvat # ( zvanstefan@gmail.com ) # by the exercises from David Lucal Burge - Perfect Pitch Ear Traning Supercourse # Thanks to Wojciech M. Zabolotny ( wzab@ise.pw.edu.pl ) for snd-virmidi example # ( wzab@ise.pw.edu.pl ) import random import time import sys import re fname="/de...
mit
-7,023,858,542,194,064,000
24.979798
155
0.588647
false
dsorokin/aivika-modeler
tests/submodel_test.py
1
1158
#!/usr/local/bin/python3 # NOTE: The model itself is quite meaningless. The purpose is # to check some features. Consider it like an unit-test from simulation.aivika.modeler import * model = MainModel() submodel1 = SubModel(model, name = 'submodel1') submodel2 = SubModel(submodel1, name = 'submodel2') data_ty...
bsd-3-clause
1,714,945,578,067,700,500
32.085714
99
0.74266
false
hirofumi0810/asr_preprocessing
swbd/input_data.py
1
8525
#! /usr/bin/env python # -*- coding: utf-8 -*- """Make input data (Switchboard corpus).""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from os.path import join, basename import numpy as np import pickle from tqdm import tqdm from utils.util import mkd...
mit
2,988,558,157,063,402,000
39.023474
86
0.55085
false
Fity/2code
flaskr/flaskr_tests.py
1
1622
# -*- coding:utf-8 -*- import os import flaskr import unittest import tempfile class FlaskrTestCase(unittest.TestCase): def setUp(self): self.db_fd, flaskr.app.config['DATABASE'] = tempfile.mkstemp() flaskr.app.config['TESTING'] = True self.app = flaskr.app.test_client() flaskr.in...
mit
-6,352,385,153,454,176,000
29.037037
70
0.590012
false
fortesg/fortrantestgenerator
config_fortrantestgenerator.py
1
1665
import os ftgDir = os.path.dirname(os.path.realpath(__file__)) # Directory where FortranCallGraph is located # REQUIRED FCG_DIR = ftgDir + '/../fortrancallgraph' # Configuration file to be used by FortranCallGraph # OPTIONAL: When omitted or None, config variables required by FortranCallGraph must be assigned here #...
gpl-3.0
-4,443,048,437,855,805,400
38.642857
111
0.763363
false
ethereum/pyethapp
pyethapp/app.py
1
30125
# -*- coding: utf8 -*- from __future__ import print_function from __future__ import absolute_import from builtins import zip from builtins import next from builtins import range import copy import json import os import signal import sys from logging import StreamHandler from uuid import uuid4 import click import ether...
mit
1,139,392,548,384,149,500
39.220294
180
0.645378
false
xrobau/PoGoMap
runserver.py
1
9755
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import shutil import logging import time import re import requests import ssl import json from distutils.version import StrictVersion from threading import Thread, Event from queue import Queue from flask_cors import CORS from flask_cache_bust import...
agpl-3.0
4,981,080,807,710,686,000
36.664093
138
0.663557
false
squaresLab/Houston
test/test_state.py
1
3173
import pytest from houston.state import State, var def test_variable_construction(): class S(State): foo = var(float, lambda c: 0.1) assert set(n for n in S.variables) == {'foo'} def test_constructor(): class S(State): foo = var(float, lambda c: 0.1) state = S(foo=0.1, time_offset=...
mit
-8,171,461,671,288,105,000
28.933962
87
0.590923
false
kirbyfan64/cppexpat
doc/source/conf.py
1
8300
# -*- coding: utf-8 -*- # # CppExpat documentation build configuration file, created by # sphinx-quickstart on Mon Jul 13 19:00:49 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # ...
mit
-6,357,192,428,893,004,000
30.679389
79
0.707229
false
ehashman/oh-mainline
vendor/packages/django-http-proxy/httpproxy/migrations/0001_initial.py
1
2970
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Request', fields=[ ('id', models.AutoField(verb...
agpl-3.0
5,437,310,444,514,051,000
43.328358
122
0.537037
false
Banbury/cartwheel-3d
Python/UI/MainWindow.py
1
5484
''' Created on 2009-08-24 This module contains the main OpenGL application window that is used by all SNM applications @author: beaudoin ''' import wx import UI class MainWindow(wx.Frame): """The class for the main window.""" MIN_TOOLPANEL_WIDTH = 200 MIN_CONSOLE_HEIGHT = 100 ...
apache-2.0
-7,808,601,954,536,289,000
34.317881
117
0.585157
false
serkanaltuntas/yavst
yavst/prepare_gpf4.py
1
4894
#!/usr/bin/env python # # # # $Header: /opt/cvs/python/packages/share1.5/AutoDockTools/Utilities24/prepare_gpf4.py,v 1.10.4.3 2009/03/23 21:54:28 rhuey Exp $ # import string import os.path import glob from MolKit import Read from AutoDockTools.GridParameters import GridParameters, grid_parameter_list4 from AutoDockTo...
mit
-1,222,868,990,191,267,000
35.796992
129
0.592154
false
wy182000/gyp
pylib/gyp/generator/ninja.py
1
80265
# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import copy import hashlib import multiprocessing import os.path import re import signal import subprocess import sys import gyp import gyp.common import gyp.msvs_...
bsd-3-clause
-8,764,016,464,242,874,000
40.203799
80
0.626624
false
myd7349/DiveIntoPython3Practices
chapter_09_UnitTesting/roman2.py
1
4834
# -*- coding: utf-8 -*- # 2014-11-18T22:48+08:00 import unittest class OutOfRangeError(ValueError): pass roman_numeral_map = (('M', 1000), ('CM', 900), ('D', 500), ('CD', 400), ('C', 100), ('XC', 90), ...
lgpl-3.0
2,665,887,912,295,815,000
36.984252
95
0.439884
false
troup-system/troup
troup/observer.py
1
1190
# Copyright 2016 Pavle Jonoski # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
apache-2.0
-3,194,647,551,165,012,500
33
74
0.663866
false
MaxTyutyunnikov/lino
obsolete/tests/74.py
1
1459
## Copyright 2003-2006 Luc Saffre ## This file is part of the Lino project. ## Lino 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...
gpl-3.0
-2,120,210,230,867,551,700
30.717391
70
0.681974
false
gem/oq-engine
openquake/hmtk/seismicity/declusterer/dec_gardner_knopoff.py
1
6271
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # LICENSE # # Copyright (C) 2010-2021 GEM Foundation, G. Weatherill, M. Pagani, # D. Monelli. # # The Hazard Modeller's Toolkit is free software: you can redistribute # it and/or modify it under the terms of the GNU Affero General Public # License a...
agpl-3.0
-5,080,174,637,922,129,000
39.173077
79
0.629807
false
qtproject/pyside-shiboken
tests/samplebinding/privatedtor_test.py
1
3555
#!/usr/bin/env python # -*- coding: utf-8 -*- # ############################################################################# ## ## Copyright (C) 2016 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of the test suite of PySide2. ## ## $QT_BEGIN_LICENSE:GPL-EXCEPT$ ## Commercial Lice...
gpl-2.0
2,029,832,499,969,279,700
34.909091
91
0.654571
false
tommyod/KDEpy
KDEpy/tests/test_estimator_vs_estimator.py
1
2239
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Test the implemented estimators against each other on simple data sets. """ import numpy as np from KDEpy.NaiveKDE import NaiveKDE from KDEpy.TreeKDE import TreeKDE from KDEpy.FFTKDE import FFTKDE import itertools import pytest N = 2 ** 5 estimators = [NaiveKDE, Tree...
gpl-3.0
7,116,459,819,006,918,000
28.460526
108
0.634658
false
BenDoan/unomaha_utils
course_scraper/scraper.py
1
5095
#!/usr/bin/env python2 """ Usage: ./scraper.py [options] Options: -h, --help Prints this help message -o FILE, --output FILE Specifies output file -c COLLEGE, --college COLLEGE Specifies a specific college -l, --last-term-only Only ouputs the last term ...
mit
-6,599,031,899,051,639,000
27.463687
193
0.559961
false
admk/soap
soap/semantics/schedule/ii.py
1
2125
import itertools import math import numpy from soap.context import context neg_inf = -float('inf') def rec_init_int_check(graph, ii): """ Checks if the target II is valid. Runs a modified Floyd-Warshall algorithm to test the absence of positive cycles. Input ii must be greater or equal to 1. ...
mit
3,456,767,238,910,983,000
26.24359
73
0.596706
false
shivamvats/graphSearch
heuristicSearch/planners/island_astar.py
1
2665
from astar import * class IslandAstar(Astar): def __init__(self, env, inflation=10): super(IslandAstar, self).__init__(env, inflation) #@profile def plan(self, startNode, goalNode, viz=None): self.startNode = startNode self.goalNode = goalNode print(goalNode.getNodeId()) ...
mit
-3,337,239,640,545,486,300
31.901235
83
0.566604
false
sniemi/ShapeMeasurement
shapeMeasurements.py
1
17431
""" Measuring a shape of an object ============================== Simple class to measure weighted quadrupole moments, size, and ellipticity of an object. Can be used for example to verify weak lensing mission requirements. :requires: NumPy (tested with 1.9.1) :author: Sami-Matias Niemi :contact: s.niemi@icloud.com ...
bsd-2-clause
-302,642,680,278,198,100
37.821826
128
0.560151
false
amadeusproject/amadeuslms
reports/forms.py
1
3623
""" Copyright 2016, 2017 UFPE - Universidade Federal de Pernambuco Este arquivo é parte do programa Amadeus Sistema de Gestão de Aprendizagem, ou simplesmente Amadeus LMS O Amadeus LMS é um software livre; você pode redistribui-lo e/ou modifica-lo dentro dos termos da Licença Pública Geral GNU como publicada pela ...
gpl-2.0
-1,449,295,162,794,327,800
41.797619
231
0.705064
false
bernardhu/whlianjia
crawler.py
1
59560
# -*- coding: utf-8 -*- import pickle import math import os.path import shutil import datetime import time import random import json import re import chardet import string import base64 import requests from bs4 import BeautifulSoup from model import TradedHouse, DistricHouse, BidHouse, RentHouse, create_table, cle...
mit
-7,020,224,055,126,833,000
47.170492
155
0.585199
false
akx/shoop
shoop_tests/admin/test_modelform_persistence.py
1
1653
# -*- coding: utf-8 -*- # This file is part of Shoop. # # Copyright (c) 2012-2016, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. import pytest import six from django.forms.models import ModelForm from djan...
agpl-3.0
-856,095,380,547,393,200
34.170213
107
0.669691
false
andres53016/domotica
software/alarma.py
1
1989
import zmq,json,time import pygame import RPi.GPIO as GPIO pygame.mixer.init() GPIO.setmode(GPIO.BCM) GPIO.setup(25,GPIO.OUT) GPIO.setup(8,GPIO.OUT) GPIO.output(25,0) GPIO.output(8,0) entradas={"puerta":17,"ventanaCocina":27,"ventanaDormitorio":22} for entrada in entradas.values(): GPIO.setup(entrada,GPIO.IN,pull_u...
gpl-3.0
-7,158,794,117,130,000,000
29.136364
64
0.529915
false
csutherl/sos
sos/plugins/atomichost.py
1
1611
# Copyright (C) 2015 Red Hat, Inc. # 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 distributed in th...
gpl-2.0
-940,422,531,690,939,600
36.465116
72
0.657356
false
2016-Capstone/PythonController
src/Bybop_Commands.py
1
8092
import os import sys import struct MY_PATH, _ = os.path.split(os.path.realpath(__file__)) ARSDK_PATH=os.path.join(MY_PATH,'..', 'arsdk-xml') ARCOMMANDS_PATH=os.path.join(ARSDK_PATH, 'xml') sys.path.append(ARSDK_PATH) import arsdkparser _ctx = arsdkparser.ArParserCtx() arsdkparser.parse_xml(_ctx, os.path.join(ARCOMM...
bsd-3-clause
-1,871,689,588,491,917,000
29.885496
107
0.57699
false
juanchodepisa/sbtk
SBTK_League_Helper/src/security/key_handling.py
1
4752
from urllib.parse import quote import json import os from src import log_entry from .obfuscation import transform from .exceptions import KeysDirectoryNotFound, KeysFileNotFound user_index = os.path.join(os.path.dirname(__file__), "keys_loc.json") default_context = "OGS" obfuscated = "_obfuscated_" plaintext = "_pla...
mit
-288,971,447,259,933,760
32.471831
134
0.555766
false
xirdneh/oposum
oPOSum/apps/client/models.py
1
3379
from django.db import models from oPOSum.libs import utils as pos_utils from django.utils.translation import ugettext as _ from decimal import Decimal from django.core.validators import RegexValidator # Create your models here. class Client(models.Model): first_name = models.CharField(_("First Name"), max_length=1...
mit
-6,659,084,490,970,760,000
39.22619
105
0.576798
false
avanzosc/avanzosc6.1
avanzosc_crm_call_ext/crm_opportunity.py
1
7613
# -*- encoding: utf-8 -*- ############################################################################## # # Avanzosc - Avanced Open Source Consulting # Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com> # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
-5,189,564,213,395,655,000
45.408537
113
0.517935
false
weirdgiraffe/plugin.video.giraffe.seasonvar
resources/site-packages/plugin_video/screen.py
1
7083
# coding: utf-8 # # Copyright © 2017 weirdgiraffe <giraffe@cyberzoo.xyz> # # Distributed under terms of the MIT license. # from kodi import logger, Plugin import seasonvar from datetime import datetime, timedelta def week(plugin): date = datetime.today() for date_offset in range(7): datestr = date.st...
mit
7,216,715,170,337,933,000
31.391705
76
0.551999
false
bagage/cadastre-conflation
back/batimap/bbox.py
1
1181
import re from math import sqrt class Bbox(object): def __init__(self, xmin, ymin, xmax, ymax): self.coords = [xmin, ymin, xmax, ymax] self.xmin = xmin self.ymin = ymin self.xmax = xmax self.ymax = ymax def __repr__(self): return f"{self.xmin},{self.ymin},{self...
mit
-6,715,307,017,670,733,000
26.465116
84
0.485182
false
guiccbr/autonomous-fuzzy-quadcopter
python/py_quad_control/controller/sparc.py
1
17796
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 # ------------------------ Imports ----------------------------------# from __future__ import division # Force real division import numpy as np # Numpy Arrays import math # Square root # ------------------------ Classes ---------------------------------# clas...
mit
6,382,856,539,554,038,000
38.284768
119
0.600079
false
rtts/qqq
user_profile/views.py
1
3338
from django.http import HttpResponse, HttpResponseRedirect, Http404 from django.shortcuts import get_object_or_404, render_to_response from django.core.urlresolvers import reverse from django.contrib.auth.models import User from django.template.loader import get_template from django.template import Context, RequestCont...
gpl-3.0
1,092,736,102,146,066,000
29.623853
111
0.713901
false
shady831213/myBlog
myBlog/articles/permission.py
1
1112
from rest_framework import permissions #adminorreadonly class ArticlePermission(permissions.BasePermission): def has_permission(self, request, view): return ( request.method in permissions.SAFE_METHODS or request.user and request.user.is_staff ) def has_object_permissio...
mit
2,163,750,632,873,102,600
37.37931
109
0.652878
false
Exesium/python_training
fixture/session.py
1
1504
# -*- coding: utf-8 -*- class SessionHelper: def __init__(self, app): self.app = app def login(self, username, password): wd = self.app.wd self.app.open_home_page() wd.find_element_by_name("pass").click() wd.find_element_by_id("LoginForm").click() wd.find_elem...
gpl-3.0
6,056,223,281,163,196,000
30.333333
76
0.569149
false
padajuan/ansible-module-etcd
library/etcd.py
1
9055
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2017, Juan Manuel Parrilla <jparrill@redhat.com> # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your opt...
mit
-4,966,589,647,599,316,000
27.564669
105
0.631695
false
meeb/txcloudfiles
examples/account_set_temp_key.py
1
2390
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright 2012 Joe Harris 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 ...
apache-2.0
9,021,300,464,980,471,000
28.506173
96
0.673222
false
googleads/google-ads-python
google/ads/googleads/v8/errors/types/partial_failure_error.py
1
1168
# -*- 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,045,782,478,356,995,000
29.736842
74
0.708048
false
sequana/sequana
sequana/modules_report/bwa_bam_to_fastq.py
1
3230
# coding: utf-8 # # This file is part of Sequana software # # Copyright (c) 2016 - Sequana Development Team # # File author(s): # Thomas Cokelaer <thomas.cokelaer@pasteur.fr> # Dimitri Desvillechabrol <dimitri.desvillechabrol@pasteur.fr>, # <d.desvillechabrol@gmail.com> # # Distributed under the ...
bsd-3-clause
6,454,543,908,194,447,000
30.666667
81
0.586378
false
ramondiez/machine-learning
ex2/plotDecisionBoundary.py
1
1679
''' Created on 20 feb. 2017 @author: fara ''' import numpy as np from matplotlib import pyplot as plt from mapFeature import mapFeature from show import show def plotDecisionBoundary(ax,theta, X, y): ''' %PLOTDECISIONBOUNDARY Plots the data points X and y into a new figure with %the decision boundary def...
gpl-3.0
-6,819,960,103,957,050,000
29
102
0.564622
false
n3wb13/OpenNfrGui-5.0-1
lib/python/Plugins/Extensions/NFR4XBoot/ubi_reader/ubi/block/sort.py
5
2187
def list_by_list(blist, slist): slist_blocks = [] for block in blist: if block in slist: slist_blocks.append(block) return slist_blocks def by_image_seq(blocks, image_seq): seq_blocks = [] for block in blocks: if blocks[block].ec_hdr.image_seq == image_...
gpl-2.0
8,051,677,869,966,243,000
23.752941
70
0.54321
false
skosukhin/spack
var/spack/repos/builtin/packages/gmake/package.py
1
2179
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
6,446,346,152,501,126,000
37.22807
91
0.65397
false
epeios-q37/epeios
other/exercises/Hangman/workshop/en/l.py
1
1311
# coding: utf-8 """ MIT License Copyright (c) 2019 Claude SIMON (https://q37.info/s/rmnmqd49) 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 limit...
agpl-3.0
4,384,650,867,266,639,000
38.96875
78
0.767353
false
carlshan/ml_workflow
datascience_tools/modeling/workflow_model_setup.py
1
2346
from workflow_diagnostics import get_diagnostics_dict from workflow_util import upload_to_s3 from sklearn import preprocessing import cPickle as pickle import pandas as pd import os def run_model(training, testing, features, outcome, clf, clf_name, normalize=True, verbose=True): # NOTE: You should set the clf se...
mit
-8,404,296,448,362,090,000
37.459016
103
0.665388
false
akretion/odoo
odoo/tools/image.py
10
15192
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import base64 import codecs import io from PIL import Image from PIL import ImageEnhance from random import randrange # Preload PIL with the minimal subset of image formats we need from odoo.tools import pycompat Image...
agpl-3.0
2,528,655,349,134,123,500
44.214286
132
0.634742
false
kit-cel/gr-dab
python/qa_mp4_encode_sb.py
1
2634
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2017 Moritz Luca Schmid, Communications Engineering Lab (CEL) / Karlsruhe Institute of Technology (KIT). # # This 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
-2,318,910,913,169,316,400
40.15625
135
0.657175
false
jjdmol/LOFAR
SAS/ResourceAssignment/ResourceAssignmentEstimator/resource_estimators/base_resource_estimator.py
1
3118
# base_resource_estimator.py # # Copyright (C) 2016 # ASTRON (Netherlands Institute for Radio Astronomy) # P.O.Box 2, 7990 AA Dwingeloo, The Netherlands # # This file is part of the LOFAR software suite. # The LOFAR software suite is free software: you can redistribute it # and/or modify it under the terms of the GNU G...
gpl-3.0
7,776,506,931,752,656,000
40.026316
119
0.679602
false
midokura/python-midonetclient
src/midonetclient/tenant.py
1
2329
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Midokura PTE LTD. # 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/LICENS...
apache-2.0
-1,329,265,309,934,497,500
32.753623
77
0.674109
false
pudo-attic/ted-xml
parse.py
1
6683
import os from lxml import etree from pprint import pprint from forms.parseutil import ted_documents, Extractor from collections import defaultdict from common import engine, documents_table, contracts_table, cpvs_table, references_table def select_form(form, lang): lang = lang.split()[0] children = form.getch...
mit
4,463,501,169,465,063,000
46.397163
105
0.638635
false
gregmuellegger/django-superform
django_superform/forms.py
1
13772
""" This is awesome. And needs more documentation. To bring some light in the big number of classes in this file: First there are: * ``SuperForm`` * ``SuperModelForm`` They are the forms that you probably want to use in your own code. They are direct base classes of ``django.forms.Form`` and ``django.forms.ModelFor...
bsd-3-clause
3,049,697,306,495,678,000
33.865823
79
0.636364
false
DStauffman/dstauffman2
dstauffman2/puzzles/codefights_2017_01_17.py
1
7196
r"""Codefight challenge (stringsRearrangement), 2017-01-17, by DStauffman.""" #%% Imports import doctest import unittest #%% Functions - is_str_one_off def is_str_one_off(str1, str2): r""" Determines if strings are only one character different from one another. Parameters ---------- str1 : str ...
lgpl-3.0
-1,356,583,979,382,144,300
29.88412
98
0.592135
false
satra/NiPypeold
nipype/interfaces/afni/tests/test_preprocess.py
1
23033
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: import warnings warnings.simplefilter('ignore') from nipype.testing import * from nipype.interfaces import afni from nipype.interfaces.base import InterfaceResult def afni_not_installed(): ''' XXX: Th...
bsd-3-clause
5,142,300,293,424,247,000
41.972015
118
0.564712
false
openjck/kuma
kuma/wiki/models.py
1
71106
import hashlib import json import sys import traceback from datetime import datetime, timedelta from functools import wraps import newrelic.agent import waffle from constance import config from django.conf import settings from django.core.exceptions import ValidationError from django.db import models from django.db.mo...
mpl-2.0
-1,674,403,241,280,517,600
37.414911
100
0.59919
false
ahknight/fig-django
app/test_app/settings.py
1
2113
""" Django settings for test_app project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) i...
bsd-3-clause
2,028,688,857,110,303,200
23.569767
71
0.716517
false
dashmoment/moxa_ai_training
CNN_HW_solution/model_zoo.py
1
4589
import tensorflow as tf import netfactory as nf import numpy as np class model_zoo: def __init__(self, inputs, dropout, is_training, model_ticket): self.model_ticket = model_ticket self.inputs = inputs self.dropout = dropout self.is_training = is_training ...
mit
1,189,355,182,992,824,300
34.859375
143
0.460885
false
kubernetes-client/python
kubernetes/e2e_test/test_client.py
1
20967
# -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
apache-2.0
8,037,305,217,771,363,000
38.264045
102
0.484666
false
collectiveacuity/labPack
tests/test_events_meetup.py
1
10267
__author__ = 'rcj1492' __created__ = '2016.12' __license__ = 'MIT' from labpack.events.meetup import * if __name__ == '__main__': # import dependencies & configs from pprint import pprint from time import time from labpack.records.settings import load_settings from labpack.handlers.reques...
mit
1,395,610,115,595,362,000
43.438053
110
0.598812
false
katakumpo/nicedjango
tests/test_utils.py
1
1809
import pytest from nicedjango.utils import divide_model_def, model_label, queryset_from_def from tests.a1.models import A from tests.a2 import models as a2 from tests.a3.models import Book DIVIDE_RESULTS = ( (A, A, ''), ('a1-a', A, ''), ('a', A, ''), ('a1-a.foo.bar', A, 'foo.bar'), ('a.foo.bar', A...
mit
2,524,520,707,256,657,000
25.217391
96
0.610835
false
MazamaScience/ispaq
ispaq/pressureCorrelation_metrics.py
1
6526
""" ISPAQ Business Logic for Simple Metrics. :copyright: Mazama Science :license: GNU Lesser General Public License, Version 3 (http://www.gnu.org/copyleft/lesser.html) """ from __future__ import (absolute_import, division, print_function) import math import numpy as np import pandas as pd from obspy im...
gpl-3.0
7,286,951,401,950,999,000
37.163743
138
0.564818
false
dodger487/MIST
data/magnetak_ml.py
1
23641
""" Copyright 2014 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 agreed to in...
apache-2.0
1,774,346,763,933,319,000
37.378247
113
0.646419
false
alkaitz/general-programming
water_level/water_level.py
1
1035
''' Created on Aug 1, 2017 @author: alkaitz ''' ''' An integer array defines the height of a 2D set of columns. After it rains enough amount of water, how much water will be contained in the valleys formed by these mountains? Ex: [3 2 3] X X X W X X X X -> X X X -> 1 X X X X X X ''' d...
mit
4,423,365,319,701,444,600
26.263158
102
0.533333
false
jonfoster/pyxb1
examples/ndfd/showreq.py
1
1914
import pyxb.utils.domutils import xml.dom import xml.dom.minidom import pyxb.namespace # Structure #import DWML #print 'Validating DWML' #DWML.Namespace.validateSchema() #print 'Validated DWML: types %s' % ("\n".join(DWML.Namespace.typeDefinitions().keys()),) xmls = open('NDFDgen.xml').read() dom = xml.dom.minidom.pa...
apache-2.0
-6,638,820,040,696,046,000
25.583333
89
0.718913
false
huazhisong/graduate_text
src/rnn/utils.py
1
4176
#!/usr/bin/env python # -*- coding: utf-8 -*- import os, sys import time import csv import collections import cPickle as pickle import numpy as np import pandas as pd import tensorflow as tf from tensorflow.contrib import learn class TextLoader(object): def __init__(self, utils_dir, data_path, b...
agpl-3.0
323,030,258,419,681,400
31.95122
101
0.559148
false
USGSDenverPychron/pychron
launchers/pydiode.py
1
1078
# =============================================================================== # Copyright 2014 Jake Ross # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licens...
apache-2.0
-2,949,165,895,291,454,000
43.916667
81
0.519481
false
pymedusa/SickRage
medusa/show/coming_episodes.py
1
7304
# coding=utf-8 # This file is part of Medusa. # # Medusa 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. # # Medusa is distributed in t...
gpl-3.0
-8,968,734,022,603,750,000
35.52
120
0.583242
false
okffi/decisions
web/decisions/subscriptions/models.py
1
4698
from __future__ import unicode_literals import os import base64 from datetime import timedelta from django.db import models from django.utils.translation import ugettext_lazy as _ from django.utils.timezone import now from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.fields i...
bsd-3-clause
-2,500,066,219,397,966,300
28.923567
76
0.649638
false
rowinggolfer/openmolar2
src/lib_openmolar/client/qt4/dialogs/save_discard_cancel_dialog.py
1
3474
#! /usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### ## ## ## Copyright 2010-2012, Neil Wallace <neil@openmolar.com> ## ## ...
gpl-3.0
-4,159,314,006,897,088,500
39.882353
79
0.519862
false