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
gauravbose/digital-menu
digimenu2/django/contrib/gis/utils/layermapping.py
61
27288
# LayerMapping -- A Django Model/OGR Layer Mapping Utility """ The LayerMapping class provides a way to map the contents of OGR vector files (e.g. SHP files) to Geographic-enabled Django models. For more information, please consult the GeoDjango documentation: https://docs.djangoproject.com/en/dev/ref/contrib/gi...
bsd-3-clause
luistorresm/odoo
addons/website_forum/tests/common.py
201
3470
# -*- coding: utf-8 -*- from openerp.tests import common KARMA = { 'ask': 5, 'ans': 10, 'com_own': 5, 'com_all': 10, 'com_conv_all': 50, 'upv': 5, 'dwv': 10, 'edit_own': 10, 'edit_all': 20, 'close_own': 10, 'close_all': 20, 'unlink_own': 10, 'unlink_all': 20, 'gen_que_new': 1, 'gen_que...
agpl-3.0
puiterwijk/product-definition-center
pdc/apps/compose/tests.py
1
99430
# -*- coding: utf-8 -*- # # Copyright (c) 2015 Red Hat # Licensed under The MIT License (MIT) # http://opensource.org/licenses/MIT # import json import mock from StringIO import StringIO from django.core.urlresolvers import reverse from django.test import TestCase from django.test.client import Client from rest_framew...
mit
pbrazdil/phantomjs
src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/text_format.py
261
21737
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
bsd-3-clause
paulondc/gaffer
python/GafferUI/Enums.py
5
3767
########################################################################## # # Copyright (c) 2012, Image Engine Design 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: # # * Red...
bsd-3-clause
LeslieW/protobuf
python/google/protobuf/internal/cpp_message.py
29
23530
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
bsd-3-clause
w1ll1am23/home-assistant
homeassistant/components/smartthings/cover.py
3
5263
"""Support for covers through the SmartThings cloud API.""" from __future__ import annotations from typing import Sequence from pysmartthings import Attribute, Capability from homeassistant.components.cover import ( ATTR_POSITION, DEVICE_CLASS_DOOR, DEVICE_CLASS_GARAGE, DEVICE_CLASS_SHADE, DOMAIN...
apache-2.0
2ndQuadrant/ansible
test/units/modules/network/f5/test_bigip_profile_fastl4.py
16
5811
# -*- 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 import os import json import pytest import sys if sys.version_info < (2...
gpl-3.0
alisaifee/AutobahnPython
autobahn/autobahn/wamp/tests/test_protocol.py
6
11092
############################################################################### ## ## Copyright (C) 2014 Tavendo GmbH ## ## 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:/...
apache-2.0
justincassidy/scikit-learn
sklearn/ensemble/tests/test_weight_boosting.py
35
16763
"""Testing for the boost module (sklearn.ensemble.boost).""" import numpy as np from sklearn.utils.testing import assert_array_equal, assert_array_less from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal, assert_true from sklearn.utils.testing import assert_raises...
bsd-3-clause
was4444/chromium.src
third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/flakytests_unittest.py
1
3178
# Copyright 2014 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 flakytests from webkitpy.common.checkout.scm.scm_mock import MockSCM from webkitpy.layout_tests.layout_package import bot_test_expectations from webk...
bsd-3-clause
openstack/neutron-lib
neutron_lib/agent/extension.py
1
1809
# 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 # d...
apache-2.0
huang4fstudio/django
django/conf/locale/pl/formats.py
504
1147
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j E Y' TIME_FORMAT = 'H:i' DATETI...
bsd-3-clause
Daniel15/PathPicker
src/test.py
1
7076
# Copyright (c) 2015-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. # # @nolint import unitte...
bsd-3-clause
freakboy3742/django
django/contrib/gis/db/backends/spatialite/models.py
62
1928
""" The GeometryColumns and SpatialRefSys models for the SpatiaLite backend. """ from django.contrib.gis.db.backends.base.models import SpatialRefSysMixin from django.db import models class SpatialiteGeometryColumns(models.Model): """ The 'geometry_columns' table from SpatiaLite. """ f_table_name = m...
bsd-3-clause
elbaniun/puzzle-logic
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py
1417
12751
#!/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. """Utility functions for Windows builds. These functions are executed via gyp-win-tool when using the ninja generator. """ import os impor...
gpl-2.0
mhvk/numpy
numpy/random/tests/test_randomstate_regression.py
10
7555
import sys import pytest from numpy.testing import ( assert_, assert_array_equal, assert_raises, ) import numpy as np from numpy import random class TestRegression: def test_VonMises_range(self): # Make sure generated random variables are in [-pi, pi]. # Regression test for ticket #986...
bsd-3-clause
bruinfish/cs118-proj2-pox
pox/boot.py
5
14931
#!/bin/bash - # Copyright 2011-2012 James McCauley # # This file is part of POX. # # POX 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 versio...
gpl-3.0
yongshengwang/hue
build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/contrib/auth/tests/test_signals.py
227
3278
from django.contrib.auth import signals from django.contrib.auth.models import User from django.contrib.auth.tests.utils import skipIfCustomUser from django.test import TestCase from django.test.client import RequestFactory from django.test.utils import override_settings @skipIfCustomUser @override_settings(USE_TZ=Fa...
apache-2.0
mikebenfield/scipy
scipy/sparse/linalg/isolve/minres.py
128
9207
from __future__ import division, print_function, absolute_import from numpy import sqrt, inner, finfo, zeros from numpy.linalg import norm from .utils import make_system from .iterative import set_docstring __all__ = ['minres'] header = \ """Use MINimum RESidual iteration to solve Ax=b MINRES minimizes norm(A*x -...
bsd-3-clause
granrothge/neutronpy
neutronpy/crystal/sample.py
3
5162
# -*- coding: utf-8 -*- r"""Sample class for e.g. Instrument class """ import numpy as np from .lattice import Lattice from .tools import gram_schmidt class Sample(Lattice): u"""Private class containing sample information. Parameters ---------- a : float Unit cell length in angstroms b...
mit
DasIch/django
tests/check_framework/tests_1_8_compatibility.py
138
1113
from django.core.checks.compatibility.django_1_8_0 import \ check_duplicate_template_settings from django.test import SimpleTestCase from django.test.utils import override_settings class CheckDuplicateTemplateSettingsTest(SimpleTestCase): def test_not_raised_if_no_templates_setting(self): self.assert...
bsd-3-clause
rhdedgar/openshift-tools
openshift/installer/vendored/openshift-ansible-3.6.173/roles/lib_utils/src/lib/repoquery.py
82
2356
# pylint: skip-file # flake8: noqa ''' class that wraps the repoquery commands in a subprocess ''' # pylint: disable=too-many-lines,wrong-import-position,wrong-import-order from collections import defaultdict # noqa: E402 # pylint: disable=no-name-in-module,import-error # Reason: pylint errors with "No name 'v...
apache-2.0
Harunx9/Transaltors
Lexer/Lexer/env/Lib/site-packages/pip/_vendor/html5lib/constants.py
963
87346
from __future__ import absolute_import, division, unicode_literals import string import gettext _ = gettext.gettext EOF = None E = { "null-character": _("Null character in input stream, replaced with U+FFFD."), "invalid-codepoint": _("Invalid codepoint in stream."), "incorrectly-placed-so...
mit
cpp-mirrors/gmock
scripts/generator/cpp/ast.py
384
62773
#!/usr/bin/env python # # Copyright 2007 Neal Norwitz # Portions 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...
bsd-3-clause
onceuponatimeforever/oh-mainline
vendor/packages/django-extensions/django_extensions/db/fields/json.py
17
2979
""" JSONField automatically serializes most Python terms to JSON data. Creates a TEXT field with a default value of "{}". See test_json.py for more information. from django.db import models from django_extensions.db.fields import json class LOL(models.Model): extra = json.JSONField() """ import datetime fro...
agpl-3.0
dontnod/weblate
weblate/fonts/validators.py
1
1311
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2019 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.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, eith...
gpl-3.0
jmartinm/invenio-records
invenio_records/config.py
1
1717
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014, 2015 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...
gpl-2.0
jiangxb1987/spark
examples/src/main/python/ml/robust_scaler_example.py
20
1639
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
maurizioandreotti/D-Rats-0.3.ev
d_rats/session_coordinator.py
4
15742
#!/usr/bin/python # # Copyright 2008 Dan Smith <dsmith@danplanet.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
gpl-3.0
0x46616c6b/ansible
test/runner/lib/git.py
41
1869
"""Wrapper around git command-line tools.""" from __future__ import absolute_import, print_function from lib.util import ( CommonConfig, run_command, ) class Git(object): """Wrapper around git command-line tools.""" def __init__(self, args): """ :type args: CommonConfig """ ...
gpl-3.0
atpohjal/or-tools
examples/python/einav_puzzle.py
34
6418
# 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
ddico/odoo
addons/sale_crm/models/crm_team.py
9
1819
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import models,fields, api, _ class CrmTeam(models.Model): _inherit = 'crm.team' def _compute_dashboard_button_name(self): super(CrmTeam, self)._compute_dashboard_button_name() teams_w...
agpl-3.0
JackDandy/SickGear
lib/feedparser_py2/datetimes/iso8601.py
3
5630
# Copyright 2010-2020 Kurt McKee <contactme@kurtmckee.org> # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # # This file is a part of feedparser. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistrib...
gpl-3.0
zzacharo/inspire-next
inspirehep/utils/tickets.py
5
11619
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 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 ...
gpl-3.0
darencard/ContigAnnotator
ensembl_orthologs.py
1
2122
#!/usr/local/env python import optparse usage_line = """ A script to extract orthologous Ensembl IDs from a genome-of-interest using a list \ of Ensembl IDs already in hand. Input is a list of Ensembl IDs and a "database" file \ downloaded from Ensembl that has the query Ensembl IDs in one column and the target/subje...
gpl-2.0
guiquanz/msaf
msaf/pymf/pca.py
2
4037
#!/usr/bin/python # # Copyright (C) Christian Thurau, 2010. # Licensed under the GNU General Public License (GPL). # http://www.gnu.org/licenses/gpl.txt """ PyMF Principal Component Analysis. PCA: Class for Principal Component Analysis """ import numpy as np from .nmf import NMF from .svd import SVD __all__ ...
mit
mindw/numpy
numpy/dual.py
174
1864
""" Aliases for functions which may be accelerated by Scipy. Scipy_ can be built to use accelerated or otherwise improved libraries for FFTs, linear algebra, and special functions. This module allows developers to transparently support these accelerated functions when scipy is available but still support users who hav...
bsd-3-clause
yd0str/infernal-twin
build/reportlab/build/lib.linux-i686-2.7/reportlab/pdfbase/_fontdata_widths_helveticaboldoblique.py
112
3670
widths = {'A': 722, 'AE': 1000, 'Aacute': 722, 'Acircumflex': 722, 'Adieresis': 722, 'Agrave': 722, 'Aring': 722, 'Atilde': 722, 'B': 722, 'C': 722, 'Ccedilla': 722, 'D': 722, 'E': 667, 'Eacute': 667, 'Ecircumflex': 667, 'Edieresis': 667, 'Egrave': 667, 'Eth': 722, 'Euro': 556, 'F': 611, 'G': 778, ...
gpl-3.0
Southpaw-TACTIC/TACTIC
src/context/client/tactic-api-python-4.0.api04/Lib/encodings/cp857.py
93
34858
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP857.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors=...
epl-1.0
wanggang3333/scikit-learn
sklearn/metrics/cluster/supervised.py
207
27395
"""Utilities to evaluate the clustering performance of models Functions named as *_score return a scalar value to maximize: the higher the better. """ # Authors: Olivier Grisel <olivier.grisel@ensta.org> # Wei LI <kuantkid@gmail.com> # Diego Molla <dmolla-aliod@gmail.com> # License: BSD 3 clause fr...
bsd-3-clause
gannetson/django
tests/admin_docs/tests.py
18
18168
import datetime import sys import unittest from django.conf import settings from django.contrib.admindocs import utils from django.contrib.admindocs.views import get_return_data_type from django.contrib.auth.models import User from django.contrib.sites.models import Site from django.core.urlresolvers import reverse fr...
bsd-3-clause
n0m4dz/odoo
addons/hw_posbox_upgrade/__openerp__.py
313
1696
# -*- 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
Metaswitch/calico-nova
nova/api/openstack/compute/contrib/floating_ip_dns.py
6
9936
# Copyright 2011 Andrew Bogott for the Wikimedia 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 requi...
apache-2.0
hagifoo/gae-pomodoro
app/lib/requests/packages/chardet/codingstatemachine.py
2931
2318
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
mit
tillahoffmann/tensorflow
tensorflow/contrib/timeseries/python/timeseries/ar_model.py
25
32793
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
paulatz/wannier90
test-suite/tools/parsers/parse_geninterp_dat.py
6
1595
""" Parser function parse() to parse the <seedname>_geninerp.dat output file of postw90.x. """ from __future__ import print_function import inspect import re from collections import defaultdict from . import show_output def parse(fname): """ Open the file, parses it and return the values. """ retdict...
gpl-2.0
qedi-r/home-assistant
homeassistant/components/zabbix/__init__.py
3
1572
"""Support for Zabbix.""" import logging from urllib.parse import urljoin import voluptuous as vol from homeassistant.const import ( CONF_PATH, CONF_HOST, CONF_SSL, CONF_PASSWORD, CONF_USERNAME, ) import homeassistant.helpers.config_validation as cv _LOGGER = logging.getLogger(__name__) DEFAULT_...
apache-2.0
hgiemza/DIRAC
Resources/Computing/CREAMComputingElement.py
2
15728
######################################################################## # File : CREAMComputingElement.py # Author : A.T. ######################################################################## """ CREAM Computing Element """ __RCSID__ = "$Id$" import os import re import tempfile import stat from DIRAC ...
gpl-3.0
pyblub/pyload
pyload/api/base.py
1
12584
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from types import MethodType from future import standard_library # from abc import ABCMeta, abstractmethod from future.builtins import object from pyload.core.datatype.base import DownloadState, DownloadStatus, Permission from pyload.c...
agpl-3.0
labsanmartin/Bika-LIMS
bika/lims/controlpanel/bika_srtemplates.py
3
3165
from Products.ATContentTypes.content import schemata from Products.Archetypes import atapi from Products.CMFCore.utils import getToolByName from bika.lims.browser.bika_listing import BikaListingView from bika.lims.config import PROJECTNAME from bika.lims import bikaMessageFactory as _ from bika.lims.utils import t from...
agpl-3.0
patrickglass/creoconfig
creoconfig/config_gui.py
3
1227
#!/usr/bin/python3 # http://www.python-course.eu/tkinter_entry_widgets.php # from Tkinter import ( # Frame, # Label, # Entry, # Button # ) import Tkinter fields = 'Last Name', 'First Name', 'Job', 'Country' def fetch(entries): for entry in entries: field = entry[0] text = entry[...
mit
legendtkl/scrapy
tests/test_http_response.py
95
19527
import unittest import six from w3lib.encoding import resolve_encoding from scrapy.http import (Request, Response, TextResponse, HtmlResponse, XmlResponse, Headers) from scrapy.selector import Selector from scrapy.utils.python import to_native_str class BaseResponseTest(unittest.TestCase): ...
bsd-3-clause
martindurant/starclassifier
ui/pysynphot/wavetable.py
1
2684
from __future__ import division """ This module handles the wavecat.dat table presently used by the synphot countrate task (and thus the ETC) to select an appropriate wavelength set for a given obsmode. """ import re import os import numpy as N import locations class Wavetable(object): """ Class to h...
mit
blamed-cloud/PythonGames
squares.py
2
11672
#!/usr/bin/env python #squares.py ###USAGE### squares.py from AISuite.game import Game as Game import AISuite.player as player from AISuite.alphabeta import UPPER_BOUND, LOWER_BOUND, shallowest_first class Square(object): reverse_side = {"UP": "DOWN", "RIGHT": "LEFT", "DOWN": "UP", "LEFT": "RIGHT"} vert_or_horiz = {...
mit
pselle/calibre
src/calibre/ebooks/unihandecode/krcodepoints.py
26
406322
# -*- coding: utf-8 -*- __license__ = 'GPL 3' __copyright__ = '2010 Hiroshi Miura <miurahr@linux.com>' __docformat__ = 'restructuredtext en' ''' Unicode code point dictionary. Based on Unicode.org Unihan database. ''' CODEPOINTS = { 'x34':[ 'Qiu ','Tian ','','','Kua ','Wu ','Yin ','','','','','','Si ','...
gpl-3.0
ujjwal96/mitmproxy
mitmproxy/contrib/wbxml/ASWBXML.py
10
30335
#!/usr/bin/env python3 ''' @author: David Shaw, shawd@vmware.com Inspired by EAS Inspector for Fiddler https://easinspectorforfiddler.codeplex.com ----- The MIT License (MIT) ----- Filename: ASWBXML.py Copyright (c) 2014, David P. Shaw Permission is hereby granted, free of charge, to any person obtaining a copy of ...
mit
candy7393/VTK
ThirdParty/Twisted/twisted/test/test_fdesc.py
32
7381
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.internet.fdesc}. """ import os, sys import errno try: import fcntl except ImportError: skip = "not supported on this platform" else: from twisted.internet import fdesc from twisted.python.util import untilCon...
bsd-3-clause
CanonicalLtd/landscape-client
landscape/client/broker/tests/test_client.py
1
16179
import mock from twisted.internet import reactor from twisted.internet.defer import Deferred from landscape.lib.twisted_util import gather_results from landscape.client.tests.helpers import ( LandscapeTest, DEFAULT_ACCEPTED_TYPES) from landscape.client.broker.tests.helpers import BrokerClientHelper from lands...
gpl-2.0
mneagul/scape-cloud-toolkit
src/sct/cloudinit.py
1
9066
# -*- coding: utf-8 -*- """ Copyright 2014 Universitatea de Vest din Timișoara 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 appli...
apache-2.0
kennedyshead/home-assistant
homeassistant/components/vallox/__init__.py
26
8917
"""Support for Vallox ventilation units.""" from datetime import timedelta import ipaddress import logging from vallox_websocket_api import PROFILE as VALLOX_PROFILE, Vallox from vallox_websocket_api.constants import vlxDevConstants from vallox_websocket_api.exceptions import ValloxApiException import voluptuous as v...
apache-2.0
tiagormk/gem5-hmp
src/arch/x86/isa/insts/romutil.py
65
7401
# Copyright (c) 2008 The Regents of The University of Michigan # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list ...
bsd-3-clause
egraba/vbox_openbsd
VirtualBox-5.0.0/src/VBox/ValidationKit/tests/selftests/tdSelfTest2.py
3
4955
#!/usr/bin/env python # -*- coding: utf-8 -*- # $Id: tdSelfTest2.py $ """ Test Manager / Suite Self Test #2 - Everything should succeed. """ __copyright__ = \ """ Copyright (C) 2010-2015 Oracle Corporation This file is part of VirtualBox Open Source Edition (OSE), as available from http://www.virtualbox.org. This fi...
mit
est/nodebox-gl
ext/psyco/src/py-utils/xam.py
5
20039
from __future__ import nested_scopes import os, sys, re, htmlentitydefs, struct, bisect __metaclass__ = type tmpfile = '~tmpfile.tmp' # the disassembler to use. 'objdump' writes GNU-style instructions. # 'ndisasm' uses Intel syntax. objdump = 'objdump -b binary -m i386 --adjust-vma=%(origin)d -D %(file)s' if sys.pla...
bsd-3-clause
shivanikhosa/browserscope
test/test_user_agent.py
9
9780
#!/usr/bin/python2.5 # # Copyright 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 or ...
apache-2.0
wholeGenomeSequencingAnalysisPipeline/BacPipe
SPAdes-3.13.0-Linux/share/spades/pyyaml2/scanner.py
434
52630
# Scanner produces tokens of the following types: # STREAM-START # STREAM-END # DIRECTIVE(name, value) # DOCUMENT-START # DOCUMENT-END # BLOCK-SEQUENCE-START # BLOCK-MAPPING-START # BLOCK-END # FLOW-SEQUENCE-START # FLOW-MAPPING-START # FLOW-SEQUENCE-END # FLOW-MAPPING-END # BLOCK-ENTRY # FLOW-ENTRY # KEY # VALUE # AL...
gpl-3.0
nikkisquared/servo
tests/wpt/harness/wptrunner/wptmanifest/backends/conditional.py
188
10519
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import operator from ..node import NodeVisitor, DataNode, ConditionalNode, KeyValueNode, ListNode, ValueNode from ..par...
mpl-2.0
awanke/bokeh
bokeh/_glyph_functions.py
15
32590
from __future__ import absolute_import from .models import glyphs, markers, BoxSelectTool def _glyph_function(glyphclass, dsnames, argnames, docstring): def func(plot, *args, **kwargs): # Note: We want to reuse the glyph functions by attaching them the Plot # class. Imports are here to prevent c...
bsd-3-clause
foxwill/ol-api-tester
env/lib/python2.7/site-packages/requests/packages/urllib3/util/connection.py
252
3265
import socket try: from select import poll, POLLIN except ImportError: # `poll` doesn't exist on OSX and other platforms poll = False try: from select import select except ImportError: # `select` doesn't exist on AppEngine. select = False def is_connection_dropped(conn): # Platform-...
gpl-2.0
BeyondTheClouds/nova
nova/tests/functional/api_sample_tests/test_flavor_manage.py
8
2649
# Copyright 2012 Nebula, Inc. # Copyright 2013 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...
apache-2.0
mboeru/maraschino
lib/sqlalchemy/engine/strategies.py
14
8823
# engine/strategies.py # Copyright (C) 2005-2011 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Strategies for creating new instances of Engine types. These are semi-private...
mit
JJMC89/delsort
scripts/upload.py
1
3001
""" Usage: python scripts/upload.py SITE TARGET USERNAME SITE: enwiki or testwiki TARGET: the page on SITE where the script will be uploaded USERNAME: the account to make the edit under """ import datetime import getpass import os.path import re import sys from clint.textui import colored from clint.textui import pro...
mit
iabdalkader/openmv
scripts/examples/21-Sensor-Control/sensor_exposure_control.py
3
3275
# Sensor Exposure Control # # This example shows off how to cotnrol the camera sensor's # exposure manually versus letting auto exposure control run. # What's the difference between gain and exposure control? # # Well, by increasing the exposure time for the image you're getting more # light on the camera. This gives ...
mit
Yubico/yubioath-desktop-dpkg
yubioath/cli/controller.py
1
3176
# Copyright (c) 2014 Yubico AB # All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program...
gpl-3.0
unnikrishnankgs/va
venv/lib/python3.5/site-packages/django/contrib/gis/gdal/field.py
112
6735
from ctypes import byref, c_int from datetime import date, datetime, time from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import GDALException from django.contrib.gis.gdal.prototypes import ds as capi from django.utils.encoding import force_text # For more information, see the OG...
bsd-2-clause
bbiiggppiigg/NTHUOJ_web
install.py
1
2886
""" The MIT License (MIT) Copyright (c) 2014 NTHUOJ team 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, copy, modify, merge, ...
mit
infobloxopen/infoblox-netmri
infoblox_netmri/api/remote/models/spm_history_interface_history_grid_remote.py
1
3640
from ..remote import RemoteModel class SpmHistoryInterfaceHistoryGridRemote(RemoteModel): """ This table lists the SPM interface history within the user specified period of time for a given interface. | ``id:`` The internal NetMRI identifier of the grid entry. | ``attribute type:`` number | ...
apache-2.0
shouhuas/bitcoin
contrib/linearize/linearize-data.py
15
8831
#!/usr/bin/env python # # linearize-data.py: Construct a linear, no-fork version of the chain. # # Copyright (c) 2013-2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from __future__ import print_...
mit
Juanvulcano/zulip
zerver/tornado/handlers.py
17
13696
from __future__ import absolute_import from __future__ import print_function import sys import tornado.web import logging from django import http from django.conf import settings from django.core.handlers.wsgi import WSGIRequest, get_script_name from django.core.handlers import base from django.core.urlresolvers impor...
apache-2.0
amiv-eth/amivapi
amivapi/tests/groups/test_permissions.py
1
2254
# -*- coding: utf-8 -*- # # license: AGPLv3, see LICENSE for details. In addition we strongly encourage # you to buy us beer if we meet and you like the software. """Tests for custom validation rules for groups. Since this hook will be added for all requests (the after auth hook) and this is tested for auth.p...
agpl-3.0
eharney/nova
nova/tests/api/openstack/compute/contrib/test_extended_volumes.py
13
4759
# Copyright 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 requ...
apache-2.0
chuan9/chromium-crosswalk
tools/auto_bisect/PRESUBMIT.py
30
3514
# Copyright (c) 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. """Top-level presubmit script for auto-bisect. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for details on the presubmit ...
bsd-3-clause
c3cashdesk/c6sh
src/postix/backoffice/checks.py
1
2378
from decimal import Decimal from django.utils.translation import ugettext as _ from postix.core.models import ( ListConstraintProduct, Product, WarningConstraintProduct, ) _check_registry = set() def register_check(fn): _check_registry.add(fn) return fn class CheckError(Exception): pass @regist...
agpl-3.0
XianliangJ/collections
Jellyfish/ripl/ripl/routing.py
1
14278
#!/usr/bin/env python '''@package routing Routing engine base class. @author Brandon Heller (brandonh@stanford.edu) ''' from copy import copy from random import choice from collections import deque import logging lg = logging.getLogger('ripl.routing') DEBUG = False lg.setLevel(logging.WARNING) if DEBUG: lg.set...
gpl-3.0
yongshengwang/builthue
apps/beeswax/src/beeswax/management/commands/close_sessions.py
6
2453
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
kidmaple/CoolWall
user/python/Demo/scripts/eqfix.py
4
5416
#! /usr/bin/env python # Fix Python source files to use the new equality test operator, i.e., # if x = y: ... # is changed to # if x == y: ... # The script correctly tokenizes the Python program to reliably # distinguish between assignments and equality tests. # # Command line arguments are files or directories to be ...
gpl-2.0
Denisolt/Tensorflow_Chat_Bot
local/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/compat.py
2943
1157
######################## BEGIN LICENSE BLOCK ######################## # Contributor(s): # Ian Cordasco - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # versio...
gpl-3.0
brandsoulmates/incubator-airflow
airflow/api/auth/backend/kerberos_auth.py
28
4378
# Copyright (c) 2013, Michael Komitee # 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 th...
apache-2.0
darrencheng0817/AlgorithmLearning
Python/leetcode/ImplementStackUsingQueues.py
1
1871
''' Created on 1.12.2016 @author: Darren '''''' from leetcode.BinaryTreeMaximumPathSum import Solution Implement the following operations of a stack using queues. push(x) -- Push element x onto stack. pop() -- Removes the element on top of the stack. top() -- Get the top element. ...
mit
mansilladev/zulip
tools/deprecated/generate-activity-metrics.py
114
5910
#!/usr/bin/env python # # Generates % delta activity metrics from graphite/statsd data # import os, sys sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) import optparse from datetime import timedelta, datetime from zerver.lib.timestamp import datetime_to_timestamp from zerver.lib.utils import statsd_...
apache-2.0
ric2b/Vivaldi-browser
chromium/tools/cr/cr/targets/target.py
10
4752
# 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. """Module to hold the Target plugin.""" from __future__ import print_function import operator import re import cr import cr.base.context DEFAULT = cr.Conf...
bsd-3-clause
mindw/libnacl
tests/unit/test_dual.py
7
2005
# Import libnacl libs import libnacl.public import libnacl.dual # Import python libs import unittest class TestDual(unittest.TestCase): ''' ''' def test_secretkey(self): ''' ''' msg = b'You\'ve got two empty halves of coconut and you\'re bangin\' \'em together.' bob = libna...
apache-2.0
seguijoaquin/taller2-appserver
Appserver/Test/ApiUnitTesting/requests/packages/chardet/utf8prober.py
2919
2652
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
mit
home-assistant/home-assistant
homeassistant/components/ialarm/alarm_control_panel.py
2
1911
"""Interfaces with iAlarm control panels.""" import logging from homeassistant.components.alarm_control_panel import AlarmControlPanelEntity from homeassistant.components.alarm_control_panel.const import ( SUPPORT_ALARM_ARM_AWAY, SUPPORT_ALARM_ARM_HOME, ) from homeassistant.helpers.update_coordinator import Co...
apache-2.0
fujunwei/chromium-crosswalk
build/android/pylib/host_driven/test_server.py
40
4646
# 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. """Host driven test server controller. This class controls the startup and shutdown of a python driven test server that runs in a separate process. The ser...
bsd-3-clause
ludwiktrammer/odoo
addons/account_check_printing/account_payment.py
37
7203
# -*- coding: utf-8 -*- import math from openerp import models, fields, api, _ from openerp.tools import amount_to_text_en, float_round from openerp.exceptions import UserError, ValidationError class account_register_payments(models.TransientModel): _inherit = "account.register.payments" check_amount_in_wor...
agpl-3.0
geminy/aidear
oss/qt/qt-everywhere-opensource-src-5.9.0/qtlocation/src/3rdparty/mapbox-gl-native/src/3rd_party/geojson-vt-cpp/deps/gyp/pylib/gyp/simple_copy.py
1869
1247
# Copyright 2014 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. """A clone of the default copy.deepcopy that doesn't handle cyclic structures or complex types except for dicts and lists. This is because gyp copies so large structur...
gpl-3.0
iulian787/spack
var/spack/repos/builtin/packages/sprng/package.py
3
4950
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) class Sprng(AutotoolsPackage): """SPRNG: A Scalable Library For Pseudorandom Number Generation Sprng is a dist...
lgpl-2.1
t794104/ansible
lib/ansible/modules/cloud/ovirt/ovirt_storage_domain_facts.py
55
3673
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or #...
gpl-3.0
guschmue/tensorflow
tensorflow/contrib/signal/python/ops/window_ops.py
30
5089
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0