repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
mancoast/CPythonPyc_test
fail/325_test_ioctl.py
87
3327
import array import unittest from test.support import run_unittest, import_module, get_attribute import os, struct fcntl = import_module('fcntl') termios = import_module('termios') get_attribute(termios, 'TIOCGPGRP') #Can't run tests without this feature try: tty = open("/dev/tty", "rb") except IOError: raise ...
gpl-3.0
risicle/django
django/db/migrations/graph.py
351
10956
from __future__ import unicode_literals import warnings from collections import deque from functools import total_ordering from django.db.migrations.state import ProjectState from django.utils.datastructures import OrderedSet from django.utils.encoding import python_2_unicode_compatible from .exceptions import Circu...
bsd-3-clause
davenovak/mtasa-blue
vendor/google-breakpad/src/tools/gyp/test/mac/gyptest-xcode-gcc-clang.py
254
1403
#!/usr/bin/env python # 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. """ Verifies that xcode-style GCC_... settings that require clang are handled properly. """ import TestGyp import os import sys if sys.pl...
gpl-3.0
13xforever/webserver
admin/CTK/CTK/Container.py
5
1701
# -*- coding: utf-8 -*- # CTK: Cherokee Toolkit # # Authors: # Alvaro Lopez Ortega <alvaro@alobbs.com> # # Copyright (C) 2009-2014 Alvaro Lopez Ortega # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public # License as published by the ...
gpl-2.0
skycucumber/xuemc
python/venv/lib/python2.7/site-packages/requests/packages/chardet/langbulgarianmodel.py
2965
12784
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
gpl-2.0
powerjg/gem5-ci-test
ext/ply/test/yacc_error1.py
174
1530
# ----------------------------------------------------------------------------- # yacc_error1.py # # Bad p_error() function # ----------------------------------------------------------------------------- import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.yacc as yacc from calclex import tokens # ...
bsd-3-clause
qiyuangong/leetcode
python/032_Longest_Valid_Parentheses.py
2
1488
import pdb class Solution(object): # def longestValidParentheses(self, s): # """ # :type s: str # :rtype: int # """ # ls = len(s) # start = [0] * (ls + 1) # all = [0] * (ls + 1) # for i in reversed(range(ls - 1)): # if s[i] == '(': # ...
mit
harisbal/pandas
pandas/tests/reshape/merge/test_merge_index_as_string.py
7
5670
import numpy as np import pytest from pandas import DataFrame from pandas.util.testing import assert_frame_equal @pytest.fixture def df1(): return DataFrame(dict( outer=[1, 1, 1, 2, 2, 2, 2, 3, 3, 4, 4], inner=[1, 2, 3, 1, 2, 3, 4, 1, 2, 1, 2], v1=np.linspace(0, 1, 11))) @pytest.fixture...
bsd-3-clause
escapewindow/signingscript
src/signingscript/vendored/mozbuild/mozbuild/jar.py
2
23403
# 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/. '''jarmaker.py provides a python class to package up chrome content by processing jar.mn files. See the documentation f...
mpl-2.0
eeshangarg/oh-mainline
vendor/packages/docutils/test/test_writers/test_html4css1_misc.py
16
7496
#! /usr/bin/env python # coding: utf-8 # $Id: test_html4css1_misc.py 7630 2013-03-15 22:27:04Z milde $ # Authors: Lea Wiemann, Dmitry Shachnev, Günter Milde # Maintainer: docutils-develop@lists.sourceforge.net # Copyright: This module has been placed in the public domain. """ Miscellaneous HTML writer tests. """ fro...
agpl-3.0
SaschaMester/delicium
tools/dromaeo_benchmark_runner/dromaeo_benchmark_runner.py
176
9706
#!/usr/bin/env python # Copyright (c) 2011 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. """Dromaeo benchmark automation script. Script runs dromaeo tests in browsers specified by --browser switch and saves results to a...
bsd-3-clause
lotharwissler/bioinformatics
python/blast/remove-from-blastout.py
1
3024
#!/usr/bin/python import os, sys # low level handling, such as command line stuff import string # string methods available import re # regular expressions import getopt # comand line argument handling from low import * # custom functions, written by myself # ===================================...
mit
306777HC/libforensics
unittests/tests/win/shell/link/objects.py
13
47648
# Copyright 2010 Michael Murr # # This file is part of LibForensics. # # LibForensics 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 option) any later ver...
lgpl-3.0
mbrukman/mapnik
scons/scons-local-2.3.6/SCons/Tool/tlib.py
4
1861
"""SCons.Tool.tlib XXX """ # # Copyright (c) 2001 - 2015 The SCons Foundation # # 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 righ...
lgpl-2.1
chokribr/invenio
invenio/modules/accounts/upgrades/accounts_2014_11_07_usergroup_name_column_unique.py
14
1968
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014 CERN. # # Invenio 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
Yen-HuaChen/STA663-Final-Project
pygraphviz/pygraphviz/agraph.py
1
58897
# -*- coding: utf-8 -*- """ A Python interface to Graphviz. """ # Copyright (C) 2006-2011 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Manos Renieris, http://www.cs.brown.edu/~er/ # Distributed with BSD license. # All rights reserved, see LICENSE for details. from __futur...
mit
strint/tensorflow
tensorflow/python/training/monitored_session_test.py
11
53058
# pylint: disable=g-bad-file-header # 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/LICENS...
apache-2.0
hcsturix74/django
django/db/models/sql/compiler.py
48
50737
import re import warnings from itertools import chain from django.core.exceptions import FieldError from django.db.models.constants import LOOKUP_SEP from django.db.models.expressions import OrderBy, Random, RawSQL, Ref from django.db.models.query_utils import QueryWrapper, select_related_descend from django.db.models...
bsd-3-clause
pp-mo/iris
lib/iris/tests/unit/experimental/representation/test_CubeListRepresentation.py
5
2373
# Copyright Iris contributors # # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the `iris.cube.CubeRepresentation` class.""" from html import escape # Import iris.tests first so that some...
lgpl-3.0
Iotic-Labs/py-application-examples
agent_tutorial_code/getting_started/6.3_advertise_feed_share.py
1
6926
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2016 Iotic Labs Ltd # # 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 # # https://github.com/Iotic-Labs/py-application-examples/...
apache-2.0
ikalnytskyi/sphinxcontrib-openapi
sphinxcontrib/openapi/schema_utils.py
1
4446
"""OpenAPI schema utility functions.""" from io import StringIO _DEFAULT_EXAMPLES = { "string": "string", "integer": 1, "number": 1.0, "boolean": True, "array": [], } _DEFAULT_STRING_EXAMPLES = { "date": "2020-01-01", "date-time": "2020-01-01T01:01:01Z", "password": "********", ...
bsd-2-clause
richardfergie/googleads-python-lib
googleads/errors.py
4
3865
# Copyright 2013 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 ...
apache-2.0
fldc/CouchPotatoServer
libs/rsa/parallel.py
196
2212
# -*- coding: utf-8 -*- # # Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu> # # 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 # # Unl...
gpl-3.0
stefanv/aandete
app/lib/pygments/lexers/erlang.py
25
18936
# -*- coding: utf-8 -*- """ pygments.lexers.erlang ~~~~~~~~~~~~~~~~~~~~~~ Lexers for Erlang. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import Lexer, RegexLexer, bygroups, words, do_insertions, \ ...
bsd-3-clause
sonaht/ansible
lib/ansible/modules/network/interface/net_lldp_interface.py
9
2296
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # # This file is part of Ansible by Red Hat # # 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 Li...
gpl-3.0
caosmo/pip
pip/_vendor/requests/packages/chardet/langthaimodel.py
2930
11275
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
mit
SomethingExplosive/android_external_chromium_org
tools/android/findbugs_plugin/test/run_findbugs_plugin_tests.py
109
1401
#!/usr/bin/env python # # Copyright (c) 2012 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. # This is used to test the findbugs plugin, it calls # build/android/pylib/utils/findbugs.py to analyze the classes in # org.chro...
bsd-3-clause
TalShafir/ansible
test/units/parsing/test_unquote.py
298
1602
# coding: utf-8 # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.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 o...
gpl-3.0
tangentlabs/django-fancypages
fancypages/utils/decorators.py
2
2379
import urlparse from functools import wraps from django.conf import settings from django.contrib import messages from django.shortcuts import render from django.contrib.auth import REDIRECT_FIELD_NAME from django.core.exceptions import PermissionDenied from django.utils.translation import ugettext_lazy as _ from djang...
bsd-3-clause
infobloxopen/infoblox-netmri
infoblox_netmri/api/broker/v3_8_0/iprg_member_broker.py
16
107641
from ..broker import Broker class IprgMemberBroker(Broker): controller = "iprg_members" def show(self, **kwargs): """Shows the details for the specified iprg member. **Inputs** | ``api version min:`` None | ``api version max:`` None | ``required:``...
apache-2.0
ropez/pytest
testing/test_runner.py
167
20633
# -*- coding: utf-8 -*- from __future__ import with_statement import _pytest._code import os import py import pytest import sys from _pytest import runner, main class TestSetupState: def test_setup(self, testdir): ss = runner.SetupState() item = testdir.getitem("def test_func(): pass") l =...
mit
tirkarthi/guake
fiximports.py
4
6458
#!/usr/bin/env python '''Check and sort import statement from a python file ''' import re import sys class FixImports(object): ''' I can be used to check and sort import statement of a python file Please use sortImportGroups() method ''' _regexImport = re.compile(r"^import\s+(.*)") _regexFr...
gpl-2.0
yasserglez/tagfs
packages/tagfs/contrib/django/contrib/databrowse/plugins/fieldchoices.py
88
3876
from django import http from django.db import models from django.contrib.databrowse.datastructures import EasyModel from django.contrib.databrowse.sites import DatabrowsePlugin from django.shortcuts import render_to_response from django.utils.text import capfirst from django.utils.encoding import smart_str, force_unico...
mit
Asana/mypipe
avro/lang/py/src/avro/ipc.py
22
17211
# 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
t794104/ansible
lib/ansible/modules/storage/netapp/na_ontap_autosupport.py
17
10134
#!/usr/bin/python """ create Autosupport module to enable, disable or modify """ # (c) 2018-2019, NetApp, 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 ANSIBLE_METADATA = {'metadat...
gpl-3.0
altairpearl/scikit-learn
sklearn/cluster/bicluster.py
66
19850
"""Spectral biclustering algorithms. Authors : Kemal Eren License: BSD 3 clause """ from abc import ABCMeta, abstractmethod import numpy as np from scipy.sparse import dia_matrix from scipy.sparse import issparse from . import KMeans, MiniBatchKMeans from ..base import BaseEstimator, BiclusterMixin from ..external...
bsd-3-clause
longmen21/edx-platform
pavelib/paver_tests/test_eslint.py
16
1694
""" Tests for paver quality tasks """ import unittest from mock import patch import pavelib.quality from paver.easy import BuildFailure class TestPaverESLint(unittest.TestCase): """ For testing run_eslint """ def setUp(self): super(TestPaverESLint, self).setUp() # Mock the paver @ne...
agpl-3.0
zouyapeng/horizon-newtouch
openstack_dashboard/dashboards/admin/volumes/volume_types/extras/views.py
7
3624
# 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
googleapis/googleapis-gen
google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/errors/types/ad_group_error.py
1
1782
# -*- 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
markkolich/FrameworkBenchmarks
frameworks/Python/django/hello/hello/wsgi.py
75
1132
""" WSGI config for hello project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` se...
bsd-3-clause
liamgh/liamgreenhughes-sl4a-tf101
python/src/Tools/freeze/makefreeze.py
46
2710
import marshal import bkfile # Write a file containing frozen code for the modules in the dictionary. header = """ #include "Python.h" static struct _frozen _PyImport_FrozenModules[] = { """ trailer = """\ {0, 0, 0} /* sentinel */ }; """ # if __debug__ == 0 (i.e. -O option given), set Py_OptimizeFlag in frozen...
apache-2.0
Faiz7412/or-tools
examples/python/young_tableaux.py
32
4055
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com # # 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
losfair/MiracleKernel
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
11088
3246
# Core.py - Python extension for perf script, core functions # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from collections import defaultdict def aut...
gpl-2.0
shiquanwang/pylearn2
pylearn2/datasets/tests/test_norb.py
4
1679
""" Unit tests for ./norb.py """ import unittest import numpy from pylearn2.datasets.norb import SmallNORB from pylearn2.datasets.norb_small import FoveatedNORB from pylearn2.utils import safe_zip from pylearn2.testing.skip import skip_if_no_data class TestNORB(unittest.TestCase): def setUp(self): skip_i...
bsd-3-clause
dkubiak789/OpenUpgrade
openerp/report/render/render.py
457
2524
# -*- 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...
agpl-3.0
janusnic/21v-python
unit_05/alive/test.py
2
5183
import main def test_get_board(): alive_cons = [(1, 1), (2, 2), (3, 1), (3, 3), (4, 0)] board = [[0, 0, 0, 0, 0], [0, 1, 0, 0, 0], [0, 0, 1, 0, 0], [0, 1, 0, 1, 0], [1, 0, 0, 0, 0]] ...
mit
N6UDP/cslbot
cslbot/commands/threads.py
2
2008
# Copyright (C) 2013-2015 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Fox Wilson # # 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 ve...
gpl-2.0
LubosD/darling
src/xar/test/integrity.py
3
2962
#!/usr/bin/env python from __future__ import print_function import os import os.path import subprocess import util # # Utility Functions # def _test_truncation(filename, path_to_be_archived, bytes_to_chop, *args): with util.archive_created(filename, path_to_be_archived) as path: with open("/dev/null", "w") as...
gpl-3.0
osstech-jp/samba
third_party/waf/wafadmin/py3kfixes.py
32
3876
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2009 (ita) """ Fixes for py3k go here """ import os all_modifs = {} def modif(dir, name, fun): if name == '*': lst = [] for y in '. Tools 3rdparty'.split(): for x in os.listdir(os.path.join(dir, y)): if x.endswith('.py'): lst.append(y + os.sep ...
gpl-3.0
SexualHealthInnovations/callisto-core
callisto_core/tests/test_base.py
2
9682
from django.conf import settings from django.contrib.auth import get_user_model from django.contrib.sites.models import Site from django.test import TestCase from django.urls import reverse from callisto_core.accounts.models import Account from callisto_core.delivery import models from callisto_core.notification.model...
agpl-3.0
m4nh/roars
scripts/nodes/examples/tf_obj_detector_example.py
1
2868
#!/usr/bin/env python # -*- encoding: utf-8 -*- from roars.rosutils.rosnode import RosNode from roars.vision.cameras import CameraRGB from roars.detections.prediction import prediction from roars.detections.tensorflow_detector_wrapper import tensorflow_detector_wrapper from roars.gui import cv_show_detection import cv...
gpl-3.0
Hasky0911/Maoyan
node_modules/node-gyp/gyp/tools/pretty_sln.py
1831
5099
#!/usr/bin/env python # 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. """Prints the information in a sln file in a diffable way. It first outputs each projects in alphabetical order with their dependenci...
mit
le9i0nx/ansible
contrib/inventory/gce.py
47
18346
#!/usr/bin/env python # Copyright 2013 Google 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 ...
gpl-3.0
evernym/plenum
plenum/server/router.py
2
3859
from collections import deque, OrderedDict from inspect import isawaitable from typing import Callable, Any, NamedTuple, Union, Iterable from typing import Tuple from stp_core.common.log import getlogger logger = getlogger() Route = Tuple[Union[type, NamedTuple], Callable] class Router: """ A simple router...
apache-2.0
amcat/amcat
amcat/tools/association.py
1
8749
########################################################################## # (C) Vrije Universiteit, Amsterdam (the Netherlands) # # # # This file is part of AmCAT - The Amsterdam Content Analysis Toolkit # # ...
agpl-3.0
cbertinato/pandas
pandas/core/reshape/pivot.py
1
21644
import numpy as np from pandas.util._decorators import Appender, Substitution from pandas.core.dtypes.cast import maybe_downcast_to_dtype from pandas.core.dtypes.common import is_integer_dtype, is_list_like, is_scalar from pandas.core.dtypes.generic import ABCDataFrame, ABCSeries import pandas.core.common as com fro...
bsd-3-clause
servo/servo
tests/wpt/web-platform-tests/tools/third_party/py/py/_code/assertion.py
60
3174
import sys import py BuiltinAssertionError = py.builtin.builtins.AssertionError _reprcompare = None # if set, will be called by assert reinterp for comparison ops def _format_explanation(explanation): """This formats an explanation Normally all embedded newlines are escaped, however there are three exce...
mpl-2.0
michaeljohn32/odoomrp-wip
purchase_requisition_full_bid_order_generator/__openerp__.py
25
1510
# -*- 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,...
agpl-3.0
marcelocure/django
tests/m2o_recursive/models.py
282
1047
""" Relating an object to itself, many-to-one To define a many-to-one relationship between a model and itself, use ``ForeignKey('self', ...)``. In this example, a ``Category`` is related to itself. That is, each ``Category`` has a parent ``Category``. Set ``related_name`` to designate what the reverse relationship i...
bsd-3-clause
scristopher/paintown
scons/helpers.py
4
1237
def read_cmake_list(name): """ Read a cmake files list and return a dictionary with each cmake variable matched to a list of filenames. This makes it easy to add/remove files, as only the cmake list needs to be modified and scons will automatically pick up the changes. """ lists = {} cu...
bsd-3-clause
abdhaleegit/avocado-misc-tests
generic/cxl.py
4
2138
#!/usr/bin/env python # 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. # # This program is distributed in the hope that ...
gpl-2.0
eLBati/odoo
addons/l10n_multilang/__openerp__.py
91
1681
# -*- 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
florentx/OpenUpgrade
addons/account/wizard/account_report_partner_balance.py
364
2199
# -*- 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
sigma-random/asuswrt-merlin
release/src/router/samba36/source4/dsdb/tests/python/dsdb_schema_info.py
31
6654
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Unix SMB/CIFS implementation. # Copyright (C) Kamen Mazdrashki <kamenim@samba.org> 2010 # # 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...
gpl-2.0
piotrek-golda/CivilHubIndependantCopy
locations/links.py
3
1119
# -*- coding: utf-8 -*- # # We map sidebar links for various views. I presume that sidebars will vary # depending on the module but in each module we will have the same set of links # for each sub-view (edition, deletion etc.). # LINKS_MAP = { 'summary': ( 'invite', ), 'news': ( 'new_discuss...
gpl-3.0
Teino1978-Corp/google-belay
tests/py/testrunner.py
4
1651
#!/usr/bin/env python # Copyright 2011 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 requi...
apache-2.0
nirmeshk/oh-mainline
vendor/packages/Django/tests/modeltests/validators/tests.py
45
9225
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re import types from datetime import datetime, timedelta from django.core.exceptions import ValidationError from django.core.validators import * from django.test.utils import str_prefix from django.utils.unittest import TestCase NOW = datetime.n...
agpl-3.0
kyasui/store
saleor/dashboard/order/forms.py
2
4228
from __future__ import unicode_literals from django import forms from django.utils.translation import ugettext_lazy as _ from satchless.item import InsufficientStock from ...cart.forms import QuantityField from ...order.models import DeliveryGroup, OrderedItem, OrderNote from ...product.models import Product class ...
bsd-3-clause
tgl-dogg/BCC-2s14-PI4-SteampunkSpider
src/steampunk_spider/database/top10paises.py
1
1585
import mysql.connector from mysql.connector import errorcode DB_NAME = 'steampunk' # Get database connection db_conn = mysql.connector.connect(user='root', password='vaporAranha', host='localhost', database='steampunk') # Get cursor to perform operations on our database cursor = db_conn.cursor() request = ("SELECT n...
mit
mhostetter/gnuradio
gr-wxgui/python/wxgui/waterfall_window.py
47
10668
# # Copyright 2008 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # #...
gpl-3.0
studio666/gnuradio
gr-filter/python/filter/qa_filterbank.py
47
4546
#!/usr/bin/env python # # Copyright 2012,2014 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 optio...
gpl-3.0
CiscoSystems/vespa
neutron/plugins/nicira/vshield/edge_loadbalancer_driver.py
5
13306
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 VMware, 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 # # ...
apache-2.0
jeremiahmarks/sl4a
python/src/Lib/plat-irix6/FILE.py
66
11296
# Generated by h2py from /usr/include/sys/file.h from warnings import warnpy3k warnpy3k("the FILE module has been removed in Python 3.0", stacklevel=2) del warnpy3k # Included from standards.h # Included from sys/types.h # Included from sgidefs.h _MIPS_ISA_MIPS1 = 1 _MIPS_ISA_MIPS2 = 2 _MIPS_ISA_MIPS3 = 3 _MIPS_ISA_...
apache-2.0
Shrhawk/edx-platform
pavelib/quality.py
26
15940
""" Check code quality using pep8, pylint, and diff_quality. """ from paver.easy import sh, task, cmdopts, needs, BuildFailure import os import re from .utils.envs import Env ALL_SYSTEMS = 'lms,cms,common,openedx,pavelib' def top_python_dirs(dirname): """ Find the directories to start from in order to find ...
agpl-3.0
grlee77/numpy
tools/cythonize.py
2
7355
#!/usr/bin/env python3 """ cythonize Cythonize pyx files into C files as needed. Usage: cythonize [root_dir] Default [root_dir] is 'numpy'. Checks pyx files to see if they have been changed relative to their corresponding C files. If they have, then runs cython on these files to recreate the C files. The script t...
bsd-3-clause
tchernomax/ansible
lib/ansible/modules/network/f5/bigip_monitor_external.py
8
22421
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
sebastien-forestier/NIPS2017
ros/nips2017/src/nips2017/torso/torso.py
1
2749
import rospy import json from os import system from nips2017.srv import * from threading import RLock from rospkg import RosPack from os.path import join from .services import TorsoServices class Torso(object): def __init__(self): self.rospack = RosPack() with open(join(self.rospack.get_path('nips...
gpl-3.0
ahhda/sympy
sympy/solvers/inequalities.py
2
18294
"""Tools for solving inequalities and systems of inequalities. """ from __future__ import print_function, division from sympy.core import Symbol, Dummy, sympify from sympy.core.compatibility import iterable, reduce from sympy.sets import Interval from sympy.core.relational import Relational, Eq, Ge, Lt from sympy.set...
bsd-3-clause
renyi533/tensorflow
tensorflow/python/estimator/canned/metric_keys.py
41
1303
# Copyright 2018 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
chromium/chromium
third_party/abseil-cpp/roll_abseil.py
9
4289
#!/usr/bin/env python # NOTE: This script requires python 3. """Script to do the first step of Abseil roll into chromium. """ import logging import os import re import subprocess import tempfile from datetime import datetime ABSL_URI = 'https://github.com/abseil/abseil-cpp.git' def _PullAbseil(abseil_dir): loggi...
bsd-3-clause
bakkou-badri/dataminingproject
env/lib/python2.7/site-packages/pip/_vendor/requests/auth.py
294
6173
# -*- coding: utf-8 -*- """ requests.auth ~~~~~~~~~~~~~ This module contains the authentication handlers for Requests. """ import os import re import time import hashlib import logging from base64 import b64encode from .compat import urlparse, str from .cookies import extract_cookies_to_jar from .utils import pars...
gpl-2.0
chkamil/ardupilot
Tools/LogAnalyzer/tests/TestVibration.py
261
3069
from LogAnalyzer import Test,TestResult import DataflashLog import numpy class TestVibration(Test): '''test for accelerometer vibration (accX/accY/accZ) within recommendations''' def __init__(self): Test.__init__(self) self.name = "Vibration" def run(self, logdata, verbose): se...
gpl-3.0
rbharath/deepchem
deepchem/models/tensorflow_models/lr.py
2
9592
# -*- coding: utf-8 -*- """ Created on Tue Nov 08 14:10:02 2016 @author: Zhenqin Wu """ import tensorflow as tf import numpy as np import os import time from deepchem.metrics import from_one_hot from deepchem.models.tensorflow_models import TensorflowGraph from deepchem.models.tensorflow_models import TensorflowGraph...
mit
purism/pdak
dak/import_users_from_passwd.py
1
5063
#!/usr/bin/env python """ Sync PostgreSQL users with system users """ # Copyright (C) 2001, 2002, 2006 James Troup <james@nocrew.org> # 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 ve...
gpl-2.0
rjaguar3/wesnoth-old
data/tools/wesnoth/libgithub.py
33
24064
# vim: tabstop=4: shiftwidth=4: expandtab: softtabstop=4: autoindent: """ This library provides an interface to github, the interface is build upon the command line git tool. """ import logging import os try: # Externally distributed, usually more up-to-date import simplejson as json except ImportError: #...
gpl-2.0
fjalir/odie-server
routes/common.py
1
1467
#! /usr/bin/env python3 import config from login import get_user from functools import partial from marshmallow import fields, Schema from marshmallow.utils import missing from marshmallow.validate import OneOf class IdSchema(Schema): id = fields.Int(required=True) class DocumentDumpSchema(IdSchema): dep...
mit
antidotcb/googlemock
scripts/upload.py
2511
51024
#!/usr/bin/env python # # Copyright 2007 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 o...
bsd-3-clause
eoghanmurray/jsonpickle_prev
tests/benchmark.py
1
1321
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2008 John Paulett (john -at- 7oars.com) # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. import sys import timeit IS_25_DOWN = sys.version_info[:2] <= (2...
bsd-3-clause
bverdu/onDemand
upnpy_spyne/services/test.py
1
6017
# encoding: utf-8 ''' Created on 17 mars 2015 @author: Bertrand Verdu ''' import sys from spyne.client import Service from spyne.client import RemoteProcedureBase from spyne.client import ClientBase from spyne.application import Application from spyne.decorator import rpc from spyne.service import ServiceBase from spy...
agpl-3.0
davidzchen/tensorflow
tensorflow/python/kernel_tests/draw_bounding_box_op_test.py
26
5086
# 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
pyq881120/pupy
pupy/pupylib/PupyCmd.py
16
20773
# -------------------------------------------------------------- # Copyright (c) 2015, Nicolas VERDIER (contact@n1nj4.eu) # 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 ...
bsd-3-clause
blaggacao/odoo
openerp/addons/base/ir/ir_sequence.py
83
14810
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/networkx/algorithms/mis.py
4
2762
# -*- coding: utf-8 -*- # $Id: maximalIndependentSet.py 576 2011-03-01 05:50:34Z lleeoo $ # Leo Lopes <leo.lopes@monash.edu> # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. # # Authors: Leo Lopes <leo.lopes@mona...
gpl-3.0
CamLib/AltmetricClient
altmetric_client/output_writer_csv/csv_writer_subject.py
1
2120
from csv import DictWriter from altmetric_client.output_writer_csv.csv_writer_base import CSVWriterBase class CSVWriterSubject(CSVWriterBase): def __init__(self, output_file_name=None, output_directory_name=None, subjects_list=None): CSVWriterBase.__init...
gpl-3.0
kracwarlock/neon
neon/transforms/tests/test_rectified.py
13
3070
# ---------------------------------------------------------------------------- # Copyright 2014 Nervana Systems 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.o...
apache-2.0
Eigenlabs/EigenD
tools/packages/SCons/Tool/sunar.py
2
2551
"""engine.SCons.Tool.sunar Tool-specific initialization for Solaris (Forte) ar (library archive). If CC exists, static libraries should be built with it, so that template instantians can be resolved. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic S...
gpl-3.0
PythonCharmers/bokeh
examples/app/sliders_applet/sliders_app.py
43
4913
""" This file demonstrates a bokeh applet, which can be viewed directly on a bokeh-server. See the README.md file in this directory for instructions on running. """ import logging logging.basicConfig(level=logging.DEBUG) import numpy as np from bokeh.plotting import figure from bokeh.models import Plot, ColumnDataS...
bsd-3-clause
talhajaved/nyuadmarket
flask/lib/python2.7/site-packages/whoosh/legacy.py
95
3459
# Copyright 2012 Matt Chaput. 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...
mit
evaschalde/odoo
addons/account_test/report/account_test_report.py
194
3819
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify #...
agpl-3.0
Haleyo/spark-tk
regression-tests/sparktkregtests/testcases/frames/frame_sort_k_test.py
13
6107
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #       http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
apache-2.0