repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
xiandiancloud/ji
lms/djangoapps/courseware/features/change_enrollment.py
15
1796
""" Provides lettuce acceptance methods for course enrollment changes """ from __future__ import absolute_import from lettuce import world, step from opaque_keys.edx.locations import SlashSeparatedCourseKey from logging import getLogger logger = getLogger(__name__) @step(u'the course "([^"]*)" has all enrollment mod...
agpl-3.0
bikash/kaggleCompetition
microsoft malware/code/_untuned_modeling.py
1
5556
###################################################### # _untuned_modeling.py # author: Gert Jacobusse, gert.jacobusse@rogatio.nl # licence: FreeBSD """ Copyright (c) 2015, Gert Jacobusse All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that...
apache-2.0
SolaWing/ycmd
cpp/ycm/tests/gmock/gtest/scripts/common.py
1180
2919
# Copyright 2013 Google Inc. All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the foll...
gpl-3.0
copooper/shadowsocks
shadowsocks/local.py
1015
2248
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2012-2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
apache-2.0
tectronics/pychess
lib/pychess/Utils/lutils/lsearch.py
20
12292
from __future__ import absolute_import from time import time from random import random from heapq import heappush, heappop from .lmovegen import genAllMoves, genCheckEvasions, genCaptures from .egtb_gaviota import egtb_gaviota from pychess.Utils.const import * from pychess.Utils.Move import Move from pychess.Utils.log...
gpl-3.0
outofbits/tracker
tests/functional-tests/07-graph.py
4
4816
#!/usr/bin/python # # Copyright (C) 2010, Nokia <ivan.frade@nokia.com> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version....
lgpl-2.1
YueHonghui/shadowsocks
shadowsocks/crypto/rc4_md5.py
1042
1339
#!/usr/bin/env python # # Copyright 2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
zasdfgbnm/tensorflow
tensorflow/python/data/kernel_tests/reader_dataset_ops_test.py
8
28362
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
JoePelz/SAM
sam/common.py
2
9717
import os import sys import importlib import logging import web import smtplib from sam import constants logger = logging.getLogger(__name__) def load_plugins(): newly_loaded = [] plugin_path = os.path.abspath(constants.plugins['root']) if not os.path.isdir(plugin_path): return newly_loaded sy...
gpl-3.0
Zumochi/eve-wspace
evewspace/Map/migrations/0010_auto__add_field_signature_owned_by__add_field_signature_owned_time.py
9
18480
# -*- 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 'Signature.owned_by' db.add_column('Map_signature', 'owned_by', self.gf...
apache-2.0
clovertrail/cloudinit-bis
tests/unittests/test_handler/test_handler_mcollective.py
3
5452
from cloudinit import (cloud, distros, helpers, util) from cloudinit.config import cc_mcollective from cloudinit.sources import DataSourceNoCloud from .. import helpers as t_help import configobj import logging import os import shutil from six import BytesIO import tempfile LOG = logging.getLogger(__name__) STOCK_...
gpl-3.0
jalabort/ijcv-2014-aam
aam/image/test/image_test.py
1
18144
import warnings import numpy as np from numpy.testing import assert_allclose, assert_equal from nose.tools import raises from menpo.testing import is_same_array from menpo.image import BooleanImage, MaskedImage, Image @raises(ValueError) def test_create_1d_error(): Image(np.ones(1)) def test_image_n_elements():...
bsd-2-clause
Nitrate/Nitrate
src/tcms/xmlrpc/api/product.py
2
16510
# -*- coding: utf-8 -*- from django.contrib.auth.decorators import permission_required from django.contrib.auth.models import User from tcms.management.models import Product from tcms.xmlrpc.decorators import log_call from tcms.xmlrpc.utils import pre_check_product, parse_bool_value __all__ = ( "check_category",...
gpl-2.0
nevins-b/lemur
lemur/plugins/lemur_openssl/plugin.py
1
4304
""" .. module: lemur.plugins.lemur_openssl.plugin :platform: Unix :copyright: (c) 2015 by Netflix Inc., see AUTHORS for more :license: Apache, see LICENSE for more details. .. moduleauthor:: Kevin Glisson <kglisson@netflix.com> """ from io import open import subprocess from flask import current_app from ...
apache-2.0
leoliujie/odoo
openerp/addons/base/ir/ir_rule.py
312
8048
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
cliffe/SecGen
modules/utilities/unix/labtainers/files/Labtainers-master/scripts/labtainer-instructor/assess_bin/UniqueCheck.py
2
10763
#!/usr/bin/env python ''' This software was created by United States Government employees at The Center for the Information Systems Studies and Research (CISR) at the Naval Postgraduate School NPS. Please note that within the United States, copyright protection is not available for any works created by United Sta...
gpl-3.0
ppribeli/AliPhysics
PWGJE/EMCALJetTasks/Tracks/analysis/old/SpectrumContainer.py
42
22919
#! /usr/bin/env python from base.Helper import NormaliseBinWidth from base.struct.ClusterTHnSparse import AxisFormatClustersOld, AxisFormatClustersNew from base.struct.TrackTHnSparse import AxisFormatTracksOld, AxisFormatTracksNew from base.struct.EventHistogram import EventHistogramOld, EventHistogramNew from base.Me...
bsd-3-clause
Eigenlabs/EigenD
tools/packages/SCons/Scanner/Prog.py
2
3306
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation # # 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 limitati...
gpl-3.0
s0930342674/pyload
module/plugins/hoster/TwoSharedCom.py
15
1037
# -*- coding: utf-8 -*- import re from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class TwoSharedCom(SimpleHoster): __name__ = "TwoSharedCom" __type__ = "hoster" __version__ = "0.14" __status__ = "testing" __pattern__ = r'http://(?:www\.)?2shared\.com/(accou...
gpl-3.0
brownharryb/erpnext
erpnext/healthcare/doctype/vital_signs/vital_signs.py
14
1675
# -*- coding: utf-8 -*- # Copyright (c) 2015, ESS LLP and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe.utils import cstr class VitalSigns(Document): def on_submit(self): insert_vital_signs...
gpl-3.0
alextingle/autoclapper
autoclapper.py
1
7762
#! /usr/bin/env python ## Support for byteswapping audio streams (needed for AIFF format). _typecode = {2:'h'} def _init_typecode(): import array for t in ('i', 'l'): a = array.array(t) if a.itemsize==4: _typecode[4] = t return import sys print "Can't find array typecode ...
agpl-3.0
CreativeOutbreak/wagtail
wagtail/wagtailcore/models.py
2
30934
import sys import os from modelcluster.models import ClusterableModel from django.db import models, connection, transaction from django.db.models import get_model, Q from django.http import Http404 from django.core.cache import cache from django.contrib.contenttypes.models import ContentType from django.contrib.auth....
bsd-3-clause
hashems/Mobile-Cloud-Development-Projects
appengine/standard/mail/handle_incoming_email.py
9
1502
# Copyright 2016 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
un33k/django-storages
storages/backends/azure_storage.py
4
2389
import os.path import mimetypes from django.core.files.base import ContentFile from django.core.exceptions import ImproperlyConfigured from storages.compat import Storage try: import azure import azure.storage except ImportError: raise ImproperlyConfigured( "Could not load Azure bindings. " ...
bsd-3-clause
reavis/queues
queues/backends/memcached.py
5
2584
""" Backend for queues that implement the memcache protocol, including starling. This backend requires either the memcache or cmemcache libraries to be installed. """ from queues.backends.base import BaseQueue from queues import InvalidBackend, QueueException import os, re try: from cmemcache import Client ...
mit
espressomd/espresso
doc/doxygen/gen_doxyconfig.py
5
1865
#!/usr/bin/env python # Copyright (C) 2013-2019 The ESPResSo project # Copyright (C) 2012 Olaf Lenz # # This file is part of ESPResSo. # # ESPResSo is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either versio...
gpl-3.0
350dotorg/Django
tests/regressiontests/forms/localflavor/ro.py
39
5387
# -*- coding: utf-8 -*- from django.contrib.localflavor.ro.forms import (ROCIFField, ROCNPField, ROCountyField, ROCountySelect, ROIBANField, ROPhoneNumberField, ROPostalCodeField) from utils import LocalFlavorTestCase class ROLocalFlavorTests(LocalFlavorTestCase): def test_ROCountySelect(self): f...
bsd-3-clause
baderj/python-ant
src/ant/core/node.py
5
8113
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2011, Martín Raúl Villalba # # 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 So...
mit
Sodki/ansible-modules-extras
network/asa/asa_config.py
9
7454
#!/usr/bin/python # # 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 later version. # # Ansible is distribut...
gpl-3.0
RPGOne/Skynet
scikit-learn-c604ac39ad0e5b066d964df3e8f31ba7ebda1e0e/examples/svm/plot_separating_hyperplane.py
62
1274
""" ========================================= SVM: Maximum margin separating hyperplane ========================================= Plot the maximum margin separating hyperplane within a two-class separable dataset using a Support Vector Machines classifier with linear kernel. """ print(__doc__) import numpy as np impo...
bsd-3-clause
tracierenea/gnuradio
gr-uhd/examples/python/usrp_spectrum_sense.py
36
11917
#!/usr/bin/env python # # Copyright 2005,2007,2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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 ...
gpl-3.0
sogelink/ansible
lib/ansible/modules/system/runit.py
26
8577
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, Brian Coca <bcoca@ansible.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
oneconvergence/group-based-policy
gbpservice/neutron/services/grouppolicy/extension_manager.py
1
11825
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
apache-2.0
dtroyer/python-openstacksdk
openstack/object_store/v1/account.py
1
1764
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under ...
apache-2.0
JetBrains/intellij-community
python/testData/inspections/PyTypeCheckerInspection/ClassObjectType.py
3
1653
from typing import Type, TypeVar, Optional class MyClass: pass def expects_myclass(x: Type[MyClass]): pass expects_myclass(<warning descr="Expected type 'Type[MyClass]', got 'MyClass' instead">MyClass()</warning>) expects_class(MyClass) T1 = TypeVar('T1') def expects_any_class(x: Type[T1]): pass ex...
apache-2.0
pschella/scipy
benchmarks/benchmarks/sparse.py
20
9563
""" Simple benchmarks for the sparse module """ from __future__ import division, print_function, absolute_import import warnings import time import timeit import numpy import numpy as np from numpy import ones, array, asarray, empty, random, zeros try: from scipy import sparse from scipy.sparse import (csr_m...
bsd-3-clause
lqch14102/lantern
install/linux_x86_32/pt/fteproxy/Crypto/Hash/RIPEMD.py
124
3005
# -*- coding: utf-8 -*- # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is granted a worldwide, perpetual, royalty-free, # non-exclusive license to e...
apache-2.0
bryx-inc/boto
tests/unit/ec2/test_volume.py
111
11441
from tests.compat import mock, unittest from boto.ec2.snapshot import Snapshot from boto.ec2.tag import Tag, TagSet from boto.ec2.volume import Volume, AttachmentSet, VolumeAttribute class VolumeTests(unittest.TestCase): def setUp(self): self.attach_data = AttachmentSet() self.attach_data.id = 1 ...
mit
erezsh/lark
lark/grammar.py
2
2915
from .utils import Serialize ###{standalone class Symbol(Serialize): __slots__ = ('name',) is_term = NotImplemented def __init__(self, name): self.name = name def __eq__(self, other): assert isinstance(other, Symbol), other return self.is_term == other.is_term and self.name ...
mit
huaweiswitch/neutron
neutron/tests/unit/bigswitch/test_servermanager.py
2
24002
# Copyright 2014 Big Switch Networks, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
chyeh727/django
tests/multiple_database/routers.py
379
1927
from __future__ import unicode_literals from django.db import DEFAULT_DB_ALIAS class TestRouter(object): """ Vaguely behave like primary/replica, but the databases aren't assumed to propagate changes. """ def db_for_read(self, model, instance=None, **hints): if instance: retu...
bsd-3-clause
civisanalytics/ansible-modules-core
cloud/amazon/iam.py
1
30387
#!/usr/bin/python # 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 later version. # # Ansible is distributed...
gpl-3.0
bhargavvader/gensim
docs/notebooks/test_notebooks.py
16
1651
import os import sys import tempfile from glob import glob import nbformat from nbconvert.preprocessors import ExecutePreprocessor from nbconvert.preprocessors.execute import CellExecutionError def _notebook_run(path): """Execute a notebook via nbconvert and collect output. :returns (parsed nb object, exe...
lgpl-2.1
YOTOV-LIMITED/kuma
kuma/core/tests/test_middleware.py
21
1352
from nose.tools import eq_ from django.test import RequestFactory from kuma.core.tests import KumaTestCase from ..middleware import SetRemoteAddrFromForwardedFor class TrailingSlashMiddlewareTestCase(KumaTestCase): def test_no_trailing_slash(self): response = self.client.get(u'/en-US/ohnoez') eq_...
mpl-2.0
openfun/edx-platform
common/djangoapps/student/tests/test_course_listing.py
18
6692
""" Unit tests for getting the list of courses for a user through iterating all courses and by reversing group name formats. """ import mock from mock import patch, Mock from student.tests.factories import UserFactory from student.roles import GlobalStaff from xmodule.modulestore import ModuleStoreEnum from xmodule.mo...
agpl-3.0
kinow-io/kinow-python-sdk
test/test_media_sources_api.py
1
1195
# coding: utf-8 """ Server API Reference for Server API (REST/Json) OpenAPI spec version: 1.4.41 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys import unittest import kinow_client from kinow_client.rest import ...
apache-2.0
ea4862/boeffla_cm11
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
titu1994/MobileNetworks
weights/remove_extra_class.py
1
1279
import h5py ''' Place all the weight files here (should automatically be placed after running weight_load.py for all the checkpoints, and then simply run this script to change the weights to support 1000 classes instead of 1001. ''' base = "mobilenet_" alphas = ["1_0", "7_5", "5_0", "2_5"] sizes = [224, 192, 160, 12...
apache-2.0
spiceqa/virt-test
qemu/tests/win_virtio_update.py
3
9832
import time import sys import re import logging import os from autotest.client.shared import error, utils from virttest import utils_test from virttest import utils_misc from virttest import data_dir from virttest import env_process @error.context_aware def run_win_virtio_update(test, params, env): """ Updat...
gpl-2.0
MadManRises/Madgine
shared/bullet3-2.89/examples/pybullet/examples/kuka_with_cube_playback.py
2
1827
import pybullet as p import time import math from datetime import datetime from numpy import * from pylab import * import struct import sys import os, fnmatch import argparse from time import sleep def readLogFile(filename, verbose=True): f = open(filename, 'rb') print('Opened'), print(filename) keys = f.re...
mit
iuliat/nova
nova/api/openstack/compute/contrib/extended_volumes.py
56
2823
# Copyright 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
mrb/letsencrypt
letsencrypt-apache/letsencrypt_apache/augeas_configurator.py
11
7335
"""Class of Augeas Configurators.""" import logging import augeas from letsencrypt import errors from letsencrypt import reverter from letsencrypt.plugins import common from letsencrypt_apache import constants logger = logging.getLogger(__name__) class AugeasConfigurator(common.Plugin): """Base Augeas Configu...
apache-2.0
kobolabs/calibre
src/calibre/ebooks/oeb/iterator/spine.py
2
4280
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import (unicode_literals, division, absolute_import, print_function) from future_builtins import map __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'rest...
gpl-3.0
jgmize/nucleus
vendor-local/lib/python/south/db/oracle.py
25
13676
from __future__ import print_function import os.path import sys import re import warnings import cx_Oracle from django.db import connection, models from django.db.backends.util import truncate_name from django.core.management.color import no_style from django.db.models.fields import NOT_PROVIDED from dj...
bsd-3-clause
ilya-epifanov/ansible
lib/ansible/plugins/lookup/dnstxt.py
103
2115
# (c) 2012, Jan-Piet Mens <jpmens(at)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 later ver...
gpl-3.0
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/PyChart-1.39/demos/failure.py
6
1995
# # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # # Pychart is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2, or (at your option) any # later version. # # Pychart is dis...
mit
anetasie/sherpa
sherpa/astro/optical/tests/test_optical.py
1
18595
# # Copyright (C) 2007, 2016, 2017, 2018, 2020 # Smithsonian Astrophysical Observatory # # # 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 you...
gpl-3.0
thunderox/Minaton
.waf-1.8.5-19a841cd1d216acf003e0ae1045c9763/waflib/ConfigSet.py
2
3763
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import copy,re,os from waflib import Logs,Utils re_imp=re.compile('^(#)*?([^#=]*?)\ =\ (.*?)$',re.M) class ConfigSet(object): __slots__=('table','parent') def __init__(self,...
gpl-2.0
dakrauth/prolog
prolog/formatters.py
1
4768
import sys import logging from textwrap import indent from .config import config __all__ = ['PrologFormatter', 'ColorFormatter', 'Colorize'] class PrologFormatter(logging.Formatter): DEFAULT_FMT = config.LONG_FMT DEFAULT_DATEFMT = config.DATE_FMT DEFAULT_STYLE = config.STYLE_FMT def __init__(self, f...
mit
ThomasColliers/whatmigrate
siteconnection.py
1
5571
# Class that handles What.CD authentication, can download torrents and can search the site log import os,pycurl,urllib,re,sys,urllib2 from BeautifulSoup import BeautifulSoup re_main = re.compile(r'<span style="color: red;">(.*?)</span>') re_detail = re.compile(r' Torrent <a href="torrents\.php\?torrentid=\d+"> \d+</a>...
gpl-3.0
jeroenj/CouchPotatoServer
couchpotato/core/downloaders/nzbget.py
21
11512
from base64 import standard_b64encode from datetime import timedelta import re import shutil import socket import traceback import xmlrpclib from couchpotato.core._base.downloader.main import DownloaderBase, ReleaseDownloadList from couchpotato.core.helpers.encoding import ss, sp from couchpotato.core.helpers.variable...
gpl-3.0
nolanliou/tensorflow
tensorflow/python/layers/normalization.py
8
35451
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
Netuitive/netuitive-diamond
src/collectors/aurora/test/testaurora.py
31
2449
#!/usr/bin/python # coding=utf-8 ############################################################################### from test import CollectorTestCase from test import get_collector_config from test import unittest from mock import Mock from mock import patch from diamond.collector import Collector from aurora import A...
mit
mrwacky42/terraform-1
vendor/github.com/hashicorp/go-msgpack/codec/msgpack_test.py
1232
3478
#!/usr/bin/env python # This will create golden files in a directory passed to it. # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). import msgpack, msgpackrpc, sys, os, threading def get_test_data_list(): # get list with all primitive typ...
mpl-2.0
40223210/w16b_test
gear.py
204
19237
#@+leo-ver=5-thin #@+node:office.20150407074720.1: * @file gear.py #@@language python #@@tabwidth -4 #@+<<declarations>> #@+node:office.20150407074720.2: ** <<declarations>> (application) #@@language python import cherrypy import os import sys # 這個程式要計算正齒輪的齒面寬, 資料庫連結希望使用 pybean 與 SQLite # 導入 pybean 模組與所要使用的 Store 及 S...
gpl-3.0
ofa/connect
open_connect/moderation/models.py
2
1642
"""Models for the moderation app""" from django.conf import settings from django.db import models from open_connect.connect_core.utils.models import TimestampModel from open_connect.connectmessages.models import Message, MESSAGE_STATUSES class ModerationAction(TimestampModel): """List of all moderation actions"...
mit
Nepherhotep/django
tests/queryset_pickle/models.py
281
1904
import datetime from django.db import DJANGO_VERSION_PICKLE_KEY, models from django.utils import six from django.utils.translation import ugettext_lazy as _ def standalone_number(): return 1 class Numbers(object): @staticmethod def get_static_number(): return 2 class PreviousDjangoVersionQuer...
bsd-3-clause
stackforge/monasca-notification
monasca_notification/plugins/email_notifier.py
1
11064
# (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP # Copyright 2017 Fujitsu LIMITED # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICE...
apache-2.0
zeispro/Plugin.Video.America
keepalive.py
333
19919
# This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it w...
gpl-2.0
craigderington/studentloan5
studentloan5/Lib/site-packages/django/db/backends/oracle/creation.py
23
15437
import sys import time from django.conf import settings from django.db.backends.base.creation import BaseDatabaseCreation from django.db.utils import DatabaseError from django.utils.six.moves import input TEST_DATABASE_PREFIX = 'test_' PASSWORD = 'Im_a_lumberjack' class DatabaseCreation(BaseDatabaseCreation): ...
bsd-3-clause
jorik041/paramiko
paramiko/kex_gss.py
26
24880
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # Copyright (C) 2013-2014 science + computing ag # Author: Sebastian Deiss <sebastian.deiss@t-online.de> # # # This file is part of paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser Gene...
lgpl-2.1
springcoil/luigi
examples/ssh_remote_execution.py
67
2931
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
spirrello/spirrello-pynet-work
applied_python/lib/python2.7/site-packages/pylint/test/unittest_lint.py
3
27410
# Copyright (c) 2003-2014 LOGILAB S.A. (Paris, FRANCE). # 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...
gpl-3.0
buildingenergy/heroku-buildpack-python-leatherman
test/distutils/envoy.py
79
4802
# -*- coding: utf-8 -*- """ envoy.core ~~~~~~~~~~ This module provides envoy awesomeness. Copyright 2012, Kenneth Reitz. MIT Licensed. """ import os import shlex import subprocess import threading __version__ = '0.0.2' __license__ = 'MIT' __author__ = 'Kenneth Reitz' class Command(object): def __init__(self...
mit
mbrahod/TD
user_guide_src/source/conf.py
87
8550
# -*- coding: utf-8 -*- # # CodeIgniter documentation build configuration file, created by # sphinx-quickstart on Sun Aug 28 07:24:38 2011. # # 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 # autogenerated file. # #...
mit
mcflugen/topoflow
topoflow/gui/GUI_utils.py
6
6387
# April 23, 2009 # S.D. Peckham import wx #---------------------------------------------------------------- # Get_Directory # Labeled_Text_Box # Labeled_Droplist # Add_Back_Next_Buttons # Precip_Methods # Snowmelt_Methods # ET_Methods # Infil_Methods # GW_Methods # Channel_Methods # Diversion_Methods # Stop_Meth...
mit
hantek/pylearn2
pylearn2/datasets/cos_dataset.py
45
3759
""" .. todo:: WRITEME """ import numpy as N import copy from theano import config import theano.tensor as T from pylearn2.utils.rng import make_np_rng class CosDataset(object): """ Makes a dataset that streams randomly generated 2D examples. The first coordinate is sampled from a uniform distributio...
bsd-3-clause
Therp/odoo
addons/base_report_designer/plugin/openerp_report_designer/bin/script/About.py
293
3815
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
agpl-3.0
FernetMenta/xbmc
lib/gtest/test/gtest_throw_on_failure_test.py
363
5767
#!/usr/bin/env python # # Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
gpl-2.0
MadsJensen/malthe_alpha_project
source_connectivity_permutation.py
1
6505
# -*- coding: utf-8 -*- """ Created on Wed Sep 9 08:41:17 2015. @author: mje """ import numpy as np import numpy.random as npr import os import socket import mne # import pandas as pd from mne.connectivity import spectral_connectivity from mne.minimum_norm import (apply_inverse_epochs, read_inverse_operator) # Pe...
mit
burdell/CS4464-Final-Project
django/db/models/query.py
97
54162
""" The main QuerySet implementation. This provides the public API for the ORM. """ from itertools import izip from django.db import connections, router, transaction, IntegrityError from django.db.models.aggregates import Aggregate from django.db.models.fields import DateField from django.db.models.query_utils import...
bsd-3-clause
yosshy/nova
nova/virt/libvirt/volume/aoe.py
33
2650
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
SnabbCo/neutron
neutron/db/migration/alembic_migrations/versions/1421183d533f_nsx_dhcp_metadata.py
16
2303
# Copyright 2014 VMware, Inc. # All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
apache-2.0
roderickmackenzie/gpvdm
gpvdm_gui/gui/QHTabBar.py
1
2005
# # General-purpose Photovoltaic Device Model - a drift diffusion base/Shockley-Read-Hall # model for 1st, 2nd and 3rd generation solar cells. # Copyright (C) 2012-2017 Roderick C. I. MacKenzie r.c.i.mackenzie at googlemail.com # # https://www.gpvdm.com # Room B86 Coates, University Park, Nottingham, NG7 2RD...
gpl-2.0
NeuralEnsemble/neuroConstruct
lib/jython/Lib/xml/FtCore.py
132
1806
""" Contains various definitions common to modules acquired from 4Suite """ __all__ = ["FtException", "get_translator"] class FtException(Exception): def __init__(self, errorCode, messages, args): # By defining __str__, args will be available. Otherwise # the __init__ of Exception sets it to the...
gpl-2.0
nnmware/nnmware
apps/money/admin.py
1
2443
# nnmware(c)2012-2020 from __future__ import unicode_literals from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from nnmware.apps.money.models import Transaction, Bill, Currency, ExchangeRate @admin.register(Transaction) class TransactionAdmin(admin.ModelAdmin): list_disp...
gpl-3.0
t3dev/odoo
addons/website_slides_survey/tests/test_course_certification_failure.py
1
6421
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.addons.survey.tests.common import SurveyCase class TestCourseCertificationFailureFlow(SurveyCase): def test_course_certification_failure_flow(self): # Step 1: create a simple certification ...
gpl-3.0
jgrocha/QGIS
tests/src/python/test_qgsrulebasedrenderer.py
9
23130
# -*- coding: utf-8 -*- """ *************************************************************************** test_qgsrulebasedrenderer.py --------------------- Date : September 2015 Copyright : (C) 2015 by Matthias Kuhn Email : matthias at opengis dot ch *******...
gpl-2.0
olemis/brython
www/src/Lib/test/test_copyreg.py
173
4217
import copyreg import unittest from test import support from test.pickletester import ExtensionSaver class C: pass class WithoutSlots(object): pass class WithWeakref(object): __slots__ = ('__weakref__',) class WithPrivate(object): __slots__ = ('__spam',) class WithSingleString(object): __slot...
bsd-3-clause
LiveZenLK/CeygateERP
addons/account/tests/test_fiscal_position.py
16
2490
from openerp.addons.account.tests.account_test_classes import AccountingTestCase class TestFiscalPosition(AccountingTestCase): """Tests for fiscal positions in auto apply (account.fiscal.position). If a partner has a vat number, the fiscal positions with "vat_required=True" are preferred. """ def ...
gpl-3.0
bretlowery/snakr
lib/django/views/decorators/debug.py
712
2627
import functools from django.http import HttpRequest def sensitive_variables(*variables): """ Indicates which variables used in the decorated function are sensitive, so that those variables can later be treated in a special way, for example by hiding them when logging unhandled exceptions. Two f...
bsd-3-clause
coolbombom/CouchPotato
cherrypy/lib/auth.py
88
3266
import cherrypy from cherrypy.lib import httpauth def check_auth(users, encrypt=None, realm=None): """If an authorization header contains credentials, return True, else False.""" request = cherrypy.serving.request if 'authorization' in request.headers: # make sure the provided credentials are corr...
gpl-3.0
dikaiosune/nau-elc-force-completion-mailer
mailer.py
1
7174
__author__ = 'adam' import configparser import logging import argparse import smtplib from email.mime.text import MIMEText from datetime import datetime, timedelta from xlrd import open_workbook from jinja2 import Template template = Template(""" <p>Dear {{ instructor.first }},</p> <p>One of the most common Blackbo...
mit
jackrzhang/zulip
zerver/views/invite.py
1
5106
from django.conf import settings from django.core.exceptions import ValidationError from django.http import HttpRequest, HttpResponse from django.utils.translation import ugettext as _ from typing import List, Optional, Set from zerver.decorator import require_realm_admin, to_non_negative_int, \ require_non_guest...
apache-2.0
sanguinariojoe/FreeCAD
src/Mod/Fem/femtaskpanels/task_solver_ccxtools.py
9
16191
# *************************************************************************** # * Copyright (c) 2015 Bernd Hahnebach <bernd@bimstatik.org> * # * * # * This file is part of the FreeCAD CAx development system. * # * ...
lgpl-2.1
matt-graham/reversible-rng
revrng/tests/test_reversible_random_state.py
1
5637
import numpy as np from revrng.numpy_wrapper import ReversibleRandomState SEED = 12345 N_ITER = 100 IN_RANGE_SAMPLES = 10000 SHAPES = [2, (1,), (5, 4), (3, 2, 1, 2)] def test_shape(): state = ReversibleRandomState(SEED) for shape in SHAPES: # ndarray shape always tuple even if integer specified ...
mit
vhakulinen/bruno-server
bruno/commands/decorators.py
1
1424
from bruno.send_utils import send_error from bruno.env import inputs class Args: """ Decorator for validating number of args. You can also pass in help message. """ def __init__(self, no_args, msg=None): self.no_args = no_args if msg: self.msg = '(' + msg + ')' ...
gpl-2.0
FireWalkerX/eyeOS-FOSS-V.2.0
devtools/qooxdoo-sdk/tool/bin/create-application.py
1
12157
#!/usr/bin/env python # -*- coding: utf-8 -*- ################################################################################ # # qooxdoo - the new era of web development # # http://qooxdoo.org # # Copyright: # 2008 - 2010 1&1 Internet AG, Germany, http://www.1und1.de # # License: # LGPL: http://www.gnu.org/...
agpl-3.0
crawln45/Flexget
flexget/tests/test_misc.py
6
9236
# pylint: disable=no-self-use from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from future.utils import text_type import os import stat import pytest from flexget.entry import EntryUnicodeError, Entry class TestDisab...
mit
bottompawn/kbengine
kbe/src/lib/python/Lib/idlelib/idle_test/test_warning.py
87
2752
'''Test warnings replacement in PyShell.py and run.py. This file could be expanded to include traceback overrides (in same two modules). If so, change name. Revise if output destination changes (http://bugs.python.org/issue18318). Make sure warnings module is left unaltered (http://bugs.python.org/issue18081). ''' im...
lgpl-3.0