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
cpyou/odoo
addons/resource/tests/test_resource.py
243
32181
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
grengojbo/st2
st2actions/st2actions/config.py
1
3073
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
apache-2.0
mikel-egana-aranguren/SADI-Galaxy-Docker
galaxy-dist/eggs/nose-0.11.1-py2.7.egg/nose/proxy.py
1
5945
""" Result Proxy ------------ The result proxy wraps the result instance given to each test. It performs two functions: enabling extended error/failure reporting and calling plugins. As each result event is fired, plugins are called with the same event; however, plugins are called with the nose.case.Test instance tha...
gpl-3.0
dummie999/android_kernel_htc_z4u
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
thomasem/nova
nova/api/openstack/compute/schemas/v3/console_output.py
110
1393
# Copyright 2014 NEC Corporation. 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 ...
apache-2.0
xxsergzzxx/python-for-android
python3-alpha/extra_modules/gdata/oauth/rsa.py
102
4676
#!/usr/bin/python """ requires tlslite - http://trevp.net/tlslite/ """ import binascii try: from gdata.tlslite.utils import keyfactory except ImportError: from tlslite.tlslite.utils import keyfactory try: from gdata.tlslite.utils import cryptomath except ImportError: from tlslite.tlslite.utils import crypto...
apache-2.0
apanju/GMIO_Odoo
addons/l10n_syscohada/__openerp__.py
430
1940
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2010-2011 BAAMTU SARL (<http://www.baamtu.sn>). # contact: leadsn@baamtu.com # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affer...
agpl-3.0
meowtec/page-navigator
example.py
1
2364
# coding:utf-8 html_tpl = ''' <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> .nav{ margin: 10px 0; font-size: 12px; font-family: "Helvetica", "Arial", sans-serif; } .nav a{ text-decoration: none; color: #000...
mit
umberto1978/speedwizz_kernel_N2
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
ehovind/extensible-ebook-converter
eecon_fetcher.py
1
3151
#!/usr/bin/env python """ This file is part of Extensible eBook Converter (EeCon), an advanced ebook analysis and conversion tool. Copyright (C) 2012 Espen Hovind <espehov@ifi.uio.no> EeCon is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the ...
gpl-3.0
BlackSmith/selenium
py/test/selenium/webdriver/common/page_load_timeout_tests.py
63
2276
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
crazy-cat/incubator-mxnet
tests/python/unittest/test_io.py
6
9265
# 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
slisson/intellij-community
python/lib/Lib/heapq.py
91
14227
# -*- coding: Latin-1 -*- """Heap queue algorithm (a.k.a. priority queue). Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for all k, counting elements from 0. For the sake of comparison, non-existing elements are considered to be infinite. The interesting property of a heap is that a[0] is always ...
apache-2.0
beatrizjesus/my-first-blog
pasta/Lib/site-packages/pip/_vendor/ipaddress.py
206
72089
# Copyright 2007 Google Inc. # Licensed to PSF under a Contributor Agreement. """A fast, lightweight IPv4/IPv6 manipulation library in Python. This library is used to create/poke/manipulate IPv4 and IPv6 addresses and networks. """ from __future__ import unicode_literals __version__ = '1.0.7' import struct # ...
mit
albert12132/templar
templar/cli/templar.py
1
2179
"""Command-line interface for templar.""" from templar.api import config from templar.api import publish from templar.exceptions import TemplarError import templar import argparse import logging import sys LOGGING_FORMAT = '%(levelname)s %(filename)s:%(lineno)d> %(message)s' logging.basicConfig(format=LOGGING_FORMAT...
mit
apark263/tensorflow
tensorflow/python/keras/layers/noise.py
5
6369
# 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
RockySteveJobs/python-for-android
python3-alpha/python3-src/Lib/distutils/fancy_getopt.py
207
17784
"""distutils.fancy_getopt Wrapper around the standard getopt module that provides the following additional features: * short and long options are tied together * options have help strings, so fancy_getopt could potentially create a complete usage summary * options set attributes of a passed-in object """ im...
apache-2.0
iAmMrinal0/CouchPotatoServer
libs/requests/compat.py
1039
1469
# -*- coding: utf-8 -*- """ pythoncompat """ from .packages import chardet import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_py3 = (_ver[0] == 3) try: import simplejson as json except (ImportError, SyntaxError): # si...
gpl-3.0
hammerlab/immuno
immuno/immunogenicity.py
1
5849
# Copyright (c) 2014. Mount Sinai School of Medicine # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
amenonsen/ansible
test/units/modules/network/fortimanager/test_fmgr_secprof_waf.py
38
2632
# Copyright 2018 Fortinet, Inc. # # 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. # # This program is distributed in the...
gpl-3.0
MrLoick/python-for-android
python3-alpha/extra_modules/atom/url.py
47
4351
#!/usr/bin/python # # Copyright (C) 2008 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 ...
apache-2.0
nox/skia
tools/skpdiff/generate_pmetric_tables.py
179
4156
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function from math import * COPYRIGHT = '''/* * Copyright 2013 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */''' HELP = '// To regenerate SkPMetricUtil_generated.h, si...
bsd-3-clause
lambday/shogun
applications/ocr/MatrixWidget.py
39
2103
# File : $HeadURL$ # Version: $Id$ import gtk import numpy as np import common as com from QuadrWidget import QuadrWidget class MatrixWidget(QuadrWidget): def __init__(self, matrix_size): QuadrWidget.__init__(self) self.matrix = np.zeros((matrix_size, matrix_size), ...
bsd-3-clause
Microsoft/PTVS
Python/Templates/Web/ProjectTemplates/Python/Web/PollsFlask/models-mongodb.py
15
2884
""" Repository of polls that stores data in a MongoDB database. """ from bson.objectid import ObjectId, InvalidId from pymongo import MongoClient from . import Poll, Choice, PollNotFound from . import _load_samples_json def _poll_from_doc(doc): """Creates a poll object from the MongoDB poll document.""" retu...
apache-2.0
Gabriel-p/mcs_rot_angles
aux_modules/validation_set.py
1
10176
import os from astropy.io import ascii from astropy.table import Table from astropy.coordinates import Distance, Angle, SkyCoord from astropy import units as u import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import sys # Change path so that we can import functions from the '...
gpl-3.0
elingg/tensorflow
tensorflow/python/kernel_tests/fractional_avg_pool_op_test.py
107
21031
# 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
nearbycoder/tulsawebdevs.org
events/models/mixins.py
3
1419
import arrow from django.core.exceptions import ValidationError from django.db import models from django.utils.translation import ugettext_lazy as _ from django_extensions.db.models import TimeStampedModel, TitleSlugDescriptionModel from .meta import Location class EventModelMixin(TimeStampedModel, TitleSlugDescript...
gpl-3.0
Messaoud-Boudjada/dipy
doc/examples/reconst_csd_parallel.py
16
3740
""" ================================= Parallel reconstruction using CSD ================================= This example shows how to use parallelism (multiprocessing) using ``peaks_from_model`` in order to speedup the signal reconstruction process. For this example will we use the same initial steps as we used in :ref:...
bsd-3-clause
wxgeo/geophar
wxgeometrie/sympy/polys/tests/test_numberfields.py
4
28618
"""Tests for computational algebraic number field theory. """ from sympy import (S, Rational, Symbol, Poly, sqrt, I, oo, Tuple, expand, pi, cos, sin, exp) from sympy.utilities.pytest import raises, slow from sympy.core.compatibility import range from sympy.polys.numberfields import ( minimal_polynomial, ...
gpl-2.0
superdesk/Live-Blog
plugins/media-archive/superdesk/media_archive/core/impl/db_search.py
2
19008
''' Created on Aug 21, 2012 @package: superdesk media archive @copyright: 2012 Sourcefabric o.p.s. @license: http://www.gnu.org/licenses/gpl-3.0.txt @author: Ioan v. Pocol The implementation of database server based search API. ''' from ally.api.type import typeFor from ally.container.ioc import injected from ally.s...
agpl-3.0
twoerner/bitbake
lib/bb/cache_extra.py
14
3113
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # Extra RecipeInfo will be all defined in this file. Currently, # Only Hob (Image Creator) Requests some extra fields. So # HobRecipeInfo is defined. It's named HobRecipeInfo because it # is introduced by 'hob'. Users could also ...
gpl-2.0
jhbradley/moose
framework/scripts/find_hung_process.py
28
5808
#!/usr/bin/env python # This script can be used to figure out if a job on a cluster is hung. If all goes well, it'll print the unique # stack traces out. import sys, os, re, subprocess from tempfile import TemporaryFile from optparse import OptionParser, OptionGroup, Values #########################################...
lgpl-2.1
nioinnovation/safepickle
safepickle/encoding.py
1
1118
from .types import TypesManager def encode(obj): """ Encodes an item preparing it to be json serializable Encode relies on defined custom types to provide encoding, which in turn are responsible of using the 'encode' function parameter passed to them to recursively encoded contained items. ...
apache-2.0
yencarnacion/jaikuengine
.google_appengine/lib/jinja2-2.6/jinja2/testsuite/inheritance.py
90
7682
# -*- coding: utf-8 -*- """ jinja2.testsuite.inheritance ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests the template inheritance feature. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Env...
apache-2.0
pligor/predicting-future-product-prices
04_time_series_prediction/gp_opt/price_history_27_gp_opt.py
1
6918
from models.model_21_price_history_seq2seq_dyn_dec_ins import PriceHistorySeq2SeqDynDecIns import pickle import dill from os import path, remove import numpy as np from skopt.space.space import Integer, Real, Categorical from skopt import gp_minimize import tensorflow as tf from mylibs.jupyter_notebook_helper import M...
agpl-3.0
shreyasva/tensorflow
tensorflow/tensorboard/backend/float_wrapper_test.py
4
1963
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
ifduyue/sentry
src/sentry/api/endpoints/system_health.py
2
1205
from __future__ import absolute_import import itertools from rest_framework.response import Response from rest_framework.permissions import IsAuthenticated from sentry import status_checks from sentry.status_checks import sort_by_severity from sentry.api.base import Endpoint from sentry.auth.superuser import is_acti...
bsd-3-clause
marcomaccio/python-docs-samples
scripts/auto_link_to_docs.py
1
3864
#!/usr/bin/env python # Copyright (C) 2013 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 applic...
apache-2.0
jdgwartney/boundary-plugin-shell
metric_item_test.py
3
1923
#!/usr/bin/env python # Copyright 2014 Boundary, 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 o...
apache-2.0
varunagrawal/azure-services
varunagrawal/site-packages/django/utils/unittest/main.py
332
9388
"""Unittest main program""" import sys import os import types from django.utils.unittest import loader, runner try: from django.utils.unittest.signals import installHandler except ImportError: installHandler = None __unittest = True FAILFAST = " -f, --failfast Stop on first failure\n" CATCHBREAK = ...
gpl-2.0
mlgruby/mining
mining/utils/__init__.py
1
1603
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import re import os import unicodedata import ConfigParser from bson import ObjectId from datetime import datetime from mining.settings import PROJECT_PATH def slugfy(text): slug = unicodedata.normalize("NFKD", text).encode("UTF-8", "ignore") slug = r...
mit
nopjmp/SickRage
lib/twilio/access_token.py
21
4382
import time from twilio import jwt class IpMessagingGrant(object): """ Grant to access Twilio IP Messaging """ def __init__(self, service_sid=None, endpoint_id=None, deployment_role_sid=None, push_credential_sid=None): self.service_sid = service_sid self.endpoint_id = endpoint...
gpl-3.0
inspirehep/inspire-schemas
tests/unit/test_job_builder.py
1
16050
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2019 CERN. # # INSPIRE 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-2.0
FireBladeNooT/Medusa_1_6
lib/github/tests/IssueComment.py
1
3235
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
Trust-Code/server-tools
auth_admin_passkey/tests/test_auth_admin_passkey.py
61
3838
# -*- encoding: utf-8 -*- ############################################################################## # # Admin Passkey module for OpenERP # Copyright (C) 2013-2014 GRAP (http://www.grap.coop) # @author Sylvain LE GAL (https://twitter.com/legalsylvain) # # This program is free software: you can redistrib...
agpl-3.0
dominicelse/scipy
benchmarks/benchmarks/sparse.py
1
10059
""" Simple benchmarks for the sparse module """ from __future__ import division, print_function, absolute_import import warnings import time import timeit import numpy import numpy as np from numpy import ones, array, asarray, empty, random, zeros try: from scipy import sparse from scipy.sparse import (csr_m...
bsd-3-clause
0x7E/ubuntu-tweak
ubuntutweak/factory.py
4
4248
# Ubuntu Tweak - Ubuntu Configuration Tool # # Copyright (C) 2007-2011 Tualatrix Chou <tualatrix@gmail.com> # # Ubuntu Tweak 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
dpetzold/django
tests/urlpatterns_reverse/views.py
67
1466
from functools import partial, update_wrapper from django.contrib.auth.decorators import user_passes_test from django.core.urlresolvers import reverse_lazy from django.http import HttpResponse from django.views.generic import RedirectView def empty_view(request, *args, **kwargs): return HttpResponse('') def ab...
bsd-3-clause
chatcannon/numpy
numpy/doc/basics.py
39
7870
""" ============ Array basics ============ Array types and conversions between types ========================================= NumPy supports a much greater variety of numerical types than Python does. This section shows which are available, and how to modify an array's data-type. ========== =======================...
bsd-3-clause
Bysmyyr/chromium-crosswalk
tools/telemetry/third_party/gsutilz/third_party/boto/boto/sdb/db/manager/sdbmanager.py
153
27253
# Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010 Chris Moyer http://coredumped.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction,...
bsd-3-clause
ianyh/heroku-buildpack-python-opencv
vendor/.heroku/lib/python2.7/test/test_MimeWriter.py
138
7593
"""Test program for MimeWriter module. The test program was too big to comfortably fit in the MimeWriter class, so it's here in its own file. This should generate Barry's example, modulo some quotes and newlines. """ import unittest, StringIO from test.test_support import run_unittest, import_module import_module(...
mit
koobonil/Boss2D
Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/contrib/learn/python/learn/__init__.py
80
2585
# 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...
mit
googleapis/googleapis-gen
google/ads/googleads/v8/googleads-py/tests/unit/gapic/googleads.v8/services/test_custom_audience_service.py
1
35288
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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
HyperBaton/ansible
test/units/modules/network/fortios/test_fortios_application_group.py
21
8298
# Copyright 2019 Fortinet, Inc. # # 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. # # This program is distributed in the...
gpl-3.0
coronary/RandomEpisode
depends/Lib/site-packages/tmdbsimple/people.py
1
7235
# -*- coding: utf-8 -*- """ tmdbsimple.people ~~~~~~~~~~~~~~~~~ This module implements the People, Credits, and Jobs functionality of tmdbsimple. Created by Celia Oakley on 2013-10-31. :copyright: (c) 2013-2017 by Celia Oakley :license: GPLv3, see LICENSE for more details """ from .base import TMDB class People(T...
mit
ruslanloman/nova
nova/virt/libvirt/volume/volume.py
1
16814
# Copyright 2011 OpenStack Foundation # (c) Copyright 2013 Hewlett-Packard Development Company, L.P. # 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 # # ...
apache-2.0
Quihico/repository.spartacus
script.trtv/streaming.py
1
24691
# -*- coding: utf-8 -*- # # Copyright (C) 2014 Sean Poyser and Richard Dean (write2dixie@gmail.com) - With acknowledgement to some original code by twinther (Tommy Winther) # import xbmc from xml.etree import ElementTree from xml.parsers.expat import ExpatError import ConfigParser import os import re import xbm...
gpl-2.0
joker946/nova
nova/tests/unit/console/test_serial.py
60
4892
# 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 agreed to in...
apache-2.0
moorecoin/MooreCoinMiningAlgorithm
contrib/devtools/update-translations.py
1
6779
#!/usr/bin/python # copyright (c) 2014 wladimir j. van der laan # distributed under the mit software license, see the accompanying # file copying or http://www.opensource.org/licenses/mit-license.php. ''' run this script from the root of the repository to update all translations from transifex. it will do the following...
mit
kssim/efp
making_decisions/python/bmi_calculator.py
1
1254
# Pratice 19. BMI Calculator # Output: # Your BMI is 19.5. # You are within the ideal weight range. # Or # Your BMI is 32.5. # You are overweight. You should see your doctor. # Formula: # bmi = (weight / (height x height)) x 703 # Standard: # BMI 18.5 ~ 25 is nomal weight. # Constraint: # - Ensure your ...
mit
jamielennox/keystone
keystone/token/persistence/backends/memcache.py
18
1147
# Copyright 2013 Metacloud, Inc. # Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
apache-2.0
hagabbar/pycbc_copy
pycbc/psd/analytical.py
2
4927
#!/usr/bin/python # Copyright (C) 2012-2016 Alex Nitz, Tito Dal Canton, Leo Singer # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any la...
gpl-3.0
tomtor/QGIS
tests/src/python/test_db_manager_spatialite.py
15
26811
# -*- coding: utf-8 -*- """QGIS Unit tests for the DBManager SPATIALITE plugin .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later...
gpl-2.0
yhpeng-git/mxnet
example/rcnn/rcnn/tools/reeval.py
14
1487
import argparse import cPickle import os import mxnet as mx from ..logger import logger from ..config import config, default, generate_config from ..dataset import * def reeval(args): # load imdb imdb = eval(args.dataset)(args.image_set, args.root_path, args.dataset_path) # load detection results ca...
apache-2.0
barsnadcat/evegant
Process.py
1
1289
from unittest import TestCase from unittest.mock import Mock from Schemes import Blueprint from ItemStack import ItemStack class TestProcess(TestCase): def test_InitProcess(self): scheme = Blueprint(0, "Name", 0, [ItemStack(0, 1)], ItemStack(0, 1)) process = Process(scheme) assert process.inputs[0].ammount =...
gpl-3.0
hippich/p2pool
p2pool/networks/bitcoin.py
5
2145
from p2pool.bitcoin import networks # CHAIN_LENGTH = number of shares back client keeps # REAL_CHAIN_LENGTH = maximum number of shares back client uses to compute payout # REAL_CHAIN_LENGTH must always be <= CHAIN_LENGTH # REAL_CHAIN_LENGTH must be changed in sync with all other clients # changes can be done by changi...
gpl-3.0
jianC/kernel_htc_lexikon-3.0
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
redsolution/django-menu-proxy
menuproxy/utils.py
1
10086
# -*- coding: utf-8 -*- from django import conf from django.core.cache import cache from importpath import importpath METHODS = ( 'replace', # Указывает, что объект point следует заменить объектом object 'insert', # Указывает, что к списку дочерних элементов inside-правила нужно добавить элемент object 'c...
gpl-3.0
monkeysecurity/zerotodocker
genie/2.2.1/example/setup.py
11
4427
#!/usr/bin/python2.7 # Copyright 2015 Netflix, 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 o...
apache-2.0
vpalatin/libsigrokdecode
decoders/arm_tpiu/__init__.py
10
1146
## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2015 Petteri Aimonen <jpa@sigrok.mail.kapsi.fi> ## ## 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...
gpl-3.0
clbarnes/bctpy
test/basic_test.py
2
1469
from .load_samples import load_sample, load_directed_sample import bct import numpy as np def test_threshold_proportional(): x = load_sample() x = bct.threshold_proportional(x, .5, copy=True) assert np.allclose(np.sum(x), 22548.51206965) def test_threshold_proportional_nocopy(): x = load_sample() ...
gpl-3.0
irisfeng/CodeScanner
SZQRCodeViewController/Pods/AVOSCloudCrashReporting/Breakpad/src/tools/gyp/pylib/gyp/generator/msvs.py
37
125839
# 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. import collections import copy import ntpath import os import posixpath import re import subprocess import sys import gyp.common import gyp.easy_xml as easy_xml i...
mit
nirvn/QGIS
tests/src/python/test_provider_ogr_gpkg.py
1
28594
# -*- coding: utf-8 -*- """QGIS Unit tests for the OGR/GPKG provider. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version....
gpl-2.0
z1gm4/desarrollo_web_udp
env/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/__init__.py
499
5766
"""A collection of modules for iterating through different kinds of tree, generating tokens identical to those produced by the tokenizer module. To create a tree walker for a new type of tree, you need to do implement a tree walker object (called TreeWalker by convention) that implements a 'serialize' method taking a ...
gpl-3.0
demarle/VTK
Rendering/Core/Testing/Python/ImageActorStressed.py
20
4147
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # Create the RenderWindow, Renderer and both Actors ren1 = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren1) iren = vtk.vtkRenderWindowInteractor() iren.SetRen...
bsd-3-clause
o-schneider/selenium
py/selenium/webdriver/support/expected_conditions.py
69
9915
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
SamYaple/neutron
neutron/context.py
21
4591
# Copyright 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 req...
apache-2.0
shakamunyi/neutron
neutron/tests/unit/plugins/ml2/drivers/ext_test.py
45
8660
# Copyright 2015 Intel Corporation. # Copyright 2015 Isaku Yamahata <isaku.yamahata at intel com> # <isaku.yamahata at gmail com> # All Rights Reserved. # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the Lic...
apache-2.0
Chemcy/vnpy
vn.tutorial/tick2trade/vn.trader_t2t/uiBasicWidget.py
9
44280
# encoding: UTF-8 import json import csv import os from collections import OrderedDict from PyQt4 import QtGui, QtCore from eventEngine import * from vtFunction import * from vtGateway import * #---------------------------------------------------------------------- def loadFont(): """载入字体设置""" fileName = '...
mit
mattt416/neutron
neutron/tests/retargetable/base.py
37
2833
# Licensed under the Apache License, Version 2.0 (the "License"); you # may not use this file except in compliance with the License. You may # obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under ...
apache-2.0
zhaochengw/android_kernel_ef51lsk
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
1927
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
follow99/django
django/contrib/sitemaps/views.py
352
2953
import datetime from calendar import timegm from functools import wraps from django.contrib.sites.shortcuts import get_current_site from django.core import urlresolvers from django.core.paginator import EmptyPage, PageNotAnInteger from django.http import Http404 from django.template.response import TemplateResponse fr...
bsd-3-clause
tlakshman26/cinder-new-branch
cinder/tests/unit/api/contrib/test_availability_zones.py
32
2932
# Copyright (c) 2013 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
brianwoo/django-tutorial
ENV/lib/python2.7/site-packages/django/contrib/gis/maps/google/overlays.py
79
11934
from __future__ import unicode_literals from django.contrib.gis.geos import ( LinearRing, LineString, Point, Polygon, fromstr, ) from django.utils import six from django.utils.encoding import python_2_unicode_compatible from django.utils.functional import total_ordering from django.utils.html import html_safe @h...
gpl-3.0
oihane/odoo-addons
product_pricelist_item_menu/models/res_partner.py
2
1420
# Copyright 2020 Alfredo de la fuente - AvanzOSC # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from odoo import models, fields, api from odoo.models import expression from odoo.tools.safe_eval import safe_eval class ResPartner(models.Model): _inherit = 'res.partner' count_pricelists_item =...
agpl-3.0
santiavenda2/griffith
lib/add.py
3
36739
# -*- coding: UTF-8 -*- # vim: fdm=marker __revision__ = '$Id$' # Copyright (c) 2005-2011 Vasco Nunes, Piotr Ożarowski # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published byp # the Free Software Foundation; either version 2 of th...
gpl-2.0
laurentb/weboob
weboob/core/ouiboube.py
1
19192
# -*- coding: utf-8 -*- # Copyright(C) 2010-2014 Romain Bignon # # This file is part of weboob. # # weboob 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 3 of the License, or # (at your...
lgpl-3.0
rghe/ansible
test/units/modules/network/f5/test_bigip_monitor_tcp_echo.py
26
10042
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # 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 import os import json import sys import pytest from nose.plugins.skip imp...
gpl-3.0
ptisserand/ansible
lib/ansible/plugins/callback/default.py
24
13770
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2017 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 DOCUMENTATION = ''' callback: default type:...
gpl-3.0
rmfitzpatrick/ansible
lib/ansible/modules/network/avi/avi_cluster.py
27
3776
#!/usr/bin/python # # Created on Aug 25, 2016 # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # # # 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...
gpl-3.0
goto-bus-stop/py3status
py3status/modules/taskwarrior.py
8
1396
# -*- coding: utf-8 -*- """ Display currently active (started) taskwarrior tasks. Configuration parameters: - cache_timeout : how often we refresh this module in seconds (5s default) Requires - task @author James Smith http://jazmit.github.io/ @license BSD """ # import your useful libs here from time import...
bsd-3-clause
Integral-Technology-Solutions/ConfigNOW
Lib/tzparse.py
27
3494
"""Parse a timezone specification.""" # XXX Unfinished. # XXX Only the typical form "XXXhhYYY;ddd/hh,ddd/hh" is currently supported. import warnings warnings.warn( "The tzparse module is obsolete and will disappear in the future", DeprecationWarning) tzpat = ('^([A-Z][A-Z][A-Z])([-+]?[0-9]+)([A-Z][A-Z][A-Z])...
mit
RudoCris/horizon
openstack_dashboard/hooks.py
89
1063
# Copyright 2013 Hewlett-Packard Development Company, L.P. # 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 # # Unles...
apache-2.0
samuel-phan/mssh-copy-id
msshcopyid/cli.py
1
9466
from __future__ import unicode_literals import argparse import datetime import logging import os import socket import sys import traceback import paramiko import msshcopyid from msshcopyid.constants import DEFAULT_KNOWN_HOSTS from msshcopyid.constants import DEFAULT_SSH_DSA from msshcopyid.constants import DEFAULT_S...
mit
cnsoft/kbengine-cocos2dx
kbe/src/lib/python/Lib/_osx_support.py
8
18472
"""Shared OS X support functions.""" import os import re import sys __all__ = [ 'compiler_fixup', 'customize_config_vars', 'customize_compiler', 'get_platform_osx', ] # configuration variables that may contain universal build flags, # like "-arch" or "-isdkroot", that may need customization for # the...
lgpl-3.0
fener06/pyload
module/plugins/accounts/DepositfilesCom.py
2
1814
# -*- coding: utf-8 -*- """ 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. This program is distributed in...
gpl-3.0
woodscn/scipy
scipy/sparse/linalg/dsolve/_add_newdocs.py
131
3801
from numpy.lib import add_newdoc add_newdoc('scipy.sparse.linalg.dsolve._superlu', 'SuperLU', """ LU factorization of a sparse matrix. Factorization is represented as:: Pr * A * Pc = L * U To construct these `SuperLU` objects, call the `splu` and `spilu` functions. Attributes --...
bsd-3-clause
oneraghavan/portcache
setup.py
1
2150
from setuptools import setup setup(name='portcache', version='0.3 ', description='A simple cache for port from remote service', url='https://github.com/oneraghavan/portcache', author='Raghavan', author_email='oneraghavan@gmail.com', license='MIT', packages=['portcache'],...
mit
arcivanov/pybuilder
src/main/python/pybuilder/plugins/python/install_dependencies_plugin.py
3
4525
# -*- coding: utf-8 -*- # # This file is part of PyBuilder # # Copyright 2011-2020 PyBuilder Team # # 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/l...
apache-2.0
mdhaber/scipy
scipy/stats/tests/test_tukeylambda_stats.py
21
3232
import numpy as np from numpy.testing import assert_allclose, assert_equal from scipy.stats._tukeylambda_stats import (tukeylambda_variance, tukeylambda_kurtosis) def test_tukeylambda_stats_known_exact(): """Compare results with some known exact formulas.""" # Some...
bsd-3-clause