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 |
|---|---|---|---|---|---|
#coding: utf8
import re # regexp
##- print
print ("はろー")
print ("はろー"+"わーるど")
print('------------------')
#-- array
sales = [50, 100, 80, 45]
sales.sort()
print(sales)
print('------------------')
#-- if
score = 40
if score > 60:
print("OK")
elif score > 40:
print("MIDDLE")
else:
print("MINIMUM")
print('------... | ogalush/Anything | Python27Helloworld2.py | Python | gpl-2.0 | 768 |
# -*- coding: utf-8 -*-
#
# Copyright 2006-2021 University of Oslo, Norway
#
# This file is part of Cerebrum.
#
# Cerebrum 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
# ... | unioslo/cerebrum | Cerebrum/modules/no/nih/bofhd_nih_cmds.py | Python | gpl-2.0 | 14,543 |
import _mysql
import os
import re
import time
from dealFile import *
def writeSplit(didOriginal,ddi,topologyFolder,Examples):
NumberOfexamples=0
for example in Examples:
if isIn(example,didOriginal):
NumberOfexamples+=1
if NumberOfexamples<=15:
return False
originalFile=open(didOriginal,'r')
if not os.path... | magic2du/contact_matrix | topologyTest/SplitDDIsHaveOver2InterfacesHave16-20Examples_OnServer.py | Python | gpl-2.0 | 4,467 |
#!/usr/bin/python2
#NOTE: Run this script from deft/papers/fuzzy-fmt with the
#command ./nm_hist.py
import numpy as np
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
import os
seeds=50
for gw in [.01, .05]:
#for gw in [0.01, 0.05, 0.1, 0.5, 0.7]:
print "gw=%g" % (gw)
#for mcconstant in [300, 8... | droundy/deft | papers/fuzzy-fmt/nm_hist.py | Python | gpl-2.0 | 918 |
#!/usr/bin/env python
import sys
n = int(sys.argv[1])
print "* %d-dim cube" % (n)
print "H-representation"
print "begin"
print " %d %d integer" % (2*n, n+1)
for i in range(0,n):
print " ".join(['0'] + ['1' if (j % n == i) else '0' for j in range(0,n)])
for i in range(0,n):
print " ".join(['1'] + ['-1' if (j % ... | denisrosset/thomas-rehn-sympol | contrib/generate_cube.py | Python | gpl-2.0 | 371 |
"""
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 ... | amadeusproject/amadeuslms | goals/forms.py | Python | gpl-2.0 | 8,841 |
#!/usr/bin/env python
import pandas as pd
import traceback
import logging.config
import argparse
import matplotlib.pyplot as plt
import time
import os
def clear_term():
os.system('cls' if os.name == 'nt' else 'clear')
def display_orderbook(routing_key, message_json):
df_all = pd.read_json(messa... | femtotrader/rabbit4mt4 | receive/Python/old/receive_dom_plot_matplotlib.py | Python | gpl-2.0 | 4,118 |
#!/usr/bin/python3
import os
import hashlib
try:
from ifupdown2.lib.addon import Addon
import ifupdown2.ifupdown.statemanager as statemanager
from ifupdown2.ifupdown.iface import *
from ifupdown2.ifupdown.utils import utils
from ifupdown2.ifupdownaddons.modulebase import moduleBase
from ifu... | CumulusNetworks/ifupdown2 | ifupdown2/addons/ppp.py | Python | gpl-2.0 | 5,422 |
# vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=python:textwidth=0:
# License: GPL2 or later see COPYING
# Written by Michael Brown
# Sections by Seth Vidal
# Sections taken from Mach by Thomas Vander Stichele
# Copyright (C) 2007 Michael E Brown <mebrown@michaels-house.net>
from __future__ import print_func... | schnoebe/fedora-mock | py/mockbuild/util.py | Python | gpl-2.0 | 38,765 |
#!/usr/bin/python -tt
import os
import os.path
import sys
import grp
import subprocess
import logging
import mockbuild.util
import mockbuild.exception
from mockbuild.trace_decorator import traceLog, decorate
class MountPoint(object):
'''base class for mounts'''
decorate(traceLog())
def __init__(self, mou... | alanfranz/mock | py/mockbuild/mounts.py | Python | gpl-2.0 | 4,631 |
###############################################################################
# Name: ScCommand.py #
# Purpose: Enumerate modified, added, deleted files in a list #
# Author: Kevin D. Smith <Kevin.Smith@sixquickrun.com> #
... | robmcmullen/peppy | peppy/project/editra/ScCommand.py | Python | gpl-2.0 | 14,865 |
__all__ = ["mainWindow"] | dcell/theHarvester-gui | gui_/__init__.py | Python | gpl-2.0 | 24 |
"""
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 ... | amadeusproject/amadeuslms | topics/apps.py | Python | gpl-2.0 | 1,017 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('tentacle', '0002_auto_20150909_0743'),
]
operations = [
migrations.CreateModel(
nam... | rilutham/tentacle | tentacle/migrations/0003_note.py | Python | gpl-2.0 | 720 |
#!/usr/bin/python
#coding: utf-8
__AUTHOR__ = "Fnkoc"
"""
Copyright (C) 2015 Franco Colombino
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
(... | fnk0c/organon | src/update.py | Python | gpl-2.0 | 2,027 |
from django.conf.urls import patterns, include, url
from django.views.generic import RedirectView
from django.conf import settings
from django.views.generic import TemplateView
from django.contrib import admin
admin.autodiscover()
from mooc.views import index, about, select_login, redirect_to_correct_dash, edit_prof... | mtarsel/Django-MOOC | mooc/urls.py | Python | gpl-2.0 | 1,720 |
#-------------------------------------------------------------------------------
# Name: sprites
# Purpose:
#
# Author: novirael
#
# Created: 17-04-2012
# Copyright: (c) novirael 2012
# Licence: <your licence>
#------------------------------------------------------------------------------... | novirael/arkanoid-pygame | sprites.py | Python | gpl-2.0 | 4,542 |
# Copyright 2007 Zachary Pincus
# This file is part of CellTool.
#
# CellTool is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
"""Extract contours from images, optionally rescaling and resampling... | tdsmith/celltool | celltool/command_line/extract_contours.py | Python | gpl-2.0 | 5,720 |
# Copyright 2012 Nebula, 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 ... | ChinaMassClouds/copenstack-server | openstack/src/horizon-2014.2/openstack_dashboard/dashboards/admin/dashboard.py | Python | gpl-2.0 | 2,057 |
import tornado.ioloop
import tornado.web
from threading import Timer
from tornado.websocket import WebSocketHandler
class SensorsHandler(WebSocketHandler):
def open(self):
Timer(60, self.on_message).start()
print("WebSocket opened")
def on_message(self, message):
self.write_message(u'... | nextgis/ngw_demo_front | ngw_demo_front_tornado/handlers/sensors.py | Python | gpl-2.0 | 397 |
#!/usr/bin/env python
# ----------------------------------------------------------------------
# Ragazzi & Rocha Robotics
# Copyright (C) 2015, Ragazzi & Rocha Robotics, Inc. Unless you have an
# agreement with Ragazzi & Rocha Robotics, Inc., for a separate license
# for this software code, the following terms a... | david-ragazzi/zebatis | tests/unit/zebatis/network/segment_test.py | Python | gpl-2.0 | 3,958 |
import os
required_tables = ('acl_groups', 'acl_groups_hosts', 'acl_groups_users',
'autotests', 'host_queue_entries', 'hosts', 'hosts_labels',
'ineligible_host_queues', 'jobs', 'labels', 'users')
def migrate_up(manager):
rows = manager.execute("SHOW TABLES")
tables = [ro... | yochow/autotest | frontend/migrations/001_initial_db.py | Python | gpl-2.0 | 5,291 |
# 1. split reddit corpus into one document = one file
import os
import sys
import uuid
dir = './data/'
print '> Splitting Reddit corpus to one document per file (if required)'
for file in os.listdir(dir):
# only reddit corpus files starts with 'corpus_'
if file.startswith('corpus'):
doc = open(dir + fi... | otaj/nlp-ntu | 5.1/stats.py | Python | gpl-2.0 | 1,139 |
"""General LID Functions"""
import shapely.geometry
from collections import Counter
from math import floor, sqrt
from . import config as cfg
from . import units
import inject as inj
from .swmm import input as si
def area_units(input_unit_system):
"""Takes in input unit system and determines area units for
... | kmmacro/ostrich-swmm | ostrich_swmm/LID.py | Python | gpl-2.0 | 2,349 |
# -*- coding: utf-8 -*-
import socket
from threading import Thread
__author__ = 'Vinícius da Silveira Serafim <vinicius@serafim.eti.br>'
# ip e porta locais para aguardar conexões
listen_on = ("127.0.0.1", 9000)
# quantas conexões o sistema operacional vai manter aguardando até que o servidor as aceite
backlog = 5
... | vsserafim/aula_sockets_echo | server_02.py | Python | gpl-2.0 | 2,523 |
#!/usr/bin/env python
#
# $Id: encrypt2.py 366 2013-07-29 22:20:24Z valos $
#
# PyXMLSec example: Encrypting XML file with a dynamicaly created template.
#
# Encrypts XML file using a dynamicaly created template file and a DES key
# from a binary file
#
# Usage:
# ./encrypt2.py <xml-doc> <des-key-file>
#
# Example:
... | Rondineli/django-sso | django_sso/pyxmlsec/trunk/examples/encrypt2.py | Python | gpl-2.0 | 4,866 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
import stdimage.models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('administration', '0015_auto_20151003_0149'),
]
operatio... | bpain2010/kgecweb | administration/migrations/0016_auto_20151011_1724.py | Python | gpl-2.0 | 950 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import smtplib
from email import encoders
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
import exchangelib
from .core import ClientAbstract
MAX_BODY_LEN = 1000000
class EmailClient(ClientAbstract):
"... | derwentx/WooGenerator | woogenerator/client/email.py | Python | gpl-2.0 | 4,510 |
# Copyright (C) 2007 LibreSoft
#
# 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 the ... | libresoft/CVSAnaly-ALERT-branch | pycvsanaly2/SVNParser.py | Python | gpl-2.0 | 10,028 |
from django.contrib import admin
from edc_base.modeladmin.admin import BaseModelAdmin
from ..models import DefaultValueLog
class DefaultValueLogAdmin(BaseModelAdmin):
list_display = ('subject_identifier', 'group_name', 'value', 'value_datetime', 'modified')
search_fields = ('subject_identifier', 'error_mess... | botswana-harvard/edc-lab-tracker | edc_lab_tracker/admin/default_value_log_admin.py | Python | gpl-2.0 | 484 |
# -*- coding: utf-8 -*-
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
class ELFFile(object):
pass
| jeffmahoney/crash-python | doc-source/mock/elftools/elf/elffile.py | Python | gpl-2.0 | 118 |
# This example show how to write an inline mode telegram bot use pyTelegramBotAPI.
import logging
import sys
import time
import telebot
from telebot import types
API_TOKEN = '<TOKEN>'
bot = telebot.TeleBot(API_TOKEN)
telebot.logger.setLevel(logging.DEBUG)
@bot.inline_handler(lambda query: query.query == 'text')
de... | sgomez/pyTelegramBotAPI | examples/inline_example.py | Python | gpl-2.0 | 2,883 |
# -*- coding: utf-8 -*-
"""
The simple server is built on top of the builtin server and request
handler classes from the standard library. This can simply be invoked
in a directory that provide some static templates that has hooks into
the JavaScript nunja libraries.
Alternatively, server side rendering can be enable... | calmjs/nunja.serve | src/nunja/serve/simple/__init__.py | Python | gpl-2.0 | 6,837 |
# -*- coding: utf-8 -*-
"""
* Copyright (C) 2015-2020 Rikard Söderström, <soderstrom.rikard@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the version 2 of the GNU General Public License
* as published by the Free Software Foundation
*
* This program i... | soderstrom-rikard/sandbox | pyasm/arch/__init__.py | Python | gpl-2.0 | 735 |
# Organic Photovoltaic Device Model - a drift diffusion base/Shockley-Read-Hall
# model for organic solar cells.
# Copyright (C) 2012 Roderick C. I. MacKenzie
#
# roderick.mackenzie@nottingham.ac.uk
# www.opvdm.com
# Room B86 Coates, University Park, Nottingham, NG7 2RD, UK
#
# This program is free softwar... | roderickmackenzie/opvdm | gui/util_text.py | Python | gpl-2.0 | 1,187 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet :
# This file is part of Fail2Ban.
#
# Fail2Ban 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;... | jakesyl/fail2ban | fail2ban/server/server.py | Python | gpl-2.0 | 16,680 |
## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
"""
Color themes for the interactive console.
"""
##################
## Color themes ##
##################
class Color:... | kinap/scapy | scapy/themes.py | Python | gpl-2.0 | 10,297 |
# Copyright (c) 2013 Hesky Fisher
# See LICENSE.txt for details.
import unittest
from mock import patch
from logging import Handler
from collections import defaultdict
from plover import log
class FakeHandler(Handler):
outputs = defaultdict(list)
def __init__(self, filename, format=log.STROKE_LOG_FO... | benreynwar/plover | plover/test_log.py | Python | gpl-2.0 | 2,813 |
# Copyright 2016, 2017 Richard Rodrigues, Nyle Rodgers, Mark Williams,
# Virginia Tech
#
# This file is part of Coremic.
#
# Coremic 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 Lice... | richrr/coremicro | src/web/send_email.py | Python | gpl-2.0 | 1,698 |
# -*- coding: utf-8 -*-
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
import sys
print("Doing static checking.")
from mypy.main import main
common_args = ["--ignore-missing-imports",
"--disallow-incomplete-defs",
"--disallow-untyped-defs",
"--disallow-unty... | jeffmahoney/crash-python | tests/run-mypy.py | Python | gpl-2.0 | 858 |
a = 4
print a
def test(a):
a = a + 5
return a
print test(a)
print a
| bt3gl/sharpening_the_axe | ritchie_and_kernighan/ch1/python_ref_test.py | Python | gpl-2.0 | 80 |
#!/usr/bin/env python
import argparse
import re
import sys
from cfme.containers.provider.openshift import OpenshiftProvider
from cfme.utils.appliance import DummyAppliance
from cfme.utils.log import add_stdout_handler
from cfme.utils.log import logger
from cfme.utils.providers import list_providers
from cfme.utils.pro... | RedHatQE/cfme_tests | scripts/ocp_cleanup.py | Python | gpl-2.0 | 3,990 |
from __future__ import division, absolute_import, print_function
from .. import kernels
from .. import _kernels
from scipy import stats
from scipy.fftpack import fft, dct
from scipy.integrate import quad
import numpy as np
class KernelTester(object):
@classmethod
def initUpClass(cls, lower=-np.inf, test_wid... | jtcb/regress-plan | astar/pyqt_fit/test/test_kernels.py | Python | gpl-2.0 | 6,301 |
# coding: utf-8
from models import *
from django.shortcuts import render_to_response
from django.core.paginator import Paginator
# Filtra els resultats per pagina
def select(request, pag_id):
page = request.GET.get('page')
if not page:
page = 1
if not pag_id:
pag_id = 0
pag_id = int... | vtomasr5/adsodj | web/views.py | Python | gpl-3.0 | 864 |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^update_all/', views.update_all, name='update_all')
]
| pmandr/plant_carer | MyGarden/Device/urls.py | Python | gpl-3.0 | 178 |
################################################################################
##
## Janus -- GUI Software for Processing Thermal-Ion Measurements from the
## Wind Spacecraft's Faraday Cups
##
## Copyright (C) 2016 Bennett A. Maruca (bmaruca@udel.edu)
##
## This program is free software: you can redistribute... | JanusWind/FC | janus_widget_mfi_lon_plot.py | Python | gpl-3.0 | 7,378 |
'''
Created on 03/11/2017
@author: chernomirdinmacuvele
'''
from PyQt5.Qt import QComboBox, Qt,QSortFilterProxyModel, QCompleter, QStandardItemModel, QStandardItem,\
QAbstractItemView, QAbstractItemModel, QApplication, QDialog, QWidget,\
QVBoxLayout, QStyledItemDelegate, QStyleOptionViewItem, QPainter,\
... | InUrSys/PescArt2.0 | src/srcPlus/UTILITY/CustomWidgets.py | Python | gpl-3.0 | 3,289 |
import shesha.config as conf
simul_name = "test_SH_base"
# loop
p_loop = conf.Param_loop()
p_loop.set_niter(100)
p_loop.set_ittime(0.002) # =1/500
# geom
p_geom = conf.Param_geom()
p_geom.set_zenithangle(0.)
# tel
p_tel = conf.Param_tel()
p_tel.set_diam(4.0)
p_tel.set_cobs(0.12)
# atmos
p_atmos = conf.Param_at... | ANR-COMPASS/shesha | data/par/par4tests/test_sh_lgs_corr.py | Python | gpl-3.0 | 2,203 |
import readline
from PyQt5.QtCore import QObject, QEvent, Qt
from PyQt5.QtGui import QTextOption
from AlphaHooks.widgets.console.display import PythonDisplay
class ConsoleProperty(QObject):
"""
Provides access to methods of console_log.
"""
HISTORY_PATH = "data/.history"
def __init__(self, ui, ... | AlphaHooks/AlphaHooks | AlphaHooks/widgets/console/config.py | Python | gpl-3.0 | 2,905 |
import bpy
from ... base_types import UMOGNode
class TextureAlternatorNode(bpy.types.Node, UMOGNode):
bl_idname = "umog_ObjectAlternatorNode"
bl_label = "Object Alternator"
assignedType = "Object"
Object = bpy.props.StringProperty()
def create(self):
self.newInput(self.assignedType, "Obj... | hsab/UMOG | umog_addon/nodes/object/object_alternator.py | Python | gpl-3.0 | 801 |
'''
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 distributed in the hope th... | YHOYO/mesh_doshape_tools | mover.py | Python | gpl-3.0 | 3,982 |
#!/bin/true
# -*- coding: utf-8 -*-
#
# This file is part of ypkg2
#
# Copyright 2015-2017 Ikey Doherty <ikey@solus-project.com>
#
# 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 ver... | solus-project/ypkg | ypkg2/scripts.py | Python | gpl-3.0 | 9,238 |
import re
from PyQt5 import QtCore
class LeaderboardFilterModel(QtCore.QSortFilterProxyModel):
def lessThan(self, leftIndex, rightIndex):
column = leftIndex.column()
leftData = self.sourceModel().data(leftIndex)
rightData = self.sourceModel().data(rightIndex)
if column == 0: # N... | FAForever/client | src/stats/models/leaderboardfiltermodel.py | Python | gpl-3.0 | 1,254 |
# Copyright 2019-2020 by Christopher C. Little.
# This file is part of Abydos.
#
# Abydos 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 versio... | chrislit/abydos | abydos/distance/_kuhns_xi.py | Python | gpl-3.0 | 5,973 |
"""add external auth tables
Revision ID: 13572931d28f
Revises: 4edfead052cd
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.schema import Column
# revision identifiers, used by Alembic.
revision = '13572931d28f'
down_revision = '4edfead052cd'
constraint_name = 'auth_external_user_type_auth_constr... | wazo-pbx/xivo-auth | alembic/versions/13572931d28f_add_external_auth_tables.py | Python | gpl-3.0 | 1,801 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import division #1/2 = float, 1//2 = integer, python 3.0 behaviour in 2.6, to make future port to 3 easier.
from optparse import OptionParser
import os
import libxml2
def ffind(path,name):
filelist = []
for root, dirs, files in os.walk(path):
for file in fil... | rvalles/pymvntricks | pomdependencyusers.py | Python | gpl-3.0 | 2,548 |
# -*- coding: utf-8 -*-
# Written (W) 2008-2012 Christian Widmer
# Written (W) 2008-2010 Cheng Soon Ong
# Written (W) 2012-2014 Daniel Blanchard, dblanchard@ets.org
# Copyright (C) 2008-2012 Max-Planck-Society, 2012-2014 ETS
# This file is part of GridMap.
# GridMap is free software: you can redistribute it and/or m... | cjw85/gridmap | gridmap/job.py | Python | gpl-3.0 | 36,774 |
__author__ = 'ds'
import org__POA.asam.ods as ods_POA
import dbHandler
import ApplicationElement
class InstanceElement_i(ods_POA.InstanceElement):
def __init__(self, instance):
self.db = dbHandler.get_db()
self.instance = instance
def addInstanceAttribute(self):
return
def crea... | ds485/Aggressive-Heart | InstanceElement.py | Python | gpl-3.0 | 2,225 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "reality.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| polypmer/obligarcy | manage.py | Python | gpl-3.0 | 250 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of python-gnupg, a Python interface to GnuPG.
# Copyright © 2013 Isis Lovecruft, <isis@leap.se> 0xA3ADB67A2CDB8B35
# © 2013 Andrej B.
# © 2013 LEAP Encryption Access Project
# © 2008-2012 Vinay Sajip
# © 2005 Ste... | isislovecruft/python-gnupg | pretty_bad_protocol/test/test_parsers.py | Python | gpl-3.0 | 2,917 |
import dlx_python.libexactcover as ec
from graph_coloring import find_graph_colors,generate_dot
from Grid import Grid
from Piece import Piece
from PIL import Image, ImageDraw
from random import randint
class Puzzle:
"""
Puzzle consists of dimensions and n pieces
Args:
pieces (Piece[]): List of n... | bforte/puzzle-solver | Puzzle.py | Python | gpl-3.0 | 6,649 |
#!/usr/bin/env python
# http://stackoverflow.com/questions/4460921/extract-the-first-paragraph-from-a-wikipedia-article-python
import re
import yaml
import urllib
import urllib2
class WikipediaError(Exception):
pass
class Wikipedia:
url_article = 'http://%s.wikipedia.org/w/index.php?action=raw&title=%s'
... | sbenthall/bluestocking | bluestocking/wikipedia.py | Python | gpl-3.0 | 2,731 |
#!/usr/bin env python3
"""CLI parser for philoload4 command"""
import collections
import os
import sys
from glob import glob
from argparse import ArgumentParser
from philologic.loadtime import Loader, LoadFilters, Parser, PlainTextParser, PostFilters
from philologic.utils import pretty_print, load_module
# Load glob... | clovis/PhiloLogic4 | python/philologic/loadtime/LoadOptions.py | Python | gpl-3.0 | 10,385 |
# -*- coding: utf-8 -*-
# Copyright (c) 2012 - 2014 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Package implementing bookmarks importers for various sources.
"""
from __future__ import unicode_literals
from PyQt5.QtCore import QCoreApplication
import UI.PixmapCache
import Globals
def getImporters():
""... | davy39/eric | Helpviewer/Bookmarks/BookmarksImporters/__init__.py | Python | gpl-3.0 | 4,424 |
#
#
# prepares HTML files
# Only supports the new MCS PSF.
#
#
#
execfile("../config.py")
import shutil
from kirbybase import KirbyBase, KBError
import variousfct
import star
import lookback_fct
import combibynight_fct
import numpy as np
from glob import glob
import ds9reg
import f2n
###### config ########
start... | COSMOGRAIL/COSMOULINE | pipe/8_pyMCS_lookback_scripts/1_buildpages.py | Python | gpl-3.0 | 14,944 |
from .base64 import Base64
| pity7736/raise_exception | utils/base64/__init__.py | Python | gpl-3.0 | 27 |
# -*- coding: utf-8 -*-
"""
This file contains the Qudi hardware module for the FPGA based fast counter.
Qudi 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) ... | tobiasgehring/qudi | hardware/switches/ok_fpga/ok_s6_switch.py | Python | gpl-3.0 | 8,601 |
# -*- encoding: utf-8 -*-
"""Test class for Foreman Discovery Rules
:Requirement: Discoveryrule
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: CLI
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from fauxfactory import gen_alphanumeric, gen_choice, gen_string
from robottelo.cli.... | elyezer/robottelo | tests/foreman/cli/test_discoveryrule.py | Python | gpl-3.0 | 21,996 |
import re
import json
from urllib import urlopen
from os import listdir, path, environ
# Django Libraries
from django import setup as django_setup
from django.conf import settings as django_settings
# Lense Libraries
from lense.common.utils import ensure_root
from lense.client.handlers.base import ClientHandler_Base
... | djtaylor/lense-client | usr/lib/python2.7/dist-packages/lense/client/handlers/module.py | Python | gpl-3.0 | 8,609 |
from flask import flash, render_template, redirect, current_app
from flask_login import login_user, login_required, logout_user, current_user
from flask_wtf import Form
from wtforms import StringField, PasswordField
from wtforms.validators import DataRequired, Length
from . import users
from app.users.models import Us... | kuujakke/kolbe | app/users/views.py | Python | gpl-3.0 | 1,699 |
#!/usr/bin/python -tt
# -*- coding: utf-8 -*-
from pyselection.core import const_types
import sys
# Constant module solution taken from:
# Martelli and Asher (2002) Python Cookbook. Sebastopol: O'Reilly. (p.193)
class _const(object):
"""Class for storing constant values."""
def __init__(self):
... | walsht26/PySelection | pyselection/const.py | Python | gpl-3.0 | 921 |
# Xandikos
# Copyright (C) 2016-2017 Jelmer Vernooij <jelmer@jelmer.uk>, et al.
#
# 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; version 3
# of the License or (at your option) any later version ... | jelmer/xandikos | xandikos/store/git.py | Python | gpl-3.0 | 25,002 |
# -*- coding=UTF-8 -*-
class Config(object):
DEBUG = False
SECRET_KEY = 'aNioVau'
PORT = 5678
DB_HOST = '127.0.0.1'
DB_USER = 'cmtech'
DB_PASSWORD = 'cmtech.1123'
DB_NAME = 'cmtech_eia'
class DevelConfig(Config):
DEBUG = True
DB_HOST = '127.0.0.1'
DB_USER = 'root'
DB_PA... | Ovaphlow/aniovau | webserver/aniovau/config.py | Python | gpl-3.0 | 365 |
import numpy
import os.path
class ObjModel:
def __init__(self, file_name_prefix):
self.materials = {}
self.colors = []
self.points = []
self.polygons = []
self._load_mtl(file_name_prefix + ".mtl")
self._load_obj(file_name_... | michalnand/motoko_uprising | src/tools/robot_debug_py/opengl_gui/obj_model.py | Python | gpl-3.0 | 2,326 |
from itpp import itload
import numpy as np
import os
from saps import ConstructNameFileResult
from saps import ArgsToStr
from colorama import Fore
try:
DirResults = Options.Config["FilesystemITPP"]["DirResults"]
except:
Msg.Error(1, "FilesystemITPP -> DirResults has to be defined in config file.")
DirResults =... | gilbertf/saps | collect/FilesystemITPP.py | Python | gpl-3.0 | 7,363 |
__author__ = 'Tadej'
from django import template
register = template.Library()
@register.assignment_tag
def get_paper(value, arg1, arg2, arg3):
return value[arg1][arg2][arg3] | TadejSk/conference-scheduler | app/templatetags/tags.py | Python | gpl-3.0 | 180 |
""""Defines the result (data + convergence information) object for surface calculations."""
from fsc.export import export
from .._result import Result
@export
class SurfaceResult(Result):
"""Container for the data, state and convergence status of a surface calculation. The attributes / properties of the data ob... | Z2PackDev/Z2Pack | z2pack/surface/_result.py | Python | gpl-3.0 | 2,586 |
# Copyright (C) 2012 Alex Nitz
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the h... | hagabbar/pycbc_copy | pycbc/types/array_cpu.py | Python | gpl-3.0 | 6,056 |
from pcmaze import entrance, exit, connected
def leads_to_exit( comingfrom, cell, depth ):
indent = depth * 4 * " "
if cell == exit():
return True
for i in range( entrance(), exit()+1 ):
if i == comingfrom:
continue
if not connected( cell, i ):
continue
... | paulmcquad/Python | 8-Recursion/maze2.py | Python | gpl-3.0 | 624 |
# coding=utf-8
from elections.tests import VotaInteligenteTestCase as TestCase
from popolo.models import Person, ContactDetail
from elections.models import Candidate, Election, QuestionCategory, Topic, Area
from candidator.models import Category, Position, TakenPosition
from django.template.loader import get_template
f... | ciudadanointeligente/votainteligente-portal-electoral | backend_candidate/tests/ranking_tests.py | Python | gpl-3.0 | 10,189 |
"""
Simple math addons and wrappers
Authors/Modifications:
----------------------
* T. Trainor (tptrainor@alaska.edu)
M. Newville (newville@cars.uchicago.edu)
* minimize and random from original tdl
Todo:
-----
* peak fit
"""
#######################################################################
import types
im... | jackey-qiu/genx_pc_qiu | supportive_functions/backcor/mathutil.py | Python | gpl-3.0 | 7,172 |
#!/usr/bin/env python
# vi: sw=4 et
# Copyright 2008 by Kate Scheppke and Wade Brainerd.
# This file is part of Typing Turtle.
#
# Typing Turtle 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... | i5o/typing-turtle | keybuilder.py | Python | gpl-3.0 | 1,702 |
#!/usr/bin/env python
#by ikswss@gmail.com
import socket
import re
import time
import cStringIO
import sys,os
from config_note import Config
from subprocess import call
from config_note import Config
import base64
import binascii
from picture import Image
from base import RawCode
import sqlite3
from datetime import da... | iksws/GnomeTurboNoteExtension | turbonote-adds/cliente.py | Python | gpl-3.0 | 12,960 |
import cv2
import numpy as np
import hist_processing as hp
image_path = "data/test.jpeg"
image = cv2.imread(image_path, 1)
# print image.shape
cv2.imshow("original", image)
blurred = cv2.medianBlur(image, 5)
gray = cv2.cvtColor(blurred, cv2.COLOR_BGR2GRAY)
hist = cv2.calcHist([gray],[0],None,[256],[0,256])
histogr... | tantalishe/object_detection | histogram/hist_picture.py | Python | gpl-3.0 | 489 |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# ---------------------------------------------------------------------------
# ___ __ ___ ___ ____ ____ __
# | \ | \ | | / | | | \ Automatic
# |__/ |__/ | | | |__ |__ | | Conference
# | |\... | brigittebigi/proceed | proceed/src/DataIO/Write/writer.py | Python | gpl-3.0 | 7,168 |
# -*- coding: utf-8 -*-
# Copyright (C) 2010-2015 Bastian Kleineidam
#
# 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.
#... | wummel/patool | tests/test_diff.py | Python | gpl-3.0 | 1,187 |
import csv
import os
import datetime
from urllib.parse import urlparse
from flask import current_app
import flask_wtf
import flask_wtf.file
from werkzeug import secure_filename
from harrier.core import db
from marshmallow import Schema, fields
class ImageSet(db.Model):
__tablename__ = 'imageset'
id = db.Colum... | ubccr/harrier | harrier/model.py | Python | gpl-3.0 | 4,578 |
"""queueme 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-ba... | josejapch/proyectoIV1617 | queueme/urls.py | Python | gpl-3.0 | 1,139 |
'''
(*)~---------------------------------------------------------------------------
This file is part of Pupil-lib.
Pupil-lib 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
(a... | gmierz/pupil-lib | pupillib/core/workers/trigger_worker.py | Python | gpl-3.0 | 12,503 |
def split_and_join(line):
# write your code here
line = line.split(" ")
line = "-".join(line)
return line
if __name__ == '__main__':
line = raw_input()
result = split_and_join(line)
print result
| STiago/Python | Code/8StringSplitJoin.py | Python | gpl-3.0 | 224 |
#!/usr/bin/env python
# Configuration file
# Fill with the data and rename to 'config.py'
#
# Copyright 2017, Krzysztof Kutt
# ------------------ API Keys and Credentials ------------------
# Wiley API Key
# See: http://olabout.wiley.com/WileyCDA/Section/id-829772.html
WILEY_API_KEY = ''
# ScienceDirect API Key
# ... | kkutt/references-tracking | config_template.py | Python | gpl-3.0 | 508 |
# #START_LICENSE###########################################################
#
# Copyright (C) 2009 by Jaime Huerta Cepas. All rights reserved.
# email: jhcepas@gmail.com
#
# This file is part of the Environment for Tree Exploration program (ETE).
# http://ete.cgenomics.org
#
# ETE is free software: you can redistribute... | xguse/ete | ete_dev/phylo/spoverlap.py | Python | gpl-3.0 | 8,523 |
# ##### 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... | cschenck/blender_sim | fluid_sim_deps/blender-2.69/2.69/scripts/addons/io_scene_fbx/parse_fbx.py | Python | gpl-3.0 | 5,862 |
#!/usr/bin/env python
""" MultiQC module to parse output from bcftools """
from __future__ import print_function
from collections import OrderedDict
import logging
from multiqc import config
from multiqc.modules.base_module import BaseMultiqcModule
# Import the Samtools submodules
from . import stats
from .stats impo... | ahvigil/MultiQC | multiqc/modules/bcftools/bcftools.py | Python | gpl-3.0 | 1,775 |
import json
import logging
import time
from typing import Any, Dict
from django.contrib import messages
from django.contrib.auth.models import User
from django.core.exceptions import PermissionDenied, ValidationError
from django.core.validators import URLValidator
from django.db.models import Count, F, Max, Q
from dja... | teemulehtinen/a-plus | exercise/staff_views.py | Python | gpl-3.0 | 17,235 |
"""
Copyright (c) 2014 Salim Haniff <salimwp@gmail.com>
This file is part of ping-pong.
Neo4j 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 versio... | salimwp/ping-pong | ping.py | Python | gpl-3.0 | 1,986 |
#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Second Order Distortion
# Author: mettus
# Generated: Thu Aug 1 12:30:23 2013
##################################################
from __future__ import unicode_literals
from gnuradio import blocks
from gnura... | bastibl/gnuradio | gr-channels/python/channels/distortion_2_gen.py | Python | gpl-3.0 | 2,478 |
from pyModeS import bds
def test_bds_infer():
assert bds.infer("8D406B902015A678D4D220AA4BDA") == "BDS08"
assert bds.infer("8FC8200A3AB8F5F893096B000000") == "BDS06"
assert bds.infer("8D40058B58C901375147EFD09357") == "BDS05"
assert bds.infer("8D485020994409940838175B284F") == "BDS09"
assert bds.... | junzis/pyModeS | tests/test_bds_inference.py | Python | gpl-3.0 | 1,291 |
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from urlparse import urlparse, parse_qs
#import os
import json
DEFAULT_HOST = '127.0.0.1'
DEFAULT_PORT = '8081'
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header('Content-type','... | AiolosLiu/ToolKit | Python/simpleTools/webserver.py | Python | gpl-3.0 | 1,916 |
from scapy.sendrecv import sniff
from scapy.utils import PcapWriter
import threading
class PacketRecorder:
"""
Simple class providing pcap packet recording
running in separate thread
"""
def __init__(self, _target, _file):
"""
Initialize pcap packet recorder
:param _targe... | jsebechlebsky/pptp_auditor | pptp_auditor/capture.py | Python | gpl-3.0 | 1,140 |