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
msingh172/pylearn2
pylearn2/models/independent_multiclass_logistic.py
44
2491
""" Multiclass-classification by taking the max over a set of one-against-rest logistic classifiers. """ __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googleg...
bsd-3-clause
alcobar/asuswrt-merlin
release/src/router/libxml2/python/tests/pushSAX.py
87
1490
#!/usr/bin/python -u import sys import libxml2 # Memory debug specific libxml2.debugMemory(1) log = "" class callback: def startDocument(self): global log log = log + "startDocument:" def endDocument(self): global log log = log + "endDocument:" def startElement(self, tag...
gpl-2.0
public-ink/public-ink
server/appengine/lib/graphene/pyutils/enum.py
3
31034
"""Python Enumerations""" import sys as _sys __all__ = ['Enum', 'IntEnum', 'unique'] version = 1, 1, 6 pyver = float('%s.%s' % _sys.version_info[:2]) try: any except NameError: def any(iterable): for element in iterable: if element: return True return False try:...
gpl-3.0
VitalPet/odoo
addons/account/account_cash_statement.py
45
14599
# encoding: utf-8 ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 PC Solutions (<http://pcsol.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # i...
agpl-3.0
gtko/Sick-Beard
lib/hachoir_parser/image/pcx.py
90
2745
""" PCX picture filter. """ from lib.hachoir_parser import Parser from lib.hachoir_core.field import ( UInt8, UInt16, PaddingBytes, RawBytes, Enum) from lib.hachoir_parser.image.common import PaletteRGB from lib.hachoir_core.endian import LITTLE_ENDIAN class PcxFile(Parser): endian = LITTLE_ENDIAN ...
gpl-3.0
JPJPJPOPOP/zulip
zerver/tests/test_timestamp.py
10
1221
from __future__ import absolute_import from django.utils import timezone from zerver.lib.test_classes import ZulipTestCase from zerver.lib.timestamp import floor_to_hour, floor_to_day, ceiling_to_hour, \ ceiling_to_day, timestamp_to_datetime, datetime_to_timestamp, \ TimezoneNotUTCException from datetime imp...
apache-2.0
Anonymouslemming/ansible
lib/ansible/utils/module_docs_fragments/files.py
89
3336
# (c) 2014, Matt Martz <matt@sivel.net> # # 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. # ...
gpl-3.0
kod3r/miasm
test/utils/cosmetics.py
9
1220
import os def getTerminalSize(): "Return the size of the terminal : COLUMNS, LINES" env = os.environ def ioctl_GWINSZ(fd): try: import fcntl import termios import struct import os cr = struct.unpack('hh', fcntl.ioctl(fd, termios.TIOCGWI...
gpl-2.0
ajs124/namebench
nb_third_party/dns/rdtypes/ANY/CERT.py
248
4263
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
ujjvala-addsol/addsol_hr
openerp/addons/base/ir/ir_attachment.py
37
16285
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
opencorato/represent-boundaries
boundaries/tests/test_geometry.py
2
3985
# coding: utf-8 from __future__ import unicode_literals from django.contrib.gis.gdal import OGRGeometry, SpatialReference from django.test import TestCase from boundaries.models import Geometry class GeometryTestCase(TestCase): maxDiff = None def test_str(self): wkt = 'MULTIPOLYGON (((0 0,0 5,5 5,0...
mit
draugiskisprendimai/odoo
openerp/service/websrv_lib.py
380
7780
# -*- coding: utf-8 -*- # # Copyright P. Christeas <p_christ@hol.gr> 2008-2010 # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsibility of assessing all potential # consequences resulting from its eventual inadequacies and bugs # End users who are looking ...
agpl-3.0
lgics/lge-kernel-msm7x27-3.4
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
gonesurfing/Quisk_rpi_remote
n2adr/quisk_conf_8600.py
2
7293
# These are the configuration parameters for receiving the # 10.7 MHz IF output of the AOR AR8600 receiver with my # transceiver. This results in a 100 kHz to 3 GHz # wide range receiver with pan adapter. # # Due to noise starting at 11.18 MHz when tuned to 449.0 MHz, we tune to 10.5 MHz center. # # Note: The AR8600 ...
gpl-2.0
balloob/home-assistant
homeassistant/components/ambient_station/sensor.py
8
2736
"""Support for Ambient Weather Station sensors.""" from homeassistant.const import ATTR_NAME from homeassistant.core import callback from . import ( SENSOR_TYPES, TYPE_SOLARRADIATION, TYPE_SOLARRADIATION_LX, AmbientWeatherEntity, ) from .const import ( ATTR_LAST_DATA, ATTR_MONITORED_CONDITIONS,...
apache-2.0
hesseltuinhof/mxnet
example/fcn-xs/solver.py
14
6530
# pylint: skip-file import numpy as np import mxnet as mx import time import logging from collections import namedtuple from mxnet import optimizer as opt from mxnet.optimizer import get_updater from mxnet import metric # Parameter to pass to batch_end_callback BatchEndParam = namedtuple('BatchEndParams', [...
apache-2.0
igemsoftware/SYSU-Software2013
project/Python27_32/Lib/test/test_copy_reg.py
129
4256
import copy_reg import unittest from test import test_support from test.pickletester import ExtensionSaver class C: pass class WithoutSlots(object): pass class WithWeakref(object): __slots__ = ('__weakref__',) class WithPrivate(object): __slots__ = ('__spam',) class WithSingleString(object): ...
mit
songmonit/CTTMSONLINE_V8
addons/account_voucher/__init__.py
358
1098
# -*- 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
jcadduono/nethunter_kernel_kccat6
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
thaumos/ansible
test/units/plugins/inventory/test_host.py
56
3412
# Copyright 2015 Marius Gedminas <marius@gedmin.as> # # 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...
gpl-3.0
alexanderfefelov/nav
python/nav/web/status/sections.py
1
29405
# -*- coding: utf-8 -*- # # Copyright (C) 2009, 2012 UNINETT AS # # This file is part of Network Administration Visualized (NAV). # # NAV is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License version 2 as published by # the Free Software Foundation. # # This prog...
gpl-2.0
precedenceguo/mxnet
example/ssd/dataset/testdb.py
26
2410
# 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
alexmogavero/home-assistant
tests/components/notify/test_file.py
24
3690
"""The tests for the notify file platform.""" import os import unittest from unittest.mock import call, mock_open, patch from homeassistant.setup import setup_component import homeassistant.components.notify as notify from homeassistant.components.notify import ( ATTR_TITLE_DEFAULT) import homeassistant.util.dt as...
apache-2.0
SunghanKim/mwparserfromhell
tests/test_template.py
3
21547
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2015 Ben Kurtovic <ben.kurtovic@gmail.com> # # 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 ...
mit
pyspace/pyspace
pySPACE/missions/nodes/spatial_filtering/rereferencing.py
2
12334
""" Change the reference of an EEG signal """ import numpy import warnings from pySPACE.missions.nodes.base_node import BaseNode from pySPACE.resources.data_types.time_series import TimeSeries from pySPACE.resources.dataset_defs.stream import StreamDataset class InvalidWindowException(Exception): pass class La...
bsd-3-clause
justathoughtor2/atomicApe
cygwin/usr/local/etc/babun/external/oh-my-zsh/plugins/git-prompt/gitstatus.py
343
2372
#!/usr/bin/env python # -*- coding: UTF-8 -*- from subprocess import Popen, PIPE import re # change those symbols to whatever you prefer symbols = { 'ahead of': '↑', 'behind': '↓', 'staged': '♦', 'changed': '‣', 'untracked': '…', 'clean': '⚡', 'unmerged': '≠', 'sha1': ':' } output, err...
gpl-3.0
ATIX-AG/ansible
lib/ansible/module_utils/network/a10/a10.py
135
5900
# 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
projectarkc/arkc-server-gae
fetchfrom/goagent.py
1
9320
#!/usr/bin/env python # coding:utf-8 __version__ = '3.2.0' __password__ = '' __hostsdeny__ = () # __hostsdeny__ = ('.youtube.com', '.youku.com') import os import re import time import struct import zlib import base64 import logging import urlparse import httplib import io import string import json from BaseHTTPServ...
gpl-2.0
solarjoe/numpy
numpy/f2py/rules.py
63
58541
#!/usr/bin/env python """ Rules for building C/API module with f2py2e. Here is a skeleton of a new wrapper function (13Dec2001): wrapper_function(args) declarations get_python_arguments, say, `a' and `b' get_a_from_python if (successful) { get_b_from_python if (successful) { callfortran ...
bsd-3-clause
kratorius/ads
python/interviewquestions/longest_sequence.py
1
1730
""" Given a list of distinct numbers, find the longest monotonically increasing subsequence within that list. For example: S = [2, 4, 3, 5, 1, 7, 6, 9, 8] -> [2, 3, 5, 6, 8] or [2, 4, 5, 7, 8] or [2, 4, 5, 7, 9] If there's more than one solut...
mit
IntelLabs/numba
numba/tests/test_comprehension.py
6
16949
import unittest from numba.tests.support import TestCase import sys import operator import numpy as np import numpy from numba.core.compiler import compile_isolated from numba import jit from numba.core import types, utils from numba.core.errors import TypingError, LoweringError from numba.core.types.functions import...
bsd-2-clause
pcingola/server
ga4gh/frontend.py
5
20419
""" The Flask frontend for the GA4GH API. TODO Document properly. """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals import os import datetime import socket import urlparse import functools import flask import flask.ext.cors as cors import humanize impor...
apache-2.0
AydinSakar/node-gyp
gyp/pylib/gyp/easy_xml.py
1049
4803
# Copyright (c) 2011 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. import re import os def XmlToString(content, encoding='utf-8', pretty=False): """ Writes the XML content to disk, touching the file only if it has changed. ...
mit
a-doumoulakis/tensorflow
tensorflow/contrib/training/python/training/device_setter_test.py
54
5692
# Copyright 2016 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
rahulunair/nova
nova/virt/powervm/disk/ssp.py
4
10824
# Copyright 2015, 2018 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 ag...
apache-2.0
AWoloszyn/shaderc
glslc/test/messages_tests.py
3
8666
# Copyright 2015 The Shaderc 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 applicable...
apache-2.0
Yannig/ansible
lib/ansible/plugins/action/net_base.py
1
7262
# (c) 2015, Ansible 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 di...
gpl-3.0
F5Networks/f5-common-python
f5/bigiq/cm/device/licensing/pool/initial_activation.py
1
1773
# coding=utf-8 # # Copyright 2017 F5 Networks 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 a...
apache-2.0
ShawnLeee/chisel
commands/FBDebugCommands.py
7
6855
#!/usr/bin/python import lldb import fblldbbase as fb import fblldbobjcruntimehelpers as objc import re def lldbcommands(): return [ FBWatchInstanceVariableCommand(), FBFrameworkAddressBreakpointCommand(), FBMethodBreakpointCommand(), ] class FBWatchInstanceVariableCommand(fb.FBCommand): def name(...
bsd-3-clause
ShassAro/ShassAro
Bl_project/blVirtualEnv/lib/python2.7/site-packages/pip/_vendor/colorama/initialise.py
484
1297
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. import atexit import sys from .ansitowin32 import AnsiToWin32 orig_stdout = sys.stdout orig_stderr = sys.stderr wrapped_stdout = sys.stdout wrapped_stderr = sys.stderr atexit_done = False def reset_all(): AnsiToWin32(orig_stdout).rese...
gpl-2.0
CSD-Public/stonix
src/MacBuild/ramdisk/lib/environment.py
1
30726
#!/usr/bin/env python3 ############################################################################### # # # Copyright 2019. Triad National Security, LLC. All rights reserved. # # This program was produced under U.S. Government contrac...
gpl-2.0
razvanphp/arangodb
3rdParty/V8-3.31.74.1/third_party/python_26/Lib/io.py
51
64383
""" The io module provides the Python interfaces to stream handling. The builtin open function is defined in this module. At the top of the I/O hierarchy is the abstract base class IOBase. It defines the basic interface to a stream. Note, however, that there is no seperation between reading and writing to streams; imp...
apache-2.0
findayu/picasso-graphic
tools/gyp/pylib/gyp/SCons.py
253
5848
# 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. """ SCons generator. This contains class definitions and supporting functions for generating pieces of SCons files for the different types of GYP targets. """ im...
bsd-3-clause
mapr/hue
desktop/core/ext-py/Django-1.6.10/django/utils/2to3_fixes/fix_unicode.py
349
1181
"""Fixer for __unicode__ methods. Uses the django.utils.encoding.python_2_unicode_compatible decorator. """ from __future__ import unicode_literals from lib2to3 import fixer_base from lib2to3.fixer_util import find_indentation, Name, syms, touch_import from lib2to3.pgen2 import token from lib2to3.pytree import Leaf,...
apache-2.0
bkahlert/seqan-research
raw/pmsb13/pmsb13-data-20130530/trunk/misc/add_include.py
14
3326
#!/usr/bin/env python2.5 """DDDoc Helper Script -- add includes. Called the path to the SeqAn checkout, this tool will search for all SeqAn header files. Within each file, it will look for all Metafunction, Function, Tag, Class and Specialization dddoc documentation. For each of documentation comment, it will add th...
mit
ifduyue/sentry
src/sentry/web/frontend/debug/debug_auth_views.py
4
1304
from __future__ import absolute_import from django.views.generic import View from sentry.models import User from sentry.web.helpers import render_to_response class DebugAuthConfirmIdentity(View): def get(self, request): auth_identity = { 'id': 'bar@example.com', 'email': 'bar@exa...
bsd-3-clause
toshic/elliptics
recovery/elliptics_recovery/dc_recovery.py
2
19207
# ============================================================================= # 2013+ Copyright (c) Kirill Smorodinnikov <shaitkir@gmail.com> # 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 Fre...
lgpl-3.0
ajbouh/tfi
src/tfi/main.py
1
13541
#!/usr/bin/env python from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import os import os.path import sys import tempfile import tfi import tfi.driver import tfi.driverconfig from tfi.resolve.model import _detect_model_file_kind, _model_mo...
mit
starwels/starwels
test/functional/test_framework/script.py
2
20868
#!/usr/bin/env python3 # Copyright (c) 2015-2019 The Starwels developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Functionality to build scripts, as well as SignatureHash(). This file is modified from python-starwelslib....
mit
henrytao-me/openerp.positionq
openerp/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/functions.py
89
11250
########################################################################## # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gener...
agpl-3.0
andersonresende/django
tests/unmanaged_models/tests.py
49
2183
from __future__ import unicode_literals from django.db import connection from django.test import TestCase from .models import A01, A02, B01, B02, C01, C02, Unmanaged2, Managed1 class SimpleTests(TestCase): def test_simple(self): """ The main test here is that the all the models can be created w...
bsd-3-clause
flying-circus/python-windows-tiler
pwt/monitor.py
2
4152
#@PydevCodeAnalysisIgnore import logging import win32api #pwt specific imports from pwt.tiler import Tiler from win32con import MONITOR_DEFAULTTONEAREST from win32con import MONITOR_DEFAULTTOPRIMARY class Monitor(object): def __init__(self, hMonitor): self.hMonitor = hMonitor self.tilers = [] ...
lgpl-3.0
kzvyahin/cfme_tests
sprout/appliances/api.py
1
17913
# -*- coding: utf-8 -*- import inspect import json import re from celery import chain from celery.result import AsyncResult from datetime import datetime from django.core.exceptions import ObjectDoesNotExist from django.db import transaction from django.http import HttpResponse from django.shortcuts import render from...
gpl-2.0
noelbk/neutron-juniper
neutron/tests/unit/hyperv/test_hyperv_utilsv2.py
6
9391
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Cloudbase Solutions SRL # 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.ap...
apache-2.0
collinjackson/mojo
sky/tools/webkitpy/common/system/outputcapture_unittest.py
62
2454
# Copyright (C) 2011 Apple 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: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
alephu5/Soundbyte
environment/lib/python3.3/site-packages/sympy/mpmath/functions/hypergeometric.py
14
51556
from ..libmp.backend import xrange from .functions import defun, defun_wrapped def _check_need_perturb(ctx, terms, prec, discard_known_zeros): perturb = recompute = False extraprec = 0 discard = [] for term_index, term in enumerate(terms): w_s, c_s, alpha_s, beta_s, a_s, b_s, z = term h...
gpl-3.0
regalstreak/android_kernel_samsung_logan2g
tools/perf/scripts/python/check-perf-trace.py
11214
2503
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
gpl-2.0
alilotfi/django
tests/migrations/test_state.py
86
44912
from django.apps.registry import Apps from django.contrib.contenttypes.fields import GenericForeignKey from django.db import models from django.db.migrations.exceptions import InvalidBasesError from django.db.migrations.operations import ( AddField, AlterField, DeleteModel, RemoveField, ) from django.db.migrations....
bsd-3-clause
aabadie/scikit-learn
benchmarks/bench_plot_neighbors.py
101
6469
""" Plot the scaling of the nearest neighbors algorithms with k, D, and N """ from time import time import numpy as np import matplotlib.pyplot as plt from matplotlib import ticker from sklearn import neighbors, datasets def get_data(N, D, dataset='dense'): if dataset == 'dense': np.random.seed(0) ...
bsd-3-clause
user-none/calibre
src/calibre/srv/errors.py
10
1408
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2015, Kovid Goyal <kovid at kovidgoyal.net>' import httplib class JobQueueFull(Exception): pass class RouteError(Va...
gpl-3.0
abramconnelly/genevieve
file_process/tasks.py
1
5314
"""Tasks for analyzing genome/genetic data files""" # absolute_import prevents conflicts between project celery.py file # and the celery package. from __future__ import absolute_import import bz2 import csv import gzip import os from random import randint from celery import shared_task from django.conf import settin...
mit
samchrisinger/osf.io
api/users/permissions.py
14
1403
from website.models import User from rest_framework import permissions class ReadOnlyOrCurrentUser(permissions.BasePermission): """ Check to see if the request is coming from the currently logged in user, and allow non-safe actions if so. """ def has_object_permission(self, request, view, obj): ...
apache-2.0
gnowxilef/Wox
PythonHome/Lib/site-packages/setuptools/sandbox.py
17
10256
import os import sys import tempfile import operator import functools import itertools import re import pkg_resources if os.name == "java": import org.python.modules.posix.PosixModule as _os else: _os = sys.modules[os.name] try: _file = file except NameError: _file = None _open = open from distutils.e...
mit
lavjain/incubator-hawq
tools/bin/gppylib/system/fileSystemImplTest.py
12
3354
#!/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 # "Li...
apache-2.0
npuichigo/ttsflow
third_party/tensorflow/tensorflow/contrib/keras/python/keras/preprocessing/image_test.py
16
7455
# Copyright 2016 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
gerald-yang/ubuntu-iotivity-demo
snappy/grovepi/pygrovepi/grove_button.py
7
1859
#!/usr/bin/env python # # GrovePi Example for using the Grove Button (http://www.seeedstudio.com/wiki/Grove_-_Button) # # The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http://www.dexterindustries.com/GrovePi # # Have a question about this example? Ask on the forums h...
apache-2.0
virneo/nupic
tests/external/testfixture_test.py
35
1766
#!/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
foodszhang/kbengine
kbe/src/lib/python/Lib/test/test_shlex.py
113
5912
import io import shlex import string import unittest from test import support # The original test data set was from shellwords, by Hartmut Goebel. data = r"""x|x| foo bar|foo|bar| foo bar|foo|bar| foo bar |foo|bar| foo bar bla fasel|foo|bar|bla|fasel| x y z xxxx|x|y|z|xxxx| \x bar|\|x|bar| ...
lgpl-3.0
tardyp/buildbot
master/buildbot/test/fake/machine.py
6
2509
# 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
centricular/meson
tools/cmake2meson.py
1
10941
#!/usr/bin/env python3 # Copyright 2014 Jussi Pakkanen # 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 o...
apache-2.0
adyliu/mysql-connector-python
python2/tests/test_examples.py
1
6610
# -*- coding: utf-8 -*- # MySQL Connector/Python - MySQL driver written in Python. # Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. # MySQL Connector/Python is licensed under the terms of the GPLv2 # <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most # MySQL Connectors. Th...
gpl-2.0
mostlygeek/splice
migrations/env.py
7
4571
from __future__ import with_statement from alembic import context from sqlalchemy import engine_from_config, pool, MetaData from logging.config import fileConfig import logging USE_TWOPHASE = False # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context...
mpl-2.0
clearcare/cc_dynamodb
tests/conftest.py
1
1033
from decimal import Decimal import os.path import pytest AWS_DYNAMODB_CONFIG_PATH = os.path.join(os.path.dirname(__file__), 'dynamodb.yml') @pytest.fixture def fake_config(): import cc_dynamodb cc_dynamodb.set_config( table_config=AWS_DYNAMODB_CONFIG_PATH, aws_access_key_id='<KEY>', ...
mit
johndpope/tensorflow
tensorflow/python/kernel_tests/sparse_conditional_accumulator_test.py
132
22955
# 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
amir343/ansible
lib/ansible/plugins/lookup/flattened.py
60
2408
# (c) 2013, Serge van Ginderachter <serge@vanginderachter.be> # # 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)...
gpl-3.0
felixbb/forseti-security
google/cloud/security/scanner/audit/buckets_rules_engine.py
1
8802
# Copyright 2017 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
JamesClough/networkx
networkx/algorithms/wiener.py
15
2586
# wiener.py - functions related to the Wiener index of a graph # # Copyright 2015 NetworkX developers. # # This file is part of NetworkX. # # NetworkX is distributed under a BSD license; see LICENSE.txt for more # information. """Functions related to the Wiener index of a graph.""" from __future__ import division from...
bsd-3-clause
mbalasso/mynumpy
numpy/oldnumeric/arrayfns.py
13
2532
"""Backward compatible with arrayfns from Numeric """ __all__ = ['array_set', 'construct3', 'digitize', 'error', 'find_mask', 'histogram', 'index_sort', 'interp', 'nz', 'reverse', 'span', 'to_corners', 'zmin_zmax'] import numpy as np from numpy import asarray class error(Exception): pass d...
bsd-3-clause
open-synergy/account-payment
account_vat_on_payment/account_invoice.py
2
4586
# -*- coding: utf-8 -*- # © 2011-2012 Domsense s.r.l. (<http://www.domsense.com>). # © 2014 Agile Business Group sagl (<http://www.agilebg.com>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp.osv import orm, fields from openerp.tools.translate import _ from openerp import api class...
agpl-3.0
klunwebale/odoo
addons/stock/product.py
137
32160
# -*- 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
lupyuen/RaspberryPiImage
home/pi/GrovePi/Software/Python/others/temboo/Library/Instagram/GetMediaComments.py
5
3659
# -*- coding: utf-8 -*- ############################################################################### # # GetMediaComments # Retrieves a full list of comments for a specified media object. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "Licen...
apache-2.0
srcLurker/home-assistant
tests/test_remote.py
3
10563
"""Test Home Assistant remote methods and classes.""" # pylint: disable=protected-access import asyncio import threading import unittest from unittest.mock import patch import homeassistant.core as ha import homeassistant.bootstrap as bootstrap import homeassistant.remote as remote import homeassistant.components.http...
mit
cyncyncyn/evette
languagefiles/language_irish_1.3.2.py
1
68626
#!/usr/bin/python # -*- coding: UTF-8 -*- #Copyright (C) 2007 Adam Spencer - Free Veterinary Management Suite #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 ...
gpl-2.0
vernhart/flickr-moderate
common.py
1
25143
#!/usr/bin/env python3 from flickrapi import FlickrAPI, exceptions # Flickr API library import os # get directory of script for config loading import yaml # config file format from pprint import pprint # for debugging import re # for topic reply searchi...
mpl-2.0
rnestler/servo
tests/wpt/web-platform-tests/XMLHttpRequest/resources/access-control-basic-preflight-cache-timeout.py
46
1806
def main(request, response): def fail(message): response.content = "FAIL " + request.method + ": " + str(message) def getState(token): server_state = request.server.stash.take(token) if not server_state: return "Uninitialized" return server_state def setState(st...
mpl-2.0
JhonyVilla/blog
pelican-plugins/assets/assets.py
1
2672
# -*- coding: utf-8 -*- """ Asset management plugin for Pelican =================================== This plugin allows you to use the `webassets`_ module to manage assets such as CSS and JS files. The ASSET_URL is set to a relative url to honor Pelican's RELATIVE_URLS setting. This requires the use of SITEUR...
gpl-3.0
samuelmaudo/yepes
yepes/contrib/datamigrations/importation_plans/base.py
1
5591
# -*- coding:utf-8 -*- from __future__ import unicode_literals import collections import operator from django.db import transaction from django.db.models import F, Q from django.utils.six.moves import reduce from django.utils.text import camel_case_to_spaces, capfirst from yepes.contrib.datamigrations.exceptions im...
bsd-3-clause
j-towns/fastar
fastar/test_util.py
1
3377
from itertools import chain from random import shuffle import numpy as np from jax import numpy as jnp, test_util as jtu from jax.util import safe_map, safe_zip from jax.tree_util import tree_multimap, tree_flatten, tree_map from fastar import lazy_eval, lazy_eval_fixed_point, LazyArray map = safe_map zip = safe_zip ...
mit
walafc0/soclib
soclib/iss/iss_profiler/bin/iss_profiler2profile.py
1
2939
#!/usr/bin/env python from dsx.util.objdumper import * import sys __id__ = "$Id: iss_profiler2profile.py 917 2009-03-12 10:10:06Z nipo $" __version__ = "$Revision: 917 $" class SymLooker: def __init__(self, arch, obj): self.__syms = {} dumper = ObjDumper(arch, obj) for section in dumper: for sym in section...
lgpl-2.1
AOSPU/external_chromium_org
tools/telemetry/telemetry/value/histogram_unittest.py
10
1589
# 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. import os import unittest from telemetry import value from telemetry.page import page_set from telemetry.value import histogram as histogram_module class Te...
bsd-3-clause
moijes12/oh-mainline
mysite/missions/base/view_helpers.py
13
2460
# This file is part of OpenHatch. # Copyright (C) 2010 Jack Grigg # Copyright (C) 2010, 2011 OpenHatch, Inc. # Copyright (C) 2010 John Stumpo # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundat...
agpl-3.0
ayepezv/GAD_ERP
openerp/addons/test_impex/models.py
2
4918
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models def selection_fn(model): return list(enumerate(["Corge", "Grault", "Wheee", "Moog"])) def compute_fn(records): for record in records: record.value = 3 def inverse_f...
gpl-3.0
mvaled/sentry
src/sentry/auth/system.py
3
2238
from __future__ import absolute_import, print_function import ipaddress import six from django.conf import settings from django.contrib.auth.models import AnonymousUser from django.utils.crypto import constant_time_compare from uuid import uuid4 from sentry import options from sentry.utils.cache import memoize INT...
bsd-3-clause
ChawalitK/odoo
addons/website_sale/tests/test_website_sale_pricelist.py
4
2725
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from mock import patch from odoo.tests.common import TransactionCase class TestWebsitePriceList(TransactionCase): # Mock nedded because request.session doesn't exist during test def _get_pricelist_available(sel...
gpl-3.0
maxdeliso/elevatorSim
Lib/distutils/tests/test_sdist.py
2
14532
"""Tests for distutils.command.sdist.""" import os import tarfile import unittest import warnings import zipfile from os.path import join from textwrap import dedent from test.support import captured_stdout, check_warnings, run_unittest try: import zlib ZLIB_SUPPORT = True except ImportError: ZLIB_SUPPORT ...
bsd-2-clause
keerts/home-assistant
homeassistant/components/sun.py
5
7073
""" Support for functionality to keep track of the sun. For more details about this component, please refer to the documentation at https://home-assistant.io/components/sun/ """ import logging from datetime import timedelta import voluptuous as vol from homeassistant.const import CONF_ELEVATION from homeassistant.he...
apache-2.0
xuru/pyvisdk
pyvisdk/do/virtual_machine_file_layout.py
1
1433
import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def VirtualMachineFileLayout(vim, *args, **kwargs): '''Describes the set of files that ma...
mit
ddzialak/boto
boto/file/bucket.py
153
4085
# Copyright 2010 Google Inc. # Copyright (c) 2011, Nexenta Systems Inc. # # 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...
mit
Adnn/django
tests/gis_tests/geos_tests/test_mutable_list.py
166
14952
# Copyright (c) 2008-2009 Aryeh Leib Taurog, http://www.aryehleib.com # All rights reserved. # # Modified from original contribution by Aryeh Leib Taurog, which was # released under the New BSD license. import unittest from django.contrib.gis.geos.mutable_list import ListMixin from django.utils import six class Use...
bsd-3-clause
steven-martins/Marking
back/marks/migrations/0001_initial.py
1
3773
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import datetime class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ m...
mit