repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
kongseokhwan/kulcloud-iitp-neutron
neutron/plugins/vmware/extensions/networkgw.py
15
9415
# Copyright 2013 VMware. 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 applic...
apache-2.0
buqing2009/MissionPlanner
Lib/encodings/iso8859_11.py
93
12898
""" Python Character Mapping Codec iso8859_11 generated from 'MAPPINGS/ISO8859/8859-11.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self...
gpl-3.0
Natalia-28028/kpk2016
Cath_the_ball/ball_1.py
2
1945
from tkinter import * from random import * root = Tk() canvas = Canvas(root) canvas.pack() def create_scores_text(): global scores_text scores_text = canvas.create_text(60, 12, text="Scores: " + str(scores), font="Sans 18") def chang...
gpl-3.0
praneethkumarpidugu/matchmaking
lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/srs.py
471
3513
from ctypes import POINTER, c_char_p, c_int, c_void_p from django.contrib.gis.gdal.libgdal import lgdal, std_call from django.contrib.gis.gdal.prototypes.generation import ( const_string_output, double_output, int_output, srs_output, string_output, void_output, ) # Shortcut generation for routines with known...
mit
pizzathief/scipy
scipy/optimize/tests/test_tnc.py
8
11197
""" Unit tests for TNC optimization routine from tnc.py """ from numpy.testing import assert_allclose, assert_equal import numpy as np from math import pow from scipy import optimize from scipy.sparse.sputils import matrix class TestTnc(object): """TNC non-linear optimization. These tests are taken from P...
bsd-3-clause
apache/incubator-superset
superset/migrations/versions/ad82a75afd82_add_query_model.py
5
3118
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
heathy/ProjectEuler
projecteuler/tests/problem_test.py
2
1231
"""Test the problems get the correct answers.""" import unittest from projecteuler.tests.answers import PROBLEM_ANSWERS class MetaTests(type): """Meta class to dynamically create test cases for each problem""" def __new__(mcs, name, bases, attrs): for problem_name, answer in PROBLEM_ANSWERS.items():...
mit
wangcy6/storm_app
frame/kafka-0.11.0/kafka-0.11.0.1-src/tests/kafkatest/tests/core/transactions_test.py
4
11938
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
adamfisk/littleshoot-client
server/appengine/boto/resultset.py
1
4599
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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 limitation the rights to use, copy, modi...
gpl-2.0
android-ia/platform_tools_idea
plugins/hg4idea/testData/bin/hgext/progress.py
90
10860
# progress.py show progress bars for some actions # # Copyright (C) 2010 Augie Fackler <durin42@gmail.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. """show progress bars for some actions This extension uses the progress in...
apache-2.0
EpicCM/SPH-D700-Kernel
external/webkit/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py
3
9434
#!/usr/bin/env python # Copyright (C) 2010 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
prasannav7/ggrc-core
test/unit/test_selenium/test_constants_regex.py
2
2110
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: miha@reciprocitylabs.com # Maintained By: miha@reciprocitylabs.com """Module for testing constant regex expressions.""" import re from lib.constan...
apache-2.0
esboych/shaker
shaker/agent/agent.py
1
5453
# Copyright (c) 2015 Mirantis Inc. # # 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 writi...
apache-2.0
uclaros/QGIS
tests/src/python/test_db_manager_sql_window.py
42
1896
# -*- coding: utf-8 -*- """QGIS Unit tests for the DBManager SQL Window From build dir, run: ctest -R PyQgsDBManagerSQLWindow -V .. note:: 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 vers...
gpl-2.0
anonymouse64/mraa
tests/platform_checks.py
12
2109
#!/usr/bin/env python # Author: Costin Constantin <costin.c.constantin@intel.com> # Copyright (c) 2015 Intel Corporation. # # 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 restrictio...
mit
spatialaudio/panorama
Python/python_core_components/configcreater.py
1
1061
from sys import stderr import configparser class ConfigCreater: ''' Generate a config-file ''' def __init__(self): pass def create_configfile(self, filename): config = configparser.ConfigParser() # section : output config['output'] = {} config['output']['directo...
mit
ryfeus/lambda-packs
HDF4_H5_NETCDF/source2.7/numpy/lib/twodim_base.py
7
26111
""" Basic functions for manipulating 2d arrays """ from __future__ import division, absolute_import, print_function from numpy.core.numeric import ( absolute, asanyarray, arange, zeros, greater_equal, multiply, ones, asarray, where, int8, int16, int32, int64, empty, promote_types, diagonal, nonzero ) ...
mit
RNAEDITINGPLUS/main
node/mirmap/if_clib_phast.py
1
13981
# -*- coding: utf-8 -*- # # Copyright (C) 2011-2012 Charles E. Vejnar # # This is free software, licensed under the GNU General Public License v3. # See /LICENSE for more information. # """Ctypes interface classes with the `PHAST <http://compgen.bscb.cornell.edu/phast>`_ C library.""" import os from ctypes import *...
apache-2.0
raccoongang/edx-platform
openedx/core/djangoapps/content/block_structure/tests/test_transformers.py
21
3350
""" Tests for transformers.py """ from mock import MagicMock, patch from nose.plugins.attrib import attr from unittest import TestCase from ..block_structure import BlockStructureModulestoreData from ..exceptions import TransformerException, TransformerDataIncompatible from ..transformers import BlockStructureTransfor...
agpl-3.0
igemsoftware/SYSU-Software2013
project/Python27/Lib/test/test_cgi.py
17
13950
from test.test_support import run_unittest, check_warnings import cgi import os import sys import tempfile import unittest class HackedSysModule: # The regression test will have real values in sys.argv, which # will completely confuse the test of the cgi module argv = [] stdin = sys.stdin cgi.sys = Ha...
mit
snasoft/QtCreatorPluginsPack
Bin/3rdParty/vera/bin/lib/cmd.py
32
14946
"""A generic class to build line-oriented command interpreters. Interpreters constructed with this class obey the following conventions: 1. End of file on input is processed as the command 'EOF'. 2. A command is parsed out of each line by collecting the prefix composed of characters in the identchars member. 3. A ...
lgpl-3.0
twiest/openshift-ansible
roles/lib_openshift/src/ansible/oc_edit.py
39
1237
# pylint: skip-file # flake8: noqa def main(): ''' ansible oc module for editing objects ''' module = AnsibleModule( argument_spec=dict( kubeconfig=dict(default='/etc/origin/master/admin.kubeconfig', type='str'), state=dict(default='present', type='str', ...
apache-2.0
HenningSchroeder/git-repo
git_command.py
48
5830
# # Copyright (C) 2008 The Android Open Source Project # # 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 la...
apache-2.0
prakritish/ansible
lib/ansible/modules/monitoring/zabbix_screen.py
36
17492
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013-2014, Epic Games, Inc. # # 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 # (...
gpl-3.0
Propanu/upm
examples/python/kxtj3.py
4
2105
#!/usr/bin/env python # The MIT License (MIT) # # Author: Assam Boudjelthia # Copyright (c) 2018 Rohm Semiconductor. # # 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, in...
mit
ilastik/ilastik-0.5
ilastik/core/dataImpex.py
1
19816
import numpy import vigra import os import warnings import pickle import struct import array with warnings.catch_warnings(): warnings.simplefilter("ignore") import h5py from ilastik.core import dataMgr from ilastik.core.volume import DataAccessor as DataAccessor from ilastik.core.overlayMgr import OverlayIte...
bsd-2-clause
fzalkow/scikit-learn
sklearn/cross_validation.py
96
58309
""" The :mod:`sklearn.cross_validation` module includes utilities for cross- validation and performance evaluation. """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org>, # Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause from...
bsd-3-clause
apechimp/servo
tests/wpt/web-platform-tests/websockets/handlers/stash_responder_wsh.py
206
1673
#!/usr/bin/python import urlparse, json from mod_pywebsocket import common, msgutil, util from mod_pywebsocket.handshake import hybi from wptserve import stash address, authkey = stash.load_env_config() stash = stash.Stash("/stash_responder", address=address, authkey=authkey) def web_socket_do_extra_handshake(request...
mpl-2.0
hlzz/dotfiles
graphics/VTK-7.0.0/ThirdParty/Twisted/twisted/web/resource.py
2
13470
# -*- test-case-name: twisted.web.test.test_web -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Implementation of the lowest-level Resource class. """ from __future__ import division, absolute_import __all__ = [ 'IResource', 'getChildForRequest', 'Resource', 'Error...
bsd-3-clause
maleficarium/youtube-dl
youtube_dl/extractor/testurl.py
76
2163
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ExtractorError class TestURLIE(InfoExtractor): """ Allows addressing of the test cases as test:yout.*be_1 """ IE_DESC = False # Do not list _VALID_URL = r'test(?:url)?:(?P<id>(?P<extractor>.+?)(?:_(...
unlicense
batxes/4Cin
SHH_INV_models/SHH_INV_models_final_output_0.2_-0.1_10000/SHH_INV_models2428.py
2
17574
import _surface import chimera try: import chimera.runCommand except: pass from VolumePath import markerset as ms try: from VolumePath import Marker_Set, Link new_marker_set=Marker_Set except: from VolumePath import volume_path_dialog d= volume_path_dialog(True) new_marker_set= d.new_marker_set marker_set...
gpl-3.0
ryfeus/lambda-packs
Tensorflow_LightGBM_Scipy_nightly/source/google/protobuf/internal/testing_refleaks.py
5
4508
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
mit
aimscare/angular-test
node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py
1789
10585
# Copyright (c) 2014 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Xcode-ninja wrapper project file generator. This updates the data structures passed to the Xcode gyp generator to build with ninja instead. The Xcode project i...
mit
sycolon/kernel_3.10
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
4653
3596
# EventClass.py # # This is a library defining some events types classes, which could # be used by other scripts to analyzing the perf samples. # # Currently there are just a few classes defined for examples, # PerfEvent is the base class for all perf event sample, PebsEvent # is a HW base Intel x86 PEBS event, and use...
gpl-2.0
miptliot/edx-platform
lms/djangoapps/certificates/management/commands/regenerate_user.py
3
5970
"""Django management command to force certificate regeneration for one user""" import copy import logging from optparse import make_option from django.contrib.auth.models import User from django.core.management.base import BaseCommand, CommandError from opaque_keys import InvalidKeyError from opaque_keys.edx.keys imp...
agpl-3.0
DzinVision/adventofcode-2016
day_02.py
1
1743
instructions = [] while True: try: instructions.append(input()) except: break password_1 = [] password_2 = [] keypad_1 = [['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9']] keypad_2 =[['0', '0', '1', '0', '0'], ['0', '2', '3', '4', '0'], ['5', '6', '7', '8', '9'], ['0', 'A', 'B', 'C', '0'], ['0...
gpl-3.0
frappe/frappe
frappe/tests/test_form_load.py
1
4445
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt import frappe, unittest from frappe.desk.form.load import getdoctype, getdoc from frappe.core.page.permission_manager.permission_manager import update, reset, add from frappe.custom.doctype.property_setter.property_sette...
mit
redhat-cip/tempest
tempest/tests/common/test_accounts.py
15
16610
# Copyright 2014 Hewlett-Packard Development Company, L.P. # # 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 requir...
apache-2.0
nappels/ga-intro-to-js
slides/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/MSVSSettings.py
383
45223
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. r"""Code to validate and convert settings of the Microsoft build tools. This file contains code to validate and convert settings of the Microsoft build tools. Th...
mit
sbuss/voteswap
lib/social/backends/dropbox.py
83
2385
""" Dropbox OAuth1 backend, docs at: http://psa.matiasaguirre.net/docs/backends/dropbox.html """ from social.backends.oauth import BaseOAuth1, BaseOAuth2 class DropboxOAuth(BaseOAuth1): """Dropbox OAuth authentication backend""" name = 'dropbox' ID_KEY = 'uid' AUTHORIZATION_URL = 'https://www.drop...
mit
manuvarkey/GEstimator
estimator/meas_templates/_2_LLLLL.py
1
2578
#!/usr/bin/env python # -*- coding: utf-8 -*- # # tableofpoints.py # # Copyright 2014 Manu Varkey <manuvarkey@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of...
gpl-3.0
DasIch/django
tests/template_tests/syntax_tests/test_autoescape.py
337
5575
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import SafeClass, UnsafeClass, setup class AutoescapeTagTests(SimpleTestCase): @setup({'autoescape-tag01': '{% autoescape off %}hello{% endautoescape %}'}) def te...
bsd-3-clause
mewtaylor/django
tests/admin_widgets/models.py
227
4760
from __future__ import unicode_literals from django.contrib.auth.models import User from django.db import models from django.utils.encoding import python_2_unicode_compatible class MyFileField(models.FileField): pass @python_2_unicode_compatible class Member(models.Model): name = models.CharField(max_lengt...
bsd-3-clause
theicfire/djangofun
django/contrib/admin/widgets.py
156
12061
""" Form Widget classes specific to the Django admin site. """ import django.utils.copycompat as copy from django import forms from django.forms.widgets import RadioFieldRenderer from django.forms.util import flatatt from django.utils.html import escape from django.utils.text import truncate_words from django.utils.t...
bsd-3-clause
sogelink/ansible
lib/ansible/modules/cloud/ovirt/ovirt_hosts_facts.py
73
3473
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # # 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 #...
gpl-3.0
smartpm/smart
tests/slackloader.py
3
1934
from smart.backends.slack.loader import SlackLoader, SlackPackageInfo, \ parsePackageInfo from smart.cache import Cache, Package from tests.mocker import MockerTestCase OLD_PACKAGE = """\ PACKAGE NAME: name1-version1-arch1-release1 """ NEW_PACKAGE = """\ PACKAGE NAME: name2-v...
gpl-2.0
benstoltz/developer-support
python/arcpy-python/find-and-replace-data-sources-in-mxd/find_and_replace_data_sources.py
6
1654
#------------------------------------------------------------------------------- # Name: Find and Replace Data Sources in MXD # Purpose: Takes an input workspace to recursively walk through a directory # and replace a specified path. A commone use case is when the name # of a server...
apache-2.0
ogenstad/ansible
lib/ansible/module_utils/network/enos/enos.py
68
5474
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by # Ansible still belong to the author of the module, and may assign their own # license to the complete wo...
gpl-3.0
Shrhawk/edx-platform
openedx/core/djangoapps/content/course_overviews/models.py
4
9720
""" Declaration of CourseOverview model """ import json import django.db.models from django.db.models.fields import BooleanField, DateTimeField, DecimalField, TextField, FloatField from django.utils.translation import ugettext from util.date_utils import strftime_localized from xmodule import course_metadata_utils f...
agpl-3.0
vmax-feihu/hue
desktop/core/ext-py/Django-1.6.10/django/utils/module_loading.py
177
3672
import imp import os import sys from django.core.exceptions import ImproperlyConfigured from django.utils import six from django.utils.importlib import import_module def import_by_path(dotted_path, error_prefix=''): """ Import a dotted module path and return the attribute/class designated by the last nam...
apache-2.0
JorgeCoock/django
django/contrib/flatpages/models.py
318
1556
from __future__ import unicode_literals from django.contrib.sites.models import Site from django.core.urlresolvers import get_script_prefix from django.db import models from django.utils.encoding import iri_to_uri, python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ @python_2_unicode_...
bsd-3-clause
buildbot/buildbot
master/buildbot/steps/source/gerrit.py
5
1974
# This file is part of Buildbot. Buildbot 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. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
bkirui/odoo
addons/hr_timesheet_invoice/hr_timesheet_invoice.py
22
18039
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 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
linktlh/Toontown-journey
toontown/suit/SuitDNA.py
1
6596
import random from pandac.PandaModules import * from direct.directnotify.DirectNotifyGlobal import * from toontown.toonbase import TTLocalizer import random from direct.distributed.PyDatagram import PyDatagram from direct.distributed.PyDatagramIterator import PyDatagramIterator from otp.avatar import AvatarDNA notify =...
apache-2.0
hradec/gaffer
python/GafferSceneTest/FilterTest.py
14
2243
########################################################################## # # Copyright (c) 2014, Image Engine Design 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: # # * Redistrib...
bsd-3-clause
ewandor/home-assistant
homeassistant/components/camera/arlo.py
2
5400
""" Support for Netgear Arlo IP cameras. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/camera.arlo/ """ import asyncio import logging from datetime import timedelta import voluptuous as vol import homeassistant.helpers.config_validation as cv from hom...
apache-2.0
mikehankey/fireball_camera
amsaware2.py
1
6050
#!/usr/bin/python3 import settings import sys import os import time as gtime from os import listdir from os.path import isfile, join import json, requests import numpy as np from datetime import datetime, date, time from dateutil import parser from amscommon import read_config #from math import radians, cos, sin, asin...
gpl-3.0
RouxRC/weboob
modules/apec/browser.py
4
5616
# -*- coding: utf-8 -*- # Copyright(C) 2013 Bezleputh # # This file is part of weboob. # # weboob 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 opt...
agpl-3.0
google/ci_edit
app/unit_test_line_buffer.py
1
1145
# Copyright 2019 Google Inc. # # 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, ...
apache-2.0
yuvallanger/gnu-social-media-uploader
gnusocialmediauploader.py
1
2780
#!/usr/bin/env python3 import pathlib import random import logging import getpass import sys import gnusocial as gs import gnusocial.media import gnusocial.statuses logging.basicConfig(level=logging.DEBUG) SERVER_URL = 'https://shitposter.club' USERNAME = 'cow2001' PASSWORD = '' SOURCE_IMAGE_DIRECTORY = pathlib.P...
agpl-3.0
grimmjow8/ansible
lib/ansible/modules/storage/zfs/zfs.py
37
8373
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Johan Wiren <johan.wiren.se@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 th...
gpl-3.0
DIRACGrid/DIRAC
src/DIRAC/Interfaces/scripts/dirac_admin_ban_site.py
2
3109
#!/usr/bin/env python ######################################################################## # File : dirac-admin-ban-site # Author : Stuart Paterson ######################################################################## """ Remove Site from Active mask for current Setup Usage: dirac-admin-ban-site [options]...
gpl-3.0
pabigot/pyxb
tests/drivers/test-mg-sequence.py
2
8660
# -*- coding: utf-8 -*- import logging if __name__ == '__main__': logging.basicConfig() _log = logging.getLogger(__name__) import pyxb.binding.generate import pyxb.utils.domutils from pyxb.utils import six from xml.dom import Node import os.path schema_path = os.path.abspath(os.path.join(os.path.dirname(__file__),...
apache-2.0
allanino/nupic
tests/unit/nupic/regions/knn_anomaly_classifier_region_test.py
35
30031
#!/usr/bin/env python # ---------------------------------------------------------------------- # 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 ...
agpl-3.0
Isendir/brython
www/src/Lib/test/test_importlib/source/test_source_encoding.py
29
3949
from . import util as source_util from importlib import _bootstrap import codecs import re import sys # Because sys.path gets essentially blanked, need to have unicodedata already # imported for the parser to use. import unicodedata import unittest CODING_RE = re.compile(r'^[ \t\f]*#.*coding[:=][ \t]*([-\w.]+)', re....
bsd-3-clause
webmasteraxe/watchman
python/pywatchman/__init__.py
9
15149
# Copyright 2014 Facebook, 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 f...
apache-2.0
mindnervestech/mnrp
addons/email_template/wizard/mail_compose_message.py
30
11648
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
jrha/aquilon
lib/python2.6/aquilon/aqdb/model/dns_domain.py
2
4103
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor # # 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...
apache-2.0
chrisjrn/registrasion
registrasion/tests/test_invoice.py
1
13994
import datetime import pytz from decimal import Decimal from django.core.exceptions import ValidationError from registrasion.models import commerce from registrasion.models import conditions from registrasion.models import inventory from registrasion.tests.controller_helpers import TestingCartController from registra...
apache-2.0
iuliat/nova
nova/virt/libvirt/volume/smbfs.py
2
4102
# 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
alephu5/Soundbyte
environment/lib/python3.3/site-packages/sympy/mpmath/libmp/libmpi.py
20
27586
""" Computational functions for interval arithmetic. """ from .backend import xrange from .libmpf import ( ComplexResult, round_down, round_up, round_floor, round_ceiling, round_nearest, prec_to_dps, repr_dps, dps_to_prec, bitcount, from_float, fnan, finf, fninf, fzero, fhalf, fone, fnone, ...
gpl-3.0
peterdougstuart/PCWG
test-gui/gui/dataset_tab.py
2
49004
import Tkinter as tk import ttk class DatasetTab(ClosableTab): def __init__(self, notebook, fileName, console): ClosableTab.__init__(self, notebook, fileName, console) self.config = configuration.DatasetConfiguration(fileName) self.addFormElements() self.main_tab.validate(False...
mit
rperier/linux-rockchip
scripts/gdb/linux/cpus.py
997
3560
# # gdb helper commands and functions for Linux kernel debugging # # per-cpu tools # # Copyright (c) Siemens AG, 2011-2013 # # Authors: # Jan Kiszka <jan.kiszka@siemens.com> # # This work is licensed under the terms of the GNU GPL version 2. # import gdb from linux import tasks, utils MAX_CPUS = 4096 def get_cu...
gpl-2.0
jadbin/xpaw
tests/test_stats.py
1
3084
# coding=utf-8 from xpaw.stats import StatsCollector, DummyStatsCollector class TestStatsCollector: def test_get_none_key(self): stats = StatsCollector() assert stats.get('key') is None assert stats.get('key', 'default') is 'default' stats.set('key', 'value') assert stats....
apache-2.0
fabriziodemaria/luigi
luigi/contrib/sqla.py
54
15631
# -*- coding: utf-8 -*- # # Copyright (c) 2015 Gouthaman Balaraman # # 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 applic...
apache-2.0
moreati/django
django/contrib/sessions/backends/signed_cookies.py
383
2895
from django.conf import settings from django.contrib.sessions.backends.base import SessionBase from django.core import signing class SessionStore(SessionBase): def load(self): """ We load the data from the key itself instead of fetching from some external data store. Opposite of _get_sess...
bsd-3-clause
pfnet/chainer
tests/chainerx_tests/unit_tests/routines_tests/test_reduction.py
4
10196
import chainer import numpy import pytest import chainerx import chainerx.testing from chainerx_tests import array_utils from chainerx_tests import math_utils from chainerx_tests import op_utils _logsumexp_params = [ ((2,), 0), ((2,), -1), ((2, 3), None), ((2, 3), 0), ((2, 3), 1), ((2, 3), -...
mit
lukauskas/scipy
scipy/optimize/_trustregion_dogleg.py
135
4449
"""Dog-leg trust-region optimization.""" from __future__ import division, print_function, absolute_import import numpy as np import scipy.linalg from ._trustregion import (_minimize_trust_region, BaseQuadraticSubproblem) __all__ = [] def _minimize_dogleg(fun, x0, args=(), jac=None, hess=None, *...
bsd-3-clause
guardian/alerta
alerta/views/bulk.py
1
4499
from flask import jsonify, request from flask_cors import cross_origin from alerta.app import qb from alerta.auth.decorators import permission from alerta.exceptions import ApiError, RejectException from alerta.models.alert import Alert from alerta.models.enums import Scope from alerta.models.metrics import timer fro...
apache-2.0
jallohm/django
tests/select_related/models.py
276
3480
""" Tests for select_related() ``select_related()`` follows all relationships and pre-caches any foreign key values so that complex trees can be fetched in a single query. However, this isn't always a good idea, so the ``depth`` argument control how many "levels" the select-related behavior will traverse. """ from dj...
bsd-3-clause
BT-fgarbely/odoo
addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py
337
3122
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 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
kelcecil/linux
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
ghdk/networkx
networkx/generators/stochastic.py
20
1994
"""Functions for generating stochastic graphs from a given weighted directed graph. """ # Copyright (C) 2010-2013 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. from __future__ import division import warnin...
bsd-3-clause
sharad/calibre
src/calibre/gui2/dialogs/confirm_delete.py
1
2425
#!/usr/bin/env python __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net' __docformat__ = 'restructuredtext en' from PyQt5.Qt import ( QDialog, Qt, QPixmap, QIcon, QSize, QVBoxLayout, QHBoxLayout, QLabel, QCheckBox, QDialogButtonBox) from calibre import confirm_config_name from ...
gpl-3.0
randomtask1155/gpdb
gpMgmt/bin/gppylib/system/configurationImplTest.py
35
2495
#!/usr/bin/env python # # Copyright (c) Greenplum Inc 2010. All Rights Reserved. # from gppylib.gparray import * """ This file defines the interface that can be used to fetch and update system configuration information for testing. It does not use the database for getting and updating system configuration d...
apache-2.0
opencloudinfra/orchestrator
venv/Lib/site-packages/wheel/metadata.py
230
11050
""" Tools for converting old- to new-style metadata. """ from collections import namedtuple from .pkginfo import read_pkg_info from .util import OrderedDefaultDict try: from collections import OrderedDict except ImportError: OrderedDict = dict import re import os.path import textwrap import pkg_resources impo...
gpl-3.0
nadeemsyed/swift
swift/obj/ssync_sender.py
4
20444
# Copyright (c) 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 agreed to ...
apache-2.0
proxysh/Safejumper-for-Desktop
buildlinux/env32/lib/python2.7/site-packages/twisted/pair/testing.py
13
17307
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tools for automated testing of L{twisted.pair}-based applications. """ import struct import socket from errno import ( EPERM, EAGAIN, EWOULDBLOCK, ENOSYS, EBADF, EINVAL, EINTR, ENOBUFS) from collections import deque from functools import ...
gpl-2.0
CameronLonsdale/sec-tools
letsjusthackshit/lib/python3.5/site-packages/pip/_vendor/lockfile/symlinklockfile.py
536
2616
from __future__ import absolute_import import os import time from . import (LockBase, NotLocked, NotMyLock, LockTimeout, AlreadyLocked) class SymlinkLockFile(LockBase): """Lock access to a file using symlink(2).""" def __init__(self, path, threaded=True, timeout=None): # super(Symlin...
mit
simonsfoundation/CaImAn
caiman/source_extraction/cnmf/merging.py
2
13849
#!/usr/bin/env python # -*- coding: utf-8 -*- """Merging of spatially overlapping components that are temporally correlated Created on Tue Sep 8 16:23:57 2015 @author: agiovann """ #\package caiman/source_extraction/cnmf #\version 1.0 #\copyright GNU General Public License v2.0 from builtins import range import n...
gpl-2.0
John-Shaw/shadowsocks
tests/test.py
1016
5029
#!/usr/bin/python # -*- coding: utf-8 -*- # # 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 b...
apache-2.0
deepsrijit1105/edx-platform
cms/envs/dev.py
21
5916
""" This config file runs the simplest dev environment""" # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files # pylint: disable=wildcard-import, unused-wildcard-import from .common import * from openedx.core.lib.logsettings import get_logger_config...
agpl-3.0
LohmuellerLab/Forward_Neanderthal
gravel.py
1
5086
#! /usr/bin/env python """ usage: gravel2.py outfilename h s f h = dominance coefficient s = selection coefficient (not population-scaled) f = starting frequency of admixture """ import numpy import sys def pnext_twopop(AC, N, Nout, h, s, m): """ AC is a tuple (pAf, pAsEu) NAf is a constant, population size take...
mit
seankelly/buildbot
master/buildbot/test/integration/test_usePty.py
2
3195
# This file is part of Buildbot. Buildbot 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. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
thomaxxl/safrs
examples/mini_examples/ex06_filtering.py
1
3265
#!/usr/bin/env python3 """ Custom Filtering Example: * Like: http://server:5000/People/?filter[name][like]=user1% * In: http://server:5000/People/?filter[id][in]=[1,2] """ import sys import json from flask import Flask from flask_sqlalchemy import SQLAlchemy from safrs import SAFRSBase, SAFRSAPI, ValidationError im...
gpl-3.0
appsembler/edx-platform
openedx/features/portfolio_project/views.py
16
1373
""" Portfolio views. """ from django.template.loader import render_to_string from django.utils.decorators import method_decorator from django.views.decorators.cache import cache_control from lms.djangoapps.courseware.views.views import CourseTabView from util.views import ensure_valid_course_key from web_fragments....
agpl-3.0
alexlo03/ansible
lib/ansible/modules/clustering/openshift/_oc.py
58
14983
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Kenneth D. Evensen <kevensen@redhat.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_versio...
gpl-3.0
Akrog/cinder
cinder/db/sqlalchemy/migrate_repo/versions/038_add_driver_initiator_data_table.py
1
2035
# 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
asrie/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/config/urls_unittest.py
124
4004
# Copyright (C) 2012 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 f...
bsd-3-clause
amit0701/rally
tests/unit/deployment/test_engine.py
1
7653
# Copyright 2013: Mirantis 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 b...
apache-2.0