code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
"""displays the root page"""
############################################################
#
# Copyright 2010, 2014 Mohammed El-Afifi
# This file is part of yabe.
#
# yabe is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# ... | MSK61/django-yabe | yabe/views.py | Python | gpl-3.0 | 1,382 |
import subprocess
import os
import dialog
class RDP():
def __init__(self):
self.d = dialog.Dialog(dialog="dialog")
self.storage_path = os.path.expanduser("~/LidskjalvData")
def show_rdp_menu(self, site, host):
# """ """
# FIXME
# print("FIXME: rdp_menu")
# sys... | berserkerbernhard/Lidskjalv | code/networkmonitor/modules/serviceutilities/rdp.py | Python | gpl-3.0 | 1,463 |
import magic
from pytag.structures import PytagDict
from pytag.constants import FIELD_NAMES
from pytag.formats import OggVorbisReader, OggVorbis, Mp3Reader, Mp3
MIMETYPE = {'application/ogg': (OggVorbisReader, OggVorbis),
'audio/mpeg': (Mp3Reader, Mp3)
}
class Tag:
"""Descriptor class.
... | jlesquembre/pytag | pytag/interface.py | Python | gpl-3.0 | 2,131 |
# -*- coding: utf-8 -*-
class GetText():
_file_path = None
_body_list = None
_target = None
def __init__(self, file_path):
#self._file_path = open(file_path, "r+").read().replace("<br","\n<br")
self._file_path = file_path.replace("<br />", "<br />\n")
#self._file_path = (se... | henriquesouza/toply | src/objects/GetText.py | Python | gpl-3.0 | 6,417 |
# -*- coding: utf-8 -*-
import random
import textwrap
def print_bold(msg):
#Funcion para mostrar por pantalla un string en negrita
print("\033[1m"+msg+"\033[0m")
def print_linea_punteada(width=72):
print('-'*width)
def ocupar_chozas():
ocupantes = ['enemigo','amigo','no ocupada']
chozas = []
... | tidus747/Tutoriales_juegos_Python | Ataca a los orcos V0.0.5/Ataca_a_los_orcos_V0.0.5.py | Python | gpl-3.0 | 4,736 |
'''
Open Source Initiative OSI - The MIT License:Licensing
Tue, 2006-10-31 04:56 nelson
The MIT License
Copyright (c) 2009 BK Precision
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without re... | sbobovyc/LabNotes | bk_precision_8500/profile_solarcell.py | Python | gpl-3.0 | 4,756 |
#!/usr/bin/env python
#simple smileys icon builder..
SMILEYS_INDEX=(
"""
# Default smileys
[default]
happy.png :) :-)
excited.png :-D :-d :D :d
sad.png :-( :(
wink.png ;-) ;)
tongue.png :P :p :-P :-p
shocked.png =-O =-... | mnunberg/yobot | py/gui/smiley.py | Python | gpl-3.0 | 18,464 |
import env
import numpy as np
import metaomr
import metaomr.kanungo as kan
from metaomr.page import Page
import glob
import pandas as pd
import itertools
import os.path
import sys
from datetime import datetime
from random import random, randint
IDEAL = [path for path in sorted(glob.glob('testset/modern/*.png'))
... | ringw/MetaOMR | metaomr_tests/eval_kanungo_est.py | Python | gpl-3.0 | 1,954 |
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | ingenieroariel/geonode | geonode/groups/tests.py | Python | gpl-3.0 | 22,844 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# CherryMusic documentation build configuration file, created by
# sphinx-quickstart on Fri Mar 1 23:32:37 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# ... | SDM-OS/playlist | doc/sphinx/conf.py | Python | gpl-3.0 | 9,469 |
# set S-JTSK axes orientation
import matplotlib
matplotlib.use('GTKAgg')
import matplotlib.pyplot as plt
ax=plt.gca()
#ax.set_ylim(ax.get_ylim()[::-1])
# direction of axes
ax.invert_xaxis()
ax.invert_yaxis()
# ticks position
for tick in ax.xaxis.get_major_ticks():
tick.label1On = False
tick.label2... | gizela/gizela | example/matplotlib/axis.py | Python | gpl-3.0 | 782 |
# coding=utf-8
#https://developers.google.com/drive/v3/web/quickstart/python
from __future__ import print_function
import httplib2
import os
import io
from apiclient import discovery
import oauth2client
from oauth2client import client
from oauth2client import tools
from apiclient.http import MediaIoBaseDownload
from ap... | aleixo/cnn_fire | googlemanager.py | Python | gpl-3.0 | 4,878 |
from math import *
inp = raw_input()
spl = inp.split()
n = int(spl[0])
m = int(spl[1])
a = int(spl[2])
i = int(ceil(n * 1.0 / a))
j = int(ceil(m * 1.0 / a))
print max(1, i * j) | yamstudio/Codeforces | 000/1A - Theatre Square.py | Python | gpl-3.0 | 177 |
import warnings
warnings.filterwarnings( "ignore", message = "The sre module is deprecated, please import re." )
from simplejson import JSONEncoder
from datetime import datetime, date
class Json( JSONEncoder ):
def __init__( self, *args, **kwargs ):
JSONEncoder.__init__( self )
if args and kwargs:
ra... | osborne6/luminotes | view/Json.py | Python | gpl-3.0 | 946 |
"""Plotting module for Sympy.
A plot is represented by the ``Plot`` class that contains a reference to the
backend and a list of the data series to be plotted. The data series are
instances of classes meant to simplify getting points and meshes from sympy
expressions. ``plot_backends`` is a dictionary with all the bac... | lidavidm/mathics-heroku | venv/lib/python2.7/site-packages/sympy/plotting/plot.py | Python | gpl-3.0 | 61,671 |
# -*- encoding: utf-8 -*-
"""Test class for :class:`robottelo.cli.hostgroup.HostGroup` CLI.
@Requirement: Hostgroup
@CaseAutomation: Automated
@CaseLevel: Acceptance
@CaseComponent: CLI
@TestType: Functional
@CaseImportance: High
@Upstream: No
"""
from fauxfactory import gen_string
from robottelo.cli.base impor... | sthirugn/robottelo | tests/foreman/cli/test_hostgroup.py | Python | gpl-3.0 | 16,401 |
from django.db.models.signals import post_save
from django.dispatch import receiver
from .models import Board, BoardPermissions, User, UserSettings
@receiver(post_save, sender=Board)
def init_board_permissions(sender, **kwargs):
"""Link existing benchmark countries to newly created countries."""
instance = k... | twschiller/open-synthesis | openach/signals.py | Python | gpl-3.0 | 681 |
import numpy as np
from ase import Hartree
from gpaw.aseinterface import GPAW
from gpaw.lcao.overlap import NewTwoCenterIntegrals
from gpaw.utilities import unpack
from gpaw.utilities.tools import tri2full, lowdin
from gpaw.lcao.tools import basis_subset2, get_bfi2
from gpaw.coulomb import get_vxc as get_ks_xc
from gp... | ajylee/gpaw-rtxs | gpaw/lcao/pwf2.py | Python | gpl-3.0 | 16,299 |
# -*- coding: utf-8 -*-
__params__ = {'la': 32, 'lb': 32, 'da': 10}
def protocol(client, server, params):
la = params['la']
lb = params['lb']
da = params["da"]
server.a = UnsignedVec(bitlen=la, dim=da).input(src=driver, desc="a")
server.b = Unsigned(bitlen=lb).input(src=driver, desc="b")
clie... | tastyproject/tasty | tasty/tests/functional/protocols/mul/unsignedvec_server_server_client/protocol.py | Python | gpl-3.0 | 442 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# res_core_data_mthd1.py
import unittest
import sys
import os
root_folder = os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + os.sep + ".." + os.sep + "aikif" )
sys.path.append(root_folder)
import core_data as mod_core
def get_method():
"""
returns a des... | acutesoftware/AIKIF | scripts/res_core_data_mthd1.py | Python | gpl-3.0 | 961 |
"""Fonctionnal testing for "Python In HTML" (PIH) and "HTML In Python" (HIP).
"""
__author__ = "Didier Wenzek (didier.wenzek@free.fr)"
# The code under test is in the .. directory.
import sys
sys.path.append('..')
# We use the Python unit testing framework
import unittest
import thread, time
from util import *
class... | jhjguxin/PyCDC | Karrigell-2.3.5/test/TemplateTest.py | Python | gpl-3.0 | 2,812 |
quantidade = int (input())
cidade = input()
qt_quartos = int (input())
if cidade.lower() == "pipa":
if qt_quartos == 2:
valor_total = (quantidade * 75)+ 600
valor_unitario = valor_total / quantidade
else:
valor_total = (quantidade * 75)+ 900
valor_unitario = valor_total / quanti... | SANDEISON/The-Huxley | Python/Viagem de Amigos.py | Python | gpl-3.0 | 615 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2015 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public Licens... | eustislab/horton | scripts/horton-esp-test.py | Python | gpl-3.0 | 3,917 |
from django.db import models
from django.conf import settings
from django.utils import timezone
from django.core.validators import MinValueValidator
from django.urls import reverse
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext as _
from .Committee import Committee
fro... | Compizfox/Inschrijflijst | app/models/Event.py | Python | gpl-3.0 | 3,577 |
clouthes = ["T-Shirt","Sweater"]
print("Hello, welcome to my shop\n")
while (True):
comment = input("Welcome to our shop, what do you want (C, R, U, D)? ")
if comment.upper()=="C":
new_item = input("Enter new item: ")
clouthes.append(new_item.capitalize())
elif comment.upper()=="R":
print(end='')
elif comment... | hanamvu/C4E11 | SS3/clothes_shop.py | Python | gpl-3.0 | 1,117 |
import unittest
from card_validation import (
numberToMatrix,
getOddDigits,
getEvenDigits,
sumOfDoubleOddPlace,
sumOfEvenPlace,
getDigit,
isValid
)
class CardValidationTest(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(CardValidationTest, self).__init__(*args, ... | dennyb87/pycity | week5/card_validation_test.py | Python | gpl-3.0 | 1,101 |
# ========================== Start Copyright Notice ========================== #
# #
# Copyright 2014 F.D.I.S. #
# This file is part of Kinetic Gunner: Gunner of Angst ... | CertainlyUncertain/Kinetic-Gunner-Gunner-of-Angst | inputMgr.py | Python | gpl-3.0 | 8,769 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class Channel(models.Model):
_inherit = 'slide.channel'
nbr_certification = fields.Integer("Number of Certifications", compute='_compute_slides_statistics', store=True)
class ... | t3dev/odoo | addons/website_slides_survey/models/slide_channel.py | Python | gpl-3.0 | 488 |
# 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 | scripts/Muon/GUI/Common/load_run_widget/load_run_model.py | Python | gpl-3.0 | 2,348 |
"""Tests for functions and classes in data/processing.py."""
import glob
import os
from absl.testing import absltest
import heatnet.data.processing as hdp
import heatnet.file_util as file_util
import heatnet.test.test_util as test_util
import numpy as np
import xarray as xr
class CDSPreprocessorTest(absltest.TestCas... | google-research/heatnet | test/test_processing.py | Python | gpl-3.0 | 9,568 |
from molpher.algorithms.functions import find_path
from molpher.core import ExplorationTree as ETree
class BasicPathfinder:
"""
:param settings: settings to use in the search
:type settings: `Settings`
A very basic pathfinder class that can be used to run exploration with
any combination of opera... | lich-uct/molpher-lib | src/python/molpher/algorithms/pathfinders.py | Python | gpl-3.0 | 1,908 |
import convis
import numpy as np
import matplotlib.pylab as plt
plt.figure()
plt.imshow(convis.numerical_filters.gauss_filter_2d(4.0,4.0))
plt.figure()
plt.plot(convis.numerical_filters.exponential_filter_1d(tau=0.01)) | jahuth/convis | docs/filters-1.py | Python | gpl-3.0 | 218 |
# -*- coding: utf-8 -*-
# (c) 2015 Tuomas Airaksinen
#
# This file is part of automate-wsgi.
#
# automate-wsgi 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 opt... | tuomas2/automate-wsgi | automate_wsgi/abstractwsgi.py | Python | gpl-3.0 | 4,163 |
from collections import namedtuple
from model.flyweight import Flyweight
from model.static.database import database
class ControlTowerResource(Flyweight):
def __init__(self,control_tower_type_id):
#prevents reinitializing
if "_inited" in self.__dict__:
return
self._inited = None... | Iconik/eve-suite | src/model/static/inv/control_tower_resources.py | Python | gpl-3.0 | 1,085 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2016-09-01 22:26:01
# @Author : Your Name (you@example.org)
# @Link : http://example.org
# @Version : $Id$
import os
import threading
import requests
import lxml
from threading import Thread
from bs4 import BeautifulSoup
import sys
reload(sys)
sys.setdef... | xycfree/py_spider | spider/down_pic_thread.py | Python | gpl-3.0 | 1,358 |
"""To install: sudo python setup.py install
"""
import os
from setuptools import setup, find_packages
def read(fname):
"""Utility function to read the README file."""
return open(os.path.join(os.path.dirname(__file__), fname)).read()
VERSION = __import__('lintswitch').__version__
setup(
name='lintswit... | grahamking/lintswitch | setup.py | Python | gpl-3.0 | 1,119 |
import graph
import dot
from core import *
import dataflow
def make_inst(g, addr, dest, op, *args):
def make_arg(a):
if a is None:
return None
if isinstance(a, int):
return VALUE(a)
if isinstance(a, str):
return REG(a)
return a
b = BBlock(add... | pfalcon/ScratchABlock | tests_unit/test_liveness.py | Python | gpl-3.0 | 2,105 |
from base.iterativeRecommender import IterativeRecommender
import numpy as np
from util import config
from collections import defaultdict
from math import log,exp
from scipy.sparse import *
from scipy import *
class CoFactor(IterativeRecommender):
def __init__(self, conf, trainingSet=None, testSet=None, fold='[1]'... | recq-cse/RecQ | model/ranking/CoFactor.py | Python | gpl-3.0 | 7,469 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Janice Cheng
import logging
from s13.Day5.conf import setting
logger = logging.getLogger('ATM-TRANSACTION-LOG')
logger.setLevel(logging.INFO) #configure a global logging level
console_handler = logging.StreamHandler() #print the log on the console
file_handl... | jcchoiling/learningPython | s13/Day05/modules/core/atm_log.py | Python | gpl-3.0 | 639 |
import numpy as np
from PyQt5.QtGui import QPainterPath, QPen
from PyQt5.QtWidgets import QGraphicsPathItem
from urh import settings
from urh.cythonext import path_creator
from urh.ui.painting.GridScene import GridScene
from urh.ui.painting.SceneManager import SceneManager
class FFTSceneManager(SceneManager):
de... | jopohl/urh | src/urh/ui/painting/FFTSceneManager.py | Python | gpl-3.0 | 1,960 |
# This file is part of OpenStack Ansible driver for Kostyor.
#
# 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 ... | ikalnytskyi/kostyor-openstack-ansible | kostyor_openstack_ansible/upgrades/ref.py | Python | gpl-3.0 | 6,099 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# **************************************************************************
# Copyright © 2016 jianglin
# File Name: forums.py
# Author: jianglin
# Email: xiyang0807@gmail.com
# Created: 2016-12-17 13:12:23 (CST)
# Last Update:星期五 2017-11-10 11:04:16 (CST)
# By:
#... | honmaple/maple-bbs | forums/admin/forums.py | Python | gpl-3.0 | 1,143 |
# -*- coding: utf-8 -*-
# __init__.py
# Copyright (C) 2015 LEAP
#
# 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.
#
# Th... | leapcode/soledad | src/leap/soledad/client/http_target/__init__.py | Python | gpl-3.0 | 3,365 |
(S'7f2210613c44962221805a1b28aa76d6'
p1
(ihappydoclib.parseinfo.moduleinfo
ModuleInfo
p2
(dp3
S'_namespaces'
p4
((dp5
S'TkDrawer'
p6
(ihappydoclib.parseinfo.classinfo
ClassInfo
p7
(dp8
g4
((dp9
(dp10
tp11
sS'_filename'
p12
S'../python/frowns/Depict/TkMoleculeDrawer.py'
p13
sS'_docstring'
p14
S''
sS'_class_member_info'
... | tuffery/Frog2 | frowns/Depict/.happydoc.TkMoleculeDrawer.py | Python | gpl-3.0 | 4,720 |
##
# Copyright 2015-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 (F... | eth-cscs/production | easybuild/easyblocks/craytoolchain.py | Python | gpl-3.0 | 3,472 |
# (c) 2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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 lat... | sean-/ansible | lib/ansible/utils/display.py | Python | gpl-3.0 | 6,949 |
'''
read the input data, parse to int list;
create mappings of (user,item) -> review int list
@author: roseck
@date Mar 15, 2017
'''
from __builtin__ import dict
import gzip
class DataPairMgr():
def _int_list(self,int_str):
'''utility fn for converting an int string to a list of int
'''
... | rosecatherinek/TransNets | src/DatasetUtils/DataPairMgr.py | Python | gpl-3.0 | 1,772 |
import os
DEBUG = True
TEMPLATE_DEBUG = True
# SETTINGS_DIR allows media paths and so to be relative to this settings file
# instead of hardcoded to c:\only\on\my\computer.
SETTINGS_DIR = os.path.dirname(os.path.realpath(__file__))
# BUILDOUT_DIR is for access to the "surrounding" buildout, for instance for
# BUILDO... | lizardsystem/lizard-security | lizard_security/testsettings.py | Python | gpl-3.0 | 3,481 |
import sys
import os
extensions = [
'sphinx.ext.todo',
]
source_suffix = '.txt'
master_doc = 'index'
### part to update ###################################
project = u'domogik-plugin-daikcode'
copyright = u'2014, Nico0084'
version = '0.1'
release = version
######################################################
... | Nico0084/domogik-plugin-daikcode | docs/conf.py | Python | gpl-3.0 | 430 |
# -*- coding: utf-8 -*-
import os
import re
import select
import socket
import struct
import time
from module.plugins.internal.Hoster import Hoster
from module.plugins.internal.misc import exists, fsjoin
class XDCC(Hoster):
__name__ = "XDCC"
__type__ = "hoster"
__version__ = "0.42"
__status__ ... | kaarl/pyload | module/plugins/hoster/XDCC.py | Python | gpl-3.0 | 7,856 |
my_name = 'Zed A. Shaw'
my_age = 35 # not a lie
my_height = 74 # Inches
my_weight = 180 # lbs
my_eyes = 'Blue'
my_teeth = 'White'
my_hair = 'Brown'
print "Let's talk about %s." % my_name
print "He's %d inches tall." % my_height
print "He's %d pounds heavy." % my_weight
print "Actually that's not too heavy"
print "He's... | rdthomson/set09103 | src/LPHW/ex5.py | Python | gpl-3.0 | 596 |
"""
Implementation of the trigsimp algorithm by Fu et al.
The idea behind the ``fu`` algorithm is to use a sequence of rules, applied
in what is heuristically known to be a smart order, to select a simpler
expression that is equivalent to the input.
There are transform rules in which a single rule is applied to the
e... | alephu5/Soundbyte | environment/lib/python3.3/site-packages/sympy/simplify/fu.py | Python | gpl-3.0 | 63,469 |
import logging
from unittest.mock import MagicMock, call
from ert_logging._log_util_abort import _log_util_abort
def test_log_util_abort(caplog, monkeypatch):
shutdown_mock = MagicMock()
monkeypatch.setattr(logging, "shutdown", shutdown_mock)
with caplog.at_level(logging.ERROR):
_log_util_abort("f... | joakim-hove/ert | tests/ert_tests/shared/test_log_abort.py | Python | gpl-3.0 | 626 |
# -*- coding: utf-8 -*-
"""Colour class.
This module contains a class implementing an RGB colour.
"""
__author__ = 'Florian Krause <florian@expyriment.org>, \
Oliver Lindemann <oliver@expyriment.org>'
__version__ = ''
__revision__ = ''
__date__ = ''
import colorsys
from . import round
# The named colours are th... | expyriment/expyriment | expyriment/misc/_colour.py | Python | gpl-3.0 | 15,022 |
# -*- encoding: utf-8 -*-
"""Test class for Smart/Puppet Variables
:Requirement: Smart_Variables
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: API
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
import json
from random import choice, uniform
import yaml
from fauxfactory import ... | ares/robottelo | tests/foreman/api/test_variables.py | Python | gpl-3.0 | 50,980 |
#!/usr/bin/env python
import os
from setuptools import setup
from distutils.cmd import Command
import django_auth_iam
def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
setup(
name='django-auth-iam',
version=django_auth_iam.__version__,
description='Django auth... | viewworld/django-auth-iam | setup.py | Python | gpl-3.0 | 1,017 |
""" Package for tesseract cube controllers. """
from .sim import SimulatedController
from .gpio import GPIOController
from .c_gpio import CffiGpioController
CUBES = [
SimulatedController,
GPIOController,
CffiGpioController,
]
| decoydavid/tesseract | ract/cubes/__init__.py | Python | gpl-3.0 | 241 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Region Fixer.
# Fix your region files with a backup copy of your Minecraft world.
# Copyright (C) 2020 Alejandro Aguilera (Fenixin)
# https://github.com/Fenixin/Minecraft-Region-Fixer
#
# This program is free software: you can redistribute it and/or modify
... | Fenixin/Minecraft-Region-Fixer | regionfixer_core/interactive.py | Python | gpl-3.0 | 24,997 |
from dotenv import load_dotenv
load_dotenv('./.env') | mbernson/iscp-search-engine | retrouve/__init__.py | Python | gpl-3.0 | 53 |
"""
Django settings for todo project.
Generated by 'django-admin startproject' using Django 1.9.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
# Bu... | jacoboamn87/todolist | todo/settings.py | Python | gpl-3.0 | 3,308 |
#!/usr/bin/python
'''
Study Common Emitter Characteristics of NPN transistors.
Saturation currents, and their dependence on base current
can be easily visualized.
'''
from __future__ import print_function
import time,sys,os
from SEEL_Apps.utilitiesClass import utilitiesClass
from .templates import ui_NFET as NFET
f... | jithinbp/SEELablet-apps | seel_res/GUI/B_ELECTRONICS/A_BJT_AND_FET/D_NFET_GS_ID.py | Python | gpl-3.0 | 3,753 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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,... | keen99/SickRage | sickbeard/dailysearcher.py | Python | gpl-3.0 | 4,533 |
import sys
class DualModulusPrescaler:
def __init__(self,p):
self.m_p = p
return
def set_prescaler(self):
return
# may be internal
def set_a(self,a):
self.m_a = a
return
# may be internal
def set_n(self,n):
self.m_n = n
return
def ... | johngumb/danphone | junkbox/dm.py | Python | gpl-3.0 | 1,692 |
import logging
import os
from lib import exception
from lib import repository
from lib.constants import REPOSITORIES_DIR
LOG = logging.getLogger(__name__)
def get_versions_repository(config):
"""
Get the packages metadata Git repository, cloning it if does not
yet exist.
Args:
config (dict... | olavph/builds | lib/versions_repository.py | Python | gpl-3.0 | 2,326 |
import uuid
from flask import g
# Utility method to get source_ip from a request - first checks headers for forwarded IP, then uses remote_addr if not
def get_source_ip(my_request):
try:
# First check for an X-Forwarded-For header provided by a proxy / router e.g. on Heroku
source_ip = my_request.... | open-ods/open-ods | openods/request_utils.py | Python | gpl-3.0 | 1,400 |
import os, re, shutil
for (base, _, files) in os.walk("essays",):
for f in files:
if f.endswith(".markdown"):
fp = os.path.join(base, f)
_, np = os.path.split(base)
np = re.sub(r"_def$", "", np)
np = os.path.join("essays", np+".markdown")
# print ... | DigitalPublishingToolkit/Society-of-the-Query-Reader | scripts/gather_essays.py | Python | gpl-3.0 | 470 |
# (c) 2014 James Cammarata, <jcammarata@ansible.com>
#
# This file is part of Ansible
#
# Ansible 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... | dr0pz0ne/sibble | lib/ansible/parsing/splitter.py | Python | gpl-3.0 | 10,657 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# async - A tool to manage and sync different machines
# Copyright 2012,2013 Abdó Roig-Maranges <abdo.roig@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
# th... | aroig/async | async/config.py | Python | gpl-3.0 | 12,584 |
# -*- coding: utf-8 -*-
# Copyright(C) 2010 Roger Philibert
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will... | jocelynj/weboob | weboob/backends/youjizz/pages/video.py | Python | gpl-3.0 | 2,211 |
"""Tests for Oscapcontent
:Requirement: Oscapcontent
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: UI
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
import unittest2
from fauxfactory import gen_string
from nailgun import entities
from robottelo.config import settings
from robo... | elyezer/robottelo | tests/foreman/ui/test_oscapcontent.py | Python | gpl-3.0 | 6,070 |
#!/usr/bin/env python
#
# Copyright 2012 <+YOU OR YOUR COMPANY+>.
#
# This 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, or (at your option)
# any later version.
#
# This software is dis... | zeza/gnuradio-rc-testcode | gr-flysky/python/qa_flysky_dumpsync.py | Python | gpl-3.0 | 1,124 |
from typing import Iterable, Mapping, Optional
from lib import data
from ..channel import pyramid
from ..channel import wall
def filterMessage() -> Iterable[data.ChatCommand]:
return []
def commands() -> Mapping[str, Optional[data.ChatCommand]]:
if not hasattr(commands, 'commands'):
setattr(comman... | MeGotsThis/BotGotsThis | pkg/spam/items/channel.py | Python | gpl-3.0 | 941 |
import sqlite3
import sys
"""<Mindpass is a intelligent password manager written in Python3
that checks your mailbox for logins and passwords that you do not remember.>
Copyright (C) <2016> <Cantaluppi Thibaut, Garchery Martial, Domain Alexandre, Boulmane Yassine>
This program is free software: you can r... | MindPass/Code | Interface_graphique/PyQt/application/classeGestion.py | Python | gpl-3.0 | 24,892 |
# scarf1{background-image: url('https://rollforfantasy.com/images/clothing/nmale/scarf1.png');}
scarf = ["scarf{}.png".format(i) for i in range(1, 31)]
| d2emon/generator-pack | src/fixtures/tools/outfit/scarf.py | Python | gpl-3.0 | 152 |
# coding=utf-8
from blueman.services.meta import SerialService
from blueman.Sdp import DIALUP_NET_SVCLASS_ID
class DialupNetwork(SerialService):
__group__ = 'serial'
__svclass_id__ = DIALUP_NET_SVCLASS_ID
__icon__ = "modem"
__priority__ = 50
| rworkman/blueman | blueman/services/DialupNetwork.py | Python | gpl-3.0 | 260 |
'''
Created on 30 de set de 2017
@author: fernando
'''
import unittest
from chapter1.solution_1_1 import has_all_unique_characters
from chapter1.solution_1_4 import are_anagrams
class Test(unittest.TestCase):
def testSolution1_1(self):
result = has_all_unique_characters("cafdgbc")
asse... | fernandojvdasilva/algorithm-studies | chapter1/test_chapter1_solutions.py | Python | gpl-3.0 | 852 |
import os
import sys
import signal
import time
import subprocess
WHO = None
def handler(signum, frame):
global WHO
print('Signal handler', signum, WHO, frame)
print('Disable handler', signum, WHO, frame)
signal.signal(signal.SIGINT, signal.SIG_DFL)
def main(argv):
global WHO
WHO = argv[1]
... | munhyunsu/Hobby | Signal/signal_propagation_shell.py | Python | gpl-3.0 | 819 |
import unittest
from pyrogi import Screen, Backend
from pyrogi.util import Vec2
class TestScreen(Screen):
pass
class TestBackend(unittest.TestCase):
def test_screens(self):
backend = Backend(Vec2(0, 0), Vec2(0, 0), '')
self.assertEqual(len(backend.screens), 0)
backend.set_screen(TestS... | BenWeedon/pyrogi | pyrogi/test_core.py | Python | gpl-3.0 | 739 |
# -*- coding: utf-8 -*-
#
# Copyright 2011 Liftoff Software Corporation
#
__doc__ = """\
playback.py - A plugin for Gate One that adds support for saving and playing
back session recordings.
.. note:: Yes this only contains one function and it is exposed to clients through a WebSocket hook.
Hooks
-----
This Py... | jimmy201602/django-gateone | applications/plugins/playback/playback.py | Python | gpl-3.0 | 3,927 |
# -*- coding: utf-8 -*-
# recurso de referencia: http://www.tutorialspoint.com/python/python_lists.htm
lista_de_asignaturas_teoricas = [ 'matematicas', 'lengua castellana']
# el la funcion len() es usado para obtener la cantidad de elementos en una lista
print "cantidad de elementos en la lista lista_de_asignaturas_... | pyladiesmedellin/lessons | lesson_4/2_6_lists_functions.py | Python | gpl-3.0 | 664 |
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 28 16:52:18 2016 by emin
"""
import os
import sys
import theano
import theano.tensor as T
import numpy as np
from lasagne.layers import InputLayer, ReshapeLayer, DenseLayer
from generators import KalmanFilteringTaskFFWD
import lasagne.layers
import lasagne.nonlinearities
i... | eminorhan/inevitable-probability | nin_nhu/ninnhu_kalman_filtering_expt.py | Python | gpl-3.0 | 5,329 |
"""
Module defining the Spline class, something easy to wrap around SciPy splines.
Includes BOK algorithms (Mollinari et al)
Some rules of splrep (k = 3)
- do not put more then 2 knots between data points.
- splrep wants inner knots only, do not give extremal knots, even only "once".
"""
import numpy as np
import ... | COSMOGRAIL/PyCS | pycs/gen/spl.py | Python | gpl-3.0 | 40,478 |
identity = {
# https://www.census.gov/prod/cen2010/briefs/c2010br-03.pdf
'sex': [('M',49.2),('F',50.8)],
# https://en.wikipedia.org/wiki/Race_and_ethnicity_in_the_United_States
'race': [('O',72.4),('U',12.6)]
}
iq = {
# Class: (mu, sigma)
# http://www.iqcomparisonsite.com/sexdifferences.aspx
... | tatwell/hiring-curve | config/distributions.py | Python | gpl-3.0 | 1,031 |
import traceback
from datetime import datetime
from itertools import count
import zmq
def serve(procs, port=None, addr='tcp://*', context=None, debug=False):
"""Make some procedures available for remote calls via ØMQ."""
if context is None:
context = zmq.Context.instance()
with context.socket(zm... | doctaphred/phredutils | zmqrpc.py | Python | gpl-3.0 | 1,764 |
# -*- coding: utf-8 -*-
# Maestro Music Manager - https://github.com/maestromusic/maestro
# Copyright (C) 2009-2015 Martin Altmayer, Michael Helmling
#
# 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 Foun... | maestromusic/maestro | maestro/gui/treeview.py | Python | gpl-3.0 | 9,172 |
# (c) Nelen & Schuurmans. GPL licensed, see LICENSE.rst.
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
import logging
import requests
logger = logging.getLogger(__name__)
def collect_filters(url):
"""Return filters from FEWS, cleaned and ready for storing... | lizardsystem/lizard-fewsapi | lizard_fewsapi/collect.py | Python | gpl-3.0 | 1,482 |
from .chucky_neighborhood_tool import NeighborhoodTool
| a0x77n/chucky-tools | src/chucky_tools/neighborhood/__init__.py | Python | gpl-3.0 | 55 |
# coding=utf-8
"""
a csv trace reader
Author: Jason Yang <peter.waynechina@gmail.com> 2016/06
"""
import string
from PyMimircache.const import ALLOW_C_MIMIRCACHE, INSTALL_PHASE
from PyMimircache.utils.printing import *
if ALLOW_C_MIMIRCACHE and not INSTALL_PHASE:
import PyMimircache.CMimircache.CacheRead... | 1a1a11a/mimircache | PyMimircache/cacheReader/csvReader.py | Python | gpl-3.0 | 8,745 |
from __future__ import unicode_literals
from frappe import _
app_name = "erpnext"
app_title = "ERPNext"
app_publisher = "Frappe Technologies Pvt. Ltd."
app_description = """ERP made simple"""
app_icon = "fa fa-th"
app_color = "#e74c3c"
app_email = "info@erpnext.com"
app_license = "GNU General Public License (v3)"
sour... | ESS-LLP/erpnext | erpnext/hooks.py | Python | gpl-3.0 | 28,711 |
import tkinter
tk = tkinter.Tk()
tk.title("Bounce")
tk.resizable(0, 0)
# Keep the window on the top
tk.wm_attributes("-topmost", 1)
canvas = tkinter.Canvas(tk, width=500, height=400)
# Remove border. Apparently no effect on Linux, but good on Mac
canvas.configure(bd=0)
# Make the 0 horizontal and vertical line appare... | amosnier/python_for_kids | course_code/13_039_animated_ball.py | Python | gpl-3.0 | 562 |
# -*- coding: utf-8 -*-
"""
Connection module
"""
from pyxmn.utils import support
# from psycopg2.pool import SimpleConnectionPool
import psycopg2.extras # load the psycopg extras module
class Pool():
"""
Connection Pool
"""
settings = None
connection = None
pool = None
@staticmethod
... | xmnlab/pyxmn | db/conn.py | Python | gpl-3.0 | 1,460 |
def progress(current, total, percent=10, iteration=None):
"""
Used in a loop to indicate progress
"""
current += 1
if current:
previous = current - 1
else:
previous = current
# print out every percent
frac = percent/100.
value = max(1, frac*total)
retur... | CDNoyes/EDL-Py | Utils/progress.py | Python | gpl-3.0 | 521 |
#!/usr/bin/env python3
# dirtool.py - diff tool for directories
# Copyright (C) 2018 Ingo Ruhnke <grumbel@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 3 of the Li... | Grumbel/dirtool | experiments/qnotify/qnotify.py | Python | gpl-3.0 | 1,673 |
import unittest
import pandas as pd
from pandas_schema import Column
from pandas_schema.validation import CanConvertValidation, LeadingWhitespaceValidation, TrailingWhitespaceValidation
class SingleValidationColumn(unittest.TestCase):
"""
Test a column with one single validation
"""
NAME = 'col1'
... | TMiguelT/PandasSchema | test/test_column.py | Python | gpl-3.0 | 2,051 |
#!/usr/bin/env python
# Copyright (c) 2010 SubDownloader Developers - See COPYING - GPLv3
import languages.autodetect_lang as autodetect_lang
import re
import os.path
import logging
log = logging.getLogger("subdownloader.languages.Languages")
import __builtin__
__builtin__._ = lambda x : x
LANGUAGES = [{'locale':'sq... | matachi/subdownloader | languages/Languages.py | Python | gpl-3.0 | 6,237 |
# -*- coding: utf-8 -*-
from patient_evaluation_report import *
| kret0s/gnuhealth-live | tryton/server/trytond-3.8.3/trytond/modules/health_history/report/__init__.py | Python | gpl-3.0 | 66 |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
# ------------------------------------------------------------
import re
from core import httptools
from core import logger
from core import scr... | r0balo/pelisalacarta | python/main-classic/channels/documentalesonline.py | Python | gpl-3.0 | 5,391 |
#!/usr/bin/python3
import sys, os, shutil
from os import path
from urllib.request import pathname2url
import subprocess
from subprocess import call
import sys
import re
import zipfile
import config
os.chdir(config.root_dir)
SUPPORTED_OPERATING_SYSTEMS = ('windows_x64', 'linux_x64', 'mac')#, 'linux-arm32', 'linux-ar... | cyanobacterium/Cyanos-Planet-Factory | deploy.py | Python | gpl-3.0 | 7,423 |
# Authors:
# Jason Gerard DeRose <jderose@redhat.com>
#
# Copyright (C) 2009 Red Hat
# see file 'COPYING' for use and warranty contextrmation
#
# 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,... | msrb/freeipa | ipalib/text.py | Python | gpl-3.0 | 18,653 |
#!/usr/bin/env python
# Copyright (C) 2008,2011 Lanedo GmbH
#
# Author: Tim Janik
#
# 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 lat... | tim-janik/testbit-tools | buglist.py | Python | gpl-3.0 | 7,933 |