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 -*-
#
# Copyright (C) 2005-2009 Edgewall Software
# Copyright (C) 2005-2007 Christopher Lenz <cmlenz@gmx.de>
# Copyright (C) 2005 Matthew Good <trac@matt-good.net>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this ... | netjunki/trac-Pygit2 | trac/web/main.py | Python | bsd-3-clause | 29,627 |
"""
Django settings for websdf project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... | samoturk/websdf | websdf/settings.py | Python | bsd-3-clause | 2,702 |
import itertools
import logging
import os
import threading
import yaml
from ..utils import get_adhoc_module
from .callback import Callback
from .context import Context
from .qube import QubeCallback
from .shell import ShellScript
from .. import logs
log = logging.getLogger('sgevents.dispatcher') # __name__ is ugly ... | westernx/sgevents | sgevents/dispatcher/dispatcher.py | Python | bsd-3-clause | 4,868 |
import unittest, os
from mock import Mock, patch, call, sentinel
from tests.ditest import DependencyInjectionTestBase
class AddTests(DependencyInjectionTestBase):
def setUp(self):
super(AddTests, self).setUp()
self.config.dryrun = False
self.repo.byLocation.return_value = None
sel... | ilogue/niprov | tests/test_add.py | Python | bsd-3-clause | 7,954 |
from twisted.plugin import IPlugin
from twisted.words.protocols import irc
from txircd.module_interface import Command, ICommand, IModuleData, ModuleData
from txircd.utils import now
from zope.interface import implementer
from typing import Any, Callable, Dict, List, Optional, Tuple
@implementer(IPlugin, IModuleData)
... | Heufneutje/txircd | txircd/modules/rfc/pingpong.py | Python | bsd-3-clause | 5,686 |
# -*- coding: utf-8 -*-
from __future__ import with_statement, print_function, absolute_import
import os
from requests_oauthlib import OAuth1Session
def create_oauth_token(expiration=None, scope=None, key=None, secret=None, name=None, output=True):
"""
Script to obtain an OAuth token from Trello.
Must ha... | sarumont/py-trello | trello/util.py | Python | bsd-3-clause | 3,964 |
##
##
# File auto-generated against equivalent DynamicSerialize Java class
from dynamicserialize.dstypes.com.raytheon.uf.common.auth.user import UserId
class User(object):
def __init__(self, userId=None):
if userId is None:
self.userId = UserId.UserId()
else:
self.userId ... | mjames-upc/python-awips | dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/User.py | Python | bsd-3-clause | 673 |
from __future__ import division, absolute_import, print_function
import collections
import tempfile
import sys
import shutil
import warnings
import operator
import io
import itertools
import ctypes
import os
if sys.version_info[0] >= 3:
import builtins
else:
import __builtin__ as builtins
from decimal import D... | kiwifb/numpy | numpy/core/tests/test_multiarray.py | Python | bsd-3-clause | 244,600 |
#!/usr/bin/env python
import math
f_truth = open('lr_good_weights.txt', 'r')
f_result = open('ALRresult.log', 'r')
frlines = f_result.readlines()
ftlines = f_truth.readlines()
c = 0
margin = 0.001
for i, line in enumerate(ftlines):
if math.fabs(float(line) - float(frlines[i])) > margin :
c = c + 1
prin... | jperla/spark-advancers | compareResult.py | Python | bsd-3-clause | 358 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'UserDetail.display_preference'
db.add_column('website_userdetail', 'display_preference',
... | solarpermit/solarpermit | website/migrations/0043_auto__add_field_userdetail_display_preference.py | Python | bsd-3-clause | 48,128 |
import glob
from io import open # for open(..,encoding=...) parameter in python 2
from os import walk
from os.path import join, dirname, sep
import re
from setuptools import setup, find_packages
# NOTE: All package data should also be set in MANIFEST.in
packages = find_packages()
package_data = {'': ['*.tmpl',
... | germn/python-for-android | setup.py | Python | mit | 4,634 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/lair/structure/exterior/shared_lair_cave_giant_exterior_krayt_dragon... | obi-two/Rebelion | data/scripts/templates/object/tangible/lair/structure/exterior/shared_lair_cave_giant_exterior_krayt_dragon.py | Python | mit | 504 |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
ZMQ example using python3's asyncio
Bitcoin should be started with the command line argument... | nlgcoin/guldencoin-official | contrib/zmq/zmq_sub3.4.py | Python | mit | 3,273 |
from CGATReport.Tracker import *
from IntervalReport import *
class ContextSummary(IntervalTracker, SingleTableTrackerRows):
table = "context_stats"
| CGATOxford/CGATPipelines | CGATPipelines/pipeline_docs/pipeline_motifs/trackers/Context.py | Python | mit | 156 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from holmes.validators.base import Validator
from holmes.utils import _
class MetaTagsValidator(Validator):
@classmethod
def get_violation_definitions(cls):
return {
'absent.metatags': {
'title': _('Meta tags not present'),
... | holmes-app/holmes-api | holmes/validators/meta_tags.py | Python | mit | 2,813 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/intangible/ship/shared_ywing_pcd.iff"
result.attribute_template_id = 8
re... | obi-two/Rebelion | data/scripts/templates/object/intangible/ship/shared_ywing_pcd.py | Python | mit | 443 |
"""SaaS Client Mixin"""
__all__ = ['ClientMixin']
class ClientMixin(object):
"""
To be mixed with the relevant model associated with a "customer" of
your platform/service(s) - the settings value of:
REST_SETTINGS = {
...
"SAAS": {
"MODEL": "app.client.Model",
"... | juannyG/django-rest-framework-saasy | rest_framework_saasy/client.py | Python | mit | 644 |
from time import time
from itertools import groupby
from vial import vfunc, vim, dref
from vial.utils import echon, redraw
from os.path import split
MAX_HISTORY_SIZE = 100
VHIST = 'vial_buf_hist'
VLAST = 'vial_last_buf'
def add_to_history(w, bufnr):
history = list(w.vars[VHIST])
history[:] = [r for r in his... | guilhermedallanol/dotfiles | vim/plugged/vial/vial/plugins/bufhist/plugin.py | Python | mit | 3,812 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
###############################################################################
# Author: Quincey Sun
# Mail: zeroonegit@gmail.com
# Created Time: 2016-06-21 23:14:26
###############################################################################
## This programs asks a u... | zeroonegit/python | python_programming/password1.py | Python | mit | 786 |
import django
import sys
import os
sys.path.append('/tmp/neuropower-web/neuropower')
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings.settings'
django.setup()
from neurodesign import design, experiment, population, generate, msequence, report
from sqlalchemy.exc import OperationalError, DatabaseError
from django.core.... | neuropower/neuropower | neuropower/apps/designtoolbox/batch/neurodesign.py | Python | mit | 6,551 |
# -*- coding: utf-8 -*-
# Scrapy settings for lego_scraper project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/l... | takanory/pymook-samplecode | 4_scraping/lego_scraper/lego_scraper/settings.py | Python | mit | 3,185 |
# Priority Queue
import heapq
class Packet:
PROTOCOL_PRIORITY = {
'ICMP': 10,
'UDP': 9,
'RTM': 8,
'IGMP': 7,
'DNS': 6,
'TCP': 5
}
def __init__(self, protocol, payload, sequence_number):
self.priority = Packet.PROTOCOL_PRIORITY[protocol]
sel... | pepincho/Python101-and-Algo1-Courses | Algo-1/week3/5-Bandwidth-Manager/bandwidth_manager.py | Python | mit | 1,423 |
from __future__ import with_statement
import os
from setuptools import setup
# Do not update the version manually - it is managed by `bumpversion`.
version = '2.0.1rc'
setup(
name='pydocstyle',
version=version,
description="Python docstring style checker",
long_description=open('README.rst').read(),
... | Nurdok/pep257 | setup.py | Python | mit | 1,105 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_spice_collective_sentry_twk_male_01.iff"
result.attrib... | obi-two/Rebelion | data/scripts/templates/object/mobile/shared_dressed_spice_collective_sentry_twk_male_01.py | Python | mit | 469 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cnh_profile', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='cnhprofile',
nam... | tpeek/Copy-n-Haste | CopyHaste/cnh_profile/migrations/0002_auto_20150810_1822.py | Python | mit | 764 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012-2013 Pierre Raybaut
# Licensed under the terms of the MIT License
# (see spyderlib/__init__.py for details)
"""
spyderlib.py3compat
-------------------
Transitional module providing compatibility functions intended to help
migrating from Python 2 to Python 3.
... | CVML/winpython | winpython/py3compat.py | Python | mit | 6,585 |
# Grid Search for Algorithm Tuning
import numpy as np
import pandas as pd
from sklearn import datasets
from sklearn.linear_model import Ridge
from sklearn.grid_search import GridSearchCV
### Plotting function ###
from matplotlib import pyplot as plt
from sklearn.metrics import r2_score
def plot_r2(y, y_pred, titl... | WesleyyC/Restaurant-Revenue-Prediction | Ari/needs_work/GridSearch.py | Python | mit | 1,295 |
class NipapError(Exception):
""" NIPAP base error class.
"""
error_code = 1000
class NipapInputError(NipapError):
""" Erroneous input.
A general input error.
"""
error_code = 1100
class NipapMissingInputError(NipapInputError):
""" Missing input.
Most input is passed ... | SoundGoof/NIPAP | nipap/nipap/errors.py | Python | mit | 1,301 |
import math
import RingGameGlobals
import RingAction
import RingTracks
import RingTrack
import RingTrackGroup
from direct.showbase import PythonUtil
STATIC = 0
SIMPLE = 1
COMPLEX = 2
def getRandomRingTrackGroup(type, numRings, rng):
global trackListGenFuncs
funcTable = trackListGenFuncs[type][numRings - 1]
... | ksmit799/Toontown-Source | toontown/minigame/RingTrackGroups.py | Python | mit | 8,136 |
'''
'''
__version__ = '0.1-dev'
device_config_name = 'Devices'
exp_config_name = 'experiment'
| matham/sniffer | sniffer/__init__.py | Python | mit | 97 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_theed_palace_chamberlain.iff"
result.attribute_templat... | anhstudios/swganh | data/scripts/templates/object/mobile/shared_dressed_theed_palace_chamberlain.py | Python | mit | 457 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Static()
result.template = "object/static/structure/general/shared_palette_supply_01.iff"
result.attribute_templa... | anhstudios/swganh | data/scripts/templates/object/static/structure/general/shared_palette_supply_01.py | Python | mit | 455 |
#!/usr/bin/env python
import smtplib
mail_server = 'smtp.example.com'
mail_server_port = 465
from_addr = 'foo@example.com'
to_addr = 'bar@exmaple.com'
from_header = 'From: %s\r\n' % from_addr
to_header = 'To: %s\r\n\r\n' % to_addr
subject_header = 'Subject: Testing SMTP Authentication'
body = 'This mail tests SMTP A... | lluxury/P_U_S_A | 4_documentation/code/authentication_email.py | Python | mit | 647 |
"""
Extensions called during training to generate samples and diagnostic plots and printouts.
"""
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import numpy as np
import os
import theano.tensor as T
import theano
from blocks.extensions import SimpleExtension
import viz
import sampler
clas... | JesseLivezey/Diffusion-Probabilistic-Models | extensions.py | Python | mit | 7,673 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import hypothesis.strategies as st
from caffe2.python import core, workspace
from hypothesis import given
import caffe2.python.hypothesis_test_util as hu
import numpy a... | ryfeus/lambda-packs | pytorch/source/caffe2/python/operator_test/ngram_ops_test.py | Python | mit | 2,472 |
from django.core.management.base import BaseCommand
from axes.handlers.proxy import AxesProxyHandler
class Command(BaseCommand):
help = "Reset access log records older than given days."
def add_arguments(self, parser):
parser.add_argument(
"--age",
type=int,
defau... | jazzband/django-axes | axes/management/commands/axes_reset_logs.py | Python | mit | 643 |
from __future__ import absolute_import
from builtins import range
from functools import partial
import numpy as npo
try:
import scipy
except:
from warnings import warn
warn('Skipping scipy tests.')
else:
import autograd.numpy as np
import autograd.numpy.random as npr
import autograd.scipy.signa... | HIPS/autograd | tests/test_scipy.py | Python | mit | 13,976 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tensorflow/core/util/memmapped_file_system.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.p... | ryfeus/lambda-packs | Tensorflow_Pandas_Numpy/source3.6/tensorflow/core/util/memmapped_file_system_pb2.py | Python | mit | 4,351 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | lmazuel/azure-sdk-for-python | azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/resource_group.py | Python | mit | 1,961 |
import json
import os
'''
Class responsible for parsing/validating the local function specs, processing the specs,
and returning something that can be saved to the DB.
Typical usage is to initialize and the read_and_validate.
Then, once a compilation report is made, you can perform a full validation.
Finally, to cr... | kbaseIncubator/catalog | lib/biokbase/catalog/local_function_reader.py | Python | mit | 13,976 |
from django.shortcuts import render, render_to_response
from django.shortcuts import redirect
from django.template import RequestContext
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.conf import settings
from manage.forms import *
from manage.models import *
from... | csdevsc/colcat_crowdsourcing_application | manage/views.py | Python | mit | 7,968 |
#! /usr/bin/env python
usage = """%prog Version of 10th November 2009
(c) Mark Johnson
Extracts words and their counts from adaptor grammar .wlt files, and writes
out lines of the form
Wordtype Word Probability Std-deviation
usage: %prog [options]"""
import optparse, re, sys
import lx, tb
de... | SnippyHolloW/contextual_word_segmentation | mark_scripts/topicsandcollocations/grammar-wordcounts.py | Python | mit | 1,886 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-21 21:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api_v2', '0008_auto_20170101_0105'),
]
operations = [
migrations.AddField(
... | AstroMatt/esa-subjective-time-perception | backend/api_v2/migrations/0009_trial_is_valid.py | Python | mit | 496 |
import json
import pytest
from GSuiteSecurityAlertCenter import MESSAGES, GSuiteClient, DemistoException
from unittest.mock import patch
def get_data_from_file(filepath):
"""
Returns data of specified file.
:param filepath: absolute or relative path of file
"""
with open(filepath) as f:
... | demisto/content | Packs/GSuiteSecurityAlertCenter/Integrations/GSuiteSecurityAlertCenter/GSuiteSecurityAlertCenter_test.py | Python | mit | 18,779 |
import json
from django.contrib.auth.decorators import login_required
from django.contrib.auth.views import logout
from django.shortcuts import render
from django.http import HttpResponseRedirect, HttpResponse
from movement_app.models import *
from movement_app.logic import find_move
def index(request):
if requ... | ox1omon/movement_fefu | movement_app/views.py | Python | mit | 5,870 |
if __name__ == '__main__':
main() | JeremiahZhang/pybeginner | _src/om2py0w/0wex0/__init__.py | Python | mit | 34 |
import unittest
import obdlib.utils as utils
class TestUtils(unittest.TestCase):
def setUp(self):
utils.unit_english = 0
def test_rpm(self):
assert utils.rpm('0000') == 0.0
assert utils.rpm('FFFF') == 16383.75
def test_speed(self):
# unit_english == 0
self.assertE... | QualiApps/obdlib | tests/test_utils.py | Python | mit | 6,692 |
#!/usr/bin/env python2
# Copyright (c) 2014-2015 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 mempool limiting together/eviction with the wallet
from test_framework.test_framework import Bitc... | bitcoinclassic/bitcoinclassic | qa/rpc-tests/mempool_limit.py | Python | mit | 2,225 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | AutorestCI/azure-sdk-for-python | azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/name_availability.py | Python | mit | 1,227 |
import tensorflow as tf
from .network import Network
from ..fast_rcnn.config import cfg
class VGGnet_test(Network):
def __init__(self, trainable=True):
self.inputs = []
self.data = tf.placeholder(tf.float32, shape=[None, None, None, 3])
self.im_info = tf.placeholder(tf.float32, shape=[None... | CharlesShang/TFFRCNN | lib/networks/VGGnet_test.py | Python | mit | 2,855 |
"""
Serializers used in various InvenTree apps
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import tablib
from decimal import Decimal
from collections import OrderedDict
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ... | inventree/InvenTree | InvenTree/InvenTree/serializers.py | Python | mit | 18,182 |
# -*- coding: utf-8 -*-
#
# SelfTest/Hash/test_SHA3_256.py: Self-test for the SHA-3/256 hash function
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# e... | mchristopher/PokemonGo-DesktopMap | app/pylibs/win32/Cryptodome/SelfTest/Hash/test_SHA3_256.py | Python | mit | 2,985 |
import argparse
import cPickle
import random
import os
from barista import baristanet
from barista import netutils
from replay import ReplayDataset
from expgain import *
from gamesim.SnakeGame import SnakeGame, gray_scale
import cv2
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument("archi... | kjchavez/distributed-deep-q | viz/vizpolicy.py | Python | mit | 2,693 |
# -*- coding: utf-8 -*-
###
# (C) Copyright (2012-2016) Hewlett Packard Enterprise Development LP
#
# 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 restriction, including without limi... | andreadean5/python-hpOneView | tests/unit/test_servers.py | Python | mit | 10,216 |
#! /usr/bin/python3.5
#-------------------------------------------------------------------
# tarfile.py
#-------------------------------------------------------------------
# Copyright (C) 2002 Lars Gustaebel <lars@gustaebel.de>
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any perso... | jameswatt2008/jameswatt2008.github.io | python/Python核心编程/网络编程/截图和代码/概述、SOCKET/多进程copy文件/test/tarfile.py | Python | gpl-2.0 | 92,927 |
import z3
from miasm2.core.asmblock import AsmLabel
from miasm2.expression.expression import *
from miasm2.ir.translators.translator import Translator
from miasm2.ir.translators.z3_ir import Z3Mem
# Some examples of use/unit tests.
def equiv(z3_expr1, z3_expr2):
s = z3.Solver()
s.add(z3.Not(z3_expr1 == z3_ex... | chubbymaggie/miasm | test/ir/translators/z3_ir.py | Python | gpl-2.0 | 5,680 |
#!/usr/bin/env python
from pcbnew import *
lst = FootprintEnumerate("/usr/share/kicad/modules/sockets.mod")
for name in lst:
m = FootprintLoad("/usr/share/kicad/modules/sockets.mod",name)
print name,"->",m.GetLibRef(), m.GetReference()
for p in m.Pads():
print "\t",p.GetPadName(),p.GetPosition(),p.GetPos0(), p.Get... | johnbeard/kicad-git | pcbnew/scripting/examples/listPcbLibrary.py | Python | gpl-2.0 | 331 |
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# ------------------------------------------------------... | marmyshev/item_title | openlp/plugins/songs/lib/songimport.py | Python | gpl-2.0 | 15,903 |
#!/usr/bin/python2.7 -u
import subprocess
subprocess.call(['ls', '/dev/null'])
| nonemaw/MATRIX_01 | COMP9041/ass1/examples/0/ls.py | Python | gpl-2.0 | 82 |
# -*- coding: utf-8 -*-
#
# AWL simulator - instructions
#
# Copyright 2012-2014 Michael Buesch <m@bues.ch>
#
# 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
... | gion86/awlsim | awlsim/core/instructions/insn_gt_d.py | Python | gpl-2.0 | 1,598 |
"""
High-level libvirt test utility functions.
This module is meant to reduce code size by performing common test procedures.
Generally, code here should look like test code.
More specifically:
- Functions in this module should raise exceptions if things go wrong
- Functions in this module typically use funct... | rbian/avocado-vt | virttest/utils_test/libvirt.py | Python | gpl-2.0 | 106,637 |
from Screens.Screen import Screen
from Components.ActionMap import NumberActionMap, ActionMap
from Components.config import config, ConfigNothing, ConfigYesNo, ConfigSelection, ConfigText, ConfigPassword
from Tools.Directories import resolveFilename, SCOPE_CURRENT_PLUGIN
from Components.SystemInfo import SystemInfo
fro... | postla/OpenNFR-E2 | lib/python/Screens/Setup.py | Python | gpl-2.0 | 9,464 |
#
# Copyright (c) 2009 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of... | colloquium/spacewalk | backend/spacewalk/common/__init__.py | Python | gpl-2.0 | 607 |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import binascii
import os
import struct
import subprocess
import aurorawatchnet as awn
import aurorawatchnet.message
# Parse command line options
parser = argparse.ArgumentParser(description='Make firmware image files')
parser.add_argumen... | stevemarple/AuroraWatchNet | software/magnetometer/sketches/RioLog/mkfwimage.py | Python | gpl-2.0 | 2,395 |
"""Module implementing Krack Attack on client, as a custom WPA Access Point
More details on the attack can be found on https://www.krackattacks.com/
Example of use (from the scapy shell):
>>> load_module("krack")
>>> KrackAP(
iface="mon0", # A monitor interface
ap_mac='11:22:33:44:55:66', # MAC ... | smainand/scapy | scapy/modules/krack/__init__.py | Python | gpl-2.0 | 965 |
#
# gui.py - Graphical front end for anaconda
#
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
# Red Hat, Inc. All rights reserved.
#
# 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 F... | kalev/anaconda | pyanaconda/gui.py | Python | gpl-2.0 | 50,515 |
import numpy as np
import cv2
import cv2.cv as cv
from video import create_capture
from common import clock, draw_str
help_message = '''
USAGE: facedetect.py [--cascade <cascade_fn>] [--nested-cascade <cascade_fn>] [<video_source>]
'''
def detect(img, cascade):
rects = cascade.detectMultiScale(img, sca... | petterreinholdtsen/cinelerra-hv | thirdparty/OpenCV-2.3.1/samples/python2/facedetect.py | Python | gpl-2.0 | 1,942 |
import logging
import os
import re
import shutil
from autotest.client.shared import error
from avocado.utils import process
from virttest import libvirt_vm
from virttest import utils_libvirtd
from virttest import virsh
from virttest import utils_conn
def do_virsh_connect(uri, options):
"""
Execute connect ... | waynesun09/tp-libvirt | libvirt/tests/src/virsh_cmd/virsh_connect.py | Python | gpl-2.0 | 8,185 |
# -*- coding: utf-8 -*-
# pylint: disable=redefined-outer-name
import os
import pytest
from guake import guake_version
from guake.about import AboutDialog
@pytest.fixture
def dialog(mocker):
mocker.patch("guake.simplegladeapp.Gtk.Widget.show_all")
try:
old_os_environ = os.environ
os.environ[... | Kaian/guake | guake/tests/test_about.py | Python | gpl-2.0 | 650 |
#!/usr/bin/env python
import sys, os
import numpy as np
import logging
import IPython as ip
from IPython import parallel
from IPython.parallel.error import RemoteError
from msmbuilder import arglib
from msmbuilder import metrics
from msmbuilder import Project
from parallel_assign import remote, local
def setup_logge... | msmbuilder/msmbuilder-legacy | Extras/parallel_assign/scripts/AssignParallel.py | Python | gpl-2.0 | 7,120 |
# -*- coding: utf-8 -*-
import re
import os
import sys
import xbmc
import urllib
import urllib2
import xbmcvfs
import xbmcaddon
import xbmcgui,xbmcplugin
from bs4 import BeautifulSoup
__addon__ = xbmcaddon.Addon()
__author__ = __addon__.getAddonInfo('author')
__scriptid__ = __addon__.getAddonInfo('id')
__scrip... | jindaxia/xbmc-addons-chinese | service.subtitles.subhd/service.py | Python | gpl-2.0 | 9,754 |
import os
import pytest
@pytest.mark.bashcomp(cmd="pkgconf")
class TestPkgconf:
@pytest.mark.complete("pkgconf ")
def test_1(self, completion):
assert completion
@pytest.mark.complete("pkgconf -", require_cmd=True)
def test_2(self, completion):
assert completion
@pytest.mark.com... | algorythmic/bash-completion | test/t/test_pkgconf.py | Python | gpl-2.0 | 548 |
from plover.key_combo import parse_key_combo
from . import TestCase
class KeyComboParserTest(TestCase):
def test_noop(self):
for combo_string in ('', ' '):
self.assertEqual(parse_key_combo(combo_string), [])
def test_syntax_error(self):
for combo_string in (
# Inv... | Germanika/plover | test/test_key_combo.py | Python | gpl-2.0 | 4,119 |
from __future__ import absolute_import, print_function, division
from netlib.http import decoded
from .connections import ClientConnection, ServerConnection
from .flow import Flow, Error
from .http import (
HTTPFlow, HTTPRequest, HTTPResponse, Headers,
make_error_response, make_connect_request, make_con... | x2Ident/x2Ident_test | mitmproxy/mitmproxy/models/__init__.py | Python | gpl-3.0 | 753 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# filename: fdfs_test.py
import os, sys, time
try:
from fdfs_client.client import *
from fdfs_client.exceptions import *
except ImportError:
import_path = os.path.abspath('../')
sys.path.append(import_path)
from fdfs_client.client import *
from fdf... | kimiscircle/fdfs_client-py | fdfs_client/fdfs_test.py | Python | gpl-3.0 | 13,799 |
"""
Implements a StreamTester that runs over Twitter data. See the class
docstring.
This module is written for Python 3 only. The __future__ imports you see here
are just to let Python 2 scan the file without crashing with a SyntaxError.
"""
from __future__ import print_function, unicode_literals
import os
from collec... | dantebarba/docker-media-server | plex/Sub-Zero.bundle/Contents/Libraries/Shared/ftfy/streamtester/twitter_tester.py | Python | gpl-3.0 | 3,155 |
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
from pylab import *
n = 1025
# computed from optimization algorithm
fd = fromfile('test_fdmin_output.bin', '<f4').reshape([n,n])
# analytical solution
r = fromfile('rastr.bin', '<f4').reshape([n,n])
figure()
imshow(fd)
colorbar()
savef... | billtr0n/rupture_stats | testing/src/plot_fdmin_output.py | Python | gpl-3.0 | 404 |
#!/usr/bin/env python3
# encoding: utf-8
# === This file is part of Calamares - <http://github.com/calamares> ===
#
# Copyright 2014, Philip Müller <philm@manjaro.org>
# Copyright 2014, Teo Mrnjavac <teo@kde.org>
#
# Calamares is free software: you can redistribute it and/or modify
# it under the terms of the G... | maui-packages/calamares | src/modules/displaymanager/main.py | Python | gpl-3.0 | 17,415 |
# codinf=utf-8
from pelican.utils import slugify
from .cached import FlickrCached
import main
import logging
logger = logging.getLogger(__name__)
class FlickrPhotoset(FlickrCached):
'''
Represents & Cache a Flickr Photoset
'''
primary = None
photos = []
def __init__(self, xml=None, id=None):
if xml i... | getpelican-plugins/pelican-flickr | pelican-flickr/models.py | Python | gpl-3.0 | 4,630 |
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
##This software is available to you under the terms of the GPL-3, see "/usr/share/common-licenses/GPL-3".
##Copyright:
##- Tomasz Makarewicz (makson96@gmail.com)
import os, shutil
from subprocess import check_output
recultis_dir = os.getenv("HOME") + "/.recultis/"
self_d... | makson96/Recultis | games/jedioutcast/game.py | Python | gpl-3.0 | 2,623 |
# Eve W-Space
# Copyright (C) 2013 Andrew Austin and other 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 License, or
# (at your option... | davidsb30/eve-wspace | evewspace/Map/views.py | Python | gpl-3.0 | 30,128 |
from django.db import models
import datetime
# Create your models here.
class AudioFile(models.Model):
# Titulo: string. No nulo
# Link permanente: string. No nulo
# Modo de compartir (público/privado): String
# URL de la imagen: string
# Descripcion: string
# Duracion: int
# Genero: string... | mpvillafranca/hear-cloud | apps/audio/models.py | Python | gpl-3.0 | 464 |
# Copyright (c) 2015 SUSE Linux GmbH. All rights reserved.
#
# This file is part of kiwi.
#
# kiwi 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 la... | dirkmueller/kiwi | kiwi/filesystem/ext4.py | Python | gpl-3.0 | 1,355 |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) 2008-2013 - Lionel Dricot & Bertrand Rousseau
#
# This program is free software: you can redistribute it and/or modify it under
# t... | shtrom/gtg | GTG/gtk/__init__.py | Python | gpl-3.0 | 1,311 |
from os.path import dirname, basename, isfile, abspath
import glob, importlib, sys
modules = glob.glob(dirname(__file__) + "/email_*.py")
__all__ = [basename(f)[:-3] for f in modules if isfile(f)]
sys.path.append(dirname(abspath(__file__)))
for m in __all__:
__import__(m, locals(), globals())
del m, f, dirnam... | DataSploit/datasploit | emails/__init__.py | Python | gpl-3.0 | 380 |
#-*- coding:utf-8 -*-
"""
This file is part of OpenSesame.
OpenSesame 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.
OpenSesame is distri... | eort/OpenSesame | openexp/_clock/psycho.py | Python | gpl-3.0 | 953 |
import datetime
from django import template
register = template.Library()
@register.filter
def xxxx_to_now(value):
value = int(value)
return range(value, datetime.datetime.now().year + 2)
| hzlf/openbroadcast.org | website/base/templatetags/daterange_tags.py | Python | gpl-3.0 | 201 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# Gestión de parámetros de configuración - xbmc eden
#------------------------------------------------------------
# tvalacarta
# http://blog.tvalacarta.info/plugin-xbmc/tvalacarta/
#--------------------------------------------------... | CarlosCondor/pelisalacarta-xbmc-plus | platformcode/xbmceden/config.py | Python | gpl-3.0 | 2,376 |
def _lsbStrToInt(str):
return ord(str[0]) + (ord(str[1]) << 8) + (ord(str[2]) << 16) + (ord(str[3]) << 24)
| mancoast/pycdc | tests/22_test_expressions.ref.py | Python | gpl-3.0 | 119 |
import extern
from Bio import SeqIO
from io import StringIO
class SequenceExtractor:
def extract(self, reads_to_extract, database_fasta_file, output_file):
'''Extract the reads_to_extract from the database_fasta_file and put them in
output_file.
Parameters
----------
reads_... | geronimp/graftM | graftm/sequence_extractor.py | Python | gpl-3.0 | 1,637 |
# -*- coding: utf-8 -*-
"""
tmdbsimple.search
~~~~~~~~~~~~~~~~~
This module implements the Search functionality of tmdbsimple.
Created by Celia Oakley on 2013-10-31.
:copyright: (c) 2013-2018 by Celia Oakley
:license: GPLv3, see LICENSE for more details
"""
from .base import TMDB
class Search(TMDB):
"""
Se... | axlt2002/script.light.imdb.ratings.update | resources/support/tmdbsimple/search.py | Python | gpl-3.0 | 6,284 |
# -*- coding: utf-8 -*-
from __future__ import division
from procedural_city_generation.roadmap.getSuggestion import getSuggestion
from procedural_city_generation.roadmap.check import check
from procedural_city_generation.additional_stuff.Singleton import Singleton
singleton=Singleton("roadmap")
def iteration(front):... | stormsson/procedural_city_generation_wrapper | vendor/josauder/procedural_city_generation/roadmap/iteration.py | Python | mpl-2.0 | 1,126 |
""" Common Authentication Handlers used across projects. """
from __future__ import absolute_import
import logging
import django.utils.timezone
from oauth2_provider import models as dot_models
from provider.oauth2 import models as dop_models
from rest_framework.exceptions import AuthenticationFailed
from rest_framewo... | ESOedX/edx-platform | openedx/core/lib/api/authentication.py | Python | agpl-3.0 | 4,363 |
import json
from flask import url_for
from flask_restplus import schemas
from udata.tests.helpers import assert200
class SwaggerBlueprintTest:
modules = []
def test_swagger_resource_type(self, api):
response = api.get(url_for('api.specs'))
assert200(response)
swagger = json.loads(re... | opendatateam/udata | udata/tests/api/test_swagger.py | Python | agpl-3.0 | 763 |
from .expression import Expression, Bool, BitVec, Array, BitVecConstant, issymbolic # noqa
from .constraints import ConstraintSet # noqa
from .solver import * # noqa
from . import operators as Operators # noqa
import logging
logger = logging.getLogger(__name__)
| trailofbits/manticore | manticore/core/smtlib/__init__.py | Python | agpl-3.0 | 268 |
"""
Minimal Django settings for tests of common/lib.
Required in Django 1.9+ due to imports of models in stock Django apps.
"""
import sys
import tempfile
from django.utils.translation import ugettext_lazy as _
from path import Path
# TODO: Remove the rest of the sys.path modification here and in (cms|lms)/envs/com... | mitocw/edx-platform | openedx/tests/settings.py | Python | agpl-3.0 | 3,886 |
import os
import os.path
import ujson
from iati_codelists.models import Sector, SectorVocabulary
class GlobalClustersSectorImporter():
"""
Wrapper class for all import methods used on the Country model
"""
def __init__(self):
"""
"""
def get_json_data(self, location_from_here):
... | openaid-IATI/OIPA | OIPA/iati_synchroniser/humanitrian_global_clusters_import.py | Python | agpl-3.0 | 1,087 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | scottpurdy/nupic | src/nupic/algorithms/backtracking_tm.py | Python | agpl-3.0 | 143,241 |
# Standard Library Imports
import configargparse
from datetime import datetime, timedelta
from glob import glob
import json
import logging
from math import radians, sin, cos, atan2, sqrt, degrees
import os
import sys
import re
# 3rd Party Imports
# Local Imports
from . import config
log = logging.getLogger('Utils')
... | xc0ut/PokeAlarm | PokeAlarm/Utils.py | Python | agpl-3.0 | 11,971 |
# Copyright (C) 2012 Eduardo Robles Elvira <edulix AT wadobo DOT com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ve... | pirata-cat/agora-ciudadana | agora_site/accounts/forms.py | Python | agpl-3.0 | 24,702 |