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
rickerc/neutron_audit
neutron/openstack/common/rpc/impl_kombu.py
1
32063
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 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/LICEN...
apache-2.0
abhishek070193/mapreduce
hadoop-2.6.0-src/hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/terasort/job_history_summary.py
323
3444
#!/usr/bin/env python # # 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 # "...
mit
VirtueSecurity/aws-extender
BappModules/docutils/languages/cs.py
148
1928
# $Id: cs.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: Marek Blaha <mb@dat.cz> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be # translated for each l...
mit
AccelAI/accel.ai
flask-aws/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/latin1prober.py
1778
5232
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
mit
Letractively/timeside
timeside/analyzer/aubio_specdesc.py
2
3126
# -*- coding: utf-8 -*- # # Copyright (c) 2013 Paul Brossier <piem@piem.org> # This file is part of TimeSide. # TimeSide 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 # ...
gpl-2.0
piffey/ansible
lib/ansible/modules/cloud/ovirt/ovirt_vmpools.py
75
7594
#!/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
jakereps/qiime2
qiime2/core/testing/format.py
2
5025
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2021, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
bsd-3-clause
jlcarmic/producthunt_simulator
venv/lib/python2.7/site-packages/scipy/integrate/odepack.py
62
9420
# Author: Travis Oliphant from __future__ import division, print_function, absolute_import __all__ = ['odeint'] from . import _odepack from copy import copy import warnings class ODEintWarning(Warning): pass _msgs = {2: "Integration successful.", 1: "Nothing was done; the integration time was 0.", ...
mit
qPCR4vir/orange
Orange/orng/orngABCN2.py
6
1113
""" This module implements argument based rule learning. The main learner class is ABCN2. The first few classes are some variants of ABCN2 with reasonable settings. """ from Orange.classification.rules import DefaultLearner from Orange.classification.rules import ABCN2 from Orange.classification.rules import ABCN2Or...
gpl-3.0
raytung/Slice
account/hooks.py
1
2621
import hashlib import random from django.core.mail import send_mail from django.template.loader import render_to_string from account.conf import settings from django.contrib.auth.models import User from django.core.exceptions import ObjectDoesNotExist class AccountDefaultHookSet(object): def send_invitation_em...
mit
AMOboxTV/AMOBox.LegoBuild
script.module.unidecode/lib/unidecode/x0ad.py
253
4766
data = ( 'gwan', # 0x00 'gwanj', # 0x01 'gwanh', # 0x02 'gwad', # 0x03 'gwal', # 0x04 'gwalg', # 0x05 'gwalm', # 0x06 'gwalb', # 0x07 'gwals', # 0x08 'gwalt', # 0x09 'gwalp', # 0x0a 'gwalh', # 0x0b 'gwam', # 0x0c 'gwab', # 0x0d 'gwabs', # 0x0e 'gwas', # 0x0f 'gwass', #...
gpl-2.0
UnrememberMe/pants
migrations/options/src/python/migrate_config.py
10
5076
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import sys from col...
apache-2.0
bocaaust/FreshLife
django_project/env/lib/python2.7/site-packages/django/contrib/auth/middleware.py
56
4526
from django.contrib import auth from django.contrib.auth import load_backend from django.contrib.auth.backends import RemoteUserBackend from django.core.exceptions import ImproperlyConfigured from django.utils.functional import SimpleLazyObject def get_user(request): if not hasattr(request, '_cached_user'): ...
apache-2.0
ericawright/bedrock
tests/pages/firefox/new/download.py
2
2137
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from selenium.webdriver.common.by import By from pages.base import BasePage from pages.regions.download_button import D...
mpl-2.0
cchurch/ansible
lib/ansible/module_utils/network/vyos/argspec/l3_interfaces/l3_interfaces.py
23
2969
# # -*- coding: utf-8 -*- # Copyright 2019 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ############################################# # WARNING # ############################################# # # This file is auto generated by ...
gpl-3.0
nopjmp/SickRage
lib/hachoir_metadata/misc.py
57
8595
from hachoir_metadata.metadata import RootMetadata, registerExtractor from hachoir_metadata.safe import fault_tolerant from hachoir_parser.container import SwfFile from hachoir_parser.misc import TorrentFile, TrueTypeFontFile, OLE2_File, PcfFile from hachoir_core.field import isString from hachoir_core.error import war...
gpl-3.0
anselal/antminer-monitor
antminermonitor/blueprints/user/models.py
1
1102
from flask_login.mixins import UserMixin from werkzeug.security import generate_password_hash, check_password_hash from sqlalchemy import Column, Integer, VARCHAR from antminermonitor.database import Base class User(UserMixin, Base): __tablename__ = 'user' id = Column(Integer, primary_key=True) username ...
gpl-3.0
MarsZone/DreamLand
evennia/evennia/contrib/multidescer.py
4
9755
""" Evennia Mutltidescer Contrib - Griatch 2016 A "multidescer" is a concept from the MUSH world. It allows for creating, managing and switching between multiple character descriptions. This multidescer will not require any changes to the Character class, rather it will use the `multidescs` Attribute (a list) and cre...
bsd-3-clause
stephane-martin/salt-debian-packaging
salt-2016.3.3/salt/modules/bigip.py
2
69757
# -*- coding: utf-8 -*- ''' An execution module which can manipulate an f5 bigip via iControl REST :maturity: develop :platform: f5_bigip_11.6 ''' # Import python libs from __future__ import absolute_import import json import logging as logger # Import third party libs try: import requests i...
apache-2.0
wurstmineberg/alltheitems.wurstmineberg.de
alltheitems/cloud.py
1
67724
import alltheitems.__main__ as ati import bottle import collections import contextlib import datetime import itertools import json import pathlib import random import re import xml.sax.saxutils import alltheitems.item import alltheitems.util import alltheitems.world class FillLevel: def __init__(self, stack_size...
mit
magicrub/MissionPlanner
Lib/site-packages/numpy/core/tests/test_npy_arraytypes.py
54
5864
import sys import warnings import numpy as np from numpy.testing import * warnings.filterwarnings('ignore', 'Casting complex values to real discards the imaginary part') types = [np.bool_, np.byte, np.ubyte, np.short, np.ushort, np.intc, np.uintc, np.int_, np.uint, np.longlong, np.ulonglong, ...
gpl-3.0
leiferikb/bitpop
build/third_party/requests_1_2_3/requests/packages/urllib3/request.py
154
5874
# urllib3/request.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php try: from urllib.parse import urlencode except ImportError: from urllib import urlencod...
gpl-3.0
apache/airflow
tests/models/test_xcom_arg.py
9
5985
# 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
srickardti/openthread
tools/harness-automation/cases_R140/leader_5_6_4.py
18
1877
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notic...
bsd-3-clause
amirgeva/coide
mainwindow.py
1
54237
from PyQt4 import QtCore from PyQt4 import QtGui import os import re import stat import qutepart from workspace import WorkSpace import output from consts import FileRole from gdbwrapper import GDBWrapper from watchestree import WatchesTree from breakpoints import BreakpointsDB, BreakpointDialog from properties impor...
gpl-2.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/pip-9.0.1-py2.7.egg/pip/_vendor/html5lib/treeadapters/sax.py
1835
1661
from __future__ import absolute_import, division, unicode_literals from xml.sax.xmlreader import AttributesNSImpl from ..constants import adjustForeignAttributes, unadjustForeignAttributes prefix_mapping = {} for prefix, localName, namespace in adjustForeignAttributes.values(): if prefix is not None: pre...
gpl-3.0
DelazJ/QGIS
python/plugins/processing/algs/gdal/pct2rgb.py
15
3807
# -*- coding: utf-8 -*- """ *************************************************************************** pct2rgb.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *******************************...
gpl-2.0
olefb/android_kernel_sony_msm8974
tools/perf/scripts/python/futex-contention.py
11261
1486
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
gpl-2.0
manjunaths/tensorflow
tensorflow/python/kernel_tests/atrous_conv2d_test.py
139
9770
# 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
mbauskar/tele-frappe
frappe/core/page/user_permissions/user_permissions.py
32
3613
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe import _ import frappe.defaults import frappe.permissions from frappe.core.doctype.user.user import get_system_users from frappe.utils.csvutils import Un...
mit
thinkopensolutions/odoo-brazil-banking
l10n_br_cnab400_import/models/account_bank_statement.py
3
2484
# -*- coding: utf-8 -*- ############################################################################## # # This module copyright (C) 2016 KMEE INFORMATICA LTDA # (<http://kmee.com.br>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Gen...
agpl-3.0
zifeishan/deepdive
src/test/python/test_ddext/output-1.py
15
2549
DROP TYPE IF EXISTS ret_func_ext_has_spouse_candidates CASCADE; CREATE TYPE ret_func_ext_has_spouse_candidates AS (person1_id text, person2_id text, sentence_id text, description text, is_true boolean, relation_id text); CREATE OR REPLACE FUNCTION func_ext_has_spouse_candidates( sentence_id text, p1_id text, p1_tex...
apache-2.0
Jonekee/chromium.src
third_party/typ/typ/fakes/tests/test_result_server_fake_test.py
81
1298
# Copyright 2014 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 ag...
bsd-3-clause
phihag/youtube-dl
youtube_dl/extractor/gfycat.py
11
3695
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, float_or_none, qualities, ExtractorError, ) class GfycatIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?gfycat\.com/(?:ifr/|gifs/detail/)?(?P<id>[^/?#]+)' _TESTS =...
unlicense
defionscode/ansible
lib/ansible/modules/windows/win_whoami.py
52
5530
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
avanzosc/odoo-addons
contacts_school/models/res_partner.py
2
13803
# Copyright 2019 Alfredo de la fuente - AvanzOSC # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from odoo import _, api, fields, models from odoo.exceptions import ValidationError EDU_CATEGORIES = [('federation', 'Federation'), ('association', 'Association'), ('sch...
agpl-3.0
rossasa/server-tools
server_environment/__openerp__.py
17
3367
# -*- coding: utf-8 -*- ############################################################################## # # Adapted by Nicolas Bessi. Copyright Camptocamp SA # Based on Florent Xicluna original code. Copyright Wingo SA # # This program is free software: you can redistribute it and/or modify # it under the te...
agpl-3.0
boutiques/schema
tools/python/boutiques/tests/test_logger.py
1
2801
#!/usr/bin/env python import os import pytest import json import boutiques as bosh import boutiques.creator as bc from boutiques import __file__ as bfile from boutiques.localExec import ExecutorError from argparse import ArgumentParser from unittest import TestCase import mock from boutiques_mocks import mock_zenodo_s...
gpl-2.0
jgeskens/django
django/contrib/gis/tests/geoadmin/tests.py
5
2490
from __future__ import absolute_import from django.test import TestCase from django.contrib.gis.geos import HAS_GEOS from django.contrib.gis.tests.utils import HAS_SPATIAL_DB from django.utils.unittest import skipUnless if HAS_GEOS and HAS_SPATIAL_DB: from django.contrib.gis import admin from django.contrib.g...
bsd-3-clause
pradyunsg/dotfiles
lib/checker.py
1
5820
import os import sys import shutil import platform from .logging import Logger, log from .utils import run_output import click import yaml class SystemChecker(object): """A super-fancy helper for checking the system configuration """ def __init__(self, verbose): super().__init__() self....
mit
loveyoupeng/rt
modules/web/src/main/native/Tools/Scripts/webkitpy/common/checksvnconfigfile.py
135
2718
# Copyright (C) 2012 Balazs Ankes (bank@inf.u-szeged.hu) University of Szeged # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this lis...
gpl-2.0
tuhangdi/django
tests/runtests.py
44
16943
#!/usr/bin/env python import atexit import copy import logging import os import shutil import subprocess import sys import tempfile import warnings from argparse import ArgumentParser import django from django.apps import apps from django.conf import settings from django.db import connection, connections from django.t...
bsd-3-clause
vvv1559/intellij-community
python/helpers/pydev/_pydev_bundle/_pydev_calltip_util.py
33
4916
''' License: Apache 2.0 Author: Yuli Fitterman ''' # noinspection PyBroadException import types from _pydevd_bundle.pydevd_constants import IS_JYTHON, IS_PY3K try: import inspect except: try: from _pydev_imps import _pydev_inspect as inspect except: import traceback; traceback.pri...
apache-2.0
Jgarcia-IAS/ReporsitorioVacioOdoo
openerp/addons/point_of_sale/wizard/__init__.py
382
1200
# -*- 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...
agpl-3.0
Djabbz/wakatime
wakatime/packages/requests/packages/chardet/utf8prober.py
2919
2652
######################## 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...
bsd-3-clause
monash-merc/cvl-fabric-launcher
IconPys/MASSIVElogoTransparent144x144.py
4
27769
#---------------------------------------------------------------------- # This file was generated by /usr/local/bin/img2py # from wx.lib.embeddedimage import PyEmbeddedImage MASSIVElogoTransparent144x144 = PyEmbeddedImage( "iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAD9GlDQ1BJQ0MgUHJvZmlsZQAA" "eNqNlM9vFGUY...
gpl-3.0
kyroskoh/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/haslanded_unittest.py
124
8125
# Copyright (C) 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 of conditions and the f...
bsd-3-clause
alex/sqlalchemy
test/dialect/postgresql/test_reflection.py
2
18054
# coding: utf-8 from sqlalchemy.testing.assertions import eq_, assert_raises, \ assert_raises_message, is_, AssertsExecutionResults, \ AssertsCompiledSQL, ComparesTables from sqlalchemy.testing import engines, fixtures from sqlalchemy import testing from sqlalchemy import Table, Column,...
mit
peterrenshaw/socsim
setup.py
1
1400
#!/usr/bin/env python # ~*~ encoding: utf-8 ~*~ """ This file is part of SOCSIM. SOCSIM 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) an...
gpl-3.0
yashu-seth/BinPy
BinPy/analog/source.py
5
2824
from math import * from BinPy import * class Source: "This class represents a base class for the signal source" def __init__(self, equation, params): self.params = params self.equation = equation def setParam(self, param, value): if not isinstance(self.params[param], type(value)...
bsd-3-clause
judaba13/GenrePredictor
hdf5_utils.py
1
28730
""" Thierry Bertin-Mahieux (2010) Columbia University tb2332@columbia.edu This code contains a set of routines to create HDF5 files containing features and metadata of a song. This is part of the Million Song Dataset project from LabROSA (Columbia University) and The Echo Nest. Copyright 2010, Thierry Bertin-Mahieux Th...
apache-2.0
asedunov/intellij-community
python/lib/Lib/codecs.py
116
33297
""" codecs -- Python Codec Registry, API and helpers. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """#" import __builtin__, sys ### Registry and builtin stateless codec functions try: from _codecs import * except ImportError, why: raise SystemErr...
apache-2.0
popazerty/dvbapp2-gui
lib/python/Tools/NumericalTextInput.py
3
3523
# -*- coding: UTF-8 -*- from enigma import eTimer from Components.Language import language # Dict languageCode -> array of strings MAP_SEARCH = ( u"%_0", u" 1", u"abc2", u"def3", u"ghi4", u"jkl5", u"mno6", u"pqrs7", u"tuv8", u"wxyz9", ) MAP_SEARCH_UPCASE = ( U"0%_", U"1 ", U"ABC2", U"DEF3", U"GHI4", U...
gpl-2.0
ibrahimgunduz34/SpiffWorkflow
SpiffWorkflow/specs/SubWorkflow.py
2
5660
# -*- coding: utf-8 -*- from __future__ import division # Copyright (C) 2007 Samuel Abels # # 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 you...
lgpl-3.0
openstack/python-magnumclient
magnumclient/tests/osc/unit/v1/test_clusters.py
1
17895
# Copyright 2016 Easystack. 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
leekchan/django_test
django/core/mail/backends/console.py
696
1477
""" Email backend that writes messages to console instead of sending them. """ import sys import threading from django.core.mail.backends.base import BaseEmailBackend from django.utils import six class EmailBackend(BaseEmailBackend): def __init__(self, *args, **kwargs): self.stream = kwargs.pop('stream',...
bsd-3-clause
blab/antibody-response-pulse
bcell-array/code/Virus_Bcell_IgM_IgG_Infection_OAS_new.py
1
13195
# coding: utf-8 # # Antibody Response Pulse # https://github.com/blab/antibody-response-pulse # # ### B-cells evolution --- cross-reactive antibody response after influenza virus infection or vaccination # ### Adaptive immune response for repeated infection # In[3]: ''' author: Alvason Zhenhua Li date: 04/09/201...
gpl-2.0
cloudera/hue
desktop/core/ext-py/eventlet-0.24.1/eventlet/websocket.py
5
32462
import base64 import codecs import collections import errno from random import Random from socket import error as SocketError import string import struct import sys import time import zlib try: from hashlib import md5, sha1 except ImportError: # pragma NO COVER from md5 import md5 from sha import sha as ...
apache-2.0
lucifurtun/myquotes
apps/search/bible/management/commands/zefania_xml_generator.py
1
2231
import json from itertools import groupby import xmltodict from django.core.management.base import BaseCommand class Command(BaseCommand): help = 'Generates zefania xml from different formats' def handle(self, *args, **options): with open('NTR.json') as f: data = json.load(f) cu...
bsd-3-clause
miguelinux/vbox
src/VBox/Additions/common/crOpenGL/cr_gl.py
5
1632
print """ /** @file * VBox OpenGL chromium functions header */ /* * Copyright (C) 2008-2015 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; * you can redistribute it and/or modify it under the terms of t...
gpl-2.0
IRI-Research/django
django/contrib/gis/maps/google/zoom.py
12
6683
from __future__ import unicode_literals from django.contrib.gis.geos import GEOSGeometry, LinearRing, Polygon, Point from django.contrib.gis.maps.google.gmap import GoogleMapException from django.utils.six.moves import xrange from math import pi, sin, log, exp, atan # Constants used for degree to radian conversion, a...
bsd-3-clause
winndows/cinder
cinder/zonemanager/drivers/brocade/brcd_fabric_opts.py
13
2224
# (c) Copyright 2014 Brocade Communications Systems Inc. # All Rights Reserved. # # Copyright 2014 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 # # ...
apache-2.0
yuanzhao/gpdb
gpMgmt/sbin/gppersistent_backup.py
7
5737
#!/usr/bin/env python # # Copyright (c) 2014-Present Pivotal Software, Inc. # """ Internal Use Function. """ from gppylib.mainUtils import simple_main, addStandardLoggingAndHelpOptions, addMasterDirectoryOptionForSingleClusterProgram import base64 import os import pickle from gppylib import gplog from gppylib.opera...
apache-2.0
adhix11/pmtk3
python/demos/linregDemo1.py
26
1104
#!/usr/bin/python2.4 import numpy import scipy.stats import matplotlib.pyplot as plt def main(): # true parameters w = 2 w0 = 3 sigma = 2 # make data numpy.random.seed(1) Ntrain = 20 xtrain = numpy.linspace(0,10,Ntrain) ytrain = w*xtrain + w0 + numpy.random.random(Ntrain)*sigma ...
mit
yank555-lu/N3-CM11
tools/perf/scripts/python/futex-contention.py
11261
1486
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
gpl-2.0
rushiagr/keystone
keystone/contrib/federation/routers.py
2
9192
# 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 t...
apache-2.0
lthurlow/Network-Grapher
proj/external/numpy-1.7.0/numpy/core/tests/test_arrayprint.py
8
6757
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import numpy as np from numpy.testing import * class TestArrayRepr(object): def test_nan_inf(self): x = np.array([np.nan, np.inf]) assert_equal(repr(x), 'array([ nan, inf])') class TestComplexArray(TestCase): def test_str(self): rva...
mit
arank/mxnet
tests/python/unittest/test_model_parallel.py
13
1545
import numpy as np import mxnet as mx def reldiff(a, b): diff = np.sum(np.abs(a - b)) norm = np.sum(np.abs(a)) if diff == 0: return 0 reldiff = diff / norm return reldiff def test_chain(): n = 2 data1 = mx.sym.Variable('data1') data2 = mx.sym.Variable('data2') with mx.Attr...
apache-2.0
rlizana/l10n-spain
l10n_es_aeat_mod349/models/account_invoice.py
6
7275
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from openerp import models, fields, api, exceptions, _ from...
agpl-3.0
TobbeTripitaka/bruges
bruges/attribute/test/similarity_test.py
3
2688
import unittest import numpy from bruges.attribute import similarity class SimilarityTest( unittest.TestCase ): def test_same_data( self ): """ Simple test to check if the algorithm works for the trivial case. """ data = numpy.zeros( [100, 100] ) check_data = dat...
apache-2.0
bclau/nova
nova/tests/api/openstack/compute/test_urlmap.py
7
5225
# Copyright 2011 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 requ...
apache-2.0
40223201/40223201
wsgi.py
2
47682
#@+leo-ver=5-thin #@+node:2014fall.20141212095015.1775: * @file wsgi.py # coding=utf-8 # 上面的程式內容編碼必須在程式的第一或者第二行才會有作用 ################# (1) 模組導入區 # 導入 cherrypy 模組, 為了在 OpenShift 平台上使用 cherrypy 模組, 必須透過 setup.py 安裝 #@@language python #@@tabwidth -4 #@+<<declarations>> #@+node:2014fall.20141212095015.1776: ** <<declar...
gpl-3.0
ericvandenbergfb/spark
python/pyspark/daemon.py
79
6127
# # 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 us...
apache-2.0
polarise/BioClasses
LeafCounter.py
2
1218
# -*- encoding: utf-8 -*- from __future__ import division import sys class LeafCounter( object ): def __init__( self ): self.state_count = 0 self.zero_count = 0 self.one_count = 0 self.two_count = 0 self.branch_count = 0 def add_node( self, node ): if self.state_count == 0: if node.name == 0: se...
gpl-2.0
cesarmarinhorj/ansible
test/units/vars/test_variable_manager.py
70
5534
# (c) 2012-2014, Michael DeHaan <michael.dehaan@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) an...
gpl-3.0
sorenk/ansible
test/units/modules/network/fortimanager/fortimanager_module.py
111
2107
# (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 # (at your option) any later version. # # Ansible is dis...
gpl-3.0
HybridF5/tempest
tempest/tests/lib/common/test_api_version_request.py
4
6634
# Copyright 2014 IBM Corp. # # 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 t...
apache-2.0
tangkun75/docker-registry
depends/docker-registry-core/docker_registry/core/boto.py
27
4825
# -*- coding: utf-8 -*- # Copyright (c) 2014 Docker. # # 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
amchoukir/ycmd
build.py
1
6445
#!/usr/bin/env python import os import os.path as p import sys major, minor = sys.version_info[ 0 : 2 ] if major != 2 or minor < 6: sys.exit( 'The build script requires Python version >= 2.6 and < 3.0; ' 'your version of Python is ' + sys.version ) DIR_OF_THIS_SCRIPT = p.dirname( p.abspath( __file__ ) ...
gpl-3.0
malev/pomodoro-indicator
pomodoro/tests/pomodoro_state.py
2
1080
import unittest from pomodoro-indicator.pomodoro_state import PomodoroState class TestPomodoroState(unittest.TestCase): def setUp(self): self.state = PomodoroState() def test_has_all_the_methods(self): """There a list of methods it has to have but do nothing""" methods_list = ["enable...
gpl-3.0
snehasi/servo
components/style/properties/data.py
1
11812
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import re PHYSICAL_SIDES = ["top", "left", "bottom", "right"] LOGICAL_SIDES = ["block-start", "block-end", "inline-star...
mpl-2.0
meiavy/python-weixin
lib/python2.7/site-packages/pip/commands/search.py
84
4717
import sys import textwrap import pkg_resources import pip.download from pip.basecommand import Command, SUCCESS from pip.util import get_terminal_size from pip.log import logger from pip.backwardcompat import xmlrpclib, reduce, cmp from pip.exceptions import CommandError from pip.status_codes import NO_MATCHES_FOUND f...
apache-2.0
babywolfh/iris-panel
iris/core/migrations/0006_copy_bak_back_to_nn.py
7
15478
# -*- coding: utf-8 -*- # This file is part of IRIS: Infrastructure and Release Information System # # Copyright (C) 2013-2015 Intel Corporation # # IRIS is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # version 2.0 as published by the Free Software Foundat...
gpl-2.0
lovesnow/flexx
flexx/webruntime/chromeapp.py
12
2788
""" Web runtime based on a chrome app In contrast to running in the chrome browser, this makes the app have more the look and feel of a desktop app. """ import os import sys from .common import DesktopRuntime # todo: icon, sizing, etc. def get_chrome_exe(): """ Get the path of the Chrome executable If...
bsd-2-clause
vcatechnology/cmake-boilerplate
cmake/pygh/__init__.py
1
25114
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import os import sys import json import errno import platform import fileinput import subprocess from datetime import datetime, timezone try: import requests except ImportError: raise ImportError( 'Failed to import \'requests\', run \'pip instal...
bsd-3-clause
rynomad/SFCCW2
server/express/node_modules/npm/node_modules/node-gyp/gyp/test/lib/TestGyp.py
46
37947
# 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. """ TestGyp.py: a testing framework for GYP integration tests. """ import os import re import shutil import stat import subprocess import sys import tempfile im...
mit
marcusmueller/gnuradio
gr-filter/examples/fft_filter_ccc.py
7
4367
#!/usr/bin/env python # # Copyright 2013 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) # ...
gpl-3.0
BeATz-UnKNoWN/python-for-android
python3-alpha/python3-src/Lib/random.py
45
25557
"""Random variable generators. integers -------- uniform within range sequences --------- pick random element pick random sample generate random permutation distributions on the real line: ------------------------------ uniform ...
apache-2.0
yongtang/tensorflow
tensorflow/python/ops/signal/spectral_ops.py
6
20175
# 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
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/OpenGL/GL/MESA/resize_buffers.py
9
1565
'''OpenGL extension MESA.resize_buffers This module customises the behaviour of the OpenGL.raw.GL.MESA.resize_buffers to provide a more Python-friendly API Overview (from the spec) Mesa is often used as a client library with no integration with the computer's window system (an X server, for example). And since...
gpl-3.0
nin042/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/urlfetcher_mock.py
165
2053
# 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
pmarques/ansible
test/integration/targets/dict_transformations/library/convert_snake_case.py
29
1432
#!/usr/bin/python # -*- coding: utf-8 -*- # 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 DOCUMENTATION = ''' --- module: convert_snake_case short_description: test converting data to s...
gpl-3.0
stephen144/odoo
addons/account_budget/wizard/account_budget_analytic.py
47
1099
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import time from openerp.osv import fields, osv class account_budget_analytic(osv.osv_memory): _name = 'account.budget.analytic' _description = 'Account Budget report for analytic account' _columns = {...
agpl-3.0
Adel-Magebinary/odoo
addons/crm_claim/report/__init__.py
446
1080
# -*- 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...
agpl-3.0
jelugbo/ddi
common/djangoapps/user_api/tests/test_profile_api.py
8
4688
# -*- coding: utf-8 -*- """ Tests for the profile API. """ from django.test import TestCase import ddt from nose.tools import raises from dateutil.parser import parse as parse_datetime from user_api.api import account as account_api from user_api.api import profile as profile_api from user_api.models import UserProfi...
agpl-3.0
BT-fgarbely/bank-statement-reconcile
__unported__/account_statement_cancel_line/wizard/cancel_statement_line.py
36
2098
# -*- coding: utf-8 -*- ############################################################################### # # # Author: Leonardo Pistone # Copyright 2014 Camptocamp SA # ...
agpl-3.0
anetasie/sherpa
sherpa/image/pyds9_backend.py
3
5786
# # Copyright (C) 2007 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 your option) any later version. ...
gpl-3.0
dlazz/ansible
lib/ansible/modules/cloud/amazon/ec2_vpc_peer.py
13
14169
#!/usr/bin/python # 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': ['stableinterf...
gpl-3.0
miguelparaiso/PracticaOdoo
addons/auth_oauth/__openerp__.py
300
1654
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
PixNDom/android_kernel_lenovo_Tab2A710F
tools/perf/util/setup.py
2079
1438
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0