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 os
import glob
import time
import threading
import readMaxim
import subprocess
#import Adafruit_DHT
#import RPi.GPIO as pigpio
#import pigpio
#import DHT22
class TaskPrintHum(threading.Thread):
def __init__(self, taskid = 0, mData = readMaxim.MaximData()):
threading.Thread.__init__(self)
... | r0bin-fr/pirok | multithreadHum.py | Python | gpl-2.0 | 2,098 |
# #
# Copyright 2014-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 (... | pescobar/easybuild-framework | test/framework/easyconfigversion.py | Python | gpl-2.0 | 13,440 |
from key_mapping import *
from pdcresource import *
from pdcglobal import *
import pygame
class Item(object):
eq_tiles = None
dd_tiles = None
game = None
def __init__(self, add):
self.game.add_item(self, add)
self.cur_surf = None
self.eq_img = None
self.eq... | cycladesnz/chambersAndCreatures | src/item/item.py | Python | gpl-2.0 | 4,441 |
# coding: utf-8
#
# Copyright 2009 Prima Tech Informatica LTDA.
#
# Licensed under the Environ License, Version 1.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.cmspublica.com.br/licenses/ENVIRON-LICENSE-1.0
#
# Unless r... | intip/da-apps | applications/da_eventos/adm.py | Python | gpl-2.0 | 22,106 |
from fabric.api import *
import time
import re
import logging
import utils.log
l = logging.getLogger()
l = utils.log.CustomLogAdapter(l, None)
@task(default=True)
def check(input_params, cluster):
""" Check the uptime for a machine and compare it against a pre-defined value
input_params parameter i... | bdeak/taskmgr | fabfile/checks/uptime.py | Python | gpl-2.0 | 3,836 |
#
# Copyright 2009-2011 Red Hat, 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 Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed ... | openSUSE/vdsm | vdsm/storage/image.py | Python | gpl-2.0 | 55,653 |
## system-config-printer
## Copyright (C) 2008 Red Hat, Inc.
## Copyright (C) 2008 Tim Waugh <twaugh@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; either version 2 of the Lic... | poolooloo/emind-cloud-printer | setup.py | Python | gpl-2.0 | 1,083 |
from Credit import Credit
from fit.ColumnFixture import ColumnFixture
class CalculateCredit(ColumnFixture):
months = 0
reliable = False
balance = 0.0
credit = Credit()
def allow_credit(self):
return self.credit.allowsCredit(self.months, self.reliable, self.balance)
def credit_limit(se... | epronk/pyfit2 | examples/CalculateCredit.py | Python | gpl-2.0 | 406 |
from builder.btools import RegisterCustomTest
from builder.btools import AddConfigKey
from builder.bconfig import getAutoconfPrefix
from builder.bconfig import filterOut
from builder.bconfig import Version
def CheckAxtor(ctx, write_config_h=False, add_to_compiler_env=False,
min_version=None, max_version... | paeschli/scons-builder | modules/axtor_check.py | Python | gpl-2.0 | 2,706 |
# -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2004 Robert Kaye
# Copyright (C) 2006-2009, 2011-2014, 2017 Lukáš Lalinský
# Copyright (C) 2008 Gary van der Merwe
# Copyright (C) 2008 amckinle
# Copyright (C) 2008-2010, 2014-2015, 2018-2022 Philipp Wolfer
# Copyright (C) 200... | metabrainz/picard | picard/tagger.py | Python | gpl-2.0 | 41,007 |
from numba import cuda, float32
def make_loop(cfun, model, n_svar):
"Construct CUDA device function for integration loop."
@cuda.jit
def loop(n_step, W, X, G):
# TODO only for 1D grid/block dims
t = cuda.blockIdx.x * cuda.blockDim.x + cuda.threadIdx.x
ti = cuda.threadIdx.x
... | stuart-knock/tvb-library | tvb/simulator/_numba/loops.py | Python | gpl-2.0 | 636 |
from __future__ import unicode_literals
#from django.db import models
from abstract_component.models import Component
from exercises.models import GradedExercise
class Practicer(Component):
"""
Model for practicer component.
"""
BEHAVIORS_PATH = 'practice/practicer-behaviors/'
@classmethod
d... | effa/smartoo | practice/models.py | Python | gpl-2.0 | 1,593 |
class deferedrun(object):
"""
An object which may be returned from a run telling the taskqueue what the next
stage (runnable) is of the task and what requirements it has.
"""
def __init__(self, runnable, requirements):
self.runnable = runnable
self.requirements = requirements
class ... | topfs2/heimdall | src/heimdall/tasks.py | Python | gpl-2.0 | 1,865 |
'''
Created on 20.03.2014
@auUhor: Charun
'''
with open ("input.txt", "r") as textfile:
RNAseq = textfile.read()
pass
codons = {"UUU" : "F", "UUC" : "F", "UUA" : "L", "UUG" : "L", "CUU" : "L", "CUC" : "L", \
"CUA" : "L", "CUG" : "L", "AUU" : "I", "AUC" : "I", "AUA" : "I", "AUG" : "M", \
... | David-J-R/Rosalind-Solutions | src/bioinformatics_stronghold/prot/prot.py | Python | gpl-2.0 | 1,420 |
import pandas as pd
import numpy as np
from distance_matrix_generator import *
# Dataset albero distribuzioni linux
df_distro = pd.read_csv('./data/distro_parent.csv', skipinitialspace=True)
# Dataset distanze geografiche normalizzate [0,1]
df_geo = np.genfromtxt("./data/geo_distance_norm.csv", delimiter=",",dtype=str... | pigna90/ars-project | attributes_distance.py | Python | gpl-2.0 | 3,996 |
#!/usr/bin/python
"""
This is a unittest for kvm_qtree library.
@author: Lukas Doktor <ldoktor@redhat.com>
@copyright: 2012 Red Hat, Inc.
"""
__author__ = """Lukas Doktor (ldoktor@redhat.com)"""
import unittest
import sys
import os
import common
from autotest.client.shared.test_utils import mock
test_dir = os.path.ab... | ldoktor/virt-test | virttest/kvm_qtree_unittest.py | Python | gpl-2.0 | 10,535 |
import sys
from skimage.feature import hog
from skimage import exposure
from PIL import Image
import numpy
from tempfile import TemporaryFile
import random
PATCH_SIZE = (55, 55)
IMAGE_SIZE = (1024,1224)
POPULATION_M = 3000
POPULATION_U = 5000
CHANNELS = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
def extract_patch(ims, x, y):
... | saahil/MSSegmentation | utils/hog.py | Python | gpl-2.0 | 2,359 |
import sys
# Set default encoding to UTF-8
reload(sys)
# noinspection PyUnresolvedReferences
sys.setdefaultencoding('utf-8')
import time
import json
import httplib
import traceback
import click
from flask import Flask, request, render_template, url_for, redirect, g
from flask.ext.cache import Cache
from flask.ext.git... | doordash/realms-wiki | realms/__init__.py | Python | gpl-2.0 | 9,122 |
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 19 13:13:13 2015
@author: Acer
"""
import sys
# sys.path.append('C:\Users\Acer\Documents\GitHub\CD3Waterbalance\Modelcreator')
from Global_counters import Global_counters
from XML_Creator import XML_Creator
from To_XML_Creator_modified_Simulator import TheHoleLot
from Gl... | iut-ibk/DynaMind-ToolBox | DynaMind-Performance-Assessment/3rdparty/CD3Waterbalance/Modelcreator/Interface_cu.py | Python | gpl-2.0 | 15,389 |
__author__ = 'sjp1'
METRES_IN_A_MILE = 1609
SECONDS_IN_AN_HOUR = 3600
CONVERT_TO_KILO = 1e-3
CONVERT_TO_MEGA = 1e-6
mass = 13782 # kg
print('Mass: %i kg' % mass)
speed_in_mph = 350 # mph
print('Speed: %i mph' % speed_in_mph)
speed = speed_in_mph * METRES_IN_A_MILE / SECONDS_IN_AN_HOUR
print('Velocity: %.1f m/s' % spe... | JediStuart/PythonFirst | src/A10.py | Python | gpl-2.0 | 1,257 |
from func import logger
from func.utils import is_public_valid_method
class BaseFactModule(object):
"""
The base fact module which is clever
enough to register the facts it is kind
of FuncModule but registers modules with
different convention and style .. Look
into other modules to get the id... | makkalot/func | func/minion/facts/modules/fact_module.py | Python | gpl-2.0 | 2,557 |
import argparse
parser = argparse.ArgumentParser(description='Run simulation for nora w 3d layers')
parser.add_argument('t', metavar='threads', type=int,
default=1,
help='number of nest threads')
parser.add_argument('n', metavar='nn',
default=3000,
... | research-team/NEUCOGAR | NEST/cube/integration/excitement/simulation_params.py | Python | gpl-2.0 | 1,252 |
from flask import render_template
from . import auth
from .models import User
@auth.route('/')
def index():
users = User.query.all()
print('users:')
print(users)
return render_template('index.html')
| ZhangBohan/python_web_start_kit | app/user/views.py | Python | gpl-2.0 | 217 |
"""
Running small pieces of cobbler sync when certain actions are taken,
such that we don't need a time consuming sync when adding new
systems if nothing has changed for systems that have already
been created.
Copyright 2006-2009, Red Hat, Inc
Michael DeHaan <mdehaan@redhat.com>
This program is free software; you ca... | ssalevan/cobbler | cobbler/action_litesync.py | Python | gpl-2.0 | 6,275 |
#!/usr/bin/env python3
a = 1
while True:
if str(a**2).endswith(str(a)):
print(a)
a += 1
| Foggalong/scraps | files/maths/jack.py | Python | gpl-2.0 | 106 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# $Id: rasterio.py 32166 2015-12-13 19:29:52Z goatbar $
#
# Project: GDAL/OGR Test Suite
# Purpose: Test default implementation of GDALRasterBand::IRasterIO
# Author: Even Rouault <even dot ... | nextgis-extra/tests | lib_gdal/gcore/rasterio.py | Python | gpl-2.0 | 33,068 |
# This file is part of Merlin/Arthur.
# Merlin/Arthur is the Copyright (C)2009,2010 of Elliot Rosemarine.
# Individual portions may be copyright by individual contributors, and
# are included in this collective work with permission of the copyright
# owners.
# This program is free software; you can redistribute it an... | ellonweb/merlin | Arthur/views/alliance/alliances.py | Python | gpl-2.0 | 2,810 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2008-2011 Zuza Software Foundation
#
# This file is part of Virtaal.
#
# 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 ... | elric/virtaal-debian-snapshots | virtaal/controllers/undocontroller.py | Python | gpl-2.0 | 9,007 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
from __future__ import unicode_literals, division, absolute_import, print_function
from .compatibility_utils import text_type
from . import unipath
from .unipath import pathof
DUMP = False
""" Set to True to dump all poss... | robwebset/script.ebooks | resources/lib/kindleunpack/unpack_structure.py | Python | gpl-2.0 | 7,089 |
#
# Copyright 2015 Red Hat, 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 Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in th... | kvaps/vdsm | lib/vdsm/concurrent.py | Python | gpl-2.0 | 1,455 |
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the GNU Lesser General Public Lice... | looooo/FCGear | freecad/gears/__init__.py | Python | gpl-2.0 | 1,556 |
"""
TODO:
- Create my own ID system
- Transparent
- Status Cancelled
- source.url (url to paper) - impossible
"""
from __future__ import print_function
import requests
import pandas as pd
from bs4 import BeautifulSoup
import httplib2
import os
import sys
import time
from apiclient import discovery
from oauth2client.... | ma-schmidt/EconSeminars | econ_seminars.py | Python | gpl-2.0 | 6,548 |
#coding:utf-8
from redis import Redis as SyncRedis
from async_redis.redis_client import AsyncRedis
from async_redis.redis_encode import *
from py.common.convert import resolve_redis_url
class Redis(object):
def __init__(self, url, sync=True, host='localhost', port=6379, db=0, pwd=None):
"""
:par... | fuwenqing0988/hanfeng | py/common/redis/redis_client.py | Python | gpl-2.0 | 2,099 |
# improb is a Python module for working with imprecise probabilities
# Copyright (c) 2008-2011, Matthias Troffaes
#
# 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 Licens... | mcmtroffaes/improb | improb/decision/tree.py | Python | gpl-2.0 | 18,245 |
from enigma import getPrevAsciiCode
from Tools.NumericalTextInput import NumericalTextInput
from Tools.Directories import resolveFilename, SCOPE_CONFIG, fileExists
from Components.Harddisk import harddiskmanager
from copy import copy as copy_copy
from os import path as os_path
from time import localtime, strftime
# Co... | sodo13/openpli-gls | lib/python/Components/config.py | Python | gpl-2.0 | 49,107 |
#!/usr/bin/env python
import os,sys
import glob,re
import imaplib,email,getpass,argparse
import datetime,dateutil.parser,time
import email.header
script_name = os.path.splitext(__file__)[0]
parser = argparse.ArgumentParser(description='unsub-me.py')
parser.add_argument('-s', '--server', help='IMAP Server eg. imap.gma... | nsivyer/unsub-me | unsub-me.py | Python | gpl-2.0 | 3,791 |
import datetime
from django.db import models
from django.db.models import Q
from django import forms
from django.utils.translation import ugettext_lazy as _
from timezones.fields import TimeZoneField
from pyconde import south_rules
CONFERENCE_CACHE = {}
class Conference(models.Model):
"""
the full confer... | viswimmer1/PythonGenerator | data/python_files/31214140/models.py | Python | gpl-2.0 | 9,042 |
# -*- coding: utf-8 -*-
#
# Copyright 2017 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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... | unho/translate | translate/lang/pl.py | Python | gpl-2.0 | 1,153 |
# -*- coding: utf-8 -*-
#
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#
# PAWTRAIN
#
# Pet underground railroad
#
#
# Authors: Baron L. Chandler, baron@venturecranial.com
# -----------------------------------------------------------------------
# COPYRIGHT ©2014 Venture Cranial, LLC
#... | VentureCranial/PawTrain | app/web/admin.py | Python | gpl-2.0 | 2,237 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 ve... | pombredanne/invenio | modules/miscutil/lib/errorlib_webinterface.py | Python | gpl-2.0 | 4,487 |
##############################################
# File Name: module4.py
# Version: 1.0
# Team No.: 22
# Team Name:
# Date: 4 Nov 15
##############################################
import RPi.GPIO as GPIO
import time
print 'Press CTRL+C to exit the program'
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11, GPIO.OUT)
GPIO.setup(... | konini-school/pibot22 | module4.py | Python | gpl-2.0 | 1,123 |
#!/usr/bin/env python
"""
Extend elements of a table w/ given string to match the longest line of the table
Copyright:
smooth_table Extend elements of a table w/ given string to match the longest line of the table
Copyright (C) 2016 William Brazelton
This program is free software: you can redistribu... | Brazelton-Lab/lab_scripts | smooth_table.py | Python | gpl-2.0 | 3,141 |
# -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2008, 2018-2021 Philipp Wolfer
# Copyright (C) 2011, 2013 Michael Wiencek
# Copyright (C) 2013, 2018, 2020-2021 Laurent Monin
# Copyright (C) 2016-2017 Sambhav Kothari
# Copyright (C) 2018 Vishal Choudhary
#
# This program is f... | zas/picard | picard/ui/ratingwidget.py | Python | gpl-2.0 | 4,085 |
"""autogenerated by genpy from color_filter/Rect2D_.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class Rect2D_(genpy.Message):
_md5sum = "4425f1067abc7ec2e487d28194eccff4"
_type = "color_filter/Rect2D_"
_has_header = False #flag to mark the ... | grandcat/robotics_g7 | color_filter/src/color_filter/msg/_Rect2D_.py | Python | gpl-2.0 | 3,294 |
#!/bin/env python
#urls = [(httpsonly?,'http_host regex pattern', 'path_info regex pattern', 'module.classname', {
# 'request-method':(auth role),
# }),]
import re
from lib.test import Test
urls = [
(0, re.compile('.*', re.I), re.compile('^/test.*'), Test, {}),
]
path = {
'/test/':{'pattern':... | huanguan1978/web3 | web3/tmpl/url.py | Python | gpl-2.0 | 1,104 |
# -*- coding: utf-8 -*-
#
from rest_framework import permissions
class IsSwagger(permissions.BasePermission):
def has_permission(self, request, view):
return getattr(view, 'swagger_fake_view', False)
class IsApplicant(permissions.BasePermission):
def has_permission(self, request, view):
retu... | skyoo/jumpserver | apps/tickets/permissions/comment.py | Python | gpl-2.0 | 508 |
# import the main window object (mw) from ankiqt
from aqt import mw
# import the "show info" tool from utils.py
from aqt.utils import showInfo, tooltip, openFolder, isWin
# import all of the Qt GUI library
from aqt.qt import *
import aqt.editor, aqt.modelchooser, aqt.deckchooser
from anki.importing import TextImporter
... | roussePaul/Dictionary-addon-for-Anki | addonTest.py | Python | gpl-2.0 | 6,424 |
from Products.ATContentTypes.interface.news import IATNewsItem
class IInitiative(IATNewsItem):
"""
marker interface
"""
| uwosh/uwosh.initiatives | uwosh/initiatives/content/interfaces.py | Python | gpl-2.0 | 134 |
#
# Copyright (C) 2014-
# Sean Poyser (seanpoyser@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 published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# Thi... | EdLogan18/logan-repository | plugin.program.super.favourites/capture.py | Python | gpl-2.0 | 17,511 |
# pygsear
# Copyright (C) 2003 Lee Harr
#
#
# This file is part of pygsear.
#
# pygsear 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.... | davesteele/pygsear-debian | examples/twisted-pygame/pygame_server.py | Python | gpl-2.0 | 4,614 |
#!/usr/bin/python
# vim: set fileencoding=utf-8 :
"""Queries the databases for songs without albums recorded, and queries
Musicbrainz for the album. This is done as a separate process, as the
Musicbrainz API limits how fast you can grab data from it."""
from __future__ import print_function
import boto
import time
im... | alexjh/whatson | script-archive/whats_on_find_album.py | Python | gpl-2.0 | 5,876 |
# -*- coding: utf-8 -*-
import datetime
import fauxfactory
import pytest
from cfme.rest import dialog as _dialog
from cfme.rest import services as _services
from cfme.rest import service_catalogs as _service_catalogs
from cfme.rest import service_templates as _service_templates
from utils.providers import setup_a_prov... | lehinevych/cfme_tests | cfme/tests/services/test_rest_services.py | Python | gpl-2.0 | 10,705 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright (C) 2005, 2006 Francisco José Rodríguez Bogado, #
# (pacoqueen@users.sourceforge.net) #
# ... | pacoqueen/upy | framework/adapter.py | Python | gpl-2.0 | 19,257 |
from django.conf import settings
from django.conf.urls import include, url
from django.views.generic.base import RedirectView
from . import views
urlpatterns = [
#url(r'^$', views.study_list),
url (r'^$', views.patient_list),
url (r'^patient/new/$', views.view_patient, name ='new_patient'),
url (r'^pat... | NavarraBiomed/seguimientoPacientes | ictus/urls.py | Python | gpl-2.0 | 787 |
"""
Django settings for program_info project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ..... | huran2014/huran.github.io | program_learning/python/django/program_info/program_info/settings.py | Python | gpl-2.0 | 2,006 |
""" hmacHash.py
Implemention of Request for Comments: 2104
HMAC: Keyed-Hashing for Message Authentication
HMAC is a mechanism for message authentication
using cryptographic hash functions. HMAC can be used with any
iterative cryptographic hash function, e.g., MD5, SHA-1, in
combination with a... | repotvsupertuga/tvsupertuga.repository | script.module.cryptolib/lib/cryptopy/keyedHash/hmacHash.py | Python | gpl-2.0 | 3,597 |
#
# gPrime - A web-based genealogy program
#
# Copyright (C) 2011 Michiel D. Nauta
#
# 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 la... | sam-m888/gprime | gprime/lib/test/merge_test.py | Python | gpl-2.0 | 77,654 |
import abjad
metadata = abjad.OrderedDict([("title", "Blue Score"), ("year", 2017)])
| Abjad/ide | scores/blue_score/blue_score/__metadata__.py | Python | gpl-2.0 | 86 |
#!/usr/bin/env python
import os, sys
import glob, re
import subprocess as sp
class TestBase:
supported_lang = {
'C': { 'cc': 'gcc', 'flags': 'CFLAGS', 'ext': '.c' },
'C++': { 'cc': 'g++', 'flags': 'CXXFLAGS', 'ext': '.cpp' },
}
TEST_SUCCESS = 0
TEST_UNSUPP_LANG = -1
TEST_BUILD... | andrewjss/uftrace | tests/runtest.py | Python | gpl-2.0 | 19,539 |
# -*- coding: utf-8 -*-
# Copyright 2014-2021 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
"""Extractors for https://www.pixiv.net/"""
from .common import Extract... | mikf/gallery-dl | gallery_dl/extractor/pixiv.py | Python | gpl-2.0 | 28,123 |
import os
from ninja_utils.factory import Downloadable
from ninja_utils.utils import download_txt_url
from .. import SETTINGS
class SilvaMapping(Downloadable):
def __init__(self, _silva_taxdmp_urls=SETTINGS.settings['silva_taxdmp_urls'], _silva_taxdmp_dir=SETTINGS.settings['silva_taxdmp_dir']):
super().... | knights-lab/NINJA-DOJO | dojo/downloaders/download_silva2ncbi_taxonomy.py | Python | gpl-2.0 | 633 |
#!/usr/bin/python
# coding: utf-8
import os
import sys
import re
import csv
# Generate pdf file
def generate_pdf(filename, directory):
print " generating pdf certificate"
command = 'inkscape %s.svg --export-pdf=%s/%s.pdf' % (filename, directory, filename)
os.system(command)
print " removing svg ... | di3goleite/certificate-generator | g_certificates.py | Python | gpl-2.0 | 1,763 |
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
from __future__ import absolute_import
import errno
import os
import time
import traceback
from contextlib import contextmanager
from bindings impor... | facebookexperimental/eden | eden/scm/edenscm/hgext/remotefilelog/repack.py | Python | gpl-2.0 | 9,960 |
# coding=utf-8
from __future__ import division
from scipy.optimize.minpack import curve_fit
from scipy.ndimage.interpolation import zoom
import numpy as np
def fit2dArrayToFn(arr, fn, mask=None, down_scale_factor=None,
output_shape=None, guess=None,
outgrid=None):
"""Fit a 2... | radjkarl/fancyTools | fancytools/fit/fit2dArrayToFn.py | Python | gpl-3.0 | 2,493 |
# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.
# Copyright (C) NIWA & British Crown (Met Office) & Contributors.
#
# 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 Licen... | cylc/cylc | cylc/flow/install_plugins/log_vc_info.py | Python | gpl-3.0 | 10,110 |
from __future__ import division
#import sys
from random import choice, randint
import numpy as np
#from scipy import stats
#from scipy.stats import gaussian_kde
#from scipy.optimize import fsolve
import math
def distance(p0, p1):
""" take two (x, y) tuples as parameters
http://stackoverflow.com/questions/540... | LennonLab/ActiveSoil | Modeling/tools/spatial/spatial.py | Python | gpl-3.0 | 2,281 |
class Point:
"""Représente un point dans l'espace"""
def __init__(self, x, y, z):
"""Méthode d'initialisation d'un point dans l'espace"""
self.x, self.y, self.z = x, y, z
def distance(self, other=None):
"""Renvoi la distance par rapport à un autre point ou par défaut à l'origine"""... | UnderXirox/Python-3_Des-fichiers-complementaires | Guide/24_Classes/24__04__mutabilité.py | Python | gpl-3.0 | 1,881 |
from dinosaurus_lib.config import *
get_name_id=GetSequence()
get_ip_id=GetSequence()
class ResName(object):
record_type="XXX"
def __init__(self,name):
self.name=name
self.id=get_name_id()
self.res={}
def __hash__(self):
return hash(self.id)
def __str__(self):
... | chiara-paci/dinosaurus | dinosaurus_lib/resolutions.py | Python | gpl-3.0 | 4,987 |
# Copyright (C) 2009-2013 Roman Zimbelmann <hut@hut.pm>
# This software is distributed under the terms of the GNU GPL version 3.
# TODO: Add an optional "!" to all commands and set a flag if it's there
import os
import ranger
import re
from collections import deque
from ranger.api import *
from ranger.core.shared im... | mathstuf/ranger | ranger/api/commands.py | Python | gpl-3.0 | 13,965 |
# -*- coding: utf-8 -*-
# !/usr/bin/python
################################### PART0 DESCRIPTION #################################
# Filename: test_decorator.py
# Description:
#
# Author: Shuai Yuan
# E-mail: ysh329@sina.com
# Create: 2016-02-14 23:15:46
# Last:
__author__ = 'yuens'
#################################... | ysh329/learn-python-characteristic | decorator/test_decorator.py | Python | gpl-3.0 | 1,109 |
from math import log as _log
from sympify import _sympify
from cache import cacheit
from core import C
from singleton import S
from expr import Expr
from sympy.core.function import (_coeff_isneg, expand_complex,
expand_multinomial, expand_mul)
from sympy.core.logic import fuzzy_bool
from sympy.core.compatibility ... | lidavidm/mathics-heroku | venv/lib/python2.7/site-packages/sympy/core/power.py | Python | gpl-3.0 | 38,801 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('interfapp', '0005_auto_20170322_1104'),
]
operations = [
migrations.AddField(
model_name='owner',
na... | EmerJuny/djcasemg | interfmg/interfapp/migrations/0006_owner_role.py | Python | gpl-3.0 | 476 |
import datetime
import unittest
from sqlalchemy.exc import IntegrityError
from src.models.author import AuthorModel
from src import engine
from src.models import metadata, BookModel, TopicModel
class CreateBookTests(unittest.TestCase):
@classmethod
def setUpClass(cls):
metadata.create_all(engine)
... | pity7736/books_read | tests/models/test_create_book.py | Python | gpl-3.0 | 1,969 |
import serial
import byte_formatting
messages = ["RX Empty Flag",
"RX Full Flag",
"Reserved",
"TX Empty Flag",
"TX Full Flag",
"TX Reuse",
"Reserved",
"TX fifo Full",
"RX ready PipeNum",
"Maximal Retransmits rea... | JackTheEngineer/Drone | scripts/uart.py | Python | gpl-3.0 | 1,018 |
from random import randint
def quick_sort(input):
"""
Time: average - O(nlogn), worst - O(n^2)
:param input:
:return:
"""
if len(input) <=1:
return input
small, equal, large = [], [], []
pivot = input[randint(0, len(input) - 1)]
for item in input:
if item < pivot:
... | NeerajM999/recap-python | LearnPython/sorting/quick_sort.py | Python | gpl-3.0 | 2,178 |
"""CLI tests for Repository setup.
:Requirement: Repository
:CaseAutomation: Automated
:CaseLevel: Component
:CaseComponent: Repositories
:Assignee: chiggins
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
import pytest
from broker import VMBroker
from robottelo.cli.factory import make_lifecycle_... | lpramuk/robottelo | tests/foreman/cli/test_vm_install_products_package.py | Python | gpl-3.0 | 2,788 |
#!/usr/bin/env python
import sys
import paperwork.backend.config as config
import paperwork.backend.docsearch as docsearch
import paperwork.backend.util as util
def main():
pconfig = config.PaperworkConfig()
pconfig.read()
print("Opening docs (%s)" % pconfig.settings['workdir'].value)
print("=======... | mjourdan/paperwork | scripts/stats.py | Python | gpl-3.0 | 4,660 |
__author__ = 'kaef'
import defaults as cfg
from Clicker import Clicker
from ScreenCapture import ScreenCapture
def main():
import time
time.sleep(4)
c = Clicker()
c.set_blank_page_pos(cfg.blank_page_pos_x,cfg.blank_page_pos_y)
c.set_next_button_pos(cfg.next_button_pos_x,cfg.next_button_pos_y)
... | bkolada/ibuk_scraper | Tool/main.py | Python | gpl-3.0 | 717 |
#coding: utf8
from server import db
from sqlalchemy import DateTime
import datetime
import json
class serializableModel(db.Model):
__abstract__ = True
def as_dict(self, recursif=False):
if recursif :
return self.as_dict_withrelationships()
d = {}
for c in self.__table__... | PnCevennes/SaisieChasse | modules/utils/genericmodels.py | Python | gpl-3.0 | 906 |
#! /usr/bin/python
#
# Copyright (C) 2003-2021 ABINIT group
#
# Written by Gabriel Antonius in python (compatible v2.7).
# This is free software, and you are welcome to redistribute it
# under certain conditions (GNU General Public License,
# see ~abinit/COPYING or http://www.gnu.org/copyleft/gpl.txt).
... | abinit/abinit | scripts/post_processing/merge_ddb_nc.py | Python | gpl-3.0 | 4,948 |
# This file is part of RiakKit.
#
# RiakKit 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 version.
#
# RiakKit is distributed in the ho... | shuhaowu/riakkit | riakkit/__init__.py | Python | gpl-3.0 | 1,382 |
"""Test class for Remote Execution Management UI
@Requirement: Remoteexecution
@CaseAutomation: Automated
@CaseLevel: Acceptance
@CaseComponent: UI
@TestType: Functional
@CaseImportance: High
@Upstream: No
"""
from datetime import datetime, timedelta
from nailgun import entities
from robottelo.constants import O... | sthirugn/robottelo | tests/foreman/ui/test_remoteexecution.py | Python | gpl-3.0 | 20,834 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import sys
import os
from GLXCurses.Utils import clamp_to_zero
from GLXCurses.Utils import clamp
from GLXCurses.Utils import resize_text
from GLXCurses.Utils import glxc_type
from GLXCurses.Utils import new_id
from GLXCurses.Utils import is_valid_id
from GL... | Tuuux/galaxie-curses | test/test_Utils.py | Python | gpl-3.0 | 4,386 |
#! /usr/bin/env python
# TuxTruck Playlist
# Time-stamp: "2008-05-27 16:23:58 jantman"
# $Id: TuxTruck_Playlist.py,v 1.7 2008-05-27 20:23:34 jantman Exp $
#
# Copyright 2008 Jason Antman. Licensed under GNU GPLv3 or latest version (at author's discretion).
# Jason Antman - jason@jasonantman.com - http://www.jasonantman... | jantman/TuxTruck-wxPython | TuxTruck_Playlist.py | Python | gpl-3.0 | 7,587 |
########################################################################
# File : CREAMComputingElement.py
# Author : A.T.
########################################################################
""" CREAM Computing Element
"""
__RCSID__ = "$Id$"
import os
import re
import tempfile
import stat
from types import S... | vmendez/DIRAC | Resources/Computing/CREAMComputingElement.py | Python | gpl-3.0 | 14,828 |
# Copyright (C) 2010-2018 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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 v... | mkuron/espresso | src/python/espressomd/lbboundaries.py | Python | gpl-3.0 | 2,672 |
#!/usr/bin/env python
import matplotlib
matplotlib.use('Agg')
import pylab
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
import numpy
def rescale(arr):
min = 1e20
for x in arr:
if x < min:
min = x
for i in range(len(arr)):
arr[i] = (arr[i] - min) # / something
def flatten(arr):
for elem i... | afrachioni/umbrella | tools/plot_pmf.py | Python | gpl-3.0 | 1,619 |
import getopt, sys
import numpy as np
import cv2
import main
def testimg(sysargv):
#====================================================================
# filename of image to load is a command line argument
try:
import RandomJunkPolygonGenerator
for iii in range(14):
cv2.imshow(str(iii), RandomJunkPolygon... | UCSD-AUVSI/Heimdall | Recognition/OCR/PythonOCR/ConvolutionalNeuralNet/Python/test.py | Python | gpl-3.0 | 1,507 |
# 'append', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort'
class vector(list):
def __init__(self, *args):
result = []
for element in args:
result.append(element)
self.v = result
def get(self):
return self.v
def add(self, v2):
result = []
for i in range(len(self.v)):
... | dodonator/area51 | array/array.py | Python | gpl-3.0 | 582 |
# HTTM: A transformation library for RAW and Electron Flux TESS Images
# Copyright (C) 2016, 2017 John Doty and Matthew Wampler-Doty of Noqsi Aerospace, Ltd.
#
# 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 Softwar... | TESScience/httm | httm/system/command_line/__init__.py | Python | gpl-3.0 | 2,753 |
"""Manages hotkeys."""
from global_hotkeys import GlobalHotkeys as ghk
from data import Dir
import subprocess
import time
def terminal(wm):
subprocess.run("C:\\cygwin64\\bin\\mintty.exe")
time.sleep(.2)
wm.insert()
class HookManager():
"""
Defines and registers all hotkeys.
Attributes:
... | howardjohn/pyty | src/hook_manager.py | Python | gpl-3.0 | 2,062 |
#!/usr/bin/env python
from sys import exit, argv, stderr
from os import system
from numpy import squeeze, abs, diff
try:
from netCDF4 import Dataset as NC
except:
print "netCDF4 is not installed!"
sys.exit(1)
pism_path=argv[1]
mpiexec=argv[2]
stderr.write("Testing: temperature continuity at ice-bed inte... | talbrecht/pism_pik06 | test/regression/temp_continuity.py | Python | gpl-3.0 | 1,796 |
import datetime
from django.contrib.auth.models import User
from django.test import TestCase
# Create your tests here.
from django.utils import timezone
from pip.wheel import root_is_purelib
from gantt.models import Project, Task, Resource, Dependency, Assignment
def initModel():
u = User.objects.create_user("p... | MeMpy/Eriteam | gantt/tests.py | Python | gpl-3.0 | 4,307 |
from __future__ import unicode_literals
from django.db import models
class Isolate(models.Model):
isolate = models.CharField(max_length=128)
species = models.CharField(max_length=128)
scheme = models.CharField(max_length=128)
st = models.IntegerField(null=True)
reads = models.IntegerField()
... | MDU-PHL/kelpie | website/kelpie/models.py | Python | gpl-3.0 | 773 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright (C) 2008 Pâris Quentin
# 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 v... | PlayOnLinux/POL-POM-4 | python/install/InstallWindow.py | Python | gpl-3.0 | 24,437 |
from entity_reader import EntityReader
from dataset_importer.utils import HandleDatasetImportException
class TXTReader(EntityReader):
@staticmethod
def get_features(**kwargs):
directory = kwargs['directory']
for file_path in TXTReader.get_file_list(directory, 'txt'):
try:
features = TXTReader.get_met... | texta-tk/texta | dataset_importer/document_reader/readers/entity/txt_reader.py | Python | gpl-3.0 | 771 |
from app import app
from app.api import apiv10
from app.form import GetLinkForm
from app.models import Urls
from app.utils import number_of_generated_short_url
from app.utils import short_url_generator
from app.utils import url_checker
from flask import abort
from flask import flash
from flask import jsonify
from flask... | ugcoder/Py-URL-Shortener | app/views.py | Python | gpl-3.0 | 2,826 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import liblo, sys
# send all messages to port 1234 on the local machine
try:
target = liblo.Address(1234)
except liblo.AddressError, err:
sys.exit(err)
# send message "/foo/message1" with int, float and string arguments
liblo.send(target, "/media/next", 1)
| yomguy/tools | osc/osc_player_next.py | Python | gpl-3.0 | 314 |
# Copyright 2011 Pyela Project
#
# This file is part of Pyela.
#
# Pyela 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.
#
# Pyela is... | atc-/pyela | chat/gui/networking_error.py | Python | gpl-3.0 | 2,558 |
from . import GeneralBranch, Branch
from anaconda_updates.settings import GlobalSettings
class Rhel6Branch(GeneralBranch):
def __init__(self):
super().__init__(branch_type=Branch.rhel6,
cmd_args=["-rh6", "--rhel6"],
help="working on RHEL6",
... | jkonecny12/anaconda_updates | anaconda_updates/releases/rhel6.py | Python | gpl-3.0 | 556 |