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 |
|---|---|---|---|---|---|
from logo import Primitive, Evaluator, Env, UnterminatedExpression, ProgramError, ParseError, TrollException, UnknowIdentifier
from sys import argv, stdin
from zumoturtle import forward, backward, turnLeft, turnRight, getGroundSensor, playMusic, sensorsAbove, BLACK_THRES
import traceback
import math
import os
Autocomp... | t00n/ZumoPdS | pylogo/repl.py | Python | gpl-2.0 | 4,308 |
import distance
import time
km = distance.km2points(33.452, -88.787, 33.471, -88.770)
miles = distance.km2miles(km)
print km
print miles
time.sleep(3) | gigglesninja/senior-design | MissionPlanner Scripts/mission_scripts/testdis.py | Python | gpl-2.0 | 151 |
from abapy.mesh import Mesh, Nodes, RegularQuadMesh
from abapy import CFE
from numpy import linspace
import matplotlib.pyplot as plt
"""
Bousinesq model
===============
"""
Bo = CFE.Boussinesq(F = 10.)
"""
Mesh model
"""
N1, N2 = 50, 50
l1, l2 = 1., 1.
Ncolor = 200
levels = linspace(0., 10., 20)
mesh = RegularQuadMe... | lcharleux/abapy | doc/example_code/indentation/Boussinesq.py | Python | gpl-2.0 | 1,357 |
import os
import sys
import tempfile
import shutil
if sys.version_info[:2] == (2, 6):
import unittest2 as unittest
else:
import unittest
from avocado import VERSION
from avocado.core import exit_codes
from avocado.utils import process
from avocado.utils import script
basedir = os.path.join(os.path.dirname(os... | adereis/avocado | selftests/functional/test_export_variables.py | Python | gpl-2.0 | 2,114 |
WEBSITE_MAIL_SERVER="info@game-2024.appspot.com"
OWNER_MAIL_ID="johndoe@gmail.com"
OWNER_NAME="John Doe"
MAIL_SIGNATURE= {
"BODY" : """
Hi {},
Thank you for visiting my profile, I will reply to you shortly.
Regards,
{}
PS: This is a computer generated message, please do not respond to it.
""",
"SUBJECT": "Notifica... | sumansaurabh/Portfolio-AppEngine | config.py | Python | gpl-2.0 | 371 |
import numpy as np
import cv2
import time
import json
stop_key = ord('q')
low_m = 90
high_m = 255
colors = {
'red' : {
'color': (0, 0, 255),
'lower': np.array([0, low_m, low_m], dtype=np.uint8),
'upper': np.array([10, high_m, high_m], dtype=np.uint8)
},
'green' : {
'colo... | geekspark-rh/dimo-input | input.py | Python | gpl-2.0 | 3,493 |
__author__ = 'Vitalii K'
def xo_referee(result):
array = []
# Add rows
array.extend(result)
# Add columns
for j in range(len(result)):
m = ''
for i in range(len(result)):
m += result[i][j]
array.append(m)
# Add main diagonals
array.append(''.join([str(re... | tivaliy/empire-of-code | XsAndOsReferee.py | Python | gpl-2.0 | 1,741 |
import json
patterns = [
# Common Patterns across SE
{
'regex': "^((?:\[)?cv-pl[sz].*?(?:\])?|\[tag:cv-pl[sz](-.*)?])(?: )?((?:\[tag\:*)?[\w :\-\(\)\*]+(?:\])?)?(?: )?(https?://.*\.(?:com|net)/(?:q(?:uestions)?|a(?:nswer)?)/\d+(?:/)?(?:\d+|(?:\w|-)+)?(?:/\d+)?(?:#\d+)?)",
'translation': "Close ... | AWegnerGitHub/SE_Zephyr_VoteRequest_bot | create_config_files.py | Python | gpl-2.0 | 11,767 |
#!/usr/bin/env python
import os
import logging
import time
import datetime
import sys
import ftplib
from ftplib import FTP
from configparser import SafeConfigParser
from argparse import ArgumentParser
class Connection(object):
def __init__(self,config,dry_run=False):
self.client = FTP(
config.get("FTP", "host")... | tomthorogood/StarboundServerPatcher | starbound_sync.py | Python | gpl-2.0 | 7,146 |
#!/usr/bin/python
import sys
import os
os.chdir ( "/home/skeezix/compo4all" )
sys.path.append ( os.getcwd() )
import modulemap
import singlescore_handler
if len ( sys.argv ) <= 1:
print "./foo prid gamename scorenum"
print "run from spagserver.py location"
sys.exit ( 0 )
req = dict()
req [ 'prid' ] = s... | skeezix/compo4all | util/pushscore.py | Python | gpl-2.0 | 498 |
"""
Artin representations for number fields
AUTHORS:
- Robert Harron (2013): initial version
TESTS:
Standard test of pickleability::
sage: from sage.rings.number_field.galois_group import GaloisGroup_v3
sage: from sage.rings.number_field.artin_representation import ArtinRepresentation
sage: K = NumberF... | rharron/ArtinGalois | sage/rings/number_field/artin_representation.py | Python | gpl-2.0 | 17,285 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
https://projecteuler.net/problem=21
=
'''
import timeit
import math
import sys
import datetime
from euler import *
def run():
# n = 10
n = 100
product = math.factorial(n)
# print list(str(product))
print (sum(map(int, list(str(product)))))
... | weyw/eulerproject | wey/p20.py | Python | gpl-2.0 | 371 |
'''Unit tests for the importance sampler functions.
'''
from .importance_sampling import *
from .. import density
from ..density.mixture_test import DummyComponent
from ..tools._probability_densities import unnormalized_log_pdf_gauss, normalized_pdf_gauss
from ..tools import History
from nose.plugins.attrib import at... | fredRos/pypmc | pypmc/sampler/importance_sampling_test.py | Python | gpl-2.0 | 16,979 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
"""
import storage
import os
import re
import tarfile
import glob
import time
from http import HTTP
from gz... | trosa/forca | gluon/fileutils.py | Python | gpl-2.0 | 11,104 |
import views
def init(app):
app.add_url_rule('/', view_func=views.hello, methods=['GET'])
app.add_url_rule('/list/', view_func=views.list_entries, methods=['GET'])
| bbranta/nibiru_car | server/web/urls.py | Python | gpl-2.0 | 174 |
# Copyright (C) 2013-2021 Roland Lutz
#
# 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 ... | rlutz/xorn | src/gaf/xmlformat.py | Python | gpl-2.0 | 1,685 |
# coding: utf-8
# # Antibody Response Pulse
# https://github.com/blab/antibody-response-pulse
#
# ### B-cells evolution --- cross-reactive antibody response after influenza virus infection or vaccination
# ### Adaptive immune response for repeated infection
# In[1]:
'''
author: Alvason Zhenhua Li
date: 04/09/201... | blab/antibody-response-pulse | bcell-array/code/Virus_Bcell_IgM_IgG_Landscape.py | Python | gpl-2.0 | 11,385 |
# -*- coding: utf-8 -*-
# This code is part of Amoco
# Copyright (C) 2016 Axel Tillequin (bdcht3@gmail.com)
# published under GPLv2 license
"""
db.py
=====
This module implements all amoco's database facilities using the
`sqlalchemy`_ package, allowing to store many analysis results and
pickled objects.
.. _sqlalch... | bdcht/amoco | amoco/db.py | Python | gpl-2.0 | 8,949 |
'''
phmovie.py - a python module for processing frames of phase images and displaying them with a movie
'''
# plotting crap
#import matplotlib
#matplotlib.use('TkAgg')
import os
import numpy as np
import scipy.ndimage as ndi
import matplotlib.pyplot as plt
import matplotlib.animation as anim
from datetime ... | taylo589/phproc | phmovie.py | Python | gpl-2.0 | 4,984 |
#!/usr/bin/env python3
import logging
import sys
sys.path = sys.path + ['..']
from etc import dev
from dm import get_host
logging.basicConfig(format='%(asctime)s %(message)s', level=logging.DEBUG)
if len(sys.argv) != 3:
print('Get all predefined host info, but no runtime info')
sys.exit('usage: %s <vendor> <h... | drunkard/lazycat | tests/get_host_info.py | Python | gpl-2.0 | 613 |
# Copyright (C) 2014 Red Hat, Inc. Jamie Bainbridge <jbainbri@redhat.com>
# Copyright (C) 2014 Red Hat, Inc. Bryn M. Reeves <bmr@redhat.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; eithe... | cnewcome/sos | sos/plugins/firewalld.py | Python | gpl-2.0 | 1,616 |
# -*- coding: utf-8 -*-
# [HARPIA PROJECT]
#
#
# S2i - Intelligent Industrial Systems
# DAS - Automation and Systems Department
# UFSC - Federal University of Santa Catarina
# Copyright: 2006 - 2007 Luis Carlos Dill Junges (lcdjunges@yahoo.com.br), Clovis Peruchi Scotti (scotti@ieee.org),
# Guilh... | samuelfd/harpia | harpia/bpGUI/show.py | Python | gpl-2.0 | 6,117 |
from django.test import TestCase
from ..models import editor_subscribe_label_deleted
class test_editor_subscribe_label_deleted(TestCase):
def setUp(self):
self.subject = editor_subscribe_label_deleted()
def test__editor_subscribe_label_deleted__instance(self):
self.assertIsInstance(self.subje... | marios-zindilis/musicbrainz-django-models | musicbrainz_django_models/tests/test_editor_subscribe_label_deleted.py | Python | gpl-2.0 | 492 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
#
# Project: GDAL/OGR Test Suite
# Purpose: ogrlineref testing
# Author: Dmitry Baryshnikov. polimax@mail.ru
#
###############################################################################... | nextgis-extra/tests | lib_gdal/utilities/test_ogrlineref.py | Python | gpl-2.0 | 5,067 |
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 23 15:00:17 2014
@author: raffaelerainone
"""
lines = open("12. Large sum.txt","r").readlines()
my_file.close()
sum=0
for i in range(0,100):
sum+=int(lines[i])
l=len(str(sum))-10
print int(sum/(10**l)) | raffo85h/projecteuler | 13. Large sum.py | Python | gpl-2.0 | 255 |
from django.contrib.auth import backends
class ModelBackend(backends.ModelBackend):
def authenticate(self, username=None, password=None, **kwargs):
UserModel = backends.get_user_model()
if username is None:
username = kwargs.get(UserModel.USERNAME_FIELD)
try:
user = ... | OpenTTD-Ladder/ladder-web | ladder/account/backends.py | Python | gpl-2.0 | 543 |
import commands
cmdGamma01 = './tesis-jaks --option 1 --algorithm RandomBOBO --strategy RANK_BY_INTRA_INTER_PROPORTIONAL --element FILE --bundles 10 --budget 30.0 --gamma 0.9 --directory ./ --write 1'
cmdGamma05 = './tesis-jaks --option 1 --algorithm RandomBOBO --strategy RANK_BY_INTRA_INTER_PROPORTIONAL --element FIL... | juanknebel/tesis-jaks | files/restaurants/run.py | Python | gpl-2.0 | 6,008 |
# vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=python:textwidth=0:
# License: GPL2 or later see COPYING
# Written by Marko Myllynen
# Copyright (C) 2010 Marko Myllynen <myllynen@redhat.com>
# python library imports
import subprocess
import tempfile
import shutil
import shlex
import sys
import pwd
import os... | jhford/mock_mozilla | py/mock_mozilla/scm.py | Python | gpl-2.0 | 6,765 |
from xcsoar.mapgen.waypoints.waypoint import Waypoint
from xcsoar.mapgen.waypoints.list import WaypointList
class __CSVLine:
def __init__(self, line):
self.__line = line
self.__index = 0
def has_next(self):
return self.__index < len(self.__line)
def next(self):
... | fberst/mapgen | lib/xcsoar/mapgen/waypoints/seeyou_reader.py | Python | gpl-2.0 | 3,340 |
import os
from sklearn import neighbors
from sklearn.decomposition import PCA, IncrementalPCA, KernelPCA
import make_dataset
if __name__ == '__main__':
test_file_names = os.listdir('/media/dick/Storage/test')
N_test = len(test_file_names)
print(str(N_test) + ' test files.')
train_file_names = os.li... | ralbayaty/KaggleRetina | kNNclassifier.py | Python | gpl-2.0 | 1,990 |
"""
Converts between MacOS time values and native time values.
A Mac timestamp is the number of seconds since Jan 1, 1904.
"""
from __future__ import absolute_import
import time
_UNIX_EPOCH_TIMESTAMP = int(time.mktime(time.strptime('1970', '%Y')))
_MAC_EPOCH_TIMESTAMP = int(time.mktime(time.strptime('1904', '%Y'))... | davidfstr/ClassicBox | classicbox/time.py | Python | gpl-2.0 | 1,640 |
from .compiler.parser import parse
from .compiler.compiler import Compiler
from .vm import VM as SkimeVM
from .types.symbol import Symbol
from .types.pair import Pair
from .prim import Primitive, PyCallable, prim_list_p, iter_list
from .proc import Procedure
import errors
from schemepy.exceptions import *
from schemep... | thousandparsec/schemepy | schemepy/skime/skime/__init__.py | Python | gpl-2.0 | 6,287 |
#!/usr/bin/env python3
class Alist:
"Association list."
def __init__(self):
self.last = self.first = []
def add(self, key, val):
node = [key, val, None]
if self.last:
self.last[2] = node
self.last = node
else:
self.first = self.last = nod... | akulakov/sicp | code/association_list.py | Python | gpl-2.0 | 938 |
# -*- coding: utf-8 -*-
"""
Catch-up TV & More
Copyright (C) 2019 SylvainCecchetto
This file is part of Catch-up TV & More.
Catch-up TV & More 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 Foundat... | SylvainCecchetto/plugin.video.catchuptvandmore | plugin.video.catchuptvandmore/resources/lib/channels/fr/lachainenormande.py | Python | gpl-2.0 | 2,381 |
"""
Configure class attributes using values from a dictionary.
This module to defines strictly typed attributes of a class, that can be loaded
from an input dictionary. This is particularly useful for loading a class from
a YAML document.
Examples
========
In this example we set up a class to store information about... | radiocosmology/caput | caput/config.py | Python | gpl-2.0 | 15,550 |
from distutils.core import setup
setup(name = "criu-coredump",
version = "0.0.1",
description = "Generate core dumps from CRIU images",
author = "Ruslan Kuprieiev",
author_email = "kupruser@gmail.com",
url = "https://github.com/efiop/criu-coredump",
packages = ["criu_coredump"],
... | efiop/criu-coredump | setup.py | Python | gpl-2.0 | 359 |
import arc.connection
import arc.tko.job
c = arc.connection.get_default()
print(arc.tko.job.get_data(c))
| clebergnu/arc | samples/api/tko/get-jobs-data.py | Python | gpl-2.0 | 108 |
# Copyright 2006-2007 Lukas Lalinsky
#
# 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.
from gi.repository import GLib
... | Meriipu/quodlibet | quodlibet/player/xinebe/player.py | Python | gpl-2.0 | 12,107 |
#!/usr/bin/env python
#
# UtilityCalc is a tool to assist in calculating shares when splitting bills
# Copyright (C) 2013 NigelB
#
# 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 ... | nigelb/UtilityCalc | utilitycalc/config.py | Python | gpl-2.0 | 1,924 |
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from wtforms import ValidationError
from wtforms.validators import Required
from ..models import Marshal
class MarshalForm(FlaskForm):
name = StringField('Name', validators=[Required()])
class MarshalEditForm(MarshalForm):
submit = S... | jyundt/oval | app/marshal/forms.py | Python | gpl-2.0 | 945 |
# -*- coding: utf-8 -*-
import sqlite3
import sys
#FUNCIONES PARA MANEJAR LA TABLA CANCIONES
def existe_cancion(url):
con = sqlite3.connect('data.db')
with con:
c = con.cursor()
c.execute("select 1 from canciones where Name=? limit 1",(url,))
return c.fetchone() is not None
def el... | diegogran94/Jukebox-telegram-bot | funciones_sqlite.py | Python | gpl-2.0 | 1,810 |
#
# Dummy class from the original queryengine built into LxDaemon.
# The functionality in the hierarchy_adapter client is a subset of this.
#
#
class QueryEngine:
"""
Class that provides methods to access an object tree like those used in the hierarchy views.
The access methods are named slightly similar to... | efocht/aggmon | src/qe/queryengine/queryengine.py | Python | gpl-2.0 | 15,068 |
#coding=utf-8
from bangumi import * | ariwaranosai/twitter_bot | twitter_bot/bangumi/__init__.py | Python | gpl-2.0 | 36 |
__author__ = 'pslii'
__all__ = ["datareader"]
from .mdot import mdot, find_index, mdot_disk, mdot_through_surface, r_mag
| pslii/cylmri | compute/__init__.py | Python | gpl-2.0 | 122 |
"""
vision/camera.py
Camera object which you can open and close.
"""
import SimpleCV
import numpy as np
#wrapper class for SimpleCV.Camera/cv2.VideoCapture
class Camera:
isStreaming = False
camera = None
def __init__(self, ip=None):
if ip == None:
self.camera = SimpleCV.Camera(0)
... | CallanIwan/Aranha | commandcenter/vision/camera.py | Python | gpl-2.0 | 1,320 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015 CERN.
#
# Invenio 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... | SamiHiltunen/invenio-workflows | invenio_workflows/manage.py | Python | gpl-2.0 | 2,776 |
# From Lorenzo Bolla about GIL
# https://lbolla.info/blog/2013/12/23/python-threads-cython-gil
from multiprocessing import Process
def busy_sleep(n):
while n > 0:
n -= 1
N = 99999999
t1 = Process(target=busy_sleep, args=(N, ))
t2 = Process(target=busy_sleep, args=(N, ))
t1.start()
t2.start()
t1.join()
... | Moggi/python-playground | busy_process.py | Python | gpl-2.0 | 330 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:mod:`dancing_links`
==================
.. module:: dancing_links
:platform: Unix, Windows
:synopsis: An implementation of Donald Knuth's Dancing Links in Python.
Created on 2015-10-19, 22:53
"""
from __future__ import division
from __future__ import print_f... | hbldh/dlxsudoku | dlxsudoku/dancing_links.py | Python | gpl-2.0 | 3,606 |
# -*- coding: utf-8 -*-
#
# This file is part of EventGhost.
# Copyright © 2005-2019 EventGhost Project <http://www.eventghost.org/>
#
# EventGhost 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... | topic2k/EventGhost | eg/Classes/RawReceiverPlugin.py | Python | gpl-2.0 | 2,173 |
# -*- coding: utf-8 -*-
"""
times_and_dates.py - Advanced Topics 5 - Time and Dates in Python
"""
import time
import datetime
"""
At its core, all times in Python are determined by the number of seconds since what is
called the UNIX epoch, which started arbitrarily at Jan 1, 1970. We gotta start somewh... | SunPowered/python-workshop-2015 | code/session2/times_and_dates.py | Python | gpl-2.0 | 2,857 |
# Copyright (C) 2006 G Ramon Gomez <gene at gomezbrothers dot com>
# Copyright (C) 2009-2016 CS-SI <support.prelude@c-s.fr>
#
# This file is part of the Prelude-Correlator program.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publishe... | agil3b3ast/CNITCorrelator | rules/BruteForcePlugin.py | Python | gpl-2.0 | 3,258 |
#!/usr/bin/env python
# This script uploads a plugin package on the server
#
# Author: A. Pasotti, V. Picavet
import xmlrpc.client
import sys
import os
import getpass
from optparse import OptionParser
# Configuration
PROTOCOL='http'
SERVER='plugins.qgis.org'
PORT='80'
ENDPOINT='/plugins/RPC2/'
VERBOSE=False
def main... | qgiscloud/qgis-cloud-plugin | qgiscloud/plugin_upload.py | Python | gpl-2.0 | 3,181 |
# Copyright (c) 2017 Charles University in Prague, Faculty of Arts,
# Institute of the Czech National Corpus
# Copyright (c) 2017 Tomas Machalek <tomas.machalek@gmail.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
#... | czcorpus/kontext | lib/plugins/abstract/chart_export.py | Python | gpl-2.0 | 3,222 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#~ The Wave - Small game where the goal is to survive a catastrophy and help others along the way
#~ Copyright (C) 2011 h4xxel, niz3, Cygnus4
#~ This program is free software; you can redistribute it and/or
#~ modify it under the terms of the GNU General Public License
#... | h4xxel/the_wave | the_wave.py | Python | gpl-2.0 | 19,923 |
from openerp.osv import fields,osv
class res_partner(osv.osv):
_name = 'res.partner'
_inherit = 'res.partner'
_columns = {
'local_name': fields.char('Local Name', size=128, required=False),
'attributes': fields.one2many('res.partner.attributes', 'partner_id', 'Attributes'),
'addres... | 3dfxsoftware/cbss-addons | bahmni_atom_feed/res_partner.py | Python | gpl-2.0 | 1,501 |
# -*- coding: utf-8 -*-
"""
plugins/milestones.py - Table of accomplished milestones.
Copyright (C) 2009 Petr Morávek
This file is part of Pyggs.
Pyggs 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... | xificurk/pyggs | plugins/milestones.py | Python | gpl-2.0 | 2,889 |
from Globals import YES, NO
from base import DataManager
class Format(DataManager):
def __init__(self):
DataManager.__init__(self, 'format',
{'format_code': {'key_field': YES, 'data_type': 'string', 'nullable': NO, 'i18n': NO, 'foreign_key': '', 'attribute': 'code'},
'... | tLDP/lampadas | pylib/datamanager/format.py | Python | gpl-2.0 | 1,011 |
from libbgg.apibase import BGGBase
from libbgg.errors import InvalidInputError, APICallError
from datetime import date
class BGG(BGGBase):
"""
For version 2 of the api, you simply instantiate the object and call
the appropriate method. "things" and "family items" are handled
dynamically and are not co... | crustymonkey/py-bgg | libbgg/apiv2.py | Python | gpl-2.0 | 12,752 |
# -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Scientific Package. This package holds all simulators, and
# analysers necessary to run brain-simulations. You can use it stand alone or
# in conjunction with TheVirtualBrain-Framework Package. See content of the
# documentation-folder for more details. See also http://ww... | stuart-knock/tvb-library | tvb/datatypes/spectral.py | Python | gpl-2.0 | 17,975 |
# -*- coding: utf-8 -*-
# Copyright (C) 2009 Stewart Adam
# This file is part of fwbackups.
# fwbackups 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 opt... | stewartadam/fwbackups | src/fwbackups/engines/rsync.py | Python | gpl-2.0 | 846 |
# #
# Copyright 2013-2021 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 (... | hpcuantwerpen/easybuild-framework | test/framework/options.py | Python | gpl-2.0 | 302,604 |
import os
import scratchlivedb
datadir = os.path.join(os.path.dirname(__file__), "data")
testcratefile = os.path.join(datadir, "test.crate")
emptydb = os.path.join(datadir, "empty.db")
def test_crateNoChange():
"""
Parse and resave the crate, make sure it doesn't change
"""
db = scratchlivedb.Scrat... | crobinso/scratchlivedb | tests/test_crate.py | Python | gpl-2.0 | 413 |
import numpy as np
import numpy.random as rng
import pylab as pl
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.mlab as mp
from matplotlib.patches import Ellipse
import copy, sys
import math
import optparse
import scipy.signal
import scipy.special.basic as sp
import scipy.optimize as sop
im... | garibaldu/radioblobs | code/code_2d/score_DirMult_2d.py | Python | gpl-2.0 | 19,713 |
from enigma import ePicLoad, eTimer, getDesktop
from Screens.Screen import Screen
from Tools.Directories import resolveFilename, pathExists, fileExists, SCOPE_MEDIA
from Plugins.Plugin import PluginDescriptor
from Components.Pixmap import Pixmap, MovingPixmap
from Components.ActionMap import ActionMap, NumberActionMa... | libo/Enigma2 | lib/python/Plugins/Extensions/PicturePlayer/plugin.py | Python | gpl-2.0 | 22,612 |
# "ChimeraExtension.py" derives a class from 'chimera.extension.EMO'
# to define how functionality defined in "__init__.py" may be invoked
# by the Chimera extension manager.
#
# .. "ChimeraExtension.py" ToolbarButtonExtension/ChimeraExtension.py
# .. "__init__.py" ToolbarButtonExtension/__init__.py
imp... | platinhom/ManualHom | Visualization/Chimera/1.10/helpdir/ProgrammersGuide/Examples/ToolbarButtonExtension/ChimeraExtension.py | Python | gpl-2.0 | 1,860 |
import sys
import os
import shlex
import subprocess
import check_for_programs
from conf import DI
from conf import relcut
from conf import abscut
from conf import abscutint
from conf import usecython
from conf import smallest_cluster
from conf import cluster_prop
from conf import py
import emoticons
from clint.textui i... | FePhyFoFum/PyPHLAWD | src/find_good_clusters_for_concat_wc.py | Python | gpl-2.0 | 9,156 |
# This file is part of kernelconfig.
# -*- coding: utf-8 -*-
from . import lookup
__all__ = []
if __name__ == "__main__":
# $ python -m kernelconfig.kernel.hwdetection.modalias <modalias> ...
#
# or
#
# $ find /sys -name modalias | \
# xargs python -m kernelconfig.kernel.hwdetection.mod... | dywisor/kernelconfig | kernelconfig/kernel/hwdetection/modalias/__main__.py | Python | gpl-2.0 | 1,583 |
import csv
from collections import Counter
from heapq import nlargest
import operator
def dna2rna(dna):
Dna2RnaMap = {'A':'A', 'T':'U', 'G':'G','C':'C'}
rna = "".join([Dna2RnaMap[nucleotide] for nucleotide in dna])
return rna
def reverseComplement(dna):
complementMap = {'A':'T', 'T':'A', 'G':'C','C':... | alorchhota/bioinformatics-algorithms-1 | week2/code/SeqUtil.py | Python | gpl-2.0 | 7,564 |
"""Generic correctness tests applicable to all routing algorithms."""
import pytest
from collections import deque
from rig.place_and_route.machine import Machine, Cores
from rig.links import Links
from rig.netlist import Net
from rig.place_and_route.routing_tree import RoutingTree
from rig.place_and_route.constr... | project-rig/rig | tests/place_and_route/route/test_generic_route.py | Python | gpl-2.0 | 12,102 |
# -*- coding:utf-8 -*-
'''
**Python Module for Nonlinear Structural Analysis
'''
from nsapy import Domain,Analysis,NodeResult
from nsapy.Material import Material1D
from nsapy import Section,Element
import numpy as np
from pylab import *
from numba import autojit
def main():
truss = Domain(2,2,'test04')
trus... | nsapy/nsapy | test/test04.py | Python | gpl-2.0 | 1,429 |
__doc__ = """Disk directives"""
from boristool.common import directive, log, utils
class DISK(directive.Directive):
"""DISK provides access to data & stats for disk devices.
It requires the 'DiskStatistics' class from the 'diskdevice' data-collection module.
Example:
# /dev/disk0
DISK ... | hexdump42/boris-tool | boris/boristool/common/directives/disk.py | Python | gpl-2.0 | 2,007 |
"""
Copyright 2014, Roberto Paleari (@rpaleari)
"""
import ctypes
import os
WINSYSCALL_FUNC = None
LIBRARY_PATH = "c:\\temp\\winsyscall.dll"
def execute_syscall(num, *params):
global WINSYSCALL_FUNC, LIBRARY_PATH
if WINSYSCALL_FUNC is None:
assert os.path.isfile(LIBRARY_PATH)
WINSYSCALL_FUNC... | rpaleari/qtrace | tools/runtime/winsyscall.py | Python | gpl-2.0 | 462 |
import unittest
from ecomaps.lib.date_util import comptime
class TestDateUtil(unittest.TestCase):
"""
Tests for the comptime formatting methods
"""
# Tests for comptime.__format__
def test_001_comptime___format___year_range(self):
t = comptime(2011, 6, 17, 13, 14, 15)
f = '{0:Y:-10... | NERC-CEH/ecomaps | ecomaps/tests/test_date_util.py | Python | gpl-2.0 | 5,638 |
"""
Django settings for tweetbed 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/
"""
import tweepy
from django.conf.global_settings import TEMPLATE_CONTEXT_PRO... | ajweb/tweet-bed | settings.py | Python | gpl-2.0 | 3,448 |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for the python dataprovider.
From build dir, run: ctest -R PyQgsPythonProvider -V
.. note:: 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 ... | ghtmtt/QGIS | tests/src/python/test_provider_python.py | Python | gpl-2.0 | 17,468 |
from multiprocessing import Pool
num_of_cores = 4
def par_filter(func, candidates):
p = Pool(min(num_of_cores, len(candidates)))
return [c for c, keep in zip(candidates, p.map(func, candidates)) if keep]
| sammyrulez/thinking-functional-python | commons/parallel.py | Python | gpl-2.0 | 215 |
#!/usr/bin/python2
import actions.common as common
def main():
common.clean_work_dirs()
| pguth/Customizer | src/actions/clean.py | Python | gpl-2.0 | 94 |
def oddsum(num1, num2):
sumo = 0
for i in range(num1, num2):
if i % 2 != 0:
sumo += i
return sumo
#Test
print oddsum(100, 200) | adelq/rosalind | INI4.py | Python | gpl-2.0 | 135 |
@!#/\ This does'nt look like python code
| mathgl67/pymmr | tests/data/plugins/bad/not_python.py | Python | gpl-2.0 | 41 |
# (c) 2013,2014 jw@suse.de
# (c) 2016 juewei@fabmail.org
# (c) 2016 Alexander Wenger
# (c) 2017 Johann Gail
#
# Distribute under GPLv2 or ask.
#
# Driver for a Graphtec Silhouette Cameo plotter.
# modeled after https://github.com/nosliwneb/robocut.git
# https://github.com/pmonta/gerber2graphtec/blob/master/file2graphte... | fablabnbg/inkscape-silhouette | silhouette/Graphtec.py | Python | gpl-2.0 | 54,682 |
#!/usr/bin/python3
# @begin:license
#
# Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.de>
#
# 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 y... | odahoda/noisicaa | noisicaa/ui/svg_symbol_filetest.py | Python | gpl-2.0 | 2,084 |
#
# processor.py
#
# Copyright (C) 2011, 2013, 2015 Uli Fouquet
# 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... | ulif/ulif.openoffice | src/ulif/openoffice/processor.py | Python | gpl-2.0 | 19,517 |
#!/usr/bin/python
import socket
import sys
import time
import binascii
import string
import re
import math
import time
import json
import os
import ConfigParser
from VMC import VMC
config = ConfigParser.RawConfigParser()
config.read('/etc/VMC/VMC.ini')
# Create a TCP/IP socket
sock = socket.socket(socket.AF_INET,... | jcoenencom/raspVMC | setspeed.py | Python | gpl-2.0 | 871 |
from __future__ import division
import math
from util import *
from collections import defaultdict
# -----------------------------------------------------------------------------------------------
class MyNet:
def __init__(self, filename=None, create=False):
self.filename = filename
if self.filena... | cheza/ActivityDynamics | data_preparation/s03_generate_weighted_network.py | Python | gpl-2.0 | 11,950 |
# Portions Copyright (c) Facebook, Inc. and its affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
# verify.py - repository integrity checking for Mercurial
#
# Copyright 2006, 2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used... | facebookexperimental/eden | eden/hg-server/edenscm/mercurial/verify.py | Python | gpl-2.0 | 22,724 |
import Base
import VS
import dynamic_mission
import gettext
def MakeGas (time_of_day='_day'):
plist=VS.musicAddList('agricultural.m3u')
VS.musicPlayList(plist)
dynamic_mission.CreateMissions()
room1 = Base.Room ('Landing Pad')
Base.Texture (room1, 'tex', 'bases/gas/landing.spr', 0, 0)
Base.Shi... | costalfy/Vega-Strike | data/bases/gas_lib.py | Python | gpl-2.0 | 729 |
# -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2012 Michael Stead <michael.stead@gmail.com> #
# Copyright 2012 Vincent Jacques <vincent@vincent-ja... | Vagab0nd/SiCKRAGE | lib3/github/PullRequest.py | Python | gpl-3.0 | 42,809 |
class InitiativesExtractor:
def extract(self):
pass
| CIECODE-Madrid/tipi-engine | extractors/andorra/initiatives.py | Python | gpl-3.0 | 64 |
#!/bin/env python
# -*- coding: ascii -*-
# file: k_encoding_charsets - automatically generated!!!
encoding2python_map = { '037': 'cp037',
'1026': 'cp1026',
'1140': 'cp1140',
'1250': 'cp1250',
'1251': 'cp1251',
'1252': 'cp1252',
'1253': 'cp1253',
'1254': 'cp1254',
'1255': 'cp1255',
... | jhjguxin/PyCDC | Karrigell-2.3.5/k_encodings/k_encoding_charsets.py | Python | gpl-3.0 | 13,209 |
mcinif='mcini_weihera'
runname='gen_test3211i'
mcpick='gen_test3a.pickle'
pathdir='/beegfs/work/ka_oj4748/echoRD'
wdir='/beegfs/work/ka_oj4748/gen_tests'
update_prec=0.04
update_mf='False'
update_part=100
import sys
sys.path.append(pathdir)
import run_echoRD as rE
rE.echoRD_job(mcinif=mcinif,mcpick=mcpick,runname=run... | cojacoo/testcases_echoRD | gen_test3211i.py | Python | gpl-3.0 | 435 |
# coding: utf-8
# Copyright © 2016 Bharadwaj Raju <bharadwaj.raju@keemail.me>
# Contributor: Maksudur Rahman Maateen <ugcoderbd@gmail.com>
# This file is part of TextSuggest.
# TextSuggest is free software.
# Licensed under the GNU General Public License 3
# See included LICENSE file or visit https://www.gnu.org/lic... | maateen/TextSuggestBangla | fonts.py | Python | gpl-3.0 | 1,045 |
#! /usr/bin/env python
# ==========================================================================
# Generate pulsar phase bins
#
# Copyright (C) 2022 Juergen Knoedlseder
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... | ctools/ctools | modules/comscripts/compulbin.py | Python | gpl-3.0 | 16,466 |
#!/usr/bin/env python
from rtslib_fb import root
from rtslib_fb.utils import RTSLibError
__author__ = 'Paul Cuzner, Michael Christie'
class LIO(object):
def __init__(self):
self.lio_root = root.RTSRoot()
self.error = False
self.error_msg = ''
self.changed = False
def ceph_s... | pcuzner/ceph-iscsi-config | ceph_iscsi_config/lio.py | Python | gpl-3.0 | 1,863 |
from random import randint
nr = randint(0, 5)
ad = int(input('Adivinhe qual número eu estou pensando (digite um número de 0 a 5): '))
if ad == nr:
print('Parabéns, você acertou! Eu estava pensando no número {}.'.format(nr))
else:
print('Você errou! Eu estava pensando no número {}.'.format(nr)) | 7agner/Python3-Curso-em-Video | Mundo 01 Fundamentos/Aulas e Desafios/Aula 10/Desafio 028.py | Python | gpl-3.0 | 309 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from ..base import WsDjangoTestCase
class BaseWebSightSerializerTestCase(WsDjangoTestCase):
"""
This is a base test case class for all test cases that test a serializer class.
"""
def get_populated_serializer(self, access_is_valid=True, ... | lavalamp-/ws-backend-community | tests/rest_tests/serializers_tests/base.py | Python | gpl-3.0 | 1,545 |
#/usr/bin/python
# -*- coding: utf-8 -*-
import json
import sys
'''
获取文件并将文件的内容读取出来,按照csv的格式输出
一次性读取一天的数据,每天12点半开始读取,生成
eg:
{'resultcode': '200', 'reason': 'SUCCESSED!', 'result':
[{'1': {'variety': '美元账户黄金', 'midpri': '1328.44', 'buypri': '1327.54', 'sellpri': '1329.34', 'maxpri': '1328.44', 'minpri': '1326.00', 'toda... | zctyhj/hj | shell/json2del.py | Python | gpl-3.0 | 5,105 |
#!/usr/bin/env python2
from os import geteuid, devnull
import logging
# shut up scapy
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *
conf.verb=0
from sys import exit
import binascii
import struct
import argparse
import signal
import base64
from urllib import unquote
from subprocess ... | magnumripper/net-creds | net-creds.py | Python | gpl-3.0 | 36,192 |
#! /usr/bin/python3
# encoding: utf-8
import subprocess
import sys
import entities.mongops
#entities.mongops.borrarindicesevitardups()
#entities.mongops.borrardb()
import pymodm
# from pymongo import MongoClient
# MongoClient().drop_database('misture_mbbd')
#pymodm.connect('mongodb://localhost:27017/misture_mbbd')
f... | carlos-gs/MiStuRe | misture_core/MISTURE/analyx/FuentesAnaly.py | Python | gpl-3.0 | 9,434 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import time
import json, string, math, socket, select
from struct import *
from PyQt5.QtCore import QThread, QObject, pyqtSignal, pyqtSlot
from fsEncoder import *
XPVER = "1.0"
UDP_PORT = 49003
UDP_SENDTO_PORT = 49000
UDP_SENDTO_IP = "192.168.1.10"
'''
class fsWorker(QObje... | neksysinfo/fspanel | fsSocket.py | Python | gpl-3.0 | 16,453 |
"""
Tools for process geographic data on PostGIS
"""
import os
import psycopg2
from gasp.pgsql import connection
from gasp.pgsql.fields import get_columns_name
def re_project(lnk, in_tbl, fld_geom, outEpsg, out_tbl,
newgeom_fld=None, new_pk=None, colsSelect=None,
whr=None):
... | JoaquimPatriarca/senpy-for-gis | gasp/postgis/proj.py | Python | gpl-3.0 | 1,376 |