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 |
|---|---|---|---|---|---|
# encoding: utf-8
"""
trends.py -- Analysis of trends in response changes across mismatch angle
Exported namespace: MismatchTrends
Created by Joe Monaco on 2010-02-17.
Copyright (c) 2009-2011 Johns Hopkins University. All rights reserved.
This software is provided AS IS under the terms of the Open Source MIT Licens... | jdmonaco/vmo-feedback-model | src/remapping/trends.py | Python | mit | 9,633 |
from twisted.protocols import amp
from constants import *
class SendSingleImageInfo(amp.Command):
arguments = [(USER_UID_KEY, amp.String()), (CACHE_UID_KEY, amp.String()), (IMAGE_UID_KEY, amp.String())]
response = [("success", amp.Boolean())]
#inform new master of master change
class InitiateMasterChange(amp... | guoyr/geo-caching | store_commands.py | Python | mit | 835 |
from identifier import Result
RPM_PATTERNS = [
'ED AB EE DB'
]
class RpmResolver:
def identify(self, stream):
return Result('RPM')
def load(hound):
hound.add_matches(RPM_PATTERNS, RpmResolver())
| Bindernews/TheHound | identifiers/rpm_identifier.py | Python | mit | 205 |
#!/usr/bin/env python3
# Copyright (c) 2016-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the dumpwallet RPC."""
import os
from test_framework.test_framework import BitcoinTestFramework
... | ftrader-bitcoinabc/bitcoin-abc | test/functional/wallet_dump.py | Python | mit | 6,366 |
# coding: utf-8
from .base import Base
from .config_auth import ConfigAuth
from .config import Config
from .user import User
from .resource import Resource
from .common import VisibilityFlags
from .meta import ItemMeta
from .meta import PageMeta
from .story import Story
from .module_config import ModuleConfig
| tiberiucorbu/av-website | main/model/__init__.py | Python | mit | 314 |
'''
Absolute value of difference between 2 integers.
Status: Accepted
'''
###############################################################################
def difference(a, b):
'''Absolute difference between 2 integers'''
return abs(a - b)
#####################################################################... | ivanlyon/exercises | kattis/k_different.py | Python | mit | 1,053 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0002_auto_20150525_1743'),
]
operations = [
migrations.AlterField(
model_name='categoria',
n... | zokis/mapa_do_cidadao | mapa_cidadao/mapa_cidadao/core/migrations/0003_auto_20150525_1937.py | Python | mit | 457 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
#
# Imports =====================================================================
from setuptools import setup, find_packages
# Variables ===================================================================
changelog = open('CHANGES.rst... | Bystroushaak/attribute_wrapper | setup.py | Python | mit | 1,689 |
import os
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
CHANGES = open(os.path.join(here, 'CHANGES.rst')).read()
packages = [
'skosprovider_getty'
]
requires = [
'skosprovider>=1.1.0',
'requests',
'rdflib'
]
set... | OnroerendErfgoed/skosprovider_getty | setup.py | Python | mit | 1,278 |
"""
terminal reporting of the full testing process.
"""
from __future__ import absolute_import, division, print_function
import collections
import sys
import _pytest._pluggy as pluggy
import _pytest._code
import py
import pytest
from _pytest.main import EXIT_NOTESTSCOLLECTED
from _pytest.terminal import TerminalReport... | MichaelAquilina/pytest | testing/test_terminal.py | Python | mit | 31,303 |
from __future__ import (absolute_import, division, print_function, unicode_literals)
from builtins import *
from future.utils import with_metaclass
import copy
import types
import wizzat.decorators
from wizzat.pghelper import *
from wizzat.util import set_defaults
__all__ = [
'DBTable',
'DBTableError',
'D... | wizzat/wizzat.py | wizzat/dbtable.py | Python | mit | 13,346 |
import requests
import json
import os
class Insights:
# Example of correct insights:
# {"aKey":"aValue","aKey2":"aValue2"}
def __init__(self, insights):
headers = {}
headers['Content-Type'] = 'application/json'
AQR_URL = os.getenv('ALGORITHMIA_API') or "http://localhost:9000"
... | algorithmiaio/algorithmia-python | Algorithmia/insights.py | Python | mit | 534 |
from ni.core.selection import Selection
from ni.core.text import char_pos_to_tab_pos
from ni.core.document import InsertDelta, DeleteDelta
class Action(object):
"""Base class for all view actions."""
def __init__(self, view):
self.grouped = False
self.editor = view.editor
self.view = ... | lerouxb/ni | actions/base.py | Python | mit | 6,191 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# (c) 2020 Mike Lewis
import logging
log = logging.getLogger(__name__)
from . import BaseAuthenticationTestCase
import six
class OAuthEndpointTestCase(BaseAuthenticationTestCase):
def test_auth_url(self):
url = self.api.oauth.auth_url()
assert isinst... | mLewisLogic/foursquare | foursquare/tests/test_oauth.py | Python | mit | 444 |
# -*- coding: utf-8 -*-
from django.contrib import messages
from django.db.models import Q
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import redirect, get_object_or_404
from django.utils.decorators import method_decorator
from django.utils.translation import ugettext as _
from django.vi... | indexofire/gork | src/gork/application/know/plugins/attachments/views.py | Python | mit | 13,497 |
from helpers import HexArrayToDecimal
from track_data import TrackData
class TrackChunk(object):
def __init__(self, raw_data):
self.raw_data = raw_data
self.length = HexArrayToDecimal(raw_data[4:8])
self.data = TrackData(raw_data[8:])
| jakeh12/hackisu2018-flopper | basestation/track_chunk.py | Python | mit | 264 |
import urllib
import os
import json
import time
import datetime
import sublime
from xml.sax.saxutils import escape
from .. import requests
from .. import util
from ..libs import auth
# https://github.com/xjsender/simple-salesforce/blob/master/simple_salesforce/login.py
def soap_login(settings, session_id_expired=Fals... | xjsender/haoide | salesforce/login.py | Python | mit | 7,654 |
# $Id$
import copy
import logging
import time
import traceback
import types
from quixote import form2
from quixote.html import htmltext
import canary.context
from canary.gazeteer import Feature
from canary.qx_defs import MyForm
from canary.utils import DTable, render_capitalized
import dtuple
class ExposureRoute ... | dchud/sentinel | canary/study.py | Python | mit | 63,030 |
# ex:set ts=4 sw=4: <- for vim
#
# EPANET File Utility
# Uses EPAENTOutputFile.py to read the EPANET output file into memory and
# then displays the content in different ways.
#
# Dependencies:
# - Python 2.6 or 2.7 (32- or 64-bit)
# - wxPython 3.0.0 (32- or 64-bit to match installed version of Python)
# - EPANETOutput... | WaterSums/EPANETFileUtility | EPANETFileUtility.py | Python | mit | 16,145 |
'''
Created on Jun 8, 2015
@author: cliff
'''
CAR_SYMBOLS = ['Q', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'L']
TRUCK_SYMBOLS = ['T', 'R', 'W', 'Z']
CAR_COLORS_NO_HASH = ['7FFF00', '7FFFD4', 'D2691E', '8B008B', 'BDB76B',\
'8B0000', 'FF1493', '1E90FF', 'FFD700', 'ADFF2F', \
... | crhaithcock/RushHour | Analytics/shared_code/RHconstants.py | Python | cc0-1.0 | 1,791 |
# cd pySU/pyMultidark/trunk/bin/fortranfile-0.2.1/
import numpy as n
import os
from os.path import join
from astropy.io import fits
import time
import fortranfile
import sys
DFdir = join("/data2", "users", "gustavo", "BigMD", "1Gpc_3840_Planck1_New", "DENSFIELDS")
mockDir = "/data1/DATA/eBOSS/Multidark-box-mocks/v1.0... | JohanComparat/nbody-npt-functions | bin/bin_MD/DF_read_density_field.py | Python | cc0-1.0 | 4,660 |
import inspect
import boto3
import logging
import multiprocessing as mp
import os
import signal
import psutil as ps
from random import randint
from botocore.config import Config
from botocore.exceptions import EndpointConnectionError, ClientError, NoCredentialsError, NoRegionError
from dataactcore.aws.sqsHandler impo... | fedspendingtransparency/data-act-broker-backend | tests/integration/sqs_work_dispatcher_tests.py | Python | cc0-1.0 | 78,313 |
#!/usr/bin/spark-submit
import sys
from operator import add
from pyspark import SparkContext
from pyspark import join
import socket, struct
from bisect import bisect_left
if __name__ == "__main__":
infileIp = 's3://gu-anly502/maxmind/GeoLite2-Country-Blocks-IPv4.csv'
infileCountry = 's3://gu-anly502/maxmind... | joshuaeitan/massivedata | PS04/forensicswiki_geolocate.py | Python | cc0-1.0 | 1,874 |
'''
Created on Feb 8, 2011
@author: vgapeyev
'''
import csv, re
__nonspace_whitespace = re.compile(r"[\t\n\r\f\v]")
__long_whitespace = re.compile(r"[ ]{2,}")
def normalize_whitespace(str):
str = re.sub(__nonspace_whitespace, " ", str)
str = re.sub(__long_whitespace, " ", str)
return str
def empty_line(... | NESCent/Chimp-Recs-FieldObservations | ObservationParsing/src/obsparser/app.py | Python | cc0-1.0 | 4,869 |
from django.conf.urls.defaults import *
urlpatterns = patterns('japos.dashboards.views',
(r'^$', 'index')
) | jyr/japos | dashboards/urls.py | Python | gpl-2.0 | 112 |
from django.core.management.base import BaseCommand
import os
import re
import subprocess
from pymediainfo import MediaInfo
from flicksapp.models import Movie, File, Track
from flicksapp.choices import FILE_TYPES, PICTURE_TYPE, VIDEO_TYPE, NFO_TYPE, \
SUBTITLES_TYPE, OTHER_TYPE, AUDIO_TYPE
IGNORES = (
'^\..+... | buzz/flicks | flicksapp/management/commands/scan_files.py | Python | gpl-2.0 | 7,514 |
# coding=utf-8
__author__ = 'dimv36'
from flask_login import AnonymousUserMixin, LoginManager
from webtests.models import User
# Модуль инициализации менеджера входа пользователей
login_manager = LoginManager()
class AnonymousUser(AnonymousUserMixin):
id = None
login_manager.anonymous_user = AnonymousUser
log... | dimV36/webtests | webtests/auth.py | Python | gpl-2.0 | 486 |
# 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... | d7415/merlin | Arthur/loadable.py | Python | gpl-2.0 | 7,668 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2009 Gary Burton
# Copyright (C) 2011 Tim G L Lyons
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published ... | arunkgupta/gramps | gramps/gen/utils/alive.py | Python | gpl-2.0 | 26,674 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
RasterLayerStatistics.py
---------------------
Date : January 2013
Copyright : (C) 2013 by Victor Olaya
Email : volayaf at gmail dot com
****************... | myarjunar/QGIS | python/plugins/processing/algs/qgis/RasterLayerStatistics.py | Python | gpl-2.0 | 4,669 |
# -*- coding: utf-8 -*-
#
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
from common.fields import StringManyToManyField
from common.serializers import AdaptedBulkListSerializer
from orgs.mixins.serializers import BulkOrgResourceModelSerializer
from ..models import User... | sdgdsffdsfff/jumpserver | apps/users/serializers/group.py | Python | gpl-2.0 | 2,119 |
"""
A script to automate installation of tool repositories from a Galaxy Tool Shed
into an instance of Galaxy.
Galaxy instance details and the installed tools can be provided in one of three
ways:
1. In the YAML format via dedicated files (see ``tool_list.yaml.sample`` for a
sample of such a file)
2. On the command... | C3BI-pasteur-fr/Galaxy-playbook | galaxy-pasteur/roles/galaxy_tools/files/install_tool_shed_tools.py | Python | gpl-2.0 | 28,649 |
#!/usr/bin/env python
import re
import sys
snappy_ver = "v3.0"
html_header_string = """\
<html>
<head>
<title>Snappy Assembly</title>
<style>
BODY {
margin-bottom: 200px;
}
TABLE TD {
vertical-align: middle;
}
H2 {
margin-bottom: 5px;
margin-top: 24px;
font-size: 20pt;
}
LI.section {
font-size: 20pt;
f... | revarbat/snappy-reprap | gen_assembly_index.py | Python | gpl-2.0 | 7,135 |
import collections
import pytest
from utils import log
#: A dict of tests, and their state at various test phases
test_tracking = collections.defaultdict(dict)
# Expose the cfme logger as a fixture for convenience
@pytest.fixture(scope='session')
def logger():
return log.logger
@pytest.mark.hookwrapper
def ... | thom-at-redhat/cfme_tests | fixtures/log.py | Python | gpl-2.0 | 4,066 |
from .variant import Variant
from .coding_variant import CodingVariant, call_coding_variants
from .codon_variant import CodonVariant, call_codon_variants
from .amino_acid_variant import AminoAcidVariant, call_amino_acid_variants
from .variant_effect import call_variant_effects
| childsish/lhc-python | lhc/binf/variant/__init__.py | Python | gpl-2.0 | 278 |
#!/usr/bin/python
import random
import math
import bisect
############################Zipf Generater################################
# The library of numpy.random.zipf or scipy.stats.zipf only work when
# alph > 1
class ZipfGenerator:
def __init__(self, n, alpha):
# Calculate Zeta values from 1 to n:
... | fengz10/ICN_SCM | Zipf.py | Python | gpl-2.0 | 821 |
#!/usr/bin/python3
"""
Controls the behaviour of the treeview for the layer-view.
This module contains the LayerTreeView class. It controls the behaviour and
appearance of the layer-view which is in the upper left side of the GUI. The
class inherits from Gtk.TreeView and requires a Gtk.TreeStore to initialize.
"""
f... | supriyantomaftuh/innstereo | innstereo/layer_view.py | Python | gpl-2.0 | 2,491 |
# iSCSI configuration dialog
#
# Copyright (C) 2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distribute... | kparal/anaconda | pyanaconda/ui/gui/spokes/advstorage/iscsi.py | Python | gpl-2.0 | 20,233 |
import sys
import os.path
oldpath = sys.path
newpath = os.path.join(os.path.dirname(__file__), '../../python/.libs')
sys.path = [newpath]
from _satyr3 import *
sys.path = oldpath
del sys, os
del oldpath, newpath
| abrt/satyr | tests/python/satyr.py | Python | gpl-2.0 | 215 |
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# ------------------------------------------------------... | crossroadchurch/paul | tests/utils/__init__.py | Python | gpl-2.0 | 2,109 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import RPi.GPIO as GPIO
import deviceConfig
import time
class Rele:
#Rele
valueRele = 0
def __init__(self):
GPIO.setup(deviceConfig.pinRele, GPIO.OUT)
GPIO.setup(deviceConfig.pinReleLed, GPIO.OUT)
GPIO.setup(deviceConfig.pinReleButton, GPIO.IN, pull_up_down=GP... | PascualArroyo/Domotics | Raspberry/rele.py | Python | gpl-2.0 | 1,058 |
"""
Intermediate module for working with XML-related virsh functions/methods.
The intention of this module is to hide the details of working with XML
from test module code. Helper methods are all high-level and not
condusive to direct use in error-testing. However, access to a virsh
instance is available.
All class... | imammedo/virt-test | virttest/libvirt_xml.py | Python | gpl-2.0 | 16,009 |
from __future__ import absolute_import, unicode_literals
import mock
import pytest
from ddns_zones_updater.configreader import ConfigReader
from ddns_zones_updater.core import DDNSZoneUpdater
@pytest.fixture
def fake_config_reader_with_two_hosts():
host_1 = mock.Mock(do_update=mock.Mock())
host_2 = mock.Moc... | bh/python-ddns-zones-updater | tests/test_core.py | Python | gpl-2.0 | 1,816 |
#-----------------------------------------------------------------
# pycparser: _build_tables.py
#
# A dummy for generating the lexing/parsing tables and and
# compiling them into .pyc for faster execution in optimized mode.
# Also generates AST code from the _c_ast.yaml configuration file.
#
# Copyright (C) 2008, Eli... | deonwu/PyTEL | src/pytel/ast/_build_tables.py | Python | gpl-2.0 | 762 |
from bs4 import BeautifulSoup
import urllib
def read(url):
soup = BeautifulSoup(urllib.urlopen(url))
repl=dict([
('DC.creator','$author'),
('DC.date','date'),
('DC.description','description'),
('DC.identifier','identifier'),
('DC.language','language'),
('DC.rights','rights'),
('DC.subject','*keywords')... | lsia/bibfix | meta.py | Python | gpl-2.0 | 5,514 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/yeison/Documentos/python/developing/pinguino/pinguino-ide/qtgui/frames/libraries_widget.ui'
#
# Created: Fri Dec 19 15:43:21 2014
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be l... | PinguinoIDE/pinguino-multilanguage | files/frames/libraries_widget.py | Python | gpl-2.0 | 14,604 |
#!/usr/bin/env python
import numpy as np
import boldsim.sim as sim
import timeit
import argparse
parser = argparse.ArgumentParser(description='Run BOLDsim benchmarks.',
epilog='By default no benchmarks will be run, so make sure to specify one!')
parser.add_argument('-a', '--all', acti... | adamatus/boldsim | benchmark/benchmark.py | Python | gpl-2.0 | 17,981 |
import re
import optparse
from django.core.management.base import BaseCommand
from dbmail.models import MailTemplate
from dbmail.defaults import BACKEND
from dbmail import db_sender
def send_test_msg(pk, email, user=None, **kwargs):
template = MailTemplate.objects.get(pk=pk)
slug = template.slug
var_lis... | Shekharrajak/django-db-mailer | dbmail/management/commands/dbmail_test_send.py | Python | gpl-2.0 | 1,678 |
import theano
import theano.tensor as tt
from activations import share, init_wts
class SoftmaxLayer():
def __init__(self, inpt, in_sz, n_classes, ):
b = share(init_wts(n_classes))
w = share(init_wts(in_sz, n_classes))
self.output = tt.nnet.softmax(tt.dot(inpt, w) + b)
self.params =... | daleloogn/deeplearning-turtorial | rnn_ctc/ctc.py | Python | gpl-2.0 | 1,769 |
# Copyright (C) 2014 Saggi Mizrahi, 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 version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY... | borisroman/vdsm | lib/yajsonrpc/stompreactor.py | Python | gpl-2.0 | 19,115 |
"""django_tasks_report URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='hom... | katiayn/django-tasks-report | django_tasks_report/urls.py | Python | gpl-2.0 | 939 |
# -*- coding: utf-8 -*-
##################################################################
# pyHTTPd
# $Id$
# (c) 2006 by Tim Taubert
##################################################################
import socket, sys, os, threading
class pHTTPServer:
address_family = socket.AF_INET
socket_type = socket.SOCK_S... | BackupTheBerlios/pyhttpd-svn | core/baseHTTPServer.py | Python | gpl-2.0 | 2,489 |
# -*- coding: utf-8 -*-
"""
(c) 2014-2016 - Copyright Red Hat Inc
Authors:
Pierre-Yves Chibon <pingou@pingoured.fr>
Ralph Bean <rbean@redhat.com>
"""
import anitya.lib.xml2dict as xml2dict
from anitya.lib.backends import BaseBackend, get_versions_by_regex, REGEX
from anitya.lib.exceptions import AnityaPlug... | pombredanne/anitya | anitya/lib/backends/cpan.py | Python | gpl-2.0 | 3,025 |
"""
# Majic
# Copyright (C) 2014 CEH
#
# 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 pr... | NERC-CEH/jules-jasmin | majic/joj/services/dataset.py | Python | gpl-2.0 | 13,566 |
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 5 15:28:13 2014
@author: deokwooj
"""
from __future__ import division # To forace float point division
import numpy as np
from scipy import stats
from scipy.interpolate import interp1d
from sklearn import mixture
#from sklearn.cluster import Ward
from sklearn.cluster imp... | TinyOS-Camp/DDEA-DEV | Archive/[14_10_11] Dr_Jung_Update/pre_bn_state_processing.py | Python | gpl-2.0 | 91,559 |
'''Siku scenario
Sea ice element simple free drift example
Creates a (large) polygon in polar region and sets some basic winds
in still water. No interaction with any boundaries, just a free
float of the polygon in the area and output in KML format of its
locations.
Be sure that siku module is in y... | Atoku/siku | samples/beaufort.py | Python | gpl-2.0 | 14,677 |
#
# Copyright 2007-2009 Fedora Unity Project (http://fedoraunity.org)
#
# 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 2, or (at your option) any
# later version.
#
# This program is di... | sanjayankur31/pyjigdo | pyJigdo/__init__.py | Python | gpl-2.0 | 827 |
#!/usr/bin/python2.7
import sys
import csv
import yaml
import codecs
TO_BE_TRANSLATED_MARK = "***TO BE TRANSLATED***"
def collect(result, node, prefix=None):
for key,value in node.items():
new_prefix = (key if prefix == None else prefix + "." + key)
if isinstance(value, dict):
collect(... | shimarin/discourse-ja-translation | yaml2csv.py | Python | gpl-2.0 | 1,474 |
# -*- coding: utf-8 -*-
class horizontal_rule:
def __init__(self):
pass
@staticmethod
def process(data, args):
data['note_viewer'].call_function('insert_horizontal_rule') | marcoconstancio/yanta | actions/horizontal_rule/horizontal_rule.py | Python | gpl-2.0 | 200 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# 2009 Gary Burton
# Copyright (C) 2011 Tim G L Lyons
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published ... | Forage/Gramps | gramps/gui/editors/editpersonref.py | Python | gpl-2.0 | 6,336 |
"""
Copyright 2016, 2017 UFPE - Universidade Federal de Pernambuco
Este arquivo é parte do programa Amadeus Sistema de Gestão de Aprendizagem, ou simplesmente Amadeus LMS
O Amadeus LMS é um software livre; você pode redistribui-lo e/ou modifica-lo dentro dos termos da Licença Pública Geral GNU como publicada pela ... | amadeusproject/amadeuslms | h5p/base_plugin/editor/library/editorstorage.py | Python | gpl-2.0 | 3,487 |
from distutils.core import setup
setup (
name = 'gfmviewer',
version = '0.1.0',
description = 'View a Github Formatted Markdown file as formatted HTML',
scripts = [ 'gfmviewer' ],
author = 'Vrai Stacey',
author_email = 'vrai.stacey@gmail.com',
url = 'http://github.com/vrai/gfmviewer-wx',
... | vrai/gfmviewer-wx | setup.py | Python | gpl-2.0 | 953 |
'''
3780 Networking Project server
@author Rio Lowry, Lezar de Guzmann
'''
import json
import heapq
import threading
class MessageStorage():
def __init__(self):
self.messages = self.read_from_file()
for destination, messagelist in self.messages.items():
# Delete empty lists ... | riolowry/cs3780-networks | storage.py | Python | gpl-2.0 | 3,021 |
# cursortools.py -- QTextCursor utility functions
#
# Copyright (c) 2008 - 2014 by Wilbert Berendsen
#
# 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... | shimpe/frescobaldi | frescobaldi_app/cursortools.py | Python | gpl-2.0 | 7,435 |
import re, os.path, os, xml.sax.saxutils, time, shutil, urllib, textwrap
from gettext import gettext as _
from gourmet import convert,gglobals
from gourmet.exporters.exporter import ExporterMultirec, exporter_mult
HTML_HEADER_START = """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
"... | butchman0922/gourmet | gourmet/plugins/import_export/html_plugin/html_exporter.py | Python | gpl-2.0 | 12,913 |
#!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# *************************************... | joshmoore/zeroc-ice | py/demo/Ice/latency/Client.py | Python | gpl-2.0 | 1,349 |
# Copyright (c) 2012 Phil Birkelbach
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distrib... | birkelbach/python-canbus | canbus/exceptions.py | Python | gpl-2.0 | 1,265 |
#!/usr/bin/env python
#
# Simple IRC Bot to announce messages
#
# Code originally based on example bot and irc-bot class from
# Joel Rosdahl <joel@rosdahl.net>, author of included python-irclib.
#
"""
An IRC bot stub, it will join a particular channel on a server. All
further functionality is implemented by additional... | adblockplus/abpbot | abpbot.py | Python | gpl-2.0 | 4,512 |
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
%matplotlib inline
# packages
import numpy as np
import itertools
import matplotlib.pyplot as plt
import matplotlib as mpl
import argparse
# global variables
pop_size = 50
seq_length = 100
alphabet = ['A', 'T', 'G', 'C']
mutation_rate = 0.0001 # per ge... | alvason/probability-insighter | code/mutation_drift.py | Python | gpl-2.0 | 7,287 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"Fully test this module's functionality through the use of fixtures."
from megacosm.generators import Generator
import unittest2 as unittest
import json
from mock import Mock, patch, MagicMock
import fakeredis
import fixtures
from config import TestConfiguration
from ppr... | CityGenerator/Megacosm-Generator | tests/test_generator.py | Python | gpl-2.0 | 8,144 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005 Ole André Vadla Ravnås <oleavr@gmail.com>
# Copyright (C) 2006-2007 Ali Sabil <ali.sabil@gmail.com>
# Copyright (C) 2007 Johann Prieur <johann.prieur@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Gene... | Kjir/papyon | papyon/gnet/io/tcp.py | Python | gpl-2.0 | 1,708 |
from __future__ import absolute_import
import os.path
import sys
from datetime import datetime
from prospector import tools, blender, postfilter
from prospector.config import ProspectorConfig, configuration as cfg
from prospector.finder import find_python
from prospector.formatters import FORMATTERS
from prospector.m... | pahaz/prospector | prospector/run.py | Python | gpl-2.0 | 4,952 |
# Copyright (C) 2013-2018 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Tris Wilson
#
# 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 v... | tjcsl/cslbot | cslbot/commands/translate.py | Python | gpl-2.0 | 1,669 |
# Since bkr is a namespace package (and thus cannot have version specific
# code in bkr.__init__), the version details are retrieved from here in
# order to correctly handle module shadowing on sys.path
__version__ = '28.2'
| beaker-project/beaker | Common/bkr/common/__init__.py | Python | gpl-2.0 | 225 |
from __future__ import print_function
from boxbranding import getMachineBrand, getMachineName
import xml.etree.cElementTree
from datetime import datetime
from time import localtime, strftime, ctime, time
from bisect import insort
from sys import maxsize
import os
from enigma import eEPGCache, getBestPlayableServiceRefe... | atvcaptain/enigma2 | RecordTimer.py | Python | gpl-2.0 | 61,002 |
# encoding: utf-8
# module PyKDE4.kio
# from /usr/lib/python2.7/dist-packages/PyKDE4/kio.so
# by generator 1.135
# no doc
# imports
import PyKDE4.kdeui as __PyKDE4_kdeui
import PyQt4.QtCore as __PyQt4_QtCore
import PyQt4.QtGui as __PyQt4_QtGui
class KBookmarkExporterBase(): # skipped bases: <type 'sip.wrapper'>
... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/PyKDE4/kio/KBookmarkExporterBase.py | Python | gpl-2.0 | 652 |
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from django.utils.six.moves import range
from misago.acl.testutils import override_acl
from ..models import Rank
from ..testutils import AuthenticatedUserTestCase
class UsersListTestCase(AuthenticatedUserTestCase):
def s... | 1905410/Misago | misago/users/tests/test_lists_views.py | Python | gpl-2.0 | 2,244 |
# -*- coding: utf-8 -*-
import pyDes
import urllib
import re
from regexUtils import parseTextToGroups
from javascriptUtils import JsFunctions, JsUnpacker, JsUnpackerV2, JsUnpacker95High, JsUnwiser, JsUnwiser2, JsUnIonCube, JsUnFunc, JsUnPP, JsUnPush
def encryptDES_ECB(data, key):
data = data.encode()
k = p... | BartOtten/manual-packages | plugin.video.SportsDevil/lib/utils/decryptionUtils.py | Python | gpl-2.0 | 7,255 |
import sys
import os
import time
import datetime
import pdb
# Path Fix
sys.path.append(
os.path.abspath(
os.path.join(
os.path.dirname(__file__), "../aggmon")))
from mongodb_store import *
from bson.objectid import ObjectId
# delete all collections in MongoDBMetricStore
MongoDBMetricStore( db... | efocht/aggmon | src/metric_store/mongodb_store_test.py | Python | gpl-2.0 | 1,651 |
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in th... | mulkieran/blk-DAG-tools | version.py | Python | gpl-2.0 | 1,244 |
import subprocess
import shutil
import xml.etree.ElementTree as ET
import shlex
import sys
def printError(message):
print "\r\n\r\n!!!!!!!!!!\r\nERROR:\r\n", message, "\r\n!!!!!!!!!!\r\n"
print "Exiting..."
exit()
if len(sys.argv) < 2:
print "Usage: python workshop-restore.py <input filename>"
exi... | ARL-UTEP-OC/emubox | workshop-creator/bin/workshop-restore.py | Python | gpl-2.0 | 1,716 |
"""Python script to measure temperature, humidity and CO2 concentration with a Raspberry Pi.
A SHT21 sensor and a MCP3424 analog digital converter are connected to gpio pins, i.e. to the I2C bus.
The BayEOSGatewayClient class is extended to transfer data to the BayEOSGateway.
The sender runs in a separate process. Orig... | kleebaum/bayeosraspberrypi | bayeosraspberrypi/bayeosraspberrypiclient.py | Python | gpl-2.0 | 3,774 |
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com).
# All rights reserved.
# This file may be distributed and/or modified under the terms of
# the GNU General Public License version 2 as published by
# the Free ... | offlinehacker/flumotion | flumotion/component/producers/checks.py | Python | gpl-2.0 | 4,436 |
#!/usr/bin/env python
#This will crack any 4 digit number in 6 different encryptions.
#http://www.darkc0de.com
#d3hydr8[at]gmail[dot]com
import sys, base64
try:
import hashlib
except(ImportError):
print "\n[-] You need the hashlib module installed, upgrade to python 2.5\n"
sys.exit(1)
def show(first):
if sys... | knightmare2600/d4rkc0de | encryption/pincrack.py | Python | gpl-2.0 | 2,540 |
# This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more information
# Copyright (C) Philippe Biondi <phil@secdev.org>
# Copyright (C) Gabriel Potter <gabriel@potter.fr>
# This program is published under a GPLv2 license
"""
Python 2 and 3 link classes.
"""
from __future__ import absolute_impor... | 6WIND/scapy | scapy/compat.py | Python | gpl-2.0 | 4,048 |
import copy
import pytest
from dapp import protocol_version, DAPPBadMsgType, DAPPTimeOut
class CommunicatorTestCase(object):
pv = 'dapp_protocol_version: {0}'.format(protocol_version).encode('utf8')
# a general confirmation message
msg_received_lines = [b'START', b'msg_type: msg_received', pv, b'STOP']
... | devassistant/dapp | test/communicator_test_case.py | Python | gpl-2.0 | 3,911 |
"""
Copyright (C) 2016 ECHO Wizard
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is dis... | kaynfiretvguru/Eldritch | plugin.program.echowizard/resources/lib/modules/extract.py | Python | gpl-2.0 | 2,897 |
#!/usr/bin/env python
# $Id$
import sys
if not hasattr(sys, 'version_info') or sys.version_info < (2, 4):
raise SystemExit, 'Muttils requires Python 2.4 or later'
from distutils.core import setup
import os.path, subprocess, time
# simplified hg versioning
def runhg(cmd):
out, err = subprocess.Popen(['hg']... | cwarden/muttils | setup.py | Python | gpl-2.0 | 2,206 |
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
import deblib
setup(name="DebLib",
version=deblib.__version__,
author = "Adelux",
author_email = "luc stepniewski at adelux.fr",
download_url = "http://code.google.com/p/deblib",
license = "G... | lstep/deblib | setup.py | Python | gpl-2.0 | 1,409 |
#!/usr/bin/env python
from threading import Thread
if(__name__ == '__main__'):
import webbrowser
web = WebServer()
webbrowser.open("http://127.0.0.1:8888")
web.start() | 50thomatoes50/Ardulan | http_serv.py | Python | gpl-2.0 | 202 |
#
# Copyright (c) 2011,2012 Bogdano Arendartchuk <bogdano@mandriva.com.br>
#
# Written by Bogdano Arendartchuk <bogdano@mandriva.com.br>
#
# This file is part of Jurt Build Bot.
#
# Jurt Build Bot is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published... | bhdn/jurt | jurtlib/command.py | Python | gpl-2.0 | 14,645 |
#/usr/bin/env python
# -#- coding: utf-8 -#-
#
# parser/test/tests.py - parsing unit test module
#
# standard copy right text
#
# Initial version: 2011-03-08
# Author: Amnon Janiv
"""
.. module:: tests/regexp_tests
:synopsis: regex_scripting test suite module
Test suite designed to test regex_scripting featur... | ajaniv/equitymaster | tests/regexp_tests.py | Python | gpl-2.0 | 3,514 |
#number = 1
#while number < 11:
# print(number)
# number += 1
# balance = 1000
# rate = 1.02
# years = 0
# while balance < 5000:
# balance *= rate
# years += 1
# print("It takes " + str(years) + " years to reach $5000.")
# for i in [1,2,3,4,5,6,7,8,9,10]:
# print(i)
#for name in ["Jane", "John", "Matt", ... | simontakite/sysadmin | pythonscripts/webprogrammingwithpython/Working Files/Chapter 2/0206 loops.py.py | Python | gpl-2.0 | 381 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2018-02-26 13:18
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('gfi', '0002_auto_20180223_1523'),
]
... | jmestrovic/finrep | web/gfi/migrations/0003_auto_20180226_1418.py | Python | gpl-2.0 | 2,921 |
#/usr/bin/env python
# -#- coding: utf-8 -#-
#
# equity_master/common.py - equity master common classes
#
# standard copy right text
#
# Initial version: 2012-04-02
# Author: Amnon Janiv
"""
.. module:: equity_master/common
:synopsis: miscellaneous abstract classes and other core constructs
.. moduleauthor... | ajaniv/equitymaster | equity_master/common.py | Python | gpl-2.0 | 3,296 |
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model, decomposition, datasets
from sklearn.pipeline import Pipeline
from sklearn.grid_search import GridSearchCV
logistic = linear_model.LogisticRegression()
pca = decomposition.PCA()
pipe = Pipeline(steps=[('pca', pca), (... | LevinJ/ud730-Deep-Learning | A1_notmnistdataset/logisticsregresstionsmaple.py | Python | gpl-2.0 | 1,313 |
# -*- test-case-name: twisted.test.test_persisted -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Different styles of persisted objects.
"""
# System Imports
import types
import copy_reg
import copy
try:
import cStringIO as StringIO
except ImportError:
import Strin... | UstadMobile/exelearning-ustadmobile-work | twisted/persisted/styles.py | Python | gpl-2.0 | 27,358 |
from __future__ import print_function
from imports import *
import common
class Base( common.Base ):
pass
class TestUnitMiSeqToNewbler( Base ):
def _C( self, *args, **kwargs ):
from bactpipeline.fix_fastq import miseq_to_newbler_id
return miseq_to_newbler_id( *args, **kwargs )
def test_r1... | VDBWRAIR/bactpipeline | test/test_fix_fastq.py | Python | gpl-2.0 | 2,468 |
# pylint: disable=missing-docstring, missing-module-docstring, invalid-name
# pylint: disable=too-few-public-methods, line-too-long, dangerous-default-value
# pylint: disable=wrong-import-order
# https://github.com/PyCQA/pylint/issues/4774
def github_issue_4774():
# Test literals
# https://github.com/PyCQA/pyl... | PyCQA/pylint | tests/functional/u/use/use_implicit_booleaness_not_comparison.py | Python | gpl-2.0 | 5,576 |
class LoggerSingleton:
_instance = None
@staticmethod
def get_instance(console_log=False):
if LoggerSingleton._instance is None:
LoggerSingleton._instance = LoggerSingleton._Logger()
if console_log:
LoggerSingleton._instance.set_next(LoggerSingleton._ConsoleL... | oknalv/piollo | loggersingleton.py | Python | gpl-2.0 | 1,004 |