repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
sysadmin75/ansible
test/units/module_utils/common/test_dict_transformations.py
78
4363
# -*- coding: utf-8 -*- # (c) 2017, Will Thames <will.thames@xvt.com.au> # # 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 y...
gpl-3.0
xanv/painindex
painindex_app/views.py
1
1646
import random from django.shortcuts import get_object_or_404, render from django.views.generic.edit import CreateView from django.core.urlresolvers import reverse_lazy from painindex_app.models import PainSource from painindex_app.forms import PainReportForm from django.http import HttpResponse def homepage(request):...
mit
grbd/GBD.Embedded.CMake4Mbed
bin/tools/LPCLink1/upload.py
1
1174
#!python3 """ Script Wrapper for uploading firmware to LPC Expresso boards via LPCLink-1 """ import sys, logging, argparse from lpc_settings import LPCSettings from pylib.logwrapper import LogWrapper from pylib.process import Process from os.path import abspath, dirname, join try: # Setup logging LogWrapper...
apache-2.0
hbhzwj/imalse
tools/ns-allinone-3.14.1/ns-3.14.1/.waf-1.6.11-30618c54883417962c38f5d395f83584/waflib/Scripting.py
11
10238
#! /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 os,shutil,traceback,errno,sys,stat from waflib import Utils,Configure,Logs,Options,ConfigSet,Context,Errors,Build,Node build_dir_override=None no_climb_commands=['confi...
gpl-3.0
ganeshnalawade/ansible-modules-core
network/nxos/nxos_bgp.py
8
37282
#!/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
famulus/aubio
python.old/aubio/task/notes.py
13
4192
from aubio.task import task from aubio.aubioclass import * class tasknotes(task): def __init__(self,input,output=None,params=None): task.__init__(self,input,params=params) self.opick = onsetpick(self.params.bufsize, self.params.hopsize, self.channels, self.myvec, self.params.threshold, mode=self.p...
gpl-3.0
theheros/kbengine
kbe/res/scripts/common/Lib/importlib/test/builtin/test_loader.py
3
3295
import importlib from importlib import machinery from .. import abc from .. import util from . import util as builtin_util import sys import types import unittest class LoaderTests(abc.LoaderTests): """Test load_module() for built-in modules.""" verification = {'__name__': 'errno', '__packag...
lgpl-3.0
ronekko/chainer
chainer/utils/__init__.py
2
1537
import contextlib import shutil import tempfile import numpy # import classes and functions from chainer.utils.array import sum_to # NOQA from chainer.utils.conv import get_conv_outsize # NOQA from chainer.utils.conv import get_deconv_outsize # NOQA from chainer.utils.experimental import experimental # NOQA from ...
mit
dharmabumstead/ansible
lib/ansible/modules/utilities/logic/import_role.py
2
2570
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: Ansible Project # 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', 'status': [...
gpl-3.0
dan82840/Netgear-RBR50
git_home/linux.git/tools/perf/scripts/python/netdev-times.py
11271
15048
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
bbiskup/cpp_benchmarks
vendor/google/googletest/googletest/scripts/upload.py
24
52037
#!/usr/bin/env python # # Copyright 2007, 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...
mit
GNOME/orca
test/keystrokes/oowriter/ui_role_combo_box.py
1
2256
#!/usr/bin/python """Test of Orca's presentation of a combo box.""" from macaroon.playback import * import utils sequence = MacroSequence() sequence.append(PauseAction(3000)) sequence.append(TypeAction("This is a test.")) sequence.append(KeyComboAction("Left")) sequence.append(KeyComboAction("<Control><Shift>Left")...
lgpl-2.1
mcanthony/rethinkdb
external/v8_3.30.33.16/testing/gtest/scripts/gen_gtest_pred_impl.py
2538
21986
#!/usr/bin/env python # # Copyright 2006, 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...
agpl-3.0
mayragomez/Chapter05_Tigram
plugins/ti.alloy/plugin.py
1729
5251
import os, sys, subprocess, hashlib import subprocess def check_output(*popenargs, **kwargs): r"""Run command with arguments and return its output as a byte string. Backported from Python 2.7 as it's implemented as pure python on stdlib. >>> check_output(['/usr/bin/python', '--version']) Python 2.6....
apache-2.0
arnaud-morvan/QGIS
python/plugins/processing/gui/matrixmodelerwidget.py
11
5263
# -*- coding: utf-8 -*- """ *************************************************************************** MatrixModelerWidget.py --------------------- Date : May 2018 Copyright : (C) 2018 by Alexander Bruy Email : alexander dot bruy at gmail dot com *********...
gpl-2.0
stephen144/odoo
openerp/addons/base/ir/ir_values.py
8
25408
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp import tools from openerp.osv import osv, fields from openerp.exceptions import AccessError, MissingError from openerp.tools.translate import _ from openerp.tools import pickle EXCLUDED_FIELDS = set(( '...
agpl-3.0
SimVascular/VTK
Filters/Hybrid/Testing/Python/TestPCA.py
20
8348
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # This example shows how to visualise the variation in shape in a set of objects using # vtkPCAAnalysisFilter. # # We make three ellipsoids by distorting and translating a sphere and ...
bsd-3-clause
d40223223/608
static/Brython3.1.1-20150328-091302/Lib/formatter.py
751
14930
"""Generic output formatting. Formatter objects transform an abstract flow of formatting events into specific output events on writer objects. Formatters manage several stack structures to allow various properties of a writer object to be changed and restored; writers need not be able to handle relative changes nor an...
gpl-3.0
Aimage/shinken
test/test_freshness.py
18
3293
#!/usr/bin/env python # Copyright (C) 2009-2014: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # # This file is part of Shinken. # # Shinken 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 F...
agpl-3.0
TheImagingSource/tiscamera
doc/sphinx-tabs/sphinx_tabs/test/testcase.py
1
5094
# pylint: disable=import-error,no-name-in-module from distutils.version import StrictVersion import unittest import re import os import pkg_resources from sphinx import __version__ as __sphinx_version__ from sphinx.builders.html import StandaloneHTMLBuilder from lxml import etree try: from StringIO import StringIO...
apache-2.0
talumbau/blaze
samples/ooc-groupby.py
4
8446
""" This script performs an out of core groupby operation for different datasets. The datasets to be processed are normally in CSV files and the key and value to be used for the grouping are defined programatically via small functions (see toy_stream() and statsmodel_stream() for examples). Those datasets included in...
bsd-3-clause
vlukes/sfepy
tests/test_poly_spaces.py
1
11051
""" Test continuity of polynomial basis and its gradients along an edge on :math:`y` line (2D) or on a face in :math:`x`-:math:`y` plane (3D) between two elements aligned with the coordinate system, stack one on top of the other. The evaluation occurs in several points shifted by a very small amount from the boundary b...
bsd-3-clause
jurassic-c/Pynterface
Pynterface/grid.py
1
2463
class grid: w = 0 h = 0 grid = None def __init__(self): rows = grid_array() rows.onAdd = self._add_width cols = grid_array() cols.onAdd = self._add_height self.grid = rows self.grid.append(cols) def __getitem__(self, x): return self.grid[x] def __setitem__(self, x, value): self.grid[x] = value ...
bsd-3-clause
steedos/odoo
addons/purchase/report/purchase_report.py
137
7689
# -*- 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
eonpatapon/rally
rally/common/objects/task.py
2
19210
# 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
shubhdev/edx-platform
common/djangoapps/track/shim.py
71
6434
"""Map new event context values to old top-level field values. Ensures events can be parsed by legacy parsers.""" import json import logging from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import UsageKey log = logging.getLogger(__name__) CONTEXT_FIELDS_TO_INCLUDE = [ 'username', 'session...
agpl-3.0
batermj/algorithm-challenger
code-analysis/programming_anguage/python/source_codes/Python3.5.9/Python-3.5.9/Lib/plat-sunos5/CDIO.py
191
1872
# Generated by h2py from /usr/include/sys/cdio.h CDROM_LBA = 0x01 CDROM_MSF = 0x02 CDROM_DATA_TRACK = 0x04 CDROM_LEADOUT = 0xAA CDROM_AUDIO_INVALID = 0x00 CDROM_AUDIO_PLAY = 0x11 CDROM_AUDIO_PAUSED = 0x12 CDROM_AUDIO_COMPLETED = 0x13 CDROM_AUDIO_ERROR = 0x14 CDROM_AUDIO_NO_STATUS = 0x15 CDROM_DA_NO_SUBCODE = 0x00 CDROM...
apache-2.0
Nihn/Diamond-1
src/diamond/utils/scheduler.py
13
3655
# coding=utf-8 import time import math import multiprocessing import os import random import sys import signal try: from setproctitle import getproctitle, setproctitle except ImportError: setproctitle = None from diamond.utils.signals import signal_to_exception from diamond.utils.signals import SIGALRMExcept...
mit
onitake/ansible
lib/ansible/modules/cloud/azure/azure_rm_aks_facts.py
37
3911
#!/usr/bin/python # # Copyright (c) 2018 Yuwei Zhou, <yuwzho@microsoft.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
nju520/django
django/conf/locale/it/formats.py
504
2079
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd F Y' # 25 Ottobre 2006 TIME_FO...
bsd-3-clause
drawks/ansible
test/units/modules/network/slxos/test_slxos_lldp.py
38
3087
# # (c) 2018 Extreme Networks 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 # (at your option) any later version. # # Ans...
gpl-3.0
apurvbhartia/gnuradio-routing
gr-howto-write-a-block-cmake/docs/doxygen/doxyxml/doxyindex.py
19
6638
# # Copyright 2010 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 option) # any later version. #...
gpl-3.0
rajul/tvb-library
tvb/datatypes/region_mapping_framework.py
1
4261
# -*- coding: utf-8 -*- # # # TheVirtualBrain-Framework Package. This package holds all Data Management, and # Web-UI helpful to run brain-simulations. To use it, you also need do download # TheVirtualBrain-Scientific Package (for simulators). See content of the # documentation-folder for more details. See also http:/...
gpl-2.0
danielpalomino/gem5
src/arch/x86/isa/insts/general_purpose/data_transfer/move.py
44
9098
# Copyright (c) 2007-2008 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware imp...
bsd-3-clause
shingonoide/odoo
addons/survey/survey.py
36
58953
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and / or modify # it under the ter...
agpl-3.0
pcodes/mhn_interface
mhn_api/stats.py
1
1127
import requests from django.conf import settings def get_request(params): if settings.DEBUG: api_key = {'api_key': settings.MHN_DEV_KEY} else: api_key = {'api_key': settings.MHN_API_KEY} base_url = settings.MHN_URL if not params: request = api_key else: request = {...
mit
reidwooten99/botbot-web
botbot/apps/accounts/forms.py
2
1038
from django import forms from . import models class AccountForm(forms.ModelForm): class Meta: model = models.User exclude = ('first_name', 'last_name', 'password', 'is_staff', 'is_active', 'is_superuser', 'last_login', 'date_joined', 'groups', 'user_permissi...
mit
abhinavp13/IITBX-edx-platform-dev
common/djangoapps/student/tests/test_email.py
14
11282
import json import django.db from student.tests.factories import UserFactory, RegistrationFactory, PendingEmailChangeFactory from student.views import reactivation_email_for_user, change_email_request, confirm_email_change from student.models import UserProfile, PendingEmailChange from django.contrib.auth.models impor...
agpl-3.0
pymedusa/SickRage
ext/boto/s3/key.py
5
83034
# Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2011, Nexenta Systems Inc. # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the...
gpl-3.0
loriab/qcdb
data/sapt_HBC1.py
2
28020
DATA = {} #DATA['SAPT MODELCHEM'] = 'SAPT3FC-SA-atz' DATA['SAPT MODELCHEM'] = 'SAPT3FC-CP-atz' # LAB 2017 for consistency with saptone mc labels DATA['SAPT ELST ENERGY'] = {} DATA['SAPT ELST ENERGY']['HBC1-FaOOFaOO-3.4'] = -64.1477 DATA['SAPT ELST ENERGY']['HBC1-FaOOFaOO-3.5'] = -54.7215 DATA['SAPT ELST ENERGY'][...
lgpl-3.0
cloudfoundry/php-buildpack-legacy
builds/runtimes/python-2.7.6/lib/python2.7/test/test_complex_args.py
136
3507
import unittest from test import test_support import textwrap class ComplexArgsTestCase(unittest.TestCase): def check(self, func, expected, *args): self.assertEqual(func(*args), expected) # These functions are tested below as lambdas too. If you add a # function test, also add a similar lambda ...
mit
wilsonxiao/machinekit
lib/python/popupkeyboard.py
13
10233
#!/usr/bin/env python #------------------------------------------------------------------------------ # Copyright: 2013 # Author: Dewey Garrett <dgarrett@panix.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 F...
gpl-3.0
nsfmc/pygments
scripts/check_sources.py
6
7467
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Checker for file headers ~~~~~~~~~~~~~~~~~~~~~~~~ Make sure each Python file has a correct file header including copyright and license information. :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE fo...
bsd-2-clause
stormi/tsunami
src/secondaires/navigation/commandes/pavillon/montrer.py
1
3737
# -*-coding:Utf-8 -* # Copyright (c) 2014 LE GOFF Vincent # 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 # rai...
bsd-3-clause
adobecs5/urp2015
lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/url.py
375
5760
from collections import namedtuple from ..exceptions import LocationParseError url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment'] class Url(namedtuple('Url', url_attrs)): """ Datastructure for representing an HTTP URL. Used as a return value for :func:`parse_url`. """ s...
apache-2.0
snakeleon/YouCompleteMe-x86
third_party/ycmd/third_party/JediHTTP/vendor/jedi/test/test_speed.py
24
1870
""" Speed tests of Jedi. To prove that certain things don't take longer than they should. """ import time import functools from .helpers import TestCase, cwd_at import jedi class TestSpeed(TestCase): def _check_speed(time_per_run, number=4, run_warm=True): """ Speed checks should typically be very tolera...
gpl-3.0
chetan/ansible
lib/ansible/module_utils/ec2.py
19
7219
# 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
Benster900/mhn
server/mhn/api/models.py
12
8796
import string from random import choice from datetime import datetime from sqlalchemy import UniqueConstraint, func from mhn import db from mhn.api import APIModel from mhn.auth.models import User from mhn.common.clio import Clio class Sensor(db.Model, APIModel): # Defines some properties on the fields: # ...
lgpl-2.1
lfairchild/PmagPy
dialogs/grid_frame2.py
2
48571
""" GridFrame -- subclass of wx.Frame. Contains grid and buttons to manipulate it. GridBuilder -- data methods for GridFrame (add data to frame, save it, etc.) """ #import pdb import wx from . import drop_down_menus2 as drop_down_menus from . import pmag_widgets as pw from . import magic_grid2 as magic_grid from pmagp...
bsd-3-clause
cyanna/edx-platform
lms/djangoapps/class_dashboard/tests/test_dashboard_data.py
13
13192
""" Tests for class dashboard (Metrics tab in instructor dashboard) """ import json from django.core.urlresolvers import reverse from django.test.client import RequestFactory from mock import patch from capa.tests.response_xml_factory import StringResponseXMLFactory from courseware.tests.factories import StudentModu...
agpl-3.0
40223119/2015w13-1
static/Brython3.1.3-20150514-095342/Lib/fractions.py
722
23203
# Originally contributed by Sjoerd Mullender. # Significantly modified by Jeffrey Yasskin <jyasskin at gmail.com>. """Fraction, infinite-precision, real numbers.""" from decimal import Decimal import math import numbers import operator import re import sys __all__ = ['Fraction', 'gcd'] def gcd(a, b): """Calcu...
gpl-3.0
sgallagher/anaconda
pyanaconda/core/constants.py
1
15488
# # constants.py: anaconda constants # # Copyright (C) 2001 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 Foundation; either version 2 of the License, or # (at your ...
gpl-2.0
drnextgis/QGIS
python/plugins/processing/algs/taudem/dinftranslimaccum2.py
5
5539
# -*- coding: utf-8 -*- """ *************************************************************************** dinftranslimaccum2.py --------------------- Date : October 2012 Copyright : (C) 2012 by Alexander Bruy Email : alexander dot bruy at gmail dot com ******...
gpl-2.0
hmen89/odoo
openerp/addons/base/module/wizard/base_module_configuration.py
447
2274
# -*- 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
dhanunjaya/neutron
neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/br_phys.py
19
2828
# Copyright (C) 2014,2015 VA Linux Systems Japan K.K. # Copyright (C) 2014,2015 YAMAMOTO Takashi <yamamoto at valinux co jp> # 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 t...
apache-2.0
wakashige/bazel
third_party/py/gflags/gflags_validators.py
488
6977
#!/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 l...
apache-2.0
3dfxsoftware/cbss-addons
TODO-7.0/rent/wizard/__init__.py
4
1149
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Addons modules by CLEARCORP S.A. # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). # # This program is free software: you can redistribute...
gpl-2.0
mistercrunch/panoramix
superset/sql_parse.py
2
12236
# 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
eceglov/phantomjs
src/qt/qtwebkit/Source/JavaScriptCore/disassembler/udis86/ud_opcode.py
118
9310
# udis86 - scripts/ud_opcode.py # # Copyright (c) 2009 Vivek Thampi # 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 not...
bsd-3-clause
lqdc/pyew
vstruct/defs/rar.py
18
1851
import vstruct from vstruct.primitives import * HEAD_TYPE_MARKER = 0x72 #marker block HEAD_TYPE_ARCHIVE = 0x73 #archive header HEAD_TYPE_FILE_HDR = 0x74 #file header HEAD_TYPE_OLD_COMMENT = 0x75 #old style comment header HEAD_TYPE_OLD_AUTH = 0x76 #o...
gpl-2.0
pk400/catering
myvenv/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/gb2312prober.py
2994
1681
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
mit
Philippe12/external_chromium_org
build/util/lib/common/unittest_util.py
138
4879
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utilities for dealing with the python unittest module.""" import fnmatch import sys import unittest class _TextTestResult(unittest._TextTestResult): ...
bsd-3-clause
chatcannon/numpy
tools/test-installed-numpy.py
106
2385
#!/usr/bin/env python from __future__ import division, absolute_import, print_function # A simple script to test the installed version of numpy by calling # 'numpy.test()'. Key features: # -- convenient command-line syntax # -- sets exit status appropriately, useful for automated test environments # It would be b...
bsd-3-clause
felixbuenemann/sentry
src/sentry/migrations/0176_auto__add_field_organizationmember_counter__add_unique_organizationmem.py
34
37043
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'OrganizationMember.counter' db.add_column('sentry_organiz...
bsd-3-clause
MarishaYasko/interactive-stories-stands
InteractiveStands/Lib/encodings/iso8859_4.py
272
13376
""" Python Character Mapping Codec iso8859_4 generated from 'MAPPINGS/ISO8859/8859-4.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,input,errors='...
mit
wSedlacek/kernel_moto_shamu
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
Geoion/AutobahnPython
examples/twisted/wamp/test_newapi3.py
8
1593
from twisted.internet.task import react from twisted.internet.defer import inlineCallbacks as coroutine from autobahn.twisted.connection import Connection def main(reactor, connection): @coroutine def on_join(session, details): print("on_join: {}".format(details)) try: print(sessi...
mit
mjmottram/echidna
echidna/calc/decay.py
1
24391
""" Double beta decay utility converter Provides a useful tool for converting between different double beta dacay parameters. """ import numpy from echidna.calc import constants as const import echidna.test.physics_tests as physics_tests class DBIsotope(object): """ Class which calculates expected counts for a...
mit
bmotlaghFLT/FLT_PhantomJS
src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/servers/http_server_integrationtest.py
118
5561
# Copyright (C) 2011 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
dkodnik/Ant
openerp/tools/which.py
456
6884
#!/usr/bin/env python """ Which - locate a command * adapted from Brian Curtin's http://bugs.python.org/file15381/shutil_which.patch * see http://bugs.python.org/issue444582 * uses ``PATHEXT`` on Windows * searches current directory before ``PATH`` on Windows, but not before an explicitly passed ...
agpl-3.0
richardcs/ansible
lib/ansible/modules/network/fortimanager/fmgr_device.py
7
9564
#!/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
illicitonion/givabit
lib/sdks/google_appengine_1.7.1/google_appengine/lib/django_0_96/django/core/cache/backends/db.py
33
3522
"Database cache backend." from django.core.cache.backends.base import BaseCache from django.db import connection, transaction, DatabaseError import base64, time from datetime import datetime try: import cPickle as pickle except ImportError: import pickle class CacheClass(BaseCache): def __init__(self, tab...
apache-2.0
alangwansui/mtl_ordercenter
openerp/addons/account_payment/__init__.py
436
1279
# -*- 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
NejcZupec/ggrc-core
test/integration/ggrc_workflows/converters/test_workflow_export_csv.py
1
11972
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Tests for workflow object exports.""" from os.path import abspath, dirname, join from flask.json import dumps from ggrc.app import app from ggrc_workflows.models import Workflow from integration.ggrc im...
apache-2.0
michaelbuehlmann/CatAna
setup.py
1
3178
import os import re import sys import subprocess import platform import versioneer from setuptools import setup, Extension from setuptools.command.build_ext import build_ext from distutils.version import LooseVersion class CMakeExtension(Extension): def __init__(self, name, sourcedir=''): Extension.__ini...
gpl-2.0
mandeepdhami/neutron
neutron/tests/unit/db/test_db_base_plugin_v2.py
1
279583
# Copyright (c) 2012 OpenStack Foundation. # 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
rgarcia-herrera/bici-tren
abm/flock_sim.py
1
3274
from time import sleep # from datetime import datetime import bike_agent as model from router import refine, Router import argparse import random parser = argparse.ArgumentParser(description='grab adscriptions from medline') parser.add_argument('--init', type=int, default=50, help="set to 0 to resu...
gpl-3.0
ClearCorp-dev/odoo-clearcorp
TODO-7.0/product_cost_group/__openerp__.py
4
1780
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Addons modules by CLEARCORP S.A. # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). # # This program is free software: you can redistribute...
agpl-3.0
jtyr/ansible
test/lib/ansible_test/_internal/ci/shippable.py
25
10040
"""Support code for working with Shippable.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import re import time from .. import types as t from ..config import ( CommonConfig, TestConfig, ) from ..git import ( Git, ) from ..http import ( HttpCli...
gpl-3.0
rafaeltomesouza/frontend-class1
aula2/a15/linkedin/client/.gradle/yarn/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py
1366
120842
# 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. """Xcode project file generator. This module is both an Xcode project file generator and a documentation of the Xcode project file format. Knowledge of the proje...
mit
intermezzo-fr/hillary-clinton-emails
scripts/outputCsvs.py
5
3577
import numpy as np import pandas as pd def normalize_address(raw_address): for c in ["'", ",", "°", "•", "`", '"', "‘", "-"]: raw_address = raw_address.replace(c, "") raw_address = raw_address.lower() if "<" in raw_address: prefix = raw_address[:raw_address.index("<")].strip() if ...
mit
magacoin/magacoin
contrib/devtools/optimize-pngs.py
51
3392
#!/usr/bin/env python # 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. ''' Run this script every time you change one of the png files. Using pngcrush, it will optimize the png fi...
mit
gppezzi/easybuild-framework
easybuild/toolchains/linalg/blis.py
2
1479
## # Copyright 2013-2019 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
gpl-2.0
lizardsystem/lizard-workspace
lizard_workspace/migrations/0019_auto__add_field_wmsserver_js_popup_class.py
1
18569
# encoding: 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 'WmsServer.js_popup_class' db.add_column('lizard_workspace_wmsserver', 'js_popup_class', se...
gpl-3.0
t-amerssonis/okami
src/Okami/third-parts/gitpy/files.py
122
1831
# Copyright (c) 2009, Rotem Yaari <vmalloc@gmail.com> # 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 li...
mit
sonofmun/DissProject
unit_tests/test_sem_extract_pipeline.py
1
6474
from unittest import TestCase from Data_Production.sem_extract_pipeline import SemPipeline, ParamTester from collections import Counter import re import os import shutil import numpy as np __author__ = 'matt' class TestInit(TestCase): def test_sim_algo_reset(self): """ Tests whether an incorrect value fo...
gpl-3.0
aivarsk/scrapy
scrapy/utils/url.py
89
4183
""" This module contains general purpose URL functions not found in the standard library. Some of the functions that used to be imported from this module have been moved to the w3lib.url module. Always import those from there instead. """ import posixpath from six.moves.urllib.parse import (ParseResult, urlunparse, ur...
bsd-3-clause
squidsoup/pip
pip/req/req_install.py
5
42989
from __future__ import absolute_import import logging import os import re import shutil import sys import tempfile import warnings import zipfile from distutils.util import change_root from distutils import sysconfig from email.parser import FeedParser from pip._vendor import pkg_resources, six from pip._vendor.dist...
mit
jdepoix/goto_cloud
goto_cloud/operating_system_support/tests/test_operating_system_support.py
1
2975
import unittest from django.test import TestCase from operating_system.public import OperatingSystem from remote_host.public import RemoteHost from ..operating_system_support import OperatingSystemRelations, AbstractedRemoteHostOperator RELATION_MOCK = { '1': { '2': { '3': { ...
mit
matthiasdiener/spack
var/spack/repos/builtin/packages/dri3proto/package.py
5
1811
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
malkoto1/just_cook
SQLAlchemy-1.0.4/lib/sqlalchemy/events.py
2
42935
# sqlalchemy/events.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Core event interfaces.""" from . import event, exc from .pool import Pool f...
gpl-2.0
rmboggs/django
tests/test_runner/test_debug_sql.py
146
2971
import sys import unittest from django.db import connection from django.test import TestCase from django.test.runner import DiscoverRunner from django.utils import six from django.utils.encoding import force_text from .models import Person @unittest.skipUnless(connection.vendor == 'sqlite', 'Only run on sqlite so w...
bsd-3-clause
aayushidwivedi01/spark-tk
python/sparktk/sparkconf.py
11
14663
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # 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 require...
apache-2.0
EmreAtes/spack
lib/spack/spack/modules/__init__.py
5
1780
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
agoose77/hivesystem
bee/worker.py
1
9348
from __future__ import print_function from .segments import reg_helpersegment, decoratorsegment from .types import parse_parameters from .beewrapper import beewrapper, reg_beehelper import inspect import libcontext import functools from . import emptyclass, mytype from .event import exception from .resolve import reso...
bsd-2-clause
tjsavage/rototutor_djangononrel
django/contrib/admindocs/views.py
296
15504
from django import template, templatetags from django.template import RequestContext from django.conf import settings from django.contrib.admin.views.decorators import staff_member_required from django.db import models from django.shortcuts import render_to_response from django.core.exceptions import ImproperlyConfigur...
bsd-3-clause
rproepp/spykeutils
spykeutils/tests/test_tools.py
1
18764
try: import unittest2 as ut assert ut # Suppress pyflakes warning about redefinition of unused ut except ImportError: import unittest as ut from builders import arange_spikes from numpy.testing import assert_array_equal, assert_array_almost_equal from spykeutils import tools import neo import neo.io.tools...
bsd-3-clause
museomix/2013_Quebec_thermoscope
raspberry/pygame-1.9.1release/lib/_camera_opencv_highgui.py
13
2229
import pygame import numpy import opencv #this is important for capturing/displaying images from opencv import highgui def list_cameras(): """ """ # -1 for opencv means get any of them. return [-1] def init(): pass def quit(): pass class Camera: def __init__(self, device =0, size =...
mit
cortedeltimo/SickRage
lib/libfuturize/fixes/fix_UserDict.py
51
3845
"""Fix UserDict. Incomplete! TODO: base this on fix_urllib perhaps? """ # Local imports from lib2to3 import fixer_base from lib2to3.fixer_util import Name, attr_chain from lib2to3.fixes.fix_imports import alternates, build_pattern, FixImports MAPPING = {'UserDict': 'collections', } # def alternates(members): # ...
gpl-3.0
pledra/odoo-product-configurator
website_product_configurator_mrp/controllers/main.py
1
1200
from openerp.http import request from openerp.addons.website_product_configurator.controllers.main import ( WebsiteProductConfig ) class WebsiteProductConfigMrp(WebsiteProductConfig): def cart_update(self, product, post): if post.get('assembly') == 'kit': attr_products = product.attribut...
agpl-3.0