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 kivy
kivy.require('1.9.1')
from kivy.uix.anchorlayout import AnchorLayout
from kivy.uix.relativelayout import RelativeLayout
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.stencilview import StencilView
from fieldlabel import FieldLabel
from kivy.properties im... | ryandoherty/RaceCapture_App | autosportlabs/uix/gauge/bargraphgauge.py | Python | gpl-3.0 | 1,453 |
# 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 | tests/fingerprint/test_fingerprint_consonant.py | Python | gpl-3.0 | 1,933 |
""" The SystemTap engine implementation.
"""
import time
import os
from subprocess import PIPE, STDOUT, DEVNULL, TimeoutExpired
import perun.collect.trace.systemtap.parse_compact as parse_compact
import perun.collect.trace.collect_engine as engine
import perun.collect.trace.systemtap.script_compact as stap_script_com... | tfiedor/perun | perun/collect/trace/systemtap/engine.py | Python | gpl-3.0 | 30,849 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013 Vinay M. Sajip. See LICENSE for licensing information.
#
# Enhancements in shlex to tokenize closer to the way real shells do
#
from collections import deque
import shlex
import sys
# We need to behave differently on 2,x and 3,x, because on 2.x
# shlex barfs on Unico... | sinesiobittencourt/explainshell | explainshell/shlext.py | Python | gpl-3.0 | 8,869 |
import socket
import android
droid = android.Android()
servidor = droid.dialogGetInput('Servidor', 'Ingrese el Servidor').result
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#'foxcarlos.no-ip.biz'
server.connect((servidor, 8000))
mensaje = droid.dialogGetInput('Mensaje', 'Ingrese el Mensaje a Enviar')... | foxcarlos/pyganso | cliente_socket.py | Python | gpl-3.0 | 350 |
import os
import unittest
from vsg.rules import loop_statement
from vsg import vhdlFile
from vsg.tests import utils
sTestDir = os.path.dirname(__file__)
lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_005_test_input.vhd'))
dIndentMap = utils.read_indent_file()
lExpected = []
lExpected.appe... | jeremiah-c-leary/vhdl-style-guide | vsg/tests/loop_statement/test_rule_005.py | Python | gpl-3.0 | 1,273 |
class SquareGrid:
N = (0, 1)
E = (1, 0)
S = (0, -1)
W = (-1, 0)
PRINCIPAL_DIRECTIONS = (N, E, S, W)
def __init__(self, length, height, wraparound=True):
self.length = length
self.height = height
self.wraparound = wraparound
def get_circle(self, center, radius, *, p):... | teatimesoft/sugarscape | sim/grids.py | Python | gpl-3.0 | 2,389 |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013, John McNamara, jmcnamara@cpan.org
#
import unittest
import os
from ...workbook import Workbook
from ..helperfunctions import _compare_xlsx_files
class TestCompareXLSXFiles(unittest.TestC... | ivmech/iviny-scope | lib/xlsxwriter/test/comparison/test_chart_bar20.py | Python | gpl-3.0 | 2,215 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('videoclases', '0013_tarea_profesor'),
]
operations = [
migrations.AddField(
model_name='grupo',
name... | Videoclases/videoclases | videoclases/migrations/0014_auto_20150726_1441.py | Python | gpl-3.0 | 975 |
import datetime
import lib.anidb as anidb
from anorak import model
def newAnime(anime, subber, location, quality):
model.new_anime(anime.id, anime.titles['x-jat'][0].title, subber, location, quality)
for i in xrange(anime.episodecount):
if anime.episodes.has_key(str(i+1)):
# Prevent None t... | Radiotechniman/Anorak | anorak/metadata.py | Python | gpl-3.0 | 3,294 |
#!/usr/bin/env python
'''
access satellite map tile database
some functions are based on code from mapUtils.py in gmapcatcher
Andrew Tridgell
May 2012
released under GNU GPL v3 or later
'''
import collections
import errno
import hashlib
import sys
import math
import threading
import os
import string
import time
impo... | monkeypants/MAVProxy | MAVProxy/modules/mavproxy_map/mp_tile.py | Python | gpl-3.0 | 23,042 |
import copy
import sys
import random
import itertools
def rotate_matrix(A):
for i in range(len(A) // 2):
for j in range(i, len(A) - i - 1):
temp = A[i][j]
A[i][j] = A[-1 - j][i]
A[-1 - j][i] = A[-1 - i][-1 - j]
A[-1 - i][-1 - j] = A[j][-1 - i]
A[... | meisamhe/GPLshared | Programming/MPI — AMath 483 583, Spring 2013 1.0 documentation_files/matrix_rotation_constant.py | Python | gpl-3.0 | 1,490 |
#! /usr/bin/env python
# Copyright (C) 2005
# ASTRON (Netherlands Institute for Radio Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This file is part of the LOFAR software suite.
# The LOFAR software suite is free software: you can redistribute it and/or
# modify it under the terms of the GNU General ... | jjdmol/LOFAR | LCS/Tools/src/makeClass.py | Python | gpl-3.0 | 17,838 |
# -*- encoding: utf-8 -*-
from abjad.tools import durationtools
from abjad.tools.datastructuretools.TypedList import TypedList
class CompoundInequality(TypedList):
'''A compound time-relation inequality.
::
>>> compound_inequality = timespantools.CompoundInequality([
... timespantools.Com... | andrewyoung1991/abjad | abjad/tools/timespantools/CompoundInequality.py | Python | gpl-3.0 | 7,680 |
"""
Populate a mongo DB collection with roll data from a csv
"""
from sysdata.mongodb.mongo_roll_data import mongoRollParametersData
from sysdata.csv.csv_roll_parameters import csvRollParametersData
if __name__ == "__main__":
input("Will overwrite existing data are you sure?! CTL-C to abort")
# modify flags a... | robcarver17/pysystemtrade | sysinit/futures/roll_parameters_csv_mongo.py | Python | gpl-3.0 | 910 |
import datetime as dt
import pytest
from django.core.management import call_command
from erudit.fedora import repository
from erudit.test.factories import IssueFactory, CollectionFactory, JournalTypeFactory
from erudit.models import Journal
pytestmark = pytest.mark.django_db
@pytest.mark.parametrize(
"kwargs"... | erudit/eruditorg | tests/unit/erudit/test_import_journals_from_fedora.py | Python | gpl-3.0 | 2,888 |
#!/usr/bin/env python
import os
import sys
import dotenv
dotenv.read_dotenv()
if __name__ == "__main__":
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'storageofknowledge.settings')
os.environ.setdefault('DJANGO_CONFIGURATION', 'Settings')
from configurations.management import execute_from_command_li... | ArtyomSliusar/StorageOfKnowledge | storageofknowledge/manage.py | Python | gpl-3.0 | 364 |
#!/usr/bin/env python3
print("this is a test program to see if")
print("we can make a new file in github")
print("and push it to the hub.")
| nap-complex/pythonPractice | newFile.py | Python | gpl-3.0 | 143 |
"""
Import identifiers mapping
"""
import sys
import opal.core
def add_arguments(parser):
"""
Add import_idsmap command specific options
"""
parser.add_argument('--type', '-t', required=True, help='Entity type (e.g. Participant).')
parser.add_argument('--map', '-m', required=True, help='Mapping n... | apruden/opal | opal-python-client/src/main/python/opal/import_idsmap.py | Python | gpl-3.0 | 1,394 |
'''
Django settings for sugarcub project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
'''
from django.conf.global_settings import AUTHENTICATION_BACKENDS, STATICFI... | bronycub/sugarcub | sugarcub/settings.py | Python | gpl-3.0 | 7,848 |
# 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/_henderson_heron.py | Python | gpl-3.0 | 2,964 |
from sqlalchemy import Column, String, Integer, Float, ForeignKey, PrimaryKeyConstraint
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, validates, backref
import time, json
DecBase = declarative_base()
class Server(DecBase):
__tablename__ = 'ezdonate_servers'
id = ... | EasyDonate/EasyDonate | EasyDonate/ORM.py | Python | gpl-3.0 | 7,304 |
# IMAPFS - Cloud storage via IMAP
# Copyright (C) 2013 Wes Weber
#
# 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.
#
# T... | waweber/imapfs | imapfs/directory.py | Python | gpl-3.0 | 2,645 |
import urllib
from django.contrib import messages
from django.contrib.admin import RelatedFieldListFilter, SimpleListFilter
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from oioioi.base import admin
from oioioi.base.utils import make_html_link
from oioioi.base.p... | papedaniel/oioioi | oioioi/oi/admin.py | Python | gpl-3.0 | 10,760 |
from django.conf.urls import url
from convention.views import games, user
app_name = 'convention'
urlpatterns = [
url(r'^games/description/$', games.ListGameView.as_view(), name='games_list'),
url(r'^games/edit/(?P<pk>[0-9]+)/$', games.UpdateGameView.as_view(), name='edit_game'),
url(r'^games/register/$',... | a-lost-shadow/shadowcon | convention/urls.py | Python | gpl-3.0 | 1,057 |
#!/usr/bin/env python
from argparse import ArgumentParser
import os
import shlex
import subprocess
import sys
from vsc.atools.int_ranges import int_ranges2set, InvalidRangeSpecError
from vsc.atools.config import (get_var_config, get_mode_config,
ConfigFileError)
if __name__ == '__main... | gjbex/atools | lib/areduce.py | Python | gpl-3.0 | 5,227 |
# Copyright 2010 Ramon Xuriguera
#
# This file is part of BibtexIndexMaker.
#
# BibtexIndexMaker 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 late... | rxuriguera/bibtexIndexMaker | src/bibim/gui/custom_widgets.py | Python | gpl-3.0 | 3,769 |
# -*- coding: utf-8 -*-
# Copyright (c) 2002 - 2015 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing the debug thread.
"""
import bdb
import sys
from DebugBase import DebugBase
class DebugThread(DebugBase):
"""
Class implementing a debug thread.
It represents a thread in the pyth... | testmana2/test | DebugClients/Python/DebugThread.py | Python | gpl-3.0 | 3,920 |
"""
inorder traverse a binary tree
https://leetcode.com/problems/binary-tree-inorder-traversal/
date: 10/09/21
"""
import sys
sys.path.append('utils/')
from TreeUtils import TreeNode
from TreeUtils import insert_level_order
def in_order(root):
if root != None:
in_order(root.left)
print(root.data,end=" ")
in... | entrepidea/projects | python/tutorials/algo/leetcode/easy/binary_tree_traversal.py | Python | gpl-3.0 | 489 |
# -*- coding: utf-8 -*-
"""
This package contains all the forms and models
for the rheumatism questionnaires.
"""
| acesonl/remotecare | remotecare/apps/questionnaire/rheumatism/__init__.py | Python | gpl-3.0 | 114 |
#!/usr/bin/env python3
"""
This file is part of mass-scheduler.
mass-scheduler 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.
mass-schedu... | tigercomputing/nagios-mass-scheduler | app.py | Python | gpl-3.0 | 3,456 |
"""
AIRLINE RESERVATION SYSTEM
DEVELOPERS
Stephen Tafoya
Ryan Hamilton
**** All comments will have ST or RH for ****
**** Stephen Tafoya or Ryan Hamilton ****
GUI CREATION FILE - CREATES AND HANDLES GUI ELEMENTS
"""
# class WindowObject()
###############################
# IMPORT STATEMENTS
# This... | YOUR-WORST-TACO/AdvPythonProject | Program/gui.py | Python | gpl-3.0 | 34,156 |
# -*- coding: utf-8 -*-
import re
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class FileStoreTo(SimpleHoster):
__name__ = "FileStoreTo"
__type__ = "hoster"
__version__ = "0.07"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?filestore\.to/\?d=(?P... | fzimmermann89/pyload | module/plugins/hoster/FileStoreTo.py | Python | gpl-3.0 | 1,290 |
"""
Permissions to use with the rest_framework_serializer_field_permissions.field classes:
class PersonSerializer(FieldPermissionSerializerMixin, serializers.ModelSerializer):
family_names = fields.CharField(permission_classes=(IsAuthenticated(), ))
given_names = fields.CharField(permission_classe... | InterSIS/django-rest-serializer-field-permissions | rest_framework_serializer_field_permissions/permissions.py | Python | gpl-3.0 | 1,438 |
from Serial import *
R = Serial("RxRxPx", '', Matrix([['x','x','0'],['y','y','x']]).T)
n_mot = 2
mot = [Motor("mot"+str(i+1),str(R.dof+i+1)) for i in range(n_mot)]
R.StaticBal = solve(R.gh_, R.lg)
R.Mh_sb_ = simplify(R.Mh_.subs(R.StaticBal))
R.vh_sb_ = simplify(R.vh_.subs(R.StaticBal))
R.gh_sb_ = simplify(R.gh_.subs... | mrcouts/Nyquist-Attack | Robotics/RxRxPx.py | Python | gpl-3.0 | 1,308 |
"""
Compute class
"""
import numpy as np
import matplotlib
matplotlib.use('Agg')
import pylab as pl
#TODO: Take care of the looks of these plots
class Compute(object):
"""
Abstract compute class. It will never be used, but is parent of all
the different computes.
"""
def __init__(self):
"""
Construc... | pabloalcain/lammps-python | pylammps/Computes/Compute.py | Python | gpl-3.0 | 1,563 |
import numpy as np
import pylab as pl
from astropy.io import fits
from scipy.interpolate import interp1d
sigma_y = 0 * np.pi / 2.355 / 60. /180. #angle in radian
sigmasq = sigma_y * sigma_y
#f = fits.open('/media/luna1/flender/projects/gasmod/maps/OuterRim/cl_tsz150_Battaglia_c05_R13.fits')[1].data
#l = np.arange(10... | vvinuv/HaloModel | plotting_scripts/compare_battaglia_vinu.py | Python | gpl-3.0 | 1,283 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
VetEpiGIS-Stat
A QGIS plugin
Spatial functions for vet epidemiology
-------------------
begin : 2016-01-06
git sha : $Format:%H$
... | IZSVenezie/VetEpiGIS-Stat | plugin/globalt.py | Python | gpl-3.0 | 21,379 |
#!/usr/bin/env python
#
# "TC BOUT BOARD" a wrestling Match Bout Board application for youth matches or tournaments
# Copyright (C) 2016 Anthony Cetera
#
# 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
# t... | nitrotc/tc-bout-board | app/tc_bout_board.py | Python | gpl-3.0 | 27,003 |
#!/usr/bin/env python3
'''
Runs Gajim's Test Suite
Unit tests tests will be run on each commit.
'''
import sys
import unittest
import getopt
use_x = True
verbose = 1
try:
shortargs = 'hnv:'
longargs = 'help no-x verbose='
opts, args = getopt.getopt(sys.argv[1:], shortargs, longargs.split())
except geto... | lovetox/gajim | test/runtests.py | Python | gpl-3.0 | 1,510 |
# -*-coding:UTF-8 -*
import os
import Auth.authentication as auth
import Auth.login as log
import Menu.barreOutils as barre
import Users.Model as U
import Projects.Model as P
#On appelle le module d'identification - Commenté pour les pahses de test d'autres modules
login = log.Login()
login.fenetre.mainloop()
#auth.... | Aveias/gestt | main.py | Python | gpl-3.0 | 1,104 |
#!/usr/bin/env python
""" (Re)build the README.md file from README-template.md.
"""
# This file is part of Twempest. Copyright 2018 Dave Rogers <info@yukondude.com>. Licensed under the GNU General Public
# License, version 3. Refer to the attached LICENSE file or see <http://www.gnu.org/licenses/> for details.
import... | yukondude/Twempest | build-readme.py | Python | gpl-3.0 | 1,279 |
../../../../../share/pyshared/google/protobuf/descriptor_pb2.py | Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/python2.7/dist-packages/google/protobuf/descriptor_pb2.py | Python | gpl-3.0 | 63 |
# Copyright (C) 2017 Christopher M. Biwer
# 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 distribut... | soumide1102/pycbc | pycbc/transforms.py | Python | gpl-3.0 | 57,402 |
#!/usr/bin/env python
import os
import time as tm
# Main function handling all internals
# -----------------------------------------------------------------------------
def main():
mainDir = '/data2/coherent/data/csi/bjs-analysis/Processed/'
outDir = '/data2/coherent/data/csi/bjs-analysis/Processed/Analyzed/'
... | Nablaquabla/csi-analysis | hcdataCalculateSpectra.py | Python | gpl-3.0 | 5,369 |
class TaskMappingSchemesFullyDyn:
TASKMAPPINGSCHEMESFULLYDYN_NONE = 0 # this will give error
TASKMAPPINGSCHEMESFULLYDYN_RANDOM = 1
TASKMAPPINGSCHEMESFULLYDYN_LOWESTUTIL_NEARESTPARENT = 2
| roshantha9/AbstractManycoreSim | src/libMappingAndScheduling/FullyDynamic/TaskMappingSchemesFullyDyn.py | Python | gpl-3.0 | 320 |
# x = last | random
# expected step N => 32 bit full
# 1 bit expected (step 1) = 1/2
# 1 bit expected (step 2) = 1/2^2
# 1 bit expected (step n) = 1/2^n
# 1 bit expected step = 1/2+2(1/2^2)+3*1/2^3)+4*1/2^4
# ???? n step or step
# 00
# 1.999999999
def bit1():
onebit = 0
for i in range(1000):
onebi... | CroMarmot/MyOICode | ProjectEuler/p323.py | Python | gpl-3.0 | 1,577 |
from threading import Thread
import winsound
import cv2
class WebcamVideoStream:
def __init__(self, src=0):
# initialize the video camera stream and read the first frame
# from the stream
self.stream = cv2.VideoCapture(src)
(self.grabbed, self.frame) = self.stream.read()
# ... | RyanChinSang/ECNG3020-ORSS4SCVI | BETA/TestCode/OpenCV/imutils-test/imultils-test2.py | Python | gpl-3.0 | 2,355 |
"""
Script to evaluate intermodal forward Brillouin scattering in a cylindrical SiO2 waveguide
"""
# Import the necessary packages
import time
import datetime
import numpy as np
import sys
import copy
from matplotlib.ticker import AutoMinorLocator
import math
sys.path.append("../backend/")
import material... | bjornsturmberg/NumBAT | JOSAB_tutorial/simo-josab-IFSBS-1umcylwg-SiO2.py | Python | gpl-3.0 | 7,020 |
import turtle
import time
window = turtle.Screen()
def test():
allturtles = []
for i in range(4):
t1 = turtle.Turtle()
t2 = turtle.Turtle()
t3 = turtle.Turtle()
t4 = turtle.Turtle()
t1.speed(0)
t2.speed(0)
t3.speed(0)
t4.speed(0)
t1.penup()
t2.penup()
t3.penup()
t4.penup()
t1.... | willybh11/python | advProg/turtleStuff/helloturtleworld.py | Python | gpl-3.0 | 846 |
#!/usr/bin/env python
# This file is part of the py-boinc-plotter,
# which provides parsing and plotting of boinc statistics and
# badge information.
# Copyright (C) 2013 obtitus@gmail.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as ... | obtitus/py-boinc-plotter | pyBoincPlotter/__init__.py | Python | gpl-3.0 | 914 |
"""
Copyright 2008, 2009, 2011 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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... | glennlive/gnuradio-wg-grc | grc/gui/MainWindow.py | Python | gpl-3.0 | 13,903 |
from django.contrib import admin
from django.conf import settings
from geonode.base.models import (TopicCategory, SpatialRepresentationType,
Region, RestrictionCodeType, ContactRole, ResourceBase, Link, License, Thumbnail)
class LicenseAdmin(admin.ModelAdmin):
model = License
list_display = ('id', 'name')... | mishravikas/geonode-cas | geonode/base/admin.py | Python | gpl-3.0 | 4,283 |
import json_handler
class conf_handler:
__m_conf_path = None
__m_conf = None
def __init__( self, conf_base = "../conf/", conf_name = "configuration.conf" ):
self.__m_conf_path = conf_base + conf_name
self.__m_conf = json_handler.json_handler(self.__m_conf_... | bncc/pycore | pycore/conf_handler.py | Python | gpl-3.0 | 660 |
##!/usr/bin/python
import numpy as np
import pylab as plt
import seaborn as sns
sns.set_context('poster')
plt.subplot(1,1,1)
data = np.genfromtxt(fname='cor.dat')
#for x in range(1,data.shape[-1]):
plt.plot(data[:,0],data[:,1],lw=2,label='Re')
plt.plot(data[:,0],data[:,2],lw=2,label='Im')
#plt.plot(data[:,0]... | binghongcha08/pyQMD | GWP/2D/1.0.7/cor.py | Python | gpl-3.0 | 1,054 |
class StateObject(object):
def _get_state(self):
raise NotImplementedError # pragma: nocover
def _load_state(self, state):
raise NotImplementedError # pragma: nocover
@classmethod
def _from_state(cls, state):
raise NotImplementedError # pragma: nocover
# Usually, thi... | phase-dev/phase | libmproxy/stateobject.py | Python | gpl-3.0 | 2,608 |
##X3D=group
##X3D Shape node from Appearance and Geometry=name
##X3D_Geometry_file=file
##appearance=string <Appearance><Material></Material></Appearance>
##output_X3D_Shape_file=output file
out=open(output_X3D_Shape_file,'w')
geofile=open(X3D_Geometry_file,'r')
# no error checking, use elementtree later
out.write(... | andreasplesch/QGIS-X3D-Processing | scripts/generate_X3D_Shape.py | Python | gpl-3.0 | 495 |
import os,sys,math,pdb,filecmp,logging,argparse,subprocess
from argparse import RawTextHelpFormatter
import time
import numpy as np
import imp
retry_count=3
# Check if OpenCV library is available
# Abort further execution if image handling is required
cv2_flag = True
try:
imp.find_module("cv2")
except:
print "WARN... | vinutah/apps | tools/vulfi/master/scripts/driver.py | Python | gpl-3.0 | 20,628 |
# Copyright 2012 VPAC, http://www.vpac.org
# Copyright 2013-2021 Marcus Furlong <furlongm@gmail.com>
#
# This file is part of Patchman.
#
# Patchman 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 on... | furlongm/patchman | arch/admin.py | Python | gpl-3.0 | 882 |
# -*- coding: utf-8 -*-
"""Copyright (C) 2013 COLDWELL AG
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 dist... | bdacode/hoster | hoster/turbobit_net.py | Python | gpl-3.0 | 5,022 |
#!/usr/bin/env python
# Copyright (C) 2009-2015 Johannes Dewender
#
# 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.
#
#... | jesus2099/JonnyJD_musicbrainz-isrcsubmit | isrcsubmit.py | Python | gpl-3.0 | 41,557 |
#!/usr/bin/env python
#coding: iso-8859-15
#
# Copyright (C) 2015
# ASTRON (Netherlands Institute for Radio Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This file is part of the LOFAR software suite.
# The LOFAR software suite is free software: you can redistribute it and/or
# modify it under the term... | jjdmol/LOFAR | SAS/OTDB_Services/getParset.py | Python | gpl-3.0 | 2,018 |
# -*- coding: utf-8 -*-
# Copyright 2007-2020 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | dnjohnstone/hyperspy | hyperspy/misc/export_dictionary.py | Python | gpl-3.0 | 7,725 |
# user: smartmirror_elp
# pw: 12345678
# API-key: 68a61abe6601c18b8288c0e133ccaafb
import os
import pyowm
import datetime
from datetime import datetime
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from Widgets.ExpandedWidget import ExpandedWidget
API_key = "68a61abe6601c18b8288c0... | IotaMyriad/SmartMirror | Widgets/InstalledWidgets/WeatherWidget/ExpandedWeatherWidget.py | Python | gpl-3.0 | 3,751 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import jsonfield.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("delft3dworker", "0020_auto_20160422_2304"),
]
operations = [
migrations.RenameField(
mod... | openearth/delft3d-gt-server | delft3dworker/migrations/0021_auto_20160525_1826.py | Python | gpl-3.0 | 618 |
import datetime
class Historico:
def __init__(self):
self.data_abertura = datetime.datetime.today()
self.transacoes = []
def imprime(self):
print('data abertura: {}'.format(self.data_abertura))
print('transações: ')
for t in self.transacoes:
print('... | dariosena/LearningPython | PY-14/conta.py | Python | gpl-3.0 | 1,698 |
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
from __future__ import (absolute_import, divi... | mganeva/mantid | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SingleCrystalDiffuseReduction.py | Python | gpl-3.0 | 21,263 |
# usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 20 13:15:05 2017
@author: Vijayasai S
"""
# Use python3
from haversine import distance
from datetime import datetime
from dateutil import tz
import my_dbscan as mydb
import alert_update as au
from pymongo import MongoClient
import pandas as pd
im... | Vijaysai005/KProject | vijay/DBSCAN/clustering/db/generate_data.py | Python | gpl-3.0 | 5,801 |
people = 30
cars = 40
buses = 15
if cars > people:
print "We should take the car."
elif cars < people:
print "We should not take the cars."
else:
print "We can not decide."
if buses > cars:
print "That's too many buses"
elif buses < cars:
print "May be we could take the buses."
else:
print "We can not decide.... | auspbro/CodeSnippets | Python/LPTHW/ex30.py | Python | gpl-3.0 | 433 |
# Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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.
#
# PySCAP is ... | cjaymes/pyscap | src/scap/model/xal_2_0/EndorsementLineCodeType.py | Python | gpl-3.0 | 987 |
# Effect.py - Base class for all ability effects
# Copyright Stefan Brus 2007.
#
# This file is part of HelHack.
#
# HelHack 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
... | Kev/helhack | src/ability/Effect.py | Python | gpl-3.0 | 839 |
#
# Copyright (C) 2017 FreeIPA Contributors. See COPYING for license
#
from __future__ import absolute_import
import binascii
import os
import psutil
import re
import subprocess
import textwrap
import pytest
from unittest.mock import patch, mock_open
from ipaplatform.paths import paths
from ipapython import ipaut... | encukou/freeipa | ipatests/test_ipaserver/test_install/test_installutils.py | Python | gpl-3.0 | 7,877 |
#!/usr/bin/env python
# Copyright 2015 Jo Pol
# 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... | d-bl/inkscape-bobbinlace | lace_polar.py | Python | gpl-3.0 | 8,181 |
import os
import os.path
import getopt
import ConfigParser
import sys
"""
rem rasterize needs to be done on tif file as .map files cannot be
rem handled directby by gdal
"""
shpfile = "subbasins_rhein_wgs1984.shp"
nname = os.path.splitext(os.path.basename(shpfile))[0]
# In this dictionary the fiedl in ... | openstreams/wflow | examples/wflow_rhine_hbv/staticmaps/shptoraster.py | Python | gpl-3.0 | 1,082 |
#!/usr/bin/env python
"""
conference.py -- Udacity conference server-side Python App Engine API;
uses Google Cloud Endpoints
$Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $
created by wesc on 2014 apr 21
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
from datetime import datetime
import ... | pyemma/scalable-python-app | Lesson_5/00_Conference_Central/conference.py | Python | gpl-3.0 | 20,067 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-04-02 19:34
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('mhap', '0003_auto_20170402_1906'),
]
operations = [
migrations.DeleteModel(
... | SIU-CS/J-JAM-production | mhapsite/mhap/migrations/0004_delete_quote.py | Python | gpl-3.0 | 354 |
"""
flask.aflafrettir
~~~~~~~~~~~~~~
Adds support for fetching data from the Department of Fisheries in Iceland and
calculating the total catch for certain period of time.
"""
import logging
from .soap import DOFService
from .landings import Landings, sort_landings
from .excel import save_excel
class Aflafre... | finnurtorfa/aflafrettir | flask_aflafrettir/__init__.py | Python | gpl-3.0 | 3,945 |
import cPickle
import os
import tarfile
import PIL.Image
from downloader import DataDownloader
class Cifar100Downloader(DataDownloader):
"""
See details about the CIFAR100 dataset here:
http://www.cs.toronto.edu/~kriz/cifar.html
"""
def urlList(self):
return [
'http://www.... | winnerineast/Origae-6 | origae/download_data/cifar100.py | Python | gpl-3.0 | 5,218 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import pygame
import os
fullname = os.path.join('res', 'gui')
def init(gui):
buttonsurf = pygame.image.load(os.path.join(fullname, 'button.png')).convert_alpha()
closesurf = pygame.image.load(os.path.join(fullname,
'closebutton.png... | luisgustavossdd/TBD | client/pygameclient/widgets/regnancyStyle.py | Python | gpl-3.0 | 3,306 |
#!/usr/bin/env python
'''
Solves Rosenbrock's Unconstrained Problem.
min 100*(x2-x1^2)**2 + (1-x1)^2
s.t.: -10 <= xi <= 10, i = 1,2
f* = 0 , x* = [1, 1]
'''
# =============================================================================
# Standard Python modules
# =================================... | svn2github/pyopt | examples/rosenbrock.py | Python | gpl-3.0 | 2,679 |
#!/usr/bin/python2
# -*- coding: utf-8 -*-
#
# Copyright 2014 Peerchemist
#
# This file is part of NuBerryPi project.
#
# 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 Li... | inuitwallet/nuberrypi | PKGBLD/nuberrypi-info/nuberrypi-info.py | Python | gpl-3.0 | 7,347 |
"""PyUnit testing against strptime"""
import unittest
import time
import locale
import re
import sys
from test import test_support
from datetime import date as datetime_date
import _strptime
class getlang_Tests(unittest.TestCase):
"""Test _getlang"""
def test_basic(self):
self.failUnlessEqual(_strpti... | mancoast/CPythonPyc_test | cpython/251_test_strptime.py | Python | gpl-3.0 | 23,903 |
import os
import Image
from flask import Module, request, current_app, render_template, jsonify, send_file, abort
from werkzeug import secure_filename
from urbanjungle.models import db
from urbanjungle.models.report import Report
from sqlalchemy.ext.serializer import dumps
frontend = Module(__name__)
def allowed_file... | thibault/UrbanJungle | site/urbanjungle/controllers/frontend.py | Python | gpl-3.0 | 2,808 |
#!/usr/bin/python
#
# motorsClass.py MOTORS CLASS
#
# METHODS:
# motors(readingPerSec) # create instance and motor control thread
# cancel() # stop motors, close motor control thread
# drive(driveSpeed) # ramp speed to go fwd(+) or back(... | slowrunner/RWPi | posie/posie-web/rwpilib/motorsClass.py | Python | gpl-3.0 | 27,889 |
#!/usr/bin/python
"""
sieveshell - remotely manipulate sieve scripts
SYNOPSIS
sieveshell [--user=user] [--authname=authname] [--realm=realm]
[--exec=script] [--auth-mech=mechanism] server
sieveshell --help
sieveshell allows users to manipulate their scripts on a remote server.
It works via MANAG... | piger/managesieve-cli | managesieve/sieveshell.py | Python | gpl-3.0 | 13,053 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# NewsReap Command Line Interface (CLI)
#
# Copyright (C) 2015-2016 Chris Caron <lead2gold@gmail.com>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software... | caronc/newsreap | bin/nr.py | Python | gpl-3.0 | 11,500 |
# -*- coding: utf-8 -*-
"""
Написать функцию is_prime, принимающую 1 аргумент: число от 0 до 1000.
Если число простое, то функция возвращает True, а в противном случае - False.
"""
prime_1000 = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, ... | victorivanovspb/challenge-accepted | resp_simple/is_prime.py | Python | gpl-3.0 | 1,857 |
"""
Remote code execution on HADOOP server with YARN and default settings
Implementation is based on code from
https://github.com/vulhub/vulhub/tree/master/hadoop/unauthorized-yarn
"""
import json
import posixpath
import string
from random import SystemRandom
import requests
from common.common_consts.tim... | guardicore/monkey | monkey/infection_monkey/exploit/hadoop.py | Python | gpl-3.0 | 4,087 |
import numpy as np
import matplotlib.pyplot as plt
from kafe2 import XYContainer
err_val_x = 0.001
err_val_y = 0.01
num_datapoints = 121
l, delta_l = 10.0, np.random.randn() * 0.001
r, delta_r = 0.052, np.random.randn() * 0.001
g_e = 9.780 # gravitational pull at the equator
y_0, delta_y_0 = 0.6, np.random.randn() ... | dsavoiu/kafe2 | examples/004_constraints/generate_data.py | Python | gpl-3.0 | 1,268 |
# Copyright 2010-2016, Damian Johnson and The Tor Project
# See LICENSE for licensing information
"""
Panel presenting the configuration state for tor or nyx. Options can be edited
and the resulting configuration files saved.
"""
import curses
import os
import nyx.controller
import nyx.curses
import nyx.panel
import... | sammyshj/nyx | nyx/panel/config.py | Python | gpl-3.0 | 11,732 |
#!/usr/bin/env python
"""
Script Usage:
Write to a file with indentation:
python %(scriptName)s --input <input-file> --output englishTermAndUiElementMap.json --indent=4
Write to a file without any indentation:
python %(scriptName)s --input <input-file> --output englishTermAndUiElementMap.json
Write to stdout with in... | siddharth96/windows-tweaker | WindowsTweaker/Search/stemmer.py | Python | gpl-3.0 | 3,563 |
# Generated by Django 2.2 on 2020-02-14 12:32
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('scoping', '0315_auto_20200114_1420'),
('twitter', '0020_auto_20200115_1237'),
]
operations = [
migrat... | mcallaghan/tmv | BasicBrowser/twitter/migrations/0021_auto_20200214_1232.py | Python | gpl-3.0 | 784 |
def test_notifyableProperty():
from view_models.adapters import NotifyablePropertyObject, notifyableProperty
class TestSubject(NotifyablePropertyObject):
name = notifyableProperty(str)
code = notifyableProperty(str, signalName='kung_foo')
def __init__(self, name=None, code=None, parent... | spooky/lobby | tests/src/test_adapters.py | Python | gpl-3.0 | 1,062 |
__author__ = 'Kami'
import json
import bs4
PATH = r"C:\Users\Kami\Google Drive\pins\Pin Evolution Table.html"
DST = r"C:\Users\Kami\Google Drive\pins\Pin Evolution Table.json"
if __name__ == "__main__":
content = open(PATH).read()
soup = bs4.BeautifulSoup(content)
iterator = iter(soup.find_all("tr"))
... | DavideCanton/Python3 | cazzate/pins_convert.py | Python | gpl-3.0 | 792 |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
fix_xml_ampersands,
)
class MetacriticIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?metacritic\.com/.+?/trailers/(?P<id>\d+)'
_TESTS = [{
'url': 'http://www.metacritic.com/game/playstation-4/infamo... | valmynd/MediaFetcher | src/plugins/youtube_dl/youtube_dl/extractor/metacritic.py | Python | gpl-3.0 | 2,280 |
import os
import sys
import sqlite3
import logging
from tqdm import tqdm
from pathlib import Path
from whoosh.index import create_in, open_dir
from whoosh.fields import Schema, TEXT, NUMERIC
from whoosh.qparser import QueryParser
from whoosh.spelling import ListCorrector
from whoosh.highlight import UppercaseFormatter
... | DeastinY/srpdfcrawler | pdf_search.py | Python | gpl-3.0 | 2,775 |
# -*- coding: utf-8 -*-
#
# allocations/entries.py is part of MetaDoc (Client).
#
# All of MetaDoc 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 opti... | henrikau/metadoc | client/allocations/entries.py | Python | gpl-3.0 | 2,825 |
from builtins import str
from qgis.PyQt.QtCore import QFileInfo
from qgis.PyQt.QtWidgets import QFileDialog
def update_directory_key(settings, settings_dir_key, fileName):
"""
modified from module RASTERCALC by Barry Rowlingson
"""
path = QFileInfo(fileName).absolutePath()
settings.setValue(se... | mauroalberti/gsf | pygsf/utils/qt_utils/filesystem.py | Python | gpl-3.0 | 1,060 |
from django.apps import AppConfig
class DesarrollowebConfig(AppConfig):
name = 'desarrolloweb'
| z1gm4/desarrollo_web_udp | desarrolloweb/apps.py | Python | gpl-3.0 | 101 |
# This work is licensed by James Town and ACOE Core Learning under a
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0
# International License: http://creativecommons.org/licenses/by-nc-sa/4.0/
import linkbot # loads library for the Linkbots
robot1 = linkbot.Linkbot('ABCD') #assigns the name robot1 to... | acoecorelearning/Algebra1wRobots | 4-RaceToTie2/raceToTie2.py | Python | gpl-3.0 | 884 |