repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
adyliu/mysql-connector-python
python23/django/introspection.py
1
5112
# MySQL Connector/Python - MySQL driver written in Python. import re from django.db.backends import BaseDatabaseIntrospection from mysql.connector.constants import FieldType foreign_key_re = re.compile(r"\sCONSTRAINT `[^`]*` FOREIGN KEY \(`([^`]*)`\) " r"REFERENCES `([^`]*)` \(`([^`]*)`...
gpl-2.0
reinout/django
tests/forms_tests/field_tests/test_datetimefield.py
98
5103
import datetime from django.forms import DateTimeField, ValidationError from django.test import SimpleTestCase class DateTimeFieldTest(SimpleTestCase): def test_datetimefield_1(self): f = DateTimeField() self.assertEqual(datetime.datetime(2006, 10, 25, 0, 0), f.clean(datetime.date(2006, 10, 25))...
bsd-3-clause
reinout/django
tests/test_client/test_conditional_content_removal.py
131
1958
import gzip from django.http import HttpRequest, HttpResponse, StreamingHttpResponse from django.test import SimpleTestCase from django.test.client import conditional_content_removal class ConditionalContentTests(SimpleTestCase): def test_conditional_content_removal(self): """ Content is removed...
bsd-3-clause
MrHohn/kubernetes
hack/update_owners.py
15
5166
#!/usr/bin/env python # Copyright 2016 The Kubernetes Authors. # # 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
replicatorg/ReplicatorG
skein_engines/skeinforge-50/fabmetheus_utilities/geometry/geometry_tools/path_elements/arc.py
13
1966
""" Arc vertexes. From: http://www.w3.org/TR/SVG/paths.html#PathDataEllipticalArcCommands """ from __future__ import absolute_import #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. import __init__ from fabm...
gpl-2.0
Fermi-Dirac/mathtests
pyggel/particle.py
1
12345
""" pyggle.particle This library (PYGGEL) is licensed under the LGPL by Matthew Roe and PYGGEL contributors. The particle module contains classes for creating and rendering particle effects. A simple fire effect is included. """ from .include import * from . import data, image, misc, data import random i...
mit
openprivacy/.emacs.d
elpy/rpc-venv/lib/python3.8/site-packages/pip/_internal/pyproject.py
13
7400
from __future__ import absolute_import import io import os import sys from collections import namedtuple from pip._vendor import six, toml from pip._vendor.packaging.requirements import InvalidRequirement, Requirement from pip._internal.exceptions import InstallationError from pip._internal.utils.typing import MYPY_...
gpl-2.0
ChristosChristofidis/bokeh
examples/glyphs/iris_splom.py
43
2936
from __future__ import print_function from math import pi from bokeh.browserlib import view from bokeh.document import Document from bokeh.embed import file_html from bokeh.models.glyphs import Circle, Text from bokeh.models import ( BasicTicker, ColumnDataSource, Grid, GridPlot, LinearAxis, DataRange1d, PanT...
bsd-3-clause
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2016_09_01/aio/operations/_express_route_circuit_peerings_operations.py
1
21703
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
xq262144/hue
desktop/core/ext-py/lxml-3.3.6/src/lxml/tests/test_nsclasses.py
19
7242
# -*- coding: utf-8 -*- """ Test cases related to namespace implementation classes and the namespace registry mechanism """ import unittest, sys, os.path this_dir = os.path.dirname(__file__) if this_dir not in sys.path: sys.path.insert(0, this_dir) # needed for Py3 from common_imports import etree, HelperTestCa...
apache-2.0
BORETS24/Zenfone-2-500CL
linux/kernel/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
pfmoore/pip
docs/pip_sphinxext.py
4
10370
"""pip sphinx extensions""" import optparse import pathlib import re import sys from textwrap import dedent from typing import Dict, Iterable, Iterator, List, Optional, Union from docutils import nodes, statemachine from docutils.parsers import rst from docutils.statemachine import StringList, ViewList from sphinx.ap...
mit
uladz/sahara-image-elements
setup.py
334
1028
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # 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
N3MIS15/maraschino-webcam
modules/xbmc_notify.py
1
1958
from flask import Flask, jsonify, render_template, request import os from maraschino import app, RUNDIR, logger from socket import * from xbmc.xbmcclient import * from maraschino.tools import get_file_list from maraschino.models import XbmcServer @app.route('/xhr/xbmc_notify', methods=['post']) def xhr_notify(): ...
mit
quxiaolong1504/django
django/conf/locale/sk/formats.py
504
1173
# -*- 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. F Y' TIME_FORMAT = 'G:i' DATET...
bsd-3-clause
lorentey/swift
utils/build_swift/tests/expected_options.py
2
24101
# This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.txt for license information # See https://swift.org/CONTRIBUTORS.txt for the list o...
apache-2.0
napkindrawing/ansible
lib/ansible/plugins/shell/csh.py
69
1478
# (c) 2014, Chris Church <chris@ninemoreminutes.com> # # This file is part of Ansible. # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
gpl-3.0
rbarlow/pulp
client_consumer/test/unit/test_exception_handler.py
15
1122
from pulp.bindings import exceptions as bindings_exceptions from pulp.client.consumer.exception_handler import ConsumerExceptionHandler from pulp.client.extensions import exceptions from pulp.client.extensions.core import TAG_FAILURE from pulp.devel.unit import base class ConsumerExceptionHandlerTests(base.PulpClient...
gpl-2.0
Elucidation/ChessboardDetect
board_detect.py
1
14132
import cv2 import PIL.Image import numpy as np import sys np.set_printoptions(suppress=True, precision=2) def scaleImageIfNeeded(img, max_width=1024, max_height=1024): """Scale image down to max_width / max_height keeping aspect ratio if needed. Do nothing otherwise.""" # Input and Output is a numpy array img = ...
mit
rabipanda/tensorflow
tensorflow/compiler/tests/reverse_sequence_op_test.py
15
3457
# 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
dsyang/buck
third-party/py/pywatchman/pywatchman/capabilities.py
29
2793
# Copyright 2015 Facebook, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the f...
apache-2.0
calvingit21/h2o-2
py/testdir_multi_jvm/notest_rf_10ktrees_fvec.py
9
1680
import unittest, time, sys sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_import as h2i class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): h2o.init(2) @classmethod def tearDownClass(cls): ...
apache-2.0
jackkiej/SickRage
lib/hachoir_parser/program/exe_ne.py
95
3543
from hachoir_core.field import (FieldSet, Bit, UInt8, UInt16, UInt32, Bytes, PaddingBits, PaddingBytes, NullBits, NullBytes) from hachoir_core.text_handler import textHandler, hexadecimal, filesizeHandler class NE_Header(FieldSet): static_size = 64*8 def createFields(self): yield Bytes(self, "s...
gpl-3.0
openatv/enigma2
lib/python/Screens/PictureInPicture.py
10
7903
from Screens.Screen import Screen from Screens.Dish import Dishpip from enigma import ePoint, eSize, eRect, eServiceCenter, getBestPlayableServiceReference, eServiceReference, eTimer from Components.SystemInfo import SystemInfo from Components.VideoWindow import VideoWindow from Components.config import config, ConfigP...
gpl-2.0
gunan/tensorflow
tensorflow/python/data/experimental/benchmarks/map_and_batch_benchmark.py
9
8438
# 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
xrmx/django
tests/custom_columns/tests.py
207
4090
from __future__ import unicode_literals from django.core.exceptions import FieldError from django.test import TestCase from django.utils import six from .models import Article, Author class CustomColumnsTests(TestCase): def setUp(self): self.a1 = Author.objects.create(first_name="John", last_name="Smit...
bsd-3-clause
JesseLivezey/sklearn-theano
sklearn_theano/externals/google/protobuf/service_reflection.py
243
11023
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
bsd-3-clause
jledbetter/openhatch
mysite/search/migrations/0018_bug_bite_size_tag_name.py
17
3743
# This file is part of OpenHatch. # Copyright (C) 2009 OpenHatch, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later v...
agpl-3.0
autrilla/servo
tests/wpt/web-platform-tests/tools/manifest/sourcefile.py
24
10645
import os import urlparse from fnmatch import fnmatch try: from xml.etree import cElementTree as ElementTree except ImportError: from xml.etree import ElementTree import html5lib import vcs from item import Stub, ManualTest, WebdriverSpecTest, RefTest, TestharnessTest from utils import rel_path_to_url, is_bla...
mpl-2.0
Axiologue/AxiologueAPI
forum/models.py
1
1829
from django.db import models from django.utils import timezone from django.conf import settings class Category(models.Model): name = models.CharField(max_length=200) description = models.TextField() created_date = models.DateTimeField(default=timezone.now) list_order = models.PositiveSmallIntegerFiel...
mit
jf---/pythonocc-core
test/core_extend_shapefactory_unittest.py
2
3720
#!/usr/bin/env python ##Copyright 2020 Thomas Paviot (tpaviot@gmail.com) ## ##This file is part of pythonOCC. ## ##pythonOCC 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 Lice...
lgpl-3.0
madhurrajn/samashthi
lib/django/template/loaders/base.py
128
3865
import warnings from django.template import Origin, Template, TemplateDoesNotExist from django.utils.deprecation import RemovedInDjango20Warning from django.utils.inspect import func_supports_parameter class Loader(object): # Only used to raise a deprecation warning. Remove in Django 1.10. _accepts_engine_in...
bsd-3-clause
abhishekgahlot/kivy
kivy/tests/test_clock.py
17
1868
''' Clock tests =========== ''' import unittest counter = 0 def callback(dt): global counter counter += 1 class ClockTestCase(unittest.TestCase): def setUp(self): from kivy.clock import Clock global counter counter = 0 Clock._events = {} def test_schedule_once(sel...
mit
pgleeson/TestArea
models/SBMLDemo/cellMechanisms/Marhl_Calcium_Oscillations/SBML2NEURON.py
6
19212
import os.path #!/usr/bin/env python # # # A file which can be used to generate NEURON mod files (and hoc files to test them) # from **SIMPLE** SBML files. The only SBML elements which are currently supported are: # # listOfCompartments # listOfSpecies # listOfParameters # listOfReactions # ...
gpl-2.0
xiaoneng/crispy-forms-pure
docs/conf.py
1
8617
# -*- coding: utf-8 -*- # # crispy-form-pure documentation build configuration file, created by # sphinx-quickstart on Sat Nov 15 20:21:48 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated fi...
mit
awemany/BitcoinUnlimited
test/functional/wallet-hd.py
10
3623
#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test Hierarchical Deterministic wallet function.""" from test_framework.test_framework import BitcoinTestFr...
mit
Jumpscale/jumpscale6_core
lib/JumpScale/lib/ovsnetconfig/VXNet/systemlist.py
1
9345
__author__ = 'delandtj' from utils import * import fcntl import time import re from netaddr import * from utils import * def acquire_lock(path): """ little tool to do EAGAIN until lockfile released :param path: :return: path """ lock_file = open(path, 'w') while True: send_to_syslog(...
bsd-2-clause
peastman/msmbuilder
msmbuilder/msm/validation/bootstrapmsm.py
7
8157
# Author: Mohammad M. Sultan <msultan@stanford.edu> # Contributors: Brooke Husic <brookehusic@gmail.com> # Copyright (c) 2016, Stanford University # All rights reserved. from __future__ import absolute_import, division from multiprocessing import Pool, cpu_count from msmbuilder.utils import list_of_1d from sklearn.uti...
lgpl-2.1
oshtaier/robottelo
robottelo/api/utils.py
1
4523
"""Module containing convenience functions for working with the API.""" from nailgun import client from robottelo.common import helpers from robottelo import entities from urlparse import urljoin class RepositoryPackagesException(Exception): """Indicates that a repository's packages could not be fetched.""" cla...
gpl-3.0
lento/cortex
test/IECore/MatrixMultiplyOp.py
11
4939
########################################################################## # # Copyright (c) 2007-2013, 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: # # * Redis...
bsd-3-clause
Sumith1896/sympy
sympy/series/kauers.py
5
1808
from __future__ import print_function, division def finite_diff(expression, variable, increment=1): """ Takes as input a polynomial expression and the variable used to construct it and returns the difference between function's value when the input is incremented to 1 and the original function value. I...
bsd-3-clause
jalexvig/tensorflow
tensorflow/tools/docs/generate_lib_test.py
29
8239
# 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
synconics/odoo
addons/hr_timesheet_sheet/hr_timesheet_sheet.py
36
36165
# -*- 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
karlgluck/heroes-of-the-storm-replay-parser
s2protocol/protocol18574.py
14
20388
# Copyright (c) 2013 Blizzard Entertainment # # 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, publi...
mit
CydarLtd/ansible
lib/ansible/modules/cloud/amazon/ecs_ecr.py
51
11804
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
wkschwartz/django
tests/db_functions/text/test_lower.py
71
1453
from django.db.models import CharField from django.db.models.functions import Lower from django.test import TestCase from django.test.utils import register_lookup from ..models import Author class LowerTests(TestCase): def test_basic(self): Author.objects.create(name='John Smith', alias='smithj') ...
bsd-3-clause
NCTU-PCCA/NCTU_Yggdrasill
codebook/gentex.py
1
3036
#!/usr/bin/env python # -*- coding: UTF-8 -*- doc_class = '\documentclass [landscape,8pt,a4paper,twocolumn]{article}' head = '''\\title {NCTU\\_Yggdarsill Codebook} \\usepackage{parskip} \\usepackage{xeCJK} \\setCJKmainfont{SourceHanSerifTW-Light} \\setmonofont{Courier New} \\usepackage {listings} \\usepackage {color...
mit
sjebbara/gensim
gensim/interfaces.py
35
10708
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ This module contains basic interfaces used throughout the whole gensim package. The interfaces are realized as abstract base classe...
gpl-3.0
system1357/pdk7105-3.4
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
manjunaths/tensorflow
tensorflow/python/ops/random_ops.py
14
17940
# 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
yeyanchao/calibre
src/calibre/gui2/convert/xpath_wizard_ui.py
1
4085
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/home/yc/code/calibre/calibre/src/calibre/gui2/convert/xpath_wizard.ui' # # Created: Thu Oct 25 16:54:55 2012 # by: PyQt4 UI code generator 4.8.5 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui ...
gpl-3.0
guorendong/iridium-browser-ubuntu
tools/gyp/test/rules-rebuild/gyptest-default.py
345
2242
#!/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 a rule that generates multiple outputs rebuilds correctly when the inputs change. """ import TestGyp test = TestGyp.Test...
bsd-3-clause
kionz/librime
thirdparty/src/yaml-cpp/test/gmock-1.7.0/scripts/generator/cpp/gmock_class.py
268
8241
#!/usr/bin/env python # # Copyright 2008 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...
bsd-3-clause
jhutar/spacewalk
backend/cdn_tools/repository.py
1
19265
# Copyright (c) 2016 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a copy of G...
gpl-2.0
ioanpocol/superdesk-core
tests/io/feed_parsers/bbc_ninjs_test.py
3
2470
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013-2018 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import os imp...
agpl-3.0
simonlynen/or-tools
examples/python/debruijn_binary.py
32
5936
# 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
ncdesouza/bookworm
env/lib/python2.7/site-packages/sqlalchemy/sql/naming.py
33
4588
# sqlalchemy/naming.py # Copyright (C) 2005-2014 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 """Establish constraint and index naming conventions. """ from .schema impor...
gpl-3.0
jakew02/android_kernel_lge_bullhead
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed 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 failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
Mazecreator/tensorflow
tensorflow/contrib/learn/python/learn/datasets/base_test.py
136
3072
# 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
lupyuen/RaspberryPiImage
home/pi/GrovePi/Software/Python/others/temboo/Library/Amazon/CloudDrive/Files/ListFiles.py
5
6477
# -*- coding: utf-8 -*- ############################################################################### # # ListFiles # Returns a list of files. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in co...
apache-2.0
miipl-naveen/optibizz
addons/account/res_config.py
200
25453
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
miipl-naveen/optibizz
addons/gamification/__openerp__.py
299
2464
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
divya-csekar/flask-microblog-server
flask/Lib/site-packages/sqlalchemy/testing/entities.py
33
2992
# testing/entities.py # Copyright (C) 2005-2014 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 import sqlalchemy as sa from sqlalchemy import exc as sa_exc _repr_stack = set(...
bsd-3-clause
double12gzh/nova
nova/cells/filters/image_properties.py
61
2516
# Copyright (c) 2012-2013 Rackspace Hosting # 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
rversteegen/commandergenius
project/jni/python/src/Lib/idlelib/MultiCall.py
49
17282
""" MultiCall - a class which inherits its methods from a Tkinter widget (Text, for example), but enables multiple calls of functions per virtual event - all matching events will be called, not only the most specific one. This is done by wrapping the event functions - event_add, event_delete and event_info. MultiCall r...
lgpl-2.1
skycucumber/restful
python/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/euctwprober.py
2994
1676
######################## 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...
gpl-2.0
kernevil/samba
python/samba/kcc/__init__.py
1
115581
# define the KCC object # # Copyright (C) Dave Craft 2011 # Copyright (C) Andrew Bartlett 2015 # # Andrew Bartlett's alleged work performed by his underlings Douglas # Bagnall and Garming Sam. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License...
gpl-3.0
stephen144/odoo
openerp/report/preprocess.py
49
3753
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from lxml import etree import re rml_parents = ['tr','story','section'] html_parents = ['tr','body','div'] sxw_parents = ['{http://openoffice.org/2000/table}table-row','{http://openoffice.org/2000/office}body','{http://o...
agpl-3.0
cpcloud/numba
numba/tests/test_casting.py
3
2913
from numba import unittest_support as unittest import numpy as np from numba.compiler import compile_isolated from numba import types, njit import struct def float_to_int(x): return types.int32(x) def int_to_float(x): return types.float64(x) / 2 def float_to_unsigned(x): return types.uint32(x) def f...
bsd-2-clause
ojengwa/odoo
addons/association/__init__.py
886
1054
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
delinhabit/django
django/shortcuts.py
129
7958
""" This module collects helper functions and classes that "span" multiple levels of MVC. In other words, these functions/classes introduce controlled coupling for convenience's sake. """ import warnings from django.core import urlresolvers from django.db.models.base import ModelBase from django.db.models.manager imp...
bsd-3-clause
lra/boto
boto/services/__init__.py
782
1108
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.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, including # without limitation the rights to use, copy, modi...
mit
pschmitt/home-assistant
tests/components/stream/test_init.py
5
3066
"""The tests for stream.""" import pytest from homeassistant.components.stream.const import ( ATTR_STREAMS, CONF_LOOKBACK, CONF_STREAM_SOURCE, DOMAIN, SERVICE_RECORD, ) from homeassistant.const import CONF_FILENAME from homeassistant.exceptions import HomeAssistantError from homeassistant.setup imp...
apache-2.0
AMOboxTV/AMOBox.LegoBuild
script.module.unidecode/lib/unidecode/x0cd.py
253
4738
data = ( 'cyess', # 0x00 'cyeng', # 0x01 'cyej', # 0x02 'cyec', # 0x03 'cyek', # 0x04 'cyet', # 0x05 'cyep', # 0x06 'cyeh', # 0x07 'co', # 0x08 'cog', # 0x09 'cogg', # 0x0a 'cogs', # 0x0b 'con', # 0x0c 'conj', # 0x0d 'conh', # 0x0e 'cod', # 0x0f 'col', # 0x10 'colg', ...
gpl-2.0
wkentaro/legit
legit/cli.py
1
18417
# -*- coding: utf-8 -*- """ legit.cli ~~~~~~~~~ This module provides the CLI interface to legit. """ import os import sys from subprocess import call from time import sleep import clint.resources try: from clint import Args args = Args() except ImportError: from clint import args from clint.eng import j...
bsd-3-clause
guschmue/tensorflow
tensorflow/python/client/timeline.py
38
24052
# 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
demiaster/rman
scene.py
1
20055
#! /usr/bin/python import getpass import time # import the python functions import sys,os.path,subprocess # import the python renderman library import prman ###-------------------------------Function Section--------------------------### """ Jon Macey's function function to check if shader exists and compile it, we a...
bsd-2-clause
webu/django-categories
doc_src/code_examples/custom_categories3.py
13
1144
class Category(CategoryBase): thumbnail = models.FileField( upload_to=THUMBNAIL_UPLOAD_PATH, null=True, blank=True, storage=STORAGE(),) thumbnail_width = models.IntegerField(blank=True, null=True) thumbnail_height = models.IntegerField(blank=True, null=True) order = models.Integ...
apache-2.0
tsdmgz/ansible
lib/ansible/modules/network/avi/avi_sslkeyandcertificate.py
27
5751
#!/usr/bin/python # # Created on Aug 25, 2016 # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the te...
gpl-3.0
jherve/ardupilot
Tools/LogAnalyzer/tests/TestPitchRollCoupling.py
267
5809
from LogAnalyzer import Test,TestResult import DataflashLog import collections class TestPitchRollCoupling(Test): '''test for divergence between input and output pitch/roll, i.e. mechanical failure or bad PID tuning''' # TODO: currently we're only checking for roll/pitch outside of max lean angle, will come ...
gpl-3.0
krischer/LASIF
lasif/tests/components/test_stations_component.py
1
9006
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import import glob import inspect import mock import obspy import os import pytest from lasif import LASIFNotFoundError from lasif.components.stations import StationsComponent from lasif.components.communicator import Communicator from .tes...
gpl-3.0
fraricci/pymatgen
pymatgen/io/prismatic.py
9
1367
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ Write Prismatic (http://prism-em.com/) input files. """ class Prismatic: """ Class to write Prismatic (http://prism-em.com/) input files. This is designed for STEM image simulation. """ ...
mit
Zhongqilong/mykbengineer
kbe/src/lib/python/Modules/_decimal/libmpdec/literature/fnt.py
50
7169
# # Copyright (c) 2008-2016 Stefan Krah. 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 ...
lgpl-3.0
muntasirsyed/intellij-community
python/testData/MockSdk3.2/Lib/_abcoll.py
112
15499
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) for collections, according to PEP 3119. DON'T USE THIS MODULE DIRECTLY! The classes here should be imported via collections; they are defined here only to alleviate certain bootstrappin...
apache-2.0
edesiocs/namebench
nb_third_party/dns/resolver.py
215
28920
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
harej/reports_bot
reportsbot/config.py
2
2143
# -*- coding: utf-8 -*- import errno from os import path import yaml from .exceptions import ConfigError __all__ = ["Config"] class Config: """Stores general-purpose bot configuration.""" def __init__(self, base_dir): self._base_dir = base_dir self._data = {} self._load() def ...
mit
hynnet/hiwifi-openwrt-HC5661-HC5761
staging_dir/host/lib/scons-2.1.0/SCons/Defaults.py
21
17649
"""SCons.Defaults Builders and other things for the local site. Here's where we'll duplicate the functionality of autoconf until we move it into the installation procedure or use something like qmconf. The code that reads the registry to find MSVC components was borrowed from distutils.msvccompiler. """ # # Copyri...
gpl-2.0
pylbert/upm
examples/python/apa102.py
6
1909
#!/usr/bin/env python # Author: Yannick Adam <yannick.adam@gmail.com> # Copyright (c) 2016 Yannick Adam # # 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 # wit...
mit
affo/nova
nova/virt/hyperv/livemigrationutils.py
2
11279
# Copyright 2013 Cloudbase Solutions Srl # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
apache-2.0
UniversalMasterEgg8679/ansible
lib/ansible/plugins/shell/powershell.py
26
46097
# (c) 2014, Chris Church <chris@ninemoreminutes.com> # # This file is part of Ansible. # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
gpl-3.0
incaser/project
project_sla/m2m.py
25
1847
""" Wrapper for OpenERP's cryptic write conventions for x2many fields. Example usage: import m2m browse_rec.write({'many_ids: m2m.clear()) browse_rec.write({'many_ids: m2m.link(99)) browse_rec.write({'many_ids: m2m.add({'name': 'Monty'})) browse_rec.write({'many_ids: m2m.replace([98, 99])) Since ...
agpl-3.0
joshbruning/selenium
py/selenium/webdriver/phantomjs/webdriver.py
21
3111
# 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
tymiles003/openwebrtc
owr/symbols_to_source.py
32
2437
""" Copyright (c) 2014-2015, Ericsson AB. 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 ...
bsd-2-clause
RanadeepPolavarapu/kuma
vendor/packages/logilab/common/test/unittest_umessage.py
7
2484
# encoding: iso-8859-15 # copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-common. # # logilab-common is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser Genera...
mpl-2.0
aspectron/jsx
extern/v8/tools/testrunner/local/statusfile.py
41
4409
# Copyright 2012 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditi...
mit
jason-weirather/py-seq-tools
seqtools/statistics/__init__.py
1
2084
"""This module contains many list-based functions to calculate descriptive statistics.""" from math import sqrt from collections import Counter def mode(arr): """get the most frequent value""" return max(set(arr),key=arr.count) def average(arr): """average of the values, must have more than 0 entries. :pa...
apache-2.0
tommo/gii
support/waf/waflib/Tools/c_osx.py
10
5517
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy 2008-2010 """ MacOSX related tools """ import os, shutil, sys, platform from waflib import TaskGen, Task, Build, Options, Utils, Errors from waflib.TaskGen import taskgen_method, feature, after_method, before_method app_info = ''' <?xml version="1.0" encoding="UT...
mit
jaggu303619/asylum
openerp/addons/google_base_account/google_base_account.py
53
1297
# -*- 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
justathoughtor2/atomicApe
cygwin/lib/python2.7/site-packages/docutils/utils/math/latex2mathml.py
104
17213
#!/usr/bin/env python # -*- coding: utf-8 -*- # :Id: $Id: latex2mathml.py 7668 2013-06-04 12:46:30Z milde $ # :Copyright: © 2010 Günter Milde. # Based on rst2mathml.py from the latex_math sandbox project # © 2005 Jens Jørgen Mortensen # :License: Released under the terms of the `2-Clause BSD li...
gpl-3.0
xianjunzhengbackup/Cloud-Native-Python
env/lib/python3.6/site-packages/setuptools/command/py36compat.py
286
4986
import os from glob import glob from distutils.util import convert_path from distutils.command import sdist from setuptools.extern.six.moves import filter class sdist_add_defaults: """ Mix-in providing forward-compatibility for functionality as found in distutils on Python 3.7. Do not edit the code ...
mit