code
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
226
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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...
JioCloud/heat
heat/db/sqlalchemy/migrate_repo/versions/020_stack_action.py
Python
apache-2.0
1,147
# -*- coding: utf-8 -*- # # 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 #...
adamhaney/airflow
airflow/utils/log/logging_mixin.py
Python
apache-2.0
5,510
# Copyright 2012 New Dream Network, LLC (DreamHost) # # 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 a...
lmaycotte/quark
quark/db/migration/alembic/cli.py
Python
apache-2.0
7,166
# Copyright 2015 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
askdaddy/PerfKitBenchmarker
perfkitbenchmarker/openstack/utils.py
Python
apache-2.0
6,432
# Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
JavaRabbit/CS496_capstone
codelabs/flex_and_vision/main.py
Python
apache-2.0
4,034
# 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...
fullfanta/mxnet
tests/python/train/test_bucketing.py
Python
apache-2.0
4,013
#!/usr/bin/env python # -*- encoding: utf-8 -*- from collections import defaultdict import random import sys sys.path.insert(1, "../../") import h2o from h2o.exceptions import H2OValueError from h2o.utils.compatibility import viewvalues from tests import pyunit_utils def create_frame_test(): """Test `h2o.create_fr...
mathemage/h2o-3
h2o-py/tests/testdir_misc/pyunit_create_frame.py
Python
apache-2.0
2,597
# Copyright 2015 Internap. # # 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, so...
mat128/netman
netman/core/objects/__init__.py
Python
apache-2.0
790
import doctest print 'Before testing be sure to set your key in README.txt..\n\n' doctest.testfile('README.rst')
gregelin/python-ideascaleapi
test_sunlightapi.py
Python
bsd-3-clause
115
# Copyright 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. import logging import sys import unittest from telemetry.internal.util import wpr_server # pylint: disable=protected-access class CreateCommandTest(unitte...
benschmaus/catapult
telemetry/telemetry/internal/util/wp_server_unittest.py
Python
bsd-3-clause
2,645
# -*- coding: utf-8 -*- # # Copyright (C)2006-2009 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wiki/TracLicense. # # This software consis...
netjunki/trac-Pygit2
trac/prefs/api.py
Python
bsd-3-clause
1,093
""" Classes to represent the definitions of aggregate functions. """ from django.db.models.constants import LOOKUP_SEP __all__ = [ 'Aggregate', 'Avg', 'Count', 'Max', 'Min', 'StdDev', 'Sum', 'Variance', ] def refs_aggregate(lookup_parts, aggregates): """ A little helper method to check if the lookup_part...
rogerhu/django
django/db/models/aggregates.py
Python
bsd-3-clause
2,701
import unittest from dpark.serialize import dump_closure, load_closure class TestSerialize(unittest.TestCase): def testNameError(self): def foo(): print x dumped_func = dump_closure(foo) func = load_closure(dumped_func) self.assertRaises(NameError, func) ...
quxiaolong1504/dpark
tests/test_serialize.py
Python
bsd-3-clause
590
# stdlib from collections import defaultdict import datetime import logging import os import shutil import tempfile # 3p import xml.etree.ElementTree as ET # project from tests.checks.common import AgentCheckTest logger = logging.getLogger(__file__) DATETIME_FORMAT = '%Y-%m-%d_%H-%M-%S' LOG_DATA = 'Finished: SUCCE...
varlib1/servermall
jenkins/test_jenkins.py
Python
bsd-3-clause
5,889
from sympy import Basic from sympy.printing.mathml import mathml import tempfile import os def print_gtk(x, start_viewer=True): """Print to Gtkmathview, a gtk widget capable of rendering MathML. Needs libgtkmathview-bin""" from sympy.utilities.mathml import c2p tmp = tempfile.mktemp() # create a temp ...
hazelnusse/sympy-old
sympy/printing/gtk.py
Python
bsd-3-clause
498
#!/usr/bin/env vpython # Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import subprocess import sys import unittest import mock import merge_lib as merger class MergeLibTest(unittest.TestCase...
chromium/chromium
testing/merge_scripts/code_coverage/merge_lib_test.py
Python
bsd-3-clause
1,506
from datetime import datetime from django.core.exceptions import ValidationError from django.db import models def validate_answer_to_universe(value): if value != 42: raise ValidationError('This is not the answer to life, universe and everything!', code='not42') class ModelToValidate(models.Model): n...
adrianholovaty/django
tests/modeltests/validation/models.py
Python
bsd-3-clause
4,204
# # adjGraph # # Created by Brad Miller on 2005-02-24. # Copyright (c) 2005 Brad Miller, David Ranum, Luther College. All rights reserved. # import sys import os import unittest class Graph: def __init__(self): self.vertices = {} self.numVertices = 0 def addVertex(self,key): ...
ArcherSys/ArcherSys
skulpt/src/lib/pythonds/graphs/adjGraph.py
Python
mit
3,004
#!/usr/bin/python # Author: Zion Orent <zorent@ics.com> # Copyright (c) 2015 Intel Corporation. # # 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 limi...
sasmita/upm
examples/python/grovewfs.py
Python
mit
2,489
# (c) Copyright 2013 Hewlett-Packard Development Company, L.P. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses...
sjsucohort6/openstack
python/venv/lib/python2.7/site-packages/neutronclient/tests/unit/vpn/test_cli20_ipsecpolicy.py
Python
mit
8,365
"""SCons.Tool.CVS.py Tool-specific initialization for CVS. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # Copyright (c) 2001 - 2014 The SCons Foundation # # Permission is hereby granted, free of charge, t...
dezelin/scons
scons-local/SCons/Tool/CVS.py
Python
mit
2,859
# -*- coding: utf-8 -*- # # test_glif_cond.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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,...
weidel-p/nest-simulator
pynest/nest/tests/test_glif_cond.py
Python
gpl-2.0
7,258
from __future__ import absolute_import from contextlib import contextmanager __all__ = [ 'reversed', ] @contextmanager def reversed(G): """A context manager for temporarily reversing a directed graph in place. This is a no-op for undirected graphs. Parameters ---------- G : graph A...
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/networkx/utils/contextmanagers.py
Python
gpl-3.0
632
# This file is part of Shoop. # # Copyright (c) 2012-2015, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ impo...
arth-co/shoop
shoop/simple_cms/__init__.py
Python
agpl-3.0
823
'''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.GL import _types as _cs # End users want this... from OpenGL.raw.GL._types import * from OpenGL.raw.GL import _errors from OpenGL.constant import Constant as _C import ctypes _...
stack-of-tasks/rbdlpy
tutorial/lib/python2.7/site-packages/OpenGL/raw/GL/ATI/pixel_format_float.py
Python
lgpl-3.0
648
# Copyright (C) 2015 Swift Navigation Inc. # Contact: Mark Fine <mark@swiftnav.com> # # This source is subject to the license found in the file 'LICENSE' which must # be be distributed together with this source. All other rights reserved. # # THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, #...
hankaiwen/libsbp
python/sbp/client/loggers/null_logger.py
Python
lgpl-3.0
823
# Copyright 2012, Red Hat, 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 agr...
akash1808/nova_test_latest
nova/tests/unit/compute/test_rpcapi.py
Python
apache-2.0
20,820
# Copyright 2014 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 ag...
KaranToor/MA450
google-cloud-sdk/lib/surface/compute/regions/list.py
Python
apache-2.0
965
''' ''' # 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");...
rpufky/trafficserver
tests/tools/sessionvalidation/session.py
Python
apache-2.0
1,826
""" Slovak-specific form helpers """ from __future__ import absolute_import, unicode_literals from django.forms.fields import Select, RegexField from django.utils.translation import ugettext_lazy as _ from .sk_districts import DISTRICT_CHOICES from .sk_regions import REGION_CHOICES class SKRegionSelect(Select): ...
zarelit/django-localflavor
localflavor/sk/forms.py
Python
bsd-3-clause
1,546
from kivy.base import runTouchApp from kivy.lang import Builder runTouchApp(Builder.load_string(''' ActionBar: pos_hint: {'top':1} ActionView: use_separator: True ActionPrevious: title: 'Action Bar' with_previous: False ActionOverflow: ActionButton: ...
LogicalDash/kivy
examples/widgets/actionbar.py
Python
mit
826
# strategy_best2.py # Strategy pattern -- function-based implementation # selecting best promotion from current module globals """ >>> joe = Customer('John Doe', 0) >>> ann = Customer('Ann Smith', 1100) >>> cart = [LineItem('banana', 4, .5), ... LineItem('apple', 10, 1.5), ... LineI...
pythonprobr/oscon2014
strategy/strategy_best2.py
Python
mit
3,172
# -*- encoding: utf-8 -*- # 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 #...
ikoula/cloudstack
tools/marvin/marvin/sandbox/demo/simulator/testcase/test_vm_life_cycle.py
Python
gpl-2.0
20,302
""" Classes used for defining and running nose test suites """ import os from paver.easy import call_task from pavelib.utils.test import utils as test_utils from pavelib.utils.test.suites import TestSuite from pavelib.utils.envs import Env __test__ = False # do not collect class NoseTestSuite(TestSuite): """ ...
wwj718/ANALYSE
pavelib/utils/test/suites/nose_suite.py
Python
agpl-3.0
5,609
from __future__ import absolute_import import errno import logging import sys import warnings from socket import error as SocketError, timeout as SocketTimeout import socket from .exceptions import ( ClosedPoolError, ProtocolError, EmptyPoolError, HeaderParsingError, HostChangedError, Locatio...
LukeMurphey/splunk-google-drive
src/bin/google_drive_app/urllib3/connectionpool.py
Python
apache-2.0
36,488
import json import logging import os import threading from collections import deque from datetime import datetime, timedelta from typing import Optional import requests logging.getLogger('requests.packages.urllib3').setLevel(logging.WARN) FETCH_PERIOD = 2 FILE_EXT = '.state-summary.json' STATE_SUMMARY_URI = os.gete...
asridharan/dcos
packages/dcos-history/extra/history/statebuffer.py
Python
apache-2.0
6,354
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 OpenStack LLC. # 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/...
KarimAllah/nova
nova/api/openstack/compute/flavors.py
Python
apache-2.0
3,905
from celery_broker import *
nextml/NEXT
next/broker/celery_app/__init__.py
Python
apache-2.0
28
# 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 by applicable law or agreed t...
zsoltdudas/lis-tempest
tempest/api/network/admin/test_agent_management.py
Python
apache-2.0
3,750
# Copyright 2017 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. """Presubmit checks used in viz""" import re def CheckChangeLintsClean(input_api, output_api, allowlist, denylist=None): source_filter = lambda x: input_...
chromium/chromium
components/viz/presubmit_checks.py
Python
bsd-3-clause
11,706
#!/usr/bin/env python import os import os.path import shutil import sys if len(sys.argv) < 2: sys.stderr.write('No binary to package specified.'); sys.stderr.flush() #print '#!/bin/sh\n' binary = sys.argv[1] if binary[0] != '/': binary = os.path.join(os.getcwd(), binary) frameworkDir = os.path.normpath(os.path.jo...
acekiller/pencil
util/osx-app-packager.py
Python
gpl-2.0
3,189
# 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 in the hope that ...
tux-00/ansible
lib/ansible/module_utils/facts/hardware/freebsd.py
Python
gpl-3.0
6,910
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
alxgu/ansible
lib/ansible/modules/cloud/google/gcp_compute_instance_group_facts.py
Python
gpl-3.0
7,002
import pytest import sys import unittest from ..backends import static # There aren't many tests here because it turns out to be way more convenient to # use test_serializer for the majority of cases @pytest.mark.xfail(sys.version[0] == "3", reason="wptmanifest.parser doesn't support py3") class ...
paulrouget/servo
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/wptmanifest/tests/test_static.py
Python
mpl-2.0
2,669
""" Page classes to test either the Course Team page or the Library Team page. """ from bok_choy.promise import EmptyPromise from bok_choy.page_object import PageObject from ...tests.helpers import disable_animations from . import BASE_URL def wait_for_ajax_or_reload(browser): """ Wait for all ajax requests t...
olexiim/edx-platform
common/test/acceptance/pages/studio/users.py
Python
agpl-3.0
6,650
try: import coverage coverage.process_startup() except ImportError: pass
NinjaMSP/crossbar
sitecustomize.py
Python
agpl-3.0
85
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 OpenStack Foundation # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use t...
zouyapeng/horizon-newtouch
openstack_dashboard/dashboards/admin/instances/views.py
Python
apache-2.0
7,076
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import os import sys from telemetry import decorators from telemetry.core import exceptions from telemetry.core import util from telemetry.co...
markYoungH/chromium.src
tools/telemetry/telemetry/core/backends/chrome_inspector/inspector_backend.py
Python
bsd-3-clause
9,745
#!/usr/bin/env python # # Copyright (c) 2019, The OpenThread 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: # 1. Redistributions of source code must retain the above copyright # notic...
chshu/openthread
tools/harness-automation/cases/border_7_1_5.py
Python
bsd-3-clause
1,877
""" Various complex queries that have been problematic in the past. """ from __future__ import unicode_literals import threading from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible class DumbCategory(models.Model): pass class ProxyCategory(Dum...
postrational/django
tests/queries/models.py
Python
bsd-3-clause
13,028
#!/usr/bin/env python """ Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ try: import _mssql import pymssql except ImportError: pass import logging from lib.core.convert import utf8encode from lib.core.data import conf from lib.core.da...
V11/volcano
server/sqlmap/plugins/dbms/sybase/connector.py
Python
mit
2,499
from config import ConfigNumber, ConfigYesNo, ConfigSubsection, ConfigSelection, config def InitRecordingConfig(): config.recording = ConfigSubsection(); # actually this is "recordings always have priority". "Yes" does mean: don't ask. The RecordTimer will ask when value is 0. config.recording.asktozap = ConfigYesN...
kingvuplus/ts-gui-3
lib/python/Components/RecordingConfig.py
Python
gpl-2.0
1,013
# Copyright (C) 2013-2018 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This progr...
BPI-SINOVOIP/BPI-Mainline-kernel
toolchains/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf/share/gdb/python/gdb/FrameDecorator.py
Python
gpl-2.0
10,392
# -*- coding: utf-8 -*- # © 2016 OpenSynergy Indonesia # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import test_hr_expense
acsone/hr
hr_expense_product_policy/tests/__init__.py
Python
agpl-3.0
156
# -*- coding: utf-8 -*- # # {{ cookiecutter.project_name }} documentation build configuration file, created by # sphinx-quickstart. # # 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 file. # # All con...
schacki/cookiecutter-django
{{cookiecutter.project_slug}}/docs/conf.py
Python
bsd-3-clause
8,166
"""The tests for the MQTT sensor platform.""" import unittest from homeassistant.bootstrap import setup_component import homeassistant.components.sensor as sensor from tests.common import mock_mqtt_component, fire_mqtt_message from tests.common import get_test_home_assistant class TestSensorMQTT(unittest.TestCase):...
xifle/home-assistant
tests/components/sensor/test_mqtt.py
Python
mit
2,148
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals """ oauthlib.oauth2.rfc6749 ~~~~~~~~~~~~~~~~~~~~~~~ This module is an implementation of various logic needed for consuming and providing OAuth 2.0 RFC6749. """ from .base import Client from ..parameters import prepare_grant_uri from ..pa...
yasoob/PythonRSSReader
venv/lib/python2.7/dist-packages/oauthlib/oauth2/rfc6749/clients/mobile_application.py
Python
mit
9,122
# # The Python Imaging Library. # $Id$ # # image enhancement classes # # For a background, see "Image Processing By Interpolation and # Extrapolation", Paul Haeberli and Douglas Voorhies. Available # at http://www.sgi.com/grafica/interp/index.html # # History: # 1996-03-23 fl Created # 2009-06-16 fl Fixed mean calcu...
Amechi101/concepteur-market-app
venv/lib/python2.7/site-packages/PIL/ImageEnhance.py
Python
mit
2,760
import os def main(): import sys # Separate the nose params and the pydev params. pydev_params = [] other_test_framework_params = [] found_other_test_framework_param = None NOSE_PARAMS = '--nose-params' PY_TEST_PARAMS = '--py-test-params' for arg in sys.argv[1:]: if not found...
dannyperry571/theapprentice
script.module.pydevd/lib/runfiles.py
Python
gpl-2.0
11,560
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import re from glob import glob from setuptools import find_packages, setup from os.path import join, dirname execfile(join(dirname(__file__), 'openerp', 'release.py')) # Load release variables lib_name = 'openerp' def py2exe_datafiles(): data_files = {}...
ToiDenGaAli/odoo
setup.py
Python
gpl-3.0
5,678
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. # design: # a threaded worker accepts connections in the main loop, accepted # connections are are added to the thread pool as a connection job. On # keepalive connections are put back in the ...
naziris/HomeSecPi
venv/lib/python2.7/site-packages/gunicorn/workers/gthread.py
Python
apache-2.0
10,785
""" Copyright (c) 2004-Present Pivotal Software, Inc. This program and the accompanying materials are made available under the terms of the 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....
edespino/gpdb
src/test/tinc/tincrepo/mpp/gpdb/tests/storage/walrepl/run/test_gpstart.py
Python
apache-2.0
2,220
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2012, Mark Theunissen <mark.theunissen@gmail.com> # Sponsored by Four Kitchens http://fourkitchens.com. # 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_functi...
tersmitten/ansible
lib/ansible/modules/database/mysql/mysql_db.py
Python
gpl-3.0
15,596
# # Copyright (c) 2014 ThoughtWorks Deutschland GmbH # # Pixelated 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 version. # # Pixelated...
PuZZleDucK/pixelated-user-agent
service/test/support/dispatcher/__init__.py
Python
agpl-3.0
700
#!/usr/bin/env python from __future__ import absolute_import from email.utils import parseaddr import functools import htmlentitydefs import itertools import logging import operator import re from ast import literal_eval from openerp.tools import mute_logger # Validation Library https://pypi.python.org/pypi/validate_e...
fdvarela/odoo8
addons/crm/base_partner_merge.py
Python
agpl-3.0
30,328
def func(): value = "not-none" if value is not None: <selection>pass</selection><caret> else: print("None") return True
siosio/intellij-community
python/testData/intentions/PyInvertIfConditionIntentionTest/generalNoElseFollowupReturnOnly_after.py
Python
apache-2.0
153
# 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 use ...
samaitra/kafka
tests/kafkatest/tests/connect_test.py
Python
apache-2.0
4,906
from __future__ import (absolute_import, division, print_function, unicode_literals) from .geom import geom class geom_blank(geom): DEFAULT_AES = {} REQUIRED_AES = set() DEFAULT_PARAMS = {'stat': 'identity', 'position': 'identity'} _aes_renames = {} _units = set() def...
Cophy08/ggplot
ggplot/geoms/geom_blank.py
Python
bsd-2-clause
363
# 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. from telemetry import benchmark from telemetry.page import page from telemetry.page import page_test from telemetry.story import story_set as story_set_module...
Chilledheart/chromium
content/test/gpu/gpu_tests/webgl_robustness.py
Python
bsd-3-clause
2,628
from __future__ import unicode_literals from django.core import serializers from django.db import connection from django.test import TestCase from .models import FKDataNaturalKey, NaturalKeyAnchor from .tests import register_tests class NaturalKeySerializerTests(TestCase): pass def natural_key_serializer_test...
loic/django
tests/serializers/test_natural.py
Python
bsd-3-clause
2,699
from nose.plugins.attrib import attr from nose.tools import eq_, ok_ from django.contrib import messages as django_messages from django.test import RequestFactory from allauth.exceptions import ImmediateHttpResponse from allauth.socialaccount.models import SocialLogin, SocialAccount from kuma.core.urlresolvers impor...
utkbansal/kuma
kuma/users/tests/test_adapters.py
Python
mpl-2.0
4,706
# Copyright (c) 2012 Rackspace Hosting # All Rights Reserved. # Copyright 2013 Red Hat, 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/license...
HybridF5/nova
nova/tests/unit/cells/test_cells_rpc_driver.py
Python
apache-2.0
8,963
# -*- coding: utf-8 -*- # Generated by Django 1.11.11 on 2018-04-15 21:49 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('addons_wiki', '0010_migrate_node_wiki_pages'), ] operations = [ migrations.RemoveF...
Johnetordoff/osf.io
addons/wiki/migrations/0011_auto_20180415_1649.py
Python
apache-2.0
590
# -*- coding: utf-8 -*- # Style_Check:Python_Fragment (meaning no pyflakes check) # # GNAT build configuration file import sys import os import time import re sys.path.append('.') import ada_pygments import latex_elements # Some configuration values for the various documentation handled by # this conf.py DOCS = { ...
Gurgel100/gcc
gcc/ada/doc/share/conf.py
Python
gpl-2.0
3,966
#! /usr/bin/env python """ this file converts simple html text into a docbook xml variant. The mapping of markups and links is far from perfect. But all we want is the docbook-to-pdf converter and similar technology being present in the world of docbook-to-anything converters. """ from datetime import date import ma...
rivimey/rwmapmaker
zziplib/docs/zzipdoc/htm2dbk.py
Python
gpl-3.0
7,044
from ..broker import Broker class JobHandlerBroker(Broker): controller = "job_handlers" def index(self, **kwargs): """Lists the available job handlers. Any of the inputs listed may be be used to narrow the list; other inputs will be ignored. Of the various ways to query lists, using this method is mo...
infobloxopen/infoblox-netmri
infoblox_netmri/api/broker/v3_8_0/job_handler_broker.py
Python
apache-2.0
46,467
from __future__ import unicode_literals import copy import sys from django.test import TestCase from rest_framework import status from rest_framework.decorators import api_view from rest_framework.response import Response from rest_framework.settings import api_settings from rest_framework.test import APIRequestFact...
callorico/django-rest-framework
tests/test_views.py
Python
bsd-2-clause
3,650
# (c) 2014, Brian Coca, Josh Drake, et al # # 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. ...
devopservices/ansible
lib/ansible/cache/jsonfile.py
Python
gpl-3.0
4,163
# # Copyright 2015 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
catapult-project/catapult-csm
third_party/google-endpoints/apitools/base/py/testing/mock.py
Python
bsd-3-clause
12,590
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.core.urlresolvers import reverse from django.views.generic import DetailView, ListView, RedirectView, UpdateView from django.contrib.auth.mixins import LoginRequiredMixin from .models import User class UserDetailView(Login...
crdoconnor/cookiecutter-django
{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/users/views.py
Python
bsd-3-clause
1,459
""" Oracle database backend for Django. Requires cx_Oracle: http://cx-oracle.sourceforge.net/ """ from __future__ import unicode_literals import datetime import decimal import os import platform import sys import warnings from django.conf import settings from django.db import utils from django.db.backends.base.base ...
oinopion/django
django/db/backends/oracle/base.py
Python
bsd-3-clause
24,986
"""AWS plugin for integration tests.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os from ..util import ( ApplicationError, display, is_shippable, ConfigParser, ) from . import ( CloudProvider, CloudEnvironment, CloudEnvironmentConfig, ...
thaim/ansible
test/lib/ansible_test/_internal/cloud/aws.py
Python
mit
3,947
"""co2_emission column added Revision ID: 2d86200bcb93 Revises: 82749d34a18 Create Date: 2014-12-30 17:23:39.654559 """ # revision identifiers, used by Alembic. revision = '2d86200bcb93' down_revision = '82749d34a18' from alembic import op import sqlalchemy as sa import geoalchemy2 as ga def upgrade(): op.add...
TeXitoi/navitia
source/sql/alembic/versions/2d86200bcb93_co2_emission_column_added.py
Python
agpl-3.0
527
import csp rgb = ['R', 'G', 'B'] domains = { 'Aosta Valley': rgb, 'Piedmont': rgb, 'Liguria': rgb, 'Lombardy': rgb, 'Trentino': rgb, 'South Tyrol': rgb, 'Veneto': rgb, 'Friuli-Venezia Giulia': rgb, 'Emilia-Romagna': rgb, 'Tuscany': rgb, 'Umbria': rgb, 'Marche': rgb, ...
armadill-odyssey/aima-python
submissions/Dickenson/myCSPs.py
Python
mit
1,998
import sys import mimetypes basedir = sys.argv[1] mimetypes.init() def application(environ, start_response): filename = basedir + environ['PATH_INFO'] (content_type, encoding) = mimetypes.guess_type(filename) if not content_type: content_type = 'text/plain' start_response('200 OK', [('Conte...
goal/uwsgi
tests/fileserve_async.py
Python
gpl-2.0
427
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2013, 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...
Lilykos/invenio
invenio/modules/jsonalchemy/jsonext/engines/sqlalchemy.py
Python
gpl-2.0
5,159
#!/usr/bin/python # Copyright: (c) Vincent Van de Kussen # 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', 'status': ['pr...
Jorge-Rodriguez/ansible
lib/ansible/modules/packaging/os/rhn_channel.py
Python
gpl-3.0
4,499
# Copyright 2014 Netflix, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
Dklotz-Circle/security_monkey
security_monkey/common/route53.py
Python
apache-2.0
3,538
#!/usr/bin/python # Copyright 2016 Red Hat | Ansible # 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', 'status': ['previe...
s-hertel/ansible
test/support/integration/plugins/modules/docker_swarm.py
Python
gpl-3.0
24,565
# 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...
strint/tensorflow
tensorflow/python/kernel_tests/array_ops_test.py
Python
apache-2.0
37,359
# coding=utf-8 from __future__ import unicode_literals from .. import Provider as BaseProvider # Ukrainian job names taken from # https://uk.wikipedia.org/wiki/%D0%A1%D0%BF%D0%B8%D1%81%D0%BE%D0%BA_%D0%BF%D1%80%D0%BE%D1%84%D0%B5%D1%81%D1%96%D0%B9 # on 22th September 2014 class Provider(BaseProvider): jobs = [ ...
Nebucatnetzer/tamagotchi
pygame/lib/python3.4/site-packages/faker/providers/job/uk_UA/__init__.py
Python
gpl-2.0
4,166
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. from .line import LineVisual # noqa from .arrow import ArrowVisual # noqa
ghisvail/vispy
vispy/visuals/line/__init__.py
Python
bsd-3-clause
221
__author__="Sergey Karakovskiy" __date__ ="$Mar 18, 2010 10:48:28 PM$" class Inspectable(object): """ All derived classes gains the ability to print the names and values of all their fields""" def __repr__(self): return '<%s: %s>' % (self.__class__.__name__, dict([(x,y) for (x,y) in self.__...
zerg000000/mario-ai
src/main/java/amico/python/agents/evaluationinfo.py
Python
bsd-3-clause
1,575
import json import pytest from units.compat import mock from ansible.modules.remote_management.lxca import lxca_nodes from ansible.module_utils.remote_management.lxca.common import setup_conn from ansible.module_utils.remote_management.lxca.common import close_conn @pytest.fixture(scope='module') @mock.patch("ansibl...
thaim/ansible
test/units/modules/remote_management/lxca/test_lxca_nodes.py
Python
mit
4,734
import pytest from pybind11_tests import local_bindings as m def test_load_external(): """Load a `py::module_local` type that's only registered in an external module""" import pybind11_cross_module_tests as cm assert m.load_external1(cm.ExternalType1(11)) == 11 assert m.load_external2(cm.ExternalTyp...
google/aistreams
third_party/pybind11/tests/test_local_bindings.py
Python
apache-2.0
7,779
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2012 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) a...
Panos512/invenio
modules/miscutil/lib/upgrades/invenio_2012_11_04_circulation_and_linkback_updates.py
Python
gpl-2.0
4,682
from twisted.trial import unittest from twisted.python.failure import Failure from twisted.internet import reactor from twisted.internet.defer import Deferred, inlineCallbacks from twisted.python import log as txlog from scrapy.http import Request, Response from scrapy.spider import BaseSpider from scrapy.utils.reques...
waseem18/oh-mainline
vendor/packages/scrapy/scrapy/tests/test_pipeline_media.py
Python
agpl-3.0
10,726
#!/usr/bin/env python traindat = '../data/fm_train_real.dat' testdat = '../data/fm_test_real.dat' parameter_list = [[traindat,testdat,2,10], [traindat,testdat,5,10]] def kernel_anova_modular (train_fname=traindat,test_fname=testdat,cardinality=2, size_cache=10): from modshogun import ANOVAKernel,RealFeatures,CSVFile ...
c4goldsw/shogun
examples/undocumented/python_modular/kernel_anova_modular.py
Python
gpl-3.0
717
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
mohittahiliani/tcp-eval-suite-ns3
src/nix-vector-routing/bindings/modulegen__gcc_LP64.py
Python
gpl-2.0
373,845
from boto.resultset import ResultSet class Template: def __init__(self, connection=None): self.connection = connection self.description = None self.template_parameters = None def startElement(self, name, attrs, connection): if name == "Parameters": self.template_par...
kumar303/rockit
vendor-local/boto/cloudformation/template.py
Python
bsd-3-clause
1,318