code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# Features
class BaseAnalyteFeature(object):
"""
Base multi analyte feature. Use this to create new features.
A feature is anything calcaulted from multiple analytes
"""
def __init__(self):
self.analyte_list = []
self.name = ''
@property
def data(self):
return 'Not i... | nvenayak/impact | impact/core/features/Base.py | Python | gpl-3.0 | 910 |
# -*- coding: utf-8 -*-
""" Expose models to the admin view """
from __future__ import unicode_literals
from django.contrib import admin
from app.models.gym import Gym
from app.models.gym_item import GymItem
from app.models.profile import Profile
from app.models.raid_item import RaidItem
from app.models.ex_raid_pokemo... | Gimpneek/exclusive-raid-gym-tracker | app/admin.py | Python | gpl-3.0 | 521 |
# coding=utf-8
import json
from datetime import date, datetime
from singledispatch import singledispatch
from functools import update_wrapper
def methdispatch(func):
dispatcher = singledispatch(func)
def wrapper(*args, **kw):
return dispatcher.dispatch(args[1].__class__)(*args, **kw)
wrapper.regi... | dongweiming/web_develop | chapter14/section3/json_singledispatch.py | Python | gpl-3.0 | 1,453 |
#! /usr/bin/env python
# This is tested in both python 2.7 and 3.4
import os
os.system('kill {}'.format(os.getpid()))
| BlitzKraft/useless | useless.py | Python | gpl-3.0 | 118 |
import decimal
class Coord:
def __init__(self, lat, lon):
self.lat = lat
self.lon = lon
class Way:
def __init__(self, source, target):
self.source = source
self.target = target
f = open('nodes', 'r')
lat = None
nodes = []
for line in f:
loaded = decimal.Decimal(line)
... | matkoniecz/szkic_inz | dfs.py | Python | gpl-3.0 | 2,187 |
'''
Copyright 2015 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 ... | Sentdex/pygta5 | models.py | Python | gpl-3.0 | 47,729 |
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 6 20:00:12 2019
@author: ander
"""
import numpy as np
def generate():
dim = 64
shape = (dim, dim, dim)
#constructing water sphere
matArr = np.zeros(shape, dtype=np.uint8)
densArr = np.zeros_like(matArr, dtype=np.double)
ind = np.indice... | medicalphysics/OpenDXMC | data/binaryimporttemplate/template_generator.py | Python | gpl-3.0 | 1,121 |
# This file was autogenerated from lyt.md. Please do not edit!
#!/usr/bin/python
# Copyright (C) 2016 Adrien Lamarque
# 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 L... | lamarqua/lyt | lyt.py | Python | gpl-3.0 | 3,984 |
def _make_cloner(cls, base, *args):
def clone(self):
# create a new object without initializing it
cloned = cls.__new__(cls)
# clone C++ state
base.__init__(cloned, *args)
# clone Python state
cloned.__dict__.update(self.__dict__)
return cloned
cls.clone ... | molpopgen/fwdpy11 | fwdpy11/custom_genetic_value_decorators.py | Python | gpl-3.0 | 857 |
# Authors:
# Rob Crittenden <rcritten@redhat.com>
# Pavel Zuna <pzuna@redhat.com>
# Petr Viktorin <pviktori@redhat.com>
#
# Copyright (C) 2008, 2009 Red Hat
# see file 'COPYING' for use and warranty information
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the G... | tbabej/freeipa | ipatests/test_xmlrpc/test_host_plugin.py | Python | gpl-3.0 | 32,242 |
###### code to sample from the paramater posterior p(\phi | data) ########
import numpy
from numpy import *
from data import Datum
from tssb import *
from util import dirichletpdfln
from numpy.random import dirichlet
import subprocess as sp
import util2 as u2
import os
def get_c_fnames(tmp_dir):
def _make_c_fnam... | morrislab/phylowgs | params.py | Python | gpl-3.0 | 9,595 |
from tkinter import *
from tkinter102 import MyGui
#应用主窗口
mainwin = Tk()
Label(mainwin, text=__name__).pack()
#弹出窗口
popup = Toplevel()
Label(popup, text='Attach').pack(side=LEFT)
MyGui(popup).pack(side=RIGHT)
mainloop() | ViMiao/PythonLearning | ProgrammingPython/C01/attachgui.py | Python | gpl-3.0 | 238 |
# Copyright (C) 2006-2007 Red Hat, Inc.
# Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/>
#
# 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
# ... | icarito/sugar | src/jarabe/view/buddymenu.py | Python | gpl-3.0 | 8,711 |
# -*- coding: utf-8 -*-
# Copyright (c) 2017, sathishpy@gmail.com and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestCMAccountMapper(unittest.TestCase):
pass
| sathishpy/corrugation | corrugation/corrugation/doctype/cm_account_mapper/test_cm_account_mapper.py | Python | gpl-3.0 | 225 |
import tables
from sapphire import CoincidencesESD, HiSPARCStations
STATIONS = [501, 510]
EVENTDATA_PATH = '/Users/arne/Datastore/501_510/e_501_510_141101_150201.h5'
# EVENTDATA_PATH = '/Users/arne/Datastore/501_510/e_501_510_150120_150201.h5'
def analyse_coincidences(data):
"""Find and store coincidences"""
... | HiSPARC/topaz | 150224_501_510/coincidences.py | Python | gpl-3.0 | 773 |
#!/usr/bin/python3
""" home_dad.py:
"""
# Import Required Libraries (Standard, Third Party, Local) ************************************************************
import copy
import datetime
import logging
import multiprocessing
import time
from .home_general import HomeGeneral
from rpihome.modules.message import Mes... | csm0042/rpihome | rpihome/home/home_user3.py | Python | gpl-3.0 | 8,755 |
from encode2unicode import *
from unicode2encode import *
| arulalant/txt2unicode | txt2unicode/__init__.py | Python | gpl-3.0 | 58 |
# list all test modules to be run by 'manage.py test ductus'
# (see http://stackoverflow.com/a/5160779)
from modules.flashcards.flashcard_deck import *
from modules.textwiki.textwiki import *
from wiki.new_lesson_page import *
| wikiotics/ductus1 | ductus/tests/__init__.py | Python | gpl-3.0 | 228 |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2014 Thomas Voegtlin
#
# 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 y... | mazaclub/electrum-nmc | gui/qt/qrwindow.py | Python | gpl-3.0 | 2,752 |
# Copyright 2016 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
import os
import os.path as op
import loggi... | mahmutf/dupeguru | core/tests/app_test.py | Python | gpl-3.0 | 20,618 |
hours = float(raw_input("How many hours?"))
rate = float(raw_input("Hourly rate?"))
if hours > 40:
pay = 40 * rate + (hours - 40) * rate * 1.5
else :
pay = hours * rate
print pay | RobMcZag/learning-python | Chapter3/salary2.py | Python | gpl-3.0 | 191 |
#coding=utf-8
from collections import defaultdict
import numpy as np
import pandas as pd
import sqlite3,csv
import pandas.io.sql as sql
# package-depend : pygraph, python-graph-core
# pip install pygrah
# pip install python-graph-core
from pygraph.classes.digraph import digraph
from pygraph.algorithms.pagerank import... | nemo-tj/biendata | source/task3.py | Python | gpl-3.0 | 28,256 |
#!/usr/bin/python
# (c) 2015, ravellosystems
#
# author zoza
#
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansibl... | dbenoit17/ansible_agnostic_deployer | ansible/library/ravello_module.py | Python | gpl-3.0 | 45,954 |
# Copyright Notice: This code is in Copyright. Any use leading to publication
# or financial gain is prohibited without the permission of the authors
# Simon O'Meara and # David Topping: simon.omeara@manchester.ac.uk. First
# published 2017.
# This file is part of box_model
# box_model is free software: you can ... | simonom/box-model | hybr_stru.py | Python | gpl-3.0 | 3,343 |
# -*- coding: utf-8 -*-
#from odoo import api, fields, models
#from datetime import datetime, timedelta
#class PurchaseOrder(models.Model):
# _inherit = "purchase.order"
# mainmenu_id = fields.Char('menu')
# gourmet_report = fields.Text(string='Tabelog')
# companion_id = fields.Many2one('res.users', st... | ichi23de5/ichi_Repo | purchases_test/models/p_test.py | Python | gpl-3.0 | 986 |
r = "N"
while r != "S":
a = int(input("Digite a quantidade de votos do candidato A: "))
b = int(input("Digite a quantidade de votos do candidato B: "))
c = int(input("Digite a quantidade de votos do candidato C: "))
r = str(input("Para sair Precione [S]. ")).upper()
if a > b and a > c:
... | ronas/PythonGNF | Ronaldo/ex004.py | Python | gpl-3.0 | 632 |
import threading
from sqlalchemy import Column, String, func, distinct
from tg_bot.modules.sql import BASE, SESSION
class GroupLogs(BASE):
__tablename__ = "log_channels"
chat_id = Column(String(14), primary_key=True)
log_channel = Column(String(14), nullable=False)
def __init__(self, chat_id, log_c... | PaulSonOfLars/tgbot | tg_bot/modules/sql/log_channel_sql.py | Python | gpl-3.0 | 2,071 |
from __future__ import print_function
import logging
#Full joinmarket uses its own bitcoin module;
#other implementations (like wallet plugins)
#can optionally include their own, which must
#be implemented as an interface in btc.py
from btc import *
from .support import get_log, calc_cj_fee, debug_dump_object, \
... | AdamISZ/joinmarket_core | joinmarket_core/__init__.py | Python | gpl-3.0 | 1,324 |
"""Write initial TrueGrid files for one Sandia blade station.
Usage
-----
start an IPython (qt)console with the pylab flag:
$ ipython qtconsole --pylab
or
$ ipython --pylab
Then, from the prompt, run this script:
|> %run sandia_blade_lib/prep_stnXX_mesh.py
or
|> import sandia_blade_lib/prep_stnXX_mesh
Au... | perryjohnson/biplaneblade | sandia_blade_lib/prep_stn04_mesh.py | Python | gpl-3.0 | 6,804 |
#!/usr/bin/env python
"""
@file vissim_parseBusStops.py
@author Daniel Krajzewicz
@date 2009-05-27
@version $Id: vissim_parseBusStops.py 11671 2012-01-07 20:14:30Z behrisch $
Parses bus stops and bus routes given in the Vissim file (first parameter).
The read bus lines are saved as <OUTPUT_PREFIX>_busses.rou.... | smendez-hi/SUMO-hib | tools/import/vissim/vissim_parseBusStops.py | Python | gpl-3.0 | 5,021 |
"""
class Esex
"""
ESODO, EKSODO, ESPAG, EKSPAG = 1, 2, 3, 4
TYPEE = {ESODO: 'Έσοδα', EKSODO: 'Έξοδα',
ESPAG: 'Αγορές παγίων', EKSPAG: 'Πωλήσεις παγίων'}
ELLADA, ENDOK, EKSOTERIKO = 10, 20, 30
TYPXO = {ELLADA: 'Εσωτερικού', ENDOK: 'Ενδοκοινοτικό', EKSOTERIKO: 'Εξωτερικό'}
class LineType:
"""Τύπος αναλυ... | tedlaz/pyted | esex17/ee.py | Python | gpl-3.0 | 3,878 |
import core
from core.urls import urls_base
from django.contrib import admin
from django.urls import include, path
from django.conf.urls.i18n import i18n_patterns
from django.contrib.sitemaps.views import sitemap
from .sitemaps import RootSitemap
from .api.urls import urlpatterns as api_urls
from .views import (
In... | pashinin-com/pashinin.com | src/pashinin/urls.py | Python | gpl-3.0 | 2,618 |
from .function_button_model import FunctionButtonModel
from .default_path_model import DefaultPathModel
from .default_boolean_model import DefaultBooleanModel
from .string_model import StringModel
| iLoop2/ResInsight | ThirdParty/Ert/devel/python/python/ert_gui/models/mixins/connectorless/__init__.py | Python | gpl-3.0 | 197 |
#!/usr/bin/python2
import xbmc
import os
import time
import urllib
import urllib2
import json
import xml.etree.ElementTree as ET
import hashlib
import re
from globals import ADDON_PATH_PROFILE, LOG_LEVEL
TAG = 'ESPN3 util: '
def is_file_valid(cache_file, timeout):
if os.path.isfile(cache_file):
modified... | locomot1f/plugin.video.espn_3 | resources/lib/util.py | Python | gpl-3.0 | 3,590 |
"""
An integer N is given, representing the area of some rectangle.
The area of a rectangle whose sides are of length A and B is A * B,
and the perimeter is 2 * (A + B).
The goal is to find the minimal perimeter of any rectangle whose area equals N.
The sides of this rectangle should be only integers.
For example, ... | Dineshkarthik/codility_training | Lesson 10 - Prime and composite numbers/min_perimeter_rectangle.py | Python | gpl-3.0 | 1,229 |
import collections
import typing
from . import _inspect, _iterate, _update
from . import duration as _duration
from . import enums as _enums
from . import format as _format
from . import indicators as _indicators
from . import iterate as iterate_
from . import markups as _markups
from . import parentage as _parentage
... | Abjad/abjad | abjad/get.py | Python | gpl-3.0 | 156,692 |
#!/usr/local/bin/python3.5
#coding: utf-8
#Author: Wu Xi <xi_wu@dell.com>
#Purpose: LifeCycle(contained in TSR log) log analyzer
#from tabulate import tabulate as T
import xml.etree.ElementTree as ET
import argparse
import datetime
from tabulate import tabulate as T
#Create parser
parser = argparse.ArgumentParser(des... | harpsichord/wuxi-scripts | Dell/lcAnalyzer.py | Python | gpl-3.0 | 2,844 |
import sys
import time
from datetime import datetime
import tornado.ioloop
import tornado.web
from tornado.log import enable_pretty_logging
from commons.sql_class import SQLMaxMilhas
import MySQLdb
from routes import ROUTES
PORT = 5000
class Application(tornado.web.Application):
def __init__(self, ROUTES):
... | gunasper/test_mm | max_milhas/app.py | Python | gpl-3.0 | 1,018 |
__author__ = 'beto'
| b-cube/restparql | api/db/__init__.py | Python | gpl-3.0 | 20 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# pac.py
#
# Copyright (C) 2013 Antergos
#
# This code is based on previous work by Rémy Oudompheng <remy@archlinux.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
# ... | prescott66/Cnchi | src/pacman/pac.py | Python | gpl-3.0 | 12,667 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2011, 2012 Tom Keffer <tkeffer@gmail.com>
#
# See the file LICENSE.txt for your full rights.
#
# $Revision$
# $Author$
# $Date$
#
"""Unit test module weewx.stats"""
from __future__ import with_statement
import os
import sys
import syslog
import time
import unitt... | crmorse/weewx-waterflow | bin/weewx/test/test_stats.py | Python | gpl-3.0 | 15,410 |
#!/usr/bin/python
# Copyright 2002, 2003 Dave Abrahams
# Copyright 2002, 2003, 2005 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
import BoostBuild
t = BoostBuild.Tester(use_test_config=False)
t.write("jamr... | TGAC/KAT | deps/boost/tools/build/test/static_and_shared_library.py | Python | gpl-3.0 | 1,097 |
import socket #import socket module
s = socket.socket() #create a socket object
host = '192.168.1.94' #Host i.p
port = 12397 #Reserve a port for your service
s.connect((host,port))
print s.recv(1024)
s.close
| Hellrungj/CSC-412-Networking | client_server-project/client3.py | Python | gpl-3.0 | 210 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import datetime
import glob
import json
import logging
import os
import pdb
import shlex
import sys
import time
from ..base import Utils
from ..base.Constants import *
log = logging.getLogger(__name__)
class DB_Obj(object):
'''
basic db object, represent one row of t... | DVS-P2P/bubblestorm | testbed/src/testbed/models/Base.py | Python | gpl-3.0 | 1,187 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Fabric_PyPOA14.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| voliveirajr/Fabric_PyPOA14 | manage.py | Python | gpl-3.0 | 257 |
def maximo(datos):
maximo = 0
for i in datos:
if i > maximo:
maximo = i
return maximo
def minimo(datos):
minimo = 999999
for i in datos:
if i < minimo:
minimo = i
return minimo
def promedio(datos):
suma = 0
for i in datos:
... | xbash/LabUNAB | 06_funciones/funciones-max-min-moda-promedio.py | Python | gpl-3.0 | 1,079 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... | kilon/sverchok | nodes/analyzer/volume.py | Python | gpl-3.0 | 3,399 |
# Copyright (C) 2015 FreeIPa Project Contributors, see 'COPYING' for license.
from __future__ import print_function, absolute_import
import enum
import logging
from ipalib import api
from ipaserver.secrets.kem import IPAKEMKeys, KEMLdap
from ipaserver.secrets.client import CustodiaClient
from ipaplatform.paths impor... | encukou/freeipa | ipaserver/install/custodiainstance.py | Python | gpl-3.0 | 11,748 |
"""
Dragon 64 config
================
:created: 2014 by Jens Diemer - www.jensdiemer.de
:copyleft: 2014-2015 by the DragonPy team, see AUTHORS for more details.
:license: GNU GPL v3 or above, see LICENSE for more details.
"""
import logging
from dragonpy import constants
from dragonpy.Dragon32.c... | jedie/DragonPy | dragonpy/Dragon64/config.py | Python | gpl-3.0 | 2,105 |
import numpy as np
from stcad.source_dev.utilities import *
from stcad.source_dev.objects import *
from stcad.source_dev.chip import *
import gdsCAD as cad
from stcad.source_dev.drums import *
chipsize = 10000
chip = Base_Chip('TEST', chipsize, chipsize,label=False)
# --------------------------------------------- ... | feschmidt/stcad | testing_scripts/rick_drum_array2.py | Python | gpl-3.0 | 6,388 |
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
def __add__(self, oth):
""" Returns a new point containing the addition of the coordinates of a & b """
return Point(self.x+oth.x,self.y+oth.y)
def __iadd__(self, oth):
self.x += oth.x
self.y += ot... | TheUnderscores/time-robot | src/point.py | Python | gpl-3.0 | 913 |
import os
from PyQt4 import QtCore, QtGui
import common
class FileList(QtGui.QListWidget):
files_dropped = QtCore.pyqtSignal()
def __init__(self, parent=None):
super(FileList, self).__init__(parent)
self.setAcceptDrops(True)
self.setIconSize(QtCore.QSize(32, 32))
# drag and dr... | micahflee/supercipher | supercipher_gui/file_selection.py | Python | gpl-3.0 | 4,842 |
# -*- coding: utf-8 -*-
from flask import Flask
app = Flask(__name__)
app.config.from_object('config')
from app import views
#app.debug = config.DEBUG
#app.secret_key = config.SECRET_KEY
#app.csrf_enabled = config.CSRF_ENABLED | OpenGrow/OpenGrow | app/__init__.py | Python | gpl-3.0 | 230 |
# Copyright (C) 2011-2012 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 you... | hcs/mailman | src/mailman/chains/tests/test_hold.py | Python | gpl-3.0 | 3,645 |
from flask.ext.assets import Environment, Bundle
def register_assets(app):
assets = Environment(app)
ALL_ASSETS = {
'core_js': Bundle('js/lib/jquery.js',
'js/lib/jquery.highlight.js',
'js/lib/jquery.mobile.js',
'js/lib/unde... | indico/indico-mobile | indicomobile/views/assets.py | Python | gpl-3.0 | 2,265 |
#!/usr/bin/python3
days_in_months = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
days_in_months_leap_year = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
months_names = ['January', 'February', 'March', 'April', 'May', 'June',
'July', 'August', 'September', 'October', 'November', 'December']
name... | nonZero/demos-python | src/exercises/basic/date/date9.py | Python | gpl-3.0 | 3,920 |
"""
Module contains tools for processing files into DataFrames or other objects
"""
from __future__ import print_function
from pandas.compat import range, lrange, StringIO, lzip, zip, string_types, map
from pandas import compat
import re
import csv
import numpy as np
from pandas.core.index import Index, MultiIndex
fr... | alephu5/Soundbyte | environment/lib/python3.3/site-packages/pandas/io/parsers.py | Python | gpl-3.0 | 76,769 |
#Assignment No :6(B)
# Take the words from file and arrange it in sorted form.
# Take the file and insert data in a file and close it
file1 = raw_input("Enter the name of file with address:")
data = "ABC\nPQR\nXYZ\nABD\nAAA\nGEF\nWXY"
f = open(file1,'w')
f.write(data)
f.close()
a = [] # Take empty list/arra... | sumitkhandelwal/computerprogrammingusingpython | assignmentno6bb2.py | Python | gpl-3.0 | 1,303 |
#-*- coding:utf-8 -*-
import subprocess
from ErrorGenerator import ErrorGenerator
class RubyErrorGenerator(ErrorGenerator):
command = ["ruby", "-c"]
startFilePath = True
parseRegex = "^:([0-9]+): (.*)"
lineIndex = 1
messageIndex = 2
stdout = None
stderr = subprocess.PIPE
| utisam/gfly | gfly/generators/RubyErrorGenerator.py | Python | gpl-3.0 | 280 |
# $HeadURL$
__RCSID__ = "$Id$"
import datetime, time
import types
import threading
import random
from DIRAC.Core.Base.DB import DB
from DIRAC import S_OK, S_ERROR, gConfig
from DIRAC.FrameworkSystem.Client.MonitoringClient import gMonitor
from DIRAC.Core.Utilities import List, ThreadSafe, Time, DEncode
from DIRAC.Acco... | vmendez/DIRAC | AccountingSystem/DB/AccountingDB.py | Python | gpl-3.0 | 70,044 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-29 09:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0002_pokemon_qr_code'),
]
operations = [
migrations.AddField(
... | petersterling1/poke-qr-viewer | main/migrations/0003_pokemon_qr_code_image.py | Python | gpl-3.0 | 487 |
x = 1.56
print( int( x ) )
print( x )
x = 2.1
y = ' 3 '
z = int( x )
print( z )
print( int( y ) )
print( 10 * int( "100000000" ) )
| paulmcquad/Python | 4-Simple Functions/int_func.py | Python | gpl-3.0 | 133 |
from django.contrib import admin
# Register your models here.
from .models import simulation,thing,User
class FilterUserAdmin(admin.ModelAdmin):
#this class is used to filter objects by user(account)
def save_model(self, request, obj, form, change):
obj.account = request.user
obj.save()
... | zibawa/zibawa | simulator/admin.py | Python | gpl-3.0 | 1,016 |
# -*- coding: utf-8 -*-
"""Test case for backend."""
from pytest import raises
from ..context import Context, ContextProvider, current_context
def test_empty_context():
"""Check that context have functions and globals."""
context = Context()
assert context.functions == {}
assert context.globals == {... | vslutov/LLB3D | llb3d/tests/test_context.py | Python | gpl-3.0 | 1,509 |
# Copyright (C) 2011, 2012 Abhijit Mahabal
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later version.
#
# This program is distribu... | amahabal/PySeqsee | farg/apps/seqsee/codelet_families/all.py | Python | gpl-3.0 | 4,940 |
__problem_title__ = "Hypocycloid and Lattice points"
__problem_url___ = "https://projecteuler.net/problem=450"
__problem_description__ = "A hypocycloid is the curve drawn by a point on a small circle rolling " \
"inside a larger circle. The parametric equations of a hypocycloid " \
... | jrichte43/ProjectEuler | Problem-0450/solutions.py | Python | gpl-3.0 | 2,107 |
"""autogenerated by genpy from rosserial_arduino/TestRequest.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class TestRequest(genpy.Message):
_md5sum = "39e92f1778057359c64c7b8a7d7b19de"
_type = "rosserial_arduino/TestRequest"
_has_header = Fa... | jgrizou/robot_omniwheel | catkin_ws/devel/lib/python2.7/dist-packages/rosserial_arduino/srv/_Test.py | Python | gpl-3.0 | 7,141 |
"""
WSGI config for twittmap project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SET... | anshulsharmanyu/twitter_plot | Twitter Map Cloud Assignment/twittmap/wsgi.py | Python | gpl-3.0 | 394 |
import pycuda.autoinit
import pycuda.driver as cuda
from pycuda.compiler import SourceModule
import warnings
import numpy as np
import os
from dbcv.__handler__ import Handler
class CudaHandler(Handler):
_MIN_N_THREADS = 32
_MAX_N_THREADS = 1024
_N_OUTPUT = 3
def __init__(self, dataset):
su... | henryzord/clustering | src/measures/dbcv/cuda/__init__.py | Python | gpl-3.0 | 3,770 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__RCSID__ = "$Id$"
from diraccfg import CFG
from DIRAC import S_OK, S_ERROR
from DIRAC.Core.Utilities import List
def loadJDLAsCFG(jdl):
"""
Load a JDL as CFG
"""
def cleanValue(value):
value = v... | yujikato/DIRAC | src/DIRAC/Core/Utilities/JDL.py | Python | gpl-3.0 | 4,840 |
from .status import startSession
from .general import *
| ttm/percolation | percolation/utils/__init__.py | Python | gpl-3.0 | 56 |
from corr2 import app
app.run()
| eepp/corr2 | bin/corr.py | Python | gpl-3.0 | 33 |
# Copyright (C) 2011 Mark Burnett
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program i... | mark-burnett/filament-dynamics | unit_tests/database/test_parameters.py | Python | gpl-3.0 | 2,579 |
print((hex(int(input())))[2:])
| LTKills/languages | python/33.py | Python | gpl-3.0 | 32 |
# Copyright 2012 the rootpy developers
# distributed under the terms of the GNU General Public License
from nose.plugins.skip import SkipTest
from rootpy.utils.silence import silence_sout
try:
with silence_sout():
import ROOT
from ROOT import (RooFit, RooRealVar, RooGaussian, RooArgusBG,
... | henryiii/rootpy | rootpy/stats/tests/test_plottable.py | Python | gpl-3.0 | 2,282 |
RIGHT = 'right'
LEFT = 'left'
WINDOW_WIDTH = 1024
WINDOW_HEIGHT = 768
| DChaushev/the-last-stand | enumerations.py | Python | gpl-3.0 | 70 |
import pytest
from pysisyphus.helpers import geom_loader
from pysisyphus.io.pdb import geom_to_pdb_str
@pytest.mark.parametrize(
"pdb_fn, fragment_num", [
("lib:pdbs/1gcn.pdb", 29),
("lib:pdbs/1bl8.pdb", 388+4),
]
)
def test_fragment_num(pdb_fn, fragment_num):
geom = geom_loader(pdb_fn)
... | eljost/pysisyphus | tests/test_pdb/test_pdb.py | Python | gpl-3.0 | 1,262 |
#
# This file is part of Checkbox.
#
# Copyright 2008 Canonical Ltd.
#
# Checkbox 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.
#
# C... | Alberto-Beralix/Beralix | i386-squashfs-root/usr/share/checkbox/plugins/persist_info.py | Python | gpl-3.0 | 1,695 |
# -*- coding: utf-8 -*-
"""
.. module: switching
Aquesta llibreria proveeix de les classes i mètodes necessaris pel switching
"""
import os
__version__ = '2.12.2'
_ROOT = os.path.abspath(os.path.dirname(__file__))
def get_data(path):
filename = isinstance(path, (list, tuple)) and path[0] or path
return os... | gisce/switching | switching/__init__.py | Python | gpl-3.0 | 357 |
import logging
import os
import select
import sys
from six import PY2
from threading import Thread
if PY2:
from Queue import Queue
else:
from queue import Queue
class IOManager:
thread = None
control_pipe = None
control_queue = None
def __init__(self):
self.control_queue = Queue()
read_fd, write... | intelligent-agent/redeem | redeem/IOManager.py | Python | gpl-3.0 | 3,274 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import oioioi.base.fields
import oioioi.participants.fields
class Migration(migrations.Migration):
dependencies = [
('contests', '0001_initial'),
migrations.s... | papedaniel/oioioi | oioioi/participants/migrations/0001_initial.py | Python | gpl-3.0 | 1,775 |
##############################################################################
#
# Copyright (C) Zenoss, Inc. 2013, all rights reserved.
#
# This content is made available according to terms specified in
# License.zenoss under the directory where your Zenoss product is installed.
#
#####################################... | krull/docker-zenoss4 | init_fs/usr/local/zenoss/ZenPacks/ZenPacks.zenoss.Microsoft.Windows-2.6.9.egg/ZenPacks/zenoss/Microsoft/Windows/modeler/plugins/zenoss/winrm/Processes.py | Python | gpl-3.0 | 5,712 |
"""Module that gather several informations about host"""
import logging
import re
from robottelo.cli.base import CLIReturnCodeError
from robottelo.helpers import lru_cache
from robottelo import ssh
LOGGER = logging.getLogger(__name__)
@lru_cache(maxsize=1)
def get_host_os_version():
"""Fetches host's OS version... | sghai/robottelo | robottelo/host_info.py | Python | gpl-3.0 | 5,289 |
class Solution(object):
def lengthOfLIS(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
length = len(nums)
if length == 0:
return 0
elif length == 1:
return 1
else:
opt_array = [1]
for i in xrange(... | urashima9616/Leetcode_Python | leet300.py | Python | gpl-3.0 | 566 |
from collections import namedtuple
from lxml import etree
from lxml.builder import E
from eruditarticle.utils import remove_xml_namespaces
Author = namedtuple("Author", "firstname lastname othername")
class BaseDomChanger:
def __init__(self, xml):
self.root = remove_xml_namespaces(etree.fromstring(xml... | erudit/eruditorg | eruditorg/erudit/test/domchange.py | Python | gpl-3.0 | 5,219 |
#! /usr/bin/env python
# ==========================================================================
# Display test reports
#
# Copyright (C) 2016 Juergen Knoedlseder
#
# 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... | ctools/ctools | dev/testreport.py | Python | gpl-3.0 | 5,623 |
# Setup
import time
import webbrowser
import md5
import sys
import hashlib
import random
from urllib2 import urlopen
from yahoo_finance import Share
# Makes the webbrowser command
def open_link(link):
webbrowser.open(link)
speak("Opening web browser")
pause(2)
# Makes the pause command
def pause(seconds)... | Redstoners/PPA | ppa.py | Python | gpl-3.0 | 3,986 |
#!/usr/bin/env python
"""Get a random offensive ASCII art"""
from urlparse import urljoin
import re
import random
import urllib
from madcow.util import Module, strip_html
class Main(Module):
pattern = re.compile(r'^\s*artfart(?:\s+(.+?))?\s*$', re.I)
require_addressing = True
help = u'artfart - displays... | cjones/madcow | madcow/modules/artfart.py | Python | gpl-3.0 | 1,205 |
# -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Recruitment',
'version': '1.0',
'category': 'Human Resources/Recruitment',
'sequence': 90,
'summary': 'Track your recruitment pipeline',
'description': "",
'website': 'https://www... | t3dev/odoo | addons/hr_recruitment/__manifest__.py | Python | gpl-3.0 | 1,120 |
# -*- coding: utf-8 -*-
import json
import requests
import time
import sys
if len(sys.argv) ==1:
print 'Insert google api Key'
quit()
apiKey=sys.argv[1]
badCriminalData=[]
criminal = json.loads(open('rustCriminal2014-2016-nao-tratado.json').read())
def excludeWrongData(criminal):
noCity = isinstance(criminal['ESTA... | devmessias/brasillivre | data/processoDoSTF(2014-2016)ExclusaoDeNomes/aggregateGEOData.py | Python | gpl-3.0 | 1,249 |
'''
The main index page
'''
import os
import sys
# For importing other modules!
path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(path)
import pieces.page as page
'''
View the main index page
'''
def Render(db):
p = page.Page(db)
# Setup the pa... | shawger/pucklab | webapp/src/views/index.py | Python | gpl-3.0 | 434 |
##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2015 Karl Palsson <karlp@tweak.net.au>
##
## 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 L... | hufsm/tu_gen2_libsigrokdecode | decoders/adns5020/pd.py | Python | gpl-3.0 | 3,386 |
import os
import re
import sys
import yaml
def die(s):
print(s, file=sys.stderr)
sys.exit(1)
def equals(name, s1, s2):
if s1 != s2:
die("in %s expected %r, got %r" % (name, s2, s1))
def matches(name, s, r):
if not re.search(r, s):
die("in %s expected to match %s, got %r" % (name, r, s... | kenvandine/snapd | tests/main/snap-info/check.py | Python | gpl-3.0 | 4,552 |
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
self.
"""
Test... | TitoAlehandro/calc | book/tests.py | Python | gpl-3.0 | 397 |
from __future__ import (absolute_import, division, print_function)
import numpy as np
def PROJECT(k, n, xi): # xi modified in place
a = np.sum(xi[:n, k])
a = a / n
xi[:n, k] -= a
| ScreamingUdder/mantid | scripts/Muon/MaxentTools/project.py | Python | gpl-3.0 | 195 |
import pymongo as Mongo
DB_NAME = 'localhost'
DB_PORT = 27017
TEST_JSON = {'url':'http://hello.com','content':'Lemon Tree'}
class DB():
def __init__(self,db,port):
self.client = Mongo.MongoClient(db,port)
self.db = self.client.test
self.collect = self.db.test_collect
def insert(sel... | CuteLemon/Learn | NewsAPI_Scraper/db_operation.py | Python | gpl-3.0 | 1,050 |
# coding=utf-8
# Author: adaur <adaur.underground@gmail.com>
# Contributor: PHD <phd59fr@gmail.com>, pluzun <pluzun59@gmail.com>
#
# URL: https://sickchill.github.io
#
# This file is part of SickChill.
#
# SickChill is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public L... | dfalt974/SickRage | sickbeard/providers/yggtorrent.py | Python | gpl-3.0 | 8,174 |
#!/usr/bin/env python
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
from setuptools import setup, find_packages
import re
info = eval(file('__tryton__.py').read())
requires = ['BeautifulSoup < 3.1']
for dep in info.get('d... | tryton/google_translate | setup.py | Python | gpl-3.0 | 2,085 |
class Hand:
def __init__(self):
self.the_hand = []
def display_hand(self):
for c in range(0, len(self.the_hand)):
print(self.the_hand[c])
| DalikarFT/CFVOP | Hand.py | Python | gpl-3.0 | 176 |
"""simple script that santizes the `output` directory.
works even if no santitation required.
'sanitation' is simply removing potentially sensitive fields from the results."""
import sys, os, json
from . import core
from os.path import join
def do():
output_dir = core.output_dir()
for dirname in os.listdir(o... | elifesciences/elife-metrics | src/article_metrics/ga_metrics/sanitize.py | Python | gpl-3.0 | 801 |