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 |
|---|---|---|---|---|---|
import cv2
__author__ = 'def'
class Environment:
def __init__(self, image, collision_checker):
self.image_to_load = image
# Load image as environment:
self.image = image
self.y_limit, self.x_limit = self.image.shape
# Get obstacles from image
self.obstacles = []
... | JavierIH/platano | algorithm/Environment.py | Python | gpl-2.0 | 1,294 |
"""
Creer par Antoine Leonard
antoine@antbig.fr
Class qui contient une ligne de couleur
"""
class Line:
def __init__(self):
self.__colors = []
def addcolor(self,color):
self.__colors.append(color)
def getnbcolor(self):
return len(self.__colors)
def hascolo... | antbig/MasterMind | Line.py | Python | gpl-2.0 | 2,372 |
# -*- coding: utf-8 -*-
#-------------------------------------------------
#--
#-- edge to Draft Bspline
#--
#-- microelly 2016 v 0.1
#--
#-- GNU Lesser General Public License (LGPL)
#-------------------------------------------------
import Draft
import FreeCADGui,FreeCAD
def run():
e=FreeCADGui.Selection.getSelecti... | microelly2/freeCAD_macro | misc/edge2bspline.py | Python | gpl-2.0 | 482 |
from setuptools import setup
setup(
name = "txt2tags",
version = '2.7',
url = 'http://txt2tags.org',
author = 'Aurelio Jargas',
author_email = 'verde@aurelio.net',
description = "Document generator. Reads a text file with minimal markup as **bold** and //italic// and converts it to various form... | austin1howard/txt2tags | setup.py | Python | gpl-2.0 | 434 |
# encoding: utf-8
# module PyQt4.QtCore
# from /usr/lib/python3/dist-packages/PyQt4/QtCore.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import sip as __sip
from .QObject import QObject
class QSharedMemory(QObject):
"""
QSharedMemory(QObject parent=None)
QSharedMemory(str, QObj... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyQt4/QtCore/QSharedMemory.py | Python | gpl-2.0 | 3,062 |
"""
This module is imported from the pandas package __init__.py file
in order to ensure that the core.config options registered here will
be available as soon as the user loads the package. if register_option
is invoked inside specific modules, they will not be registered until that
module is imported, which may or may... | pjryan126/solid-start-careers | store/api/zillow/venv/lib/python2.7/site-packages/pandas/core/config_init.py | Python | gpl-2.0 | 14,480 |
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../..')))
try:
from unittest import mock, TestCase
except ImportError:
import mock
import logging
from crmsh.crash_test import utils, main, config
class TestMyLoggingFormatter(TestCase):
@classmethod
de... | dmuhamedagic/crmsh | test/unittests/test_crashtest_utils.py | Python | gpl-2.0 | 20,445 |
# vim:ts=4:sw=4:sts=4:et
# -*- coding: utf-8 -*-
"""Classes related to graph clustering."""
from copy import deepcopy
from math import pi
from io import StringIO
from igraph import community_to_membership
from igraph.configuration import Configuration
from igraph.datatypes import UniqueIdGenerator
from igraph.drawing... | igraph/python-igraph | src/igraph/clustering.py | Python | gpl-2.0 | 65,054 |
#!/usr/bin/env python3
"""
Decode URL query strings.
"""
import argparse
import glob
import os
import signal
import sys
import urllib.parse
from typing import List
class Options:
"""
Options class
"""
def __init__(self) -> None:
self._args: argparse.Namespace = None
self.parse(sys.ar... | drtuxwang/system-config | bin/urldecode.py | Python | gpl-2.0 | 2,063 |
#! /usr/bin/env python
# -*- coding: latin-1 -*-
# Copyright (C) 2006 Universitat Pompeu Fabra
#
# Permission is hereby granted to distribute this software for
# non-commercial research purposes, provided that this copyright
# notice is included with any such distribution.
#
# THIS SOFTWARE IS PROVIDED "AS IS" WI... | PlanTool/plantool | code/Uncertainty/T0/translator/generators/m-ring-mbp.py | Python | gpl-2.0 | 5,086 |
# -*- coding: utf-8 -*-
#Library from Google
from google.appengine.api import users
from google.appengine.api import urlfetch
from google.appengine.api import images
#Library System
import datetime
import cgi
import os
import sys
import logging
import urllib
import re
import sys
#Library
from mana... | Ivebo/Ivebo-Sites | manager/controller/category.py | Python | gpl-2.0 | 7,310 |
"""
Example using MySQL Connector/Python showing:
* sending multiple statements and iterating over the results
"""
import asyncio
import mysql_async.connector
@asyncio.coroutine
def main(config):
output = []
db = mysql_async.connector.Connect(**config)
yield from db.connect()
cursor = yield from db.cu... | netpie/mysql-connector-python-async | example/multi_resualtsets.py | Python | gpl-2.0 | 2,259 |
# Adding the modules from the main path
import os, sys
lib_path = os.path.abspath('../')
sys.path.append(lib_path)
# Most important tools are assertion tests via `eq_`
from nose.tools import *
# Mock objects to allow for unit tests in complex environments
import mock
| gsec/eZchat | tests/test_tools.py | Python | gpl-2.0 | 269 |
# -*- coding: utf-8 -*-
import os
import re
import traceback
import xml.etree.ElementTree as ET
import xbmc
import xbmcgui
import xbmcvfs
# Import the common settings
from settings import Settings
from settings import log
from settings import os_path_join
from settings import os_path_split
from settings import dir_exi... | robwebset/script.videoextras | resources/lib/ExtrasItem.py | Python | gpl-2.0 | 30,282 |
#!/usr/bin/env python
class ReplyMarkup(object):
def to_json(self):
raise NotImplementedError
def __str__(self):
return self.to_json()
| pi0/python-telegram-bot | telegram/replymarkup.py | Python | gpl-2.0 | 162 |
# -*- coding: utf-8 -*-
#
# This file is part of Zenodo.
# Copyright (C) 2016 CERN.
#
# Zenodo 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 v... | tiborsimko/zenodo | tests/unit/records/test_schemas_marcxml.py | Python | gpl-2.0 | 12,706 |
#!/usr/bin/env python2
# Rekall Memory Forensics
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Author: Michael Cohen scudette@google.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... | dsweet04/rekall | rekall-agent/rekall_agent/locations/http.py | Python | gpl-2.0 | 11,603 |
"""w0401 dependency
"""
from __future__ import print_function
from . import func_w0401
if func_w0401:
print(input)
| PyCQA/pylint | tests/input/w0401_cycle.py | Python | gpl-2.0 | 122 |
import pytest
import os
from pathlib import Path
from tyssue import Sheet, History, Epithelium, RNRGeometry
from tyssue.core.history import HistoryHdf5
from tyssue.generation import three_faces_sheet, extrude
def test_simple_history():
sheet = Sheet("3", *three_faces_sheet())
history = History(sheet)
as... | CellModels/tyssue | tests/core/test_history.py | Python | gpl-2.0 | 8,115 |
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... | sileht/check_mk | web/plugins/views/sorters.py | Python | gpl-2.0 | 16,550 |
# encoding: utf-8
# module PyKDE4.kdeui
# from /usr/lib/python3/dist-packages/PyKDE4/kdeui.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import PyKDE4.kdecore as __PyKDE4_kdecore
import PyQt4.QtCore as __PyQt4_QtCore
import PyQt4.QtGui as __PyQt4_QtGui
import PyQt4.QtSvg as __PyQt4_QtSvg
cl... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyKDE4/kdeui/KExtendableItemDelegate.py | Python | gpl-2.0 | 1,751 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
author by jacksyen[hyqiu.syen@gmail.com]
---------------------------------------
发送邮件帮助类
"""
import smtplib
from email.header import Header
from email.MIMEText import MIMEText
from email.MIMEMultipart import MIMEMultipart
from log import logger
import helper.aop as ao... | liujianpc/gk7-douban | helper/mail.py | Python | gpl-2.0 | 2,160 |
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Ales Nosek <ales.nosek@gmail.com>
#
# This file is part of LinuxBand.
#
# LinuxBand 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... | noseka1/linuxband | src/main/python/linuxband/mma/parse.py | Python | gpl-2.0 | 19,612 |
# -*- coding: utf-8 -*-
import argparse
import importlib
def server():
parser = argparse.ArgumentParser()
parser.add_argument('--host', help="listen host")
parser.add_argument('--port', help="listen port")
args = parser.parse_args()
service_server = importlib.import_module("koenig.server")
s... | streethacker/koenig | koenig/utils/console.py | Python | gpl-2.0 | 751 |
# -*- coding: utf-8 -*-
cont = 0
for i in range(5):
valor = int(raw_input())
if (valor % 2 == 0):
cont = cont + 1
print("%d valores pares" % cont) | bergolho1337/URI-Online-Judge | Basicos/Python/1065/main.py | Python | gpl-2.0 | 163 |
#!/usr/bin/python
import xml.etree.ElementTree as ET
import os, sys, magic
def getFileType(filename):
# cmd = shlex.split('file --mime-type {0}'.format(filename))
# mime_type = subprocess.check_output(cmd).split()[-1]
# return mime_type
return magic.from_file(filename)
def main(argv):
if len(argv) ... | hackob/read-cfdi-files | setGetCfdi.py | Python | gpl-2.0 | 1,624 |
# -*- coding: utf-8 -*-
# =============================================================================
# Federal University of Rio Grande do Sul (UFRGS)
# Connectionist Artificial Intelligence Laboratory (LIAC)
# Renato de Pontes Pereira - rppereira@inf.ufrgs.br
# ======================================================... | Ambrosys/climatelearn | climatelearn/learning/arf.py | Python | gpl-2.0 | 24,951 |
"""Library to handle database interactions.
The master list of variants are stored in M tables named master_chrom_1, master_chrom_2, ... master_chrom_M
Columns::
rowid - corresponds to index
pos -
stop -
ref -
alt -
p - probability of variant (to make the sfs)
Sample data is stored in ... | latticelabs/Mitty | mitty/lib/db.py | Python | gpl-2.0 | 6,769 |
#!/usr/bin/env python3
# coding: utf-8
from __future__ import unicode_literals, print_function
import re
import zlib
import hashlib
from molbiox.algor.traverse import Traverser
class Hasher(object):
"""
Common interface for hashlib & zlib hash functions
"""
__hfuncs__ = {
'adler32': zlib.adl... | frozflame/molbiox | molbiox/frame/signature.py | Python | gpl-2.0 | 4,227 |
#!/usr/bin/env python
#
# sally-annoyifier.py - randomise a time reporting string, for Sally
#
# Copyright (C) 2018 Michael Davies <michael@the-davies.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 ... | mrda/junkcode | sally-annoyifier.py | Python | gpl-2.0 | 1,572 |
from datetime import datetime
from django.contrib.auth.models import User
from django.test import TestCase
from envirocon.envirocon_main.models import GroundWorkClass
class TestGroundWorkClassModels(TestCase):
def setUp(self):
self.gwc = GroundWorkClass()
def test_gwc_init(self):
self.assert... | ccnmtl/envirocon | envirocon/envirocon_main/tests/test_models.py | Python | gpl-2.0 | 1,200 |
######################################################################
# This file should be kept compatible with Python 2.3, see PEP 291. #
######################################################################
"""create and manipulate C data types in Python"""
import os as _os, sys as _sys
__version__ = "1.1.0"
i... | BartoszCichecki/onlinepython | onlinepython/pypy-2.4.0-win32/lib-python/2.7/ctypes/__init__.py | Python | gpl-2.0 | 17,513 |
# Morphux-IRC-BOT
# Quote save system
# By Noich
import time
import json
import sys
# sys.setdefaultencoding() does not exist, here!
class Quote:
def command(self):
self.config = {
"command": {
"quote": {
"function": self.fetchQuote... | Morphux/IRC-Bot | modules/quote/quote.py | Python | gpl-2.0 | 4,157 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bonjour_py.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| jameskane05/bonjour_py | manage.py | Python | gpl-2.0 | 253 |
##
# Copyright 2012-2020 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... | pescobar/easybuild-framework | easybuild/tools/github.py | Python | gpl-2.0 | 92,199 |
#!/usr/bin/python
#Andrew Hannebrink
#This is a configuration file written in Python source code for ease of manipulation. Save it at /usr/local/etc/dhcpcfg.py. This file is read when dhcplog.py, dhcpsearch.py, rest.py, and dhcppurge.py run. These parameters are necessary for the program to work, and may contain sensi... | andrewhannebrink/DHCPACK-Logger-and-Infoblox-Lease-Updater | dhcpcfg.py | Python | gpl-2.0 | 1,259 |
# ------------------------------------------------------------------------------- #
# grid_converter.py - Converts a grid map with population to the following format #
# lon, lat, population #
# Author: Thyago Mota ... | sgonzalez/cell-tower-population | grid_converter.py | Python | gpl-2.0 | 7,013 |
from __future__ import division
import logging
import base64
import hmac
import random
import re
import os.path
import string
from binascii import unhexlify
from collections import namedtuple
from copy import deepcopy
from hashlib import sha256
from io import BytesIO
from math import ceil
from .flvconcat import FLVTa... | repotvsupertuga/tvsupertuga.repository | script.module.streamlink.base/resources/lib/streamlink/stream/hds.py | Python | gpl-2.0 | 22,547 |
#!/usr/bin/env python
import datetime
import requests
import os
import time
from grader import grader, tester
import hashlib
import random
import lowlevelhttptests
from subprocess import Popen, PIPE, STDOUT
import os.path
import socket
import sys
BIN = "./lisod"
MIME = {
'.html' : 'text/html',
'.css' : 'text... | tavaresdong/TinyWeb | liso/cp2/proj1_cp2/grader1cp2.py | Python | gpl-2.0 | 8,066 |
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
url(r'^$', 'openshift.views.home', name='home'),
url(r'^getCat/', 'openshift.views.getCat', name='getCat'),
... | Honeybunch/GetCats | wsgi/openshift/urls.py | Python | gpl-2.0 | 929 |
def roombafunc(msg, rseed, rows, cols, matracoef):
print "Initializing RoombaFunction Cipher System"
print "plaintext: " + msg
print "key: " + str((rseed, rows, cols, matracoef))
print "\n\nBeginning step 1: Alphabet Shuffle..."
import random
random.seed(rseed)
alphalist = ["A","B","C","D","E","F","G","... | ZeroK-RTS/SpringRTS-Tools | MidSteed/Other Py/RoombaFunction CryptoSystem/the code.py | Python | gpl-2.0 | 3,817 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""A simple wrapper class for the matplotlib chart module."""
# Copyright 2002, 2003 St James Software
#
# This file is part of jToolkit.
#
# jToolkit is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publis... | cc-archive/jtoolkit | jToolkit/widgets/chart.py | Python | gpl-2.0 | 19,564 |
# -*- coding: iso-8859-1 -*-
# -----------------------------------------------------------------------
# eventserver.py - XBMC-compatible eventserver
# -----------------------------------------------------------------------
# $Id$
#
# JSONRPC and XBMC eventserver to be used for XBMC-compatible
# remotes. Only tested wi... | freevo/freevo2 | src/plugins/jsonrpc/eventserver.py | Python | gpl-2.0 | 5,552 |
#!/usr/bin/env python
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
import os
import time
import pymongo
import datetime
from pymongo import ASCEN... | erikdejonge/newsrivr | daemons/one_tweet_one_drop.py | Python | gpl-2.0 | 1,554 |
#!/usr/bin/env python3
import unittest
import sys
sys.path = ["/opt/thinlinc/modules"] + sys.path
import subprocess
import re
import os
import tempfile
class ObfuscateTest(unittest.TestCase):
def mkstemp(self):
"""wrapper for mkstemp, calling mktemp if mkstemp is not available"""
if hasattr(tempfi... | astrand/pyobfuscate | test/test_pyobfuscate.py | Python | gpl-2.0 | 8,719 |
#!/usr/bin/env python
def count_sort(list):
max_value = max(list)
bucket = [0 for _ in xrange(max_value+1)]
for value in list:
bucket[value] += 1
# print "bucket:", bucket
for i in xrange(1, len(bucket)):
# if i == 0: continue
bucket[i] += bucket[i-1]
# print "cumul... | alvin777/excelsior | sort/radix_sort.py | Python | gpl-2.0 | 1,594 |
##
# Copyright 2012-2020 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... | pescobar/easybuild-framework | easybuild/toolchains/gqacml.py | Python | gpl-2.0 | 1,671 |
# -*- coding: utf-8 -*-
# Asymmetric Base Framework - A collection of utilities for django frameworks
# Copyright (C) 2013 Asymmetric Ventures 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 S... | AsymmetricVentures/asymmetricbase | asymmetricbase/forms/__init__.py | Python | gpl-2.0 | 8,311 |
''' Read/Write a table in the STAR format
This module reads from and writes to the STAR format, which is an
alternative to XML.
An example of the file:
.. container:: bottomnav, topic
| data_images
| loop\_
| _rlnImageName
| _rlnDefocusU
| _rlnDefocusV
| _rlnDefocusAngle
| _rlnVoltag... | ezralanglois/arachnid | arachnid/core/metadata/formats/star.py | Python | gpl-2.0 | 12,950 |
#!/usr/bin/python
import requests
class ImageDownloader:
def __init__(self, destination):
self.destination = destination
def download(self, url, name):
r = requests.get(url, stream=True)
if r.status_code == 200:
try:
with open("%s%s" % (self.destination, n... | Ganapati/DjangoZik | infos_grabber/imageDownloader.py | Python | gpl-2.0 | 975 |
"""
Settings
--------
Change a user's password/email or delete an account.
"""
from Acquisition import aq_inner
from euphorie.client import MessageFactory as _
from euphorie.client.model import Account
from euphorie.client.model import AccountChangeRequest
from euphorie.client.model import get_current_account
from eup... | euphorie/Euphorie | src/euphorie/client/browser/settings.py | Python | gpl-2.0 | 12,114 |
"""templates.unix.restore.adjust.FSTab Module"""
import cairn
def getClass():
return FSTab()
class FSTab(object):
def run(self, sysdef):
return True
| redshodan/cairn | src/python/cairn/sysdefs/templates/unix/restore/adjust/FSTab.py | Python | gpl-2.0 | 162 |
#!/usr/bin/env python
import sys
from PyQt4 import QtGui, QtCore, QtDeclarative
from mcc2.frontends.services.controllers import Controller
from mcc2.frontends.services.models import ServiceModel
from mcc2.frontends.services.proxy import ProxyServiceModel
class SystemServicesView(QtDeclarative.QDeclarativeView):
... | wiliamsouza/mandriva-control-center | mcc2/frontends/services/services.py | Python | gpl-2.0 | 1,611 |
__author__ = 'roelvdberg@gmail.com'
import unittest
import lxml.etree as etree
import crawler.webpage
def fetch(self, url=None, download=True, *args, **kwargs):
"""
Fetches the content of a file, based on a filepath(url).
Changes fetch so that it loads a file from disk instead of from url.
:param ... | RoelvandenBerg/nlnieuwscrawler | test/test_crawl.py | Python | gpl-2.0 | 6,577 |
#!/usr/bin/env python
from numpy import random
from shogun.Classifier import LibSVM
from shogun.Features import RealFeatures, Labels
from shogun.Kernel import LinearKernel
num_feats=23
num_vec=42
scale=2.1
size_cache=10
C=0.017
epsilon=1e-5
tube_epsilon=1e-2
svm=LibSVM()
svm.set_C(C, C)
svm.set_epsilon(epsilon)
sv... | ratschlab/ASP | testsuite/python_modular/test_svm_kernel_multiple.py | Python | gpl-2.0 | 929 |
# 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.
# These are unit tests which don't need a MySQL database. Tests which n... | beaker-project/beaker | Server/bkr/server/tests/test_model.py | Python | gpl-2.0 | 10,199 |
#! /usr/bin/env python
"""! @package input
"""
from utils.xml_format import parse_xml
from utils.error_handling import InputError
def compute_name(object_name):
"""! @brief Compute attribute/module name from object name as follows: 'ObjectName' attribute/module name is 'object_name'.
@param object_name Strin... | buret/pylmflib | pylmflib/input/xml_lmf.py | Python | gpl-2.0 | 4,817 |
#!/usr/bin/env python
from __future__ import division
from numpy import *
import numpy.fft as fft
n=3
x=arange(2**n)
print x
#x_ = fft.fftshift(fft.fft(x))
x_ = fft.fft(x)
print x_
| jornada/swifft | test_ft.py | Python | gpl-2.0 | 184 |
#!/usr/bin/python -tt
# 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 ... | timlau/yumex | src/yumexbase/constants.py | Python | gpl-2.0 | 7,935 |
#!/usr/bin/python
"""Preferences Editor for Terminator.
Load a UIBuilder config file, display it,
populate it with our current config, then optionally read that back out and
write it to a config file
"""
import os
from gi.repository import GObject, Gtk, Gdk
from .util import dbg, err
from . import config
from .key... | m45t3r/t3rminator | terminatorlib/prefseditor.py | Python | gpl-2.0 | 53,737 |
import os
import sys
import re
from collections import deque
flagAllowCycle = False
for op in sys.argv:
if op == '-a':
flagAllowCycle = True
lines = sys.stdin.readlines()
nodes = {}
edges = []
lastNode = None
for i in range(1, len(lines)):
match = re.match(r' <way id="(\d+)">', lines[i])
if mat... | nesl/mercury | Services/Mapping/fixProgram/fix.py | Python | gpl-2.0 | 3,782 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# pyILPER 1.2.4 for Linux
#
# An emulator for virtual HP-IL devices for the PIL-Box
# derived from ILPER 1.4.5 for Windows
# Copyright (c) 2008-2013 Jean-Francois Garnier
# C++ version (c) 2013 Christoph Gießelink
# Python Version (c) 2015 Joachim Siebold
#
# This program is... | bug400/pyilper | pyilper/pilhp2225b.py | Python | gpl-2.0 | 53,988 |
#-----------------------------------------------------------------------------------
#Copyright (c) 2015 Lab Sensor Solutions, Inc.
#
#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 rest... | DanielPaley/TI-CC254x-USB | Return_Handler.py | Python | gpl-2.0 | 4,412 |
#!/usr/bin/env python
import threading
import rospy
import Queue
from panels import ActionModulationTest
from Tkinter import Tk
from theatrebot_action_modulation.msg import ActionDesireMessage
from std_msgs.msg import String
from ttk import Frame
class interface_test_action_modulation():
def __init__(self):
... | julianangel/EmotionBot | ROS/test_action_modulation/src/ActionTest.py | Python | gpl-2.0 | 969 |
import textwrap
from skoolkittest import SkoolKitTestCase
from skoolkit.ctlparser import CtlParser
CTL = """; Test control file for parse_ctl
@ 30000 start
b $7530 Data at 30000
N 30000 Block start comment
T 30002,10 Message in the data block
N 30012 Mid-block comment
M 30012,15 This comment covers the following two... | skoolkid/skoolkit | tests/test_ctlparser.py | Python | gpl-3.0 | 80,566 |
import init_location
from model import *
import UnitTests.Model.test_Authors_db as test_Authors_db
import UnitTests.Model.test_comments_db as test_comments_db
import UnitTests.Model.test_Post_db as test_Post_db
import UnitTests.Model.test_Images_db as test_Images_db
import UnitTests.Model.test_URL_db as test_URL_db
im... | CMPUT404-Fall2016/cmput404-project | RunMe.py | Python | gpl-3.0 | 1,028 |
# -*- coding: utf-8 -*-
##
##
## This file is part of Indico.
## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN).
##
## Indico 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; eith... | pferreir/indico-backup | indico/MaKaC/services/interface/rpc/handlers.py | Python | gpl-3.0 | 4,556 |
from django.test import TestCase, tag
from django.utils import timezone
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from dashboard.tests.loader import load_model_objects, fixtures_standard
from dashboard.models import ExtractedText, QANotes
@tag... | HumanExposure/factotum | dashboard/tests/unit/test_extracted_text.py | Python | gpl-3.0 | 3,259 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class PyScadaSMBusConfig(AppConfig):
name = 'pyscada.smbus'
verbose_name = _("PyScada SMBus Devices")
def ready(self):
import pyscada.smbus.si... | trombastic/PyScada | pyscada/smbus/apps.py | Python | gpl-3.0 | 325 |
# Progamm is running on Windows 7 32 bits with python-2.7.1 + numpy-1.6.0 + scipy-0.9.0 + matplotlib-1.0.1
# contact: Arnaud Reveillere a.reveillere@brgm.fr / arnaud.reveillere@gmail.com
# Import some matplotlib function (only required for the plots)
from pylab import figure, xlabel, ylabel, plot, legend, subplot, sav... | arnaud-reveillere/SAMBA | Examples/SAMBA_User_Guide_Example_3.py | Python | gpl-3.0 | 5,169 |
"""
Routes and views for articles CRUD.
"""
from flask_login import login_required, current_user
from flask import Blueprint, render_template, redirect, url_for, request
from models.factory import PosGraduationFactory
from settings.extensions import ExtensionsManager
from views.forms.content import AttendanceForm
... | Mazuh/Minerva | views/crud_attendances.py | Python | gpl-3.0 | 2,990 |
# -*- coding: utf-8 -*-
# Copyright (C) projekt-und-partner.com, 2010
# Author: Michael Jenny <michael.jenny%40projekt-und-partner.com>
import random
from sqlalchemy import *
from migrate import *
from migrate.changeset import *
from migrate.changeset.constraint import ForeignKeyConstraint
class upgradedataobj(obj... | prinzdezibel/p2.datashackle.repository | p2/datashackle/repository/versions/001_initial_schema.py | Python | gpl-3.0 | 12,267 |
"""
Tests to check that all pages work as expected with a 200 status code and not 404 or 500 for example.
"""
# local imports
from base_tester import URLTestCase
class CasesTestCase(URLTestCase):
def test_view_all_cases(self):
self._check_url('/cases/', None, 401) # not logged in
self._check_ur... | ubunteroz/foreman | foreman/tests/url_tests/test_case_pages.py | Python | gpl-3.0 | 12,470 |
# euler.py - Solve ODE systems using the explicit Euler method
# Copyright (C) 2017 Shiva Iyer <shiva.iyer AT g m a i l DOT c o m>
#
# 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 versio... | Shiva-Iyer/euler | ode/euler.py | Python | gpl-3.0 | 995 |
# ##### 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/modules/rna_keymap_ui.py | Python | gpl-3.0 | 12,331 |
from jobs.models import Job
from django.contrib import admin
admin.site.register(Job) | lanqiyi/LanqiyiTestToolSet | jobs/admin.py | Python | gpl-3.0 | 86 |
#example2.py source code
import turtle #1
t=turtle.Pen() #2
turtle.bgcolor('green') #3
t.color('blue') #4
t.begin_fill() #5
for x in range(1,73): #6
t.forward(250) #7
t.right(185) #8
t.end_fill() #9
| ganeshluna/python-100-projects | example2.py | Python | gpl-3.0 | 278 |
def usAl(taban, us):
sonuc = 1
while us > 0:
if us % 2 == 0:
us = us / 2
taban = taban * taban
else:
us = us - 1
sonuc = sonuc * taban
us = us / 2
taban = taban * taban
return sonuc
print(usAl(2,5))
| canberkkoc/AlgoritmaAnalizi | Hafta6/OzyinelemesizUsAlma1.py | Python | gpl-3.0 | 299 |
"""Test the FEI stream readers.
Because there is no official description of the format, these tests just tests
consistency between ``array_to_stream`` and ``stream_to*array``. In the
particular case of stream to sparse array, we use dask to compute the array
in order to mimic the usage in the FEI EMD reader.
"""
impo... | magnunor/hyperspy | hyperspy/tests/misc/test_fei_stream_readers.py | Python | gpl-3.0 | 2,664 |
'''
This file is part of TSLoad.
Copyright 2013, Sergey Klyaus, ITMO University
TSLoad 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.
TSLoad is distributed in the hope that it... | myaut/tsload | server/tsload/expsvc/model.py | Python | gpl-3.0 | 4,661 |
#!./venv/bin/python3
# File: tmoney.py
import re
import src.config as config
wo_symbol_re = r"""
[-]?
(?P<d1>[0-9]*)
[.] # If no currency symbol, must have a decimal point.
(?P<c1>[0-9]{0,2})?
[.]? # Want to know if there is a second_decimal!
"""
before_symbol_re = r"""
[-]?
{}
[-]?
(?P<d1>\d+)
([.](?P<c1>\d{{0,2... | alexKleider/debk | src/money.py | Python | gpl-3.0 | 6,704 |
# standard library
import http.client
import urllib
import json
import logging
# Django
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
# local Django
from exercise.models import (
Exercise, UserExercise, TestCaseExercise, UserExerciseSubmission
)
from exer... | CodaMais/CodaMais | CodaMais/exercise/views.py | Python | gpl-3.0 | 9,244 |
import math
# Class definitions
class Entity:
'''A base class for a DXF entities; lines and arcs.
The class attribute delta contains the maximum distance in x and y
direction between eindpoints that are considered coincident.'''
delta = 0.005
_anoent = "Argument is not an entity!"
def __init_... | voglster/Drawbot | DrawbotApp/dxfgeom.py | Python | gpl-3.0 | 12,546 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Equation of heat
----------------
Let us start with a mathematical formulation ...
.. math::
\nabla\cdot( a \cdot \nabla u ) + \frac{\partial u}{\partial t} + C = 0
.. math::
- \Delta u & = 1 \quad{\mathrm{in}}\quad\Omega\\
u & = 0 \q... | KristoferHellman/gimli | doc/tutorials/modelling/develop/plot_4-mod-fem-heat.py | Python | gpl-3.0 | 2,356 |
import json
import os
import re
import shutil
import subprocess
import urllib
import uuid
import requests
import validators
from celery.utils.log import get_task_logger
from flask import current_app
from app.utils import replace, clear_dir, unzip, get_build_tools_version, change_theme
from app.utils.assets import res... | saheedm/MASTERS | open-event-android-development/apk-generator/v2/app/generator/generator.py | Python | gpl-3.0 | 15,882 |
# -*- coding: utf-8 -*-
#
# gPodder - A media aggregator and podcast client
# Copyright (c) 2005-2009 Thomas Perl and the gPodder Team
#
# gPodder 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... | crasu/feedingit | src/portrait.py | Python | gpl-3.0 | 7,587 |
'''
This file is part of pyShop
pyShop 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.
pyShop is distributed in the hope that it will be us... | Uruwolf/pyshop | cart/settings.py | Python | gpl-3.0 | 839 |
"""Unit tests for the ``synse_server.cmd.plugin`` module."""
import pytest
from synse_grpc import api, client
from synse_server import cmd, errors
from synse_server.plugin import Plugin
@pytest.mark.asyncio
async def test_plugin_not_found(mocker):
# Mock test data
mock_get = mocker.patch('synse_server.plugi... | vapor-ware/synse-server | tests/unit/cmd/test_plugin.py | Python | gpl-3.0 | 8,992 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Name:
qgis2geowe.py
Autor:
Patricio Soriano :: SIGdeletras.com
Description:
Script Python para generar un proyecto GeoWE desde QGIS.
"""
import os
import zipfile
import json
import time
import shutil
from qgis.gui import QgsMessageBar
from PyQt4.QtGui import QMessageBo... | sigdeletras/qgis2geowe | qgis2geowe.py | Python | gpl-3.0 | 3,954 |
#listComprehension.py
#Garik Sadovy
#gcsadovy
# Create a list of all uppercase field names
fieldNames = ['FID', 'Shape', 'COVER', 'RECNO']
fieldNames2 = [ i.upper() for i in fieldNames ]
print "1. All cap field names:", fieldNames2
# Create a list of rounded float values
strList = ['3.34', '1.07', '4.21',... | gcsadovy/generalPY | listComprehension.py | Python | gpl-3.0 | 1,709 |
# (C) British Crown Copyright 2014, Met Office
#
# This file is part of Iris.
#
# Iris 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 ve... | scollis/iris | lib/iris/tests/unit/quickplot/test_outline.py | Python | gpl-3.0 | 1,408 |
import random, cmath, math
def color(x, y, phase, opacity):
phase *= 2 * math.pi
rad, phi = cmath.polar(complex(x-6, y-4))
r, g, b = (math.cos(-rad*.5+phase)+1.)/2, (math.cos(-rad*.5+phase+2/3.*math.pi)+1.)/2, (math.cos(-rad*.5+phase+4/3.*math.pi)+1.)/2
return int(r**2 *255*opacity),int(g**2 *255*o... | MerlijnWajer/lewd | animations/wobbleinvader.py | Python | gpl-3.0 | 1,677 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | tsdmgz/ansible | lib/ansible/modules/database/postgresql/postgresql_user.py | Python | gpl-3.0 | 31,487 |
# encoding: utf-8
"""
Pensieve: a tool for interacting with and modifying media through openCV and
other python tools
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2017, Gary Hendrick.
#
# This file is part of Pensieve.
#
# Pensieve is free software: you can red... | GaryHendrick/Pensieve | pensieve/utils/sysinfo.py | Python | gpl-3.0 | 2,648 |
from microbit import *
import neopixel
import random
num_of_pix = 24
np = neopixel.NeoPixel(pin0, num_of_pix) # create a NeoPixel object on pin0
p = 0 # set pixel pointer to 0
while True:
#Set Random RGB Values
r = random.randint(0,255)
g = random.randint(0,255)
b = random.randint(0,255)
p = rando... | markcarline/CoderDojo | Microbit/Microbit Halo/Flash Randomly - THIS IS THE BAD ONE.py | Python | gpl-3.0 | 474 |
import hashlib
import sys
import random
import os
'''
--- Part Two ---
As the door slides open, you are presented with a second door that uses a slightly more inspired security mechanism.
Clearly unimpressed by the last version (in what movie is the password decrypted in order?!), the Easter Bunn... | tetrismegistus/advent16 | day5/day5_2.py | Python | gpl-3.0 | 3,157 |
import sys
from PySide2.QtWidgets import (
QWidget,
QSlider,
QApplication,
QStyleOptionSlider,
QSizePolicy,
QStyle,
)
from PySide2.QtCore import Qt, QRect, QSize, Signal
from PySide2.QtGui import QPainter, QPaintEvent, QMouseEvent, QPalette, QBrush
class RangeSlider(QWidget):
rangeChange... | labsquare/CuteVariant | cutevariant/gui/widgets/range_slider.py | Python | gpl-3.0 | 5,112 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# firewall.py
#
# Copyright © 2013-2018 Antergos
# Based on parts of ufw code © 2012 Canonical
#
# This file is part of Cnchi.
#
# Cnchi is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Fr... | Antergos/Cnchi | src/installation/firewall.py | Python | gpl-3.0 | 3,318 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import os
import sys; sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), ".."))
from gtsam import *
def vector(vec):
return np.array([vec.coeff(i) for i in range(vec.rows())])
def matrix(mat):
return np.array([[mat.coef... | Eliasvan/Multiple-Quadrotor-SLAM | Work/python_libs/gtsam/test.py | Python | gpl-3.0 | 2,474 |
import os
import json
import sys
import datetime
import dateutil.parser as dp
import logging
import utils
if __name__ == "__main__":
logging.basicConfig(filename=utils.get_logfile(), level=utils.log_level)
utils.log_intro(__file__)
event_loc = utils.jsondump_dir
current_time = datetime.datetime.now()... | tonisbones/thisiship | event_cleanup.py | Python | gpl-3.0 | 1,252 |