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 |
|---|---|---|---|---|---|
#!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# This module 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 late... | emersonsoftware/ansiblefork | lib/ansible/modules/cloud/openstack/os_port.py | Python | gpl-3.0 | 12,587 |
# -*- 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... | jmesteve/saas3 | openerp/addons/hr_contract/hr_contract.py | Python | agpl-3.0 | 4,997 |
"""
Stub implementation of LTI Provider.
What is supported:
------------------
1.) This LTI Provider can service only one Tool Consumer at the same time. It is
not possible to have this LTI multiple times on a single page in LMS.
"""
from uuid import uuid4
import textwrap
import urllib
import re
from oauthlib.oauth... | wwj718/ANALYSE | common/djangoapps/terrain/stubs/lti.py | Python | agpl-3.0 | 12,436 |
# -*- coding: utf-8 -*-
import json
import re
import unicodedata
import string
from urllib import urlencode
from requests import get
languages = {'de', 'en', 'es', 'fr', 'hu', 'it', 'nl', 'jp'}
url_template = 'https://www.wikidata.org/w/api.php?action=wbgetentities&format=json&{query}&props=labels%7Cdatatype%7Cclai... | kdani3/searx | utils/fetch_currencies.py | Python | agpl-3.0 | 4,394 |
# Copyright (C) 2015 The Debsources developers <info@sources.debian.net>.
# See the AUTHORS file at the top-level directory of this distribution and at
# https://anonscm.debian.org/gitweb/?p=qa/debsources.git;a=blob;f=AUTHORS;hb=HEAD
#
# This file is part of Debsources. Debsources is free software: you can
# redistrib... | vivekanand1101/debsources | debsources/app/sources/__init__.py | Python | agpl-3.0 | 1,057 |
from PySide.QtCore import *
from PySide.QtGui import *
import unittest
class MyModel (QAbstractListModel):
stupidLine = QLine(0, 0, 10, 10)
def rowCount(self, parent):
return 1
def data(self, index, role):
return self.stupidLine
class TestBug693(unittest.TestCase):
def testIt(self)... | enthought/pyside | tests/QtGui/bug_693.py | Python | lgpl-2.1 | 670 |
# Copyright 2020 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... | tensorflow/tensorflow | tensorflow/core/platform/ram_file_system_test.py | Python | apache-2.0 | 5,699 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Script to run the tests."""
from __future__ import print_function
import sys
import unittest
# Change PYTHONPATH to include dependencies.
sys.path.insert(0, '.')
import utils.dependencies # pylint: disable=wrong-import-position
if __name__ == '__main__':
print('... | log2timeline/dfwinreg | run_tests.py | Python | apache-2.0 | 1,027 |
#!/usr/bin/env python
import time
from concurrent.futures import ThreadPoolExecutor
from eucaops import Eucaops
from eucaops import S3ops
from eutester.eutestcase import EutesterTestCase
class WalrusConcurrent(EutesterTestCase):
def __init__(self):
self.setuptestcase()
self.setup_parser()
s... | nagyistoce/eutester | testcases/cloud_user/s3/walrus_concurrency.py | Python | bsd-2-clause | 2,530 |
#
# Copyright (c) 2005
# The President and Fellows of Harvard College.
#
# 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... | jf87/smap | python/tinyos/__init__.py | Python | bsd-2-clause | 1,659 |
#!/usr/bin/env vpython
# Copyright 2016 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.
"""A script to recover devices in a known bad state."""
import argparse
import glob
import logging
import os
import signal
import sys
... | catapult-project/catapult | devil/devil/android/tools/device_recovery.py | Python | bsd-3-clause | 9,284 |
from hamcrest.core.base_matcher import BaseMatcher
from hamcrest.core.helpers.hasmethod import hasmethod
from hamcrest.core.helpers.wrap_matcher import wrap_matcher
__author__ = "Jon Reid"
__copyright__ = "Copyright 2011 hamcrest.org"
__license__ = "BSD, see License.txt"
class IsDictContainingEntries(BaseMatcher):
... | msabramo/PyHamcrest | src/hamcrest/library/collection/isdict_containingentries.py | Python | bsd-3-clause | 5,168 |
# 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.
"""GYP backend that generates Eclipse CDT settings files.
This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML
files that can be importe... | jamfang/Agora-WebRTC-Live-Broadcasting-Demo | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py | Python | mit | 17,013 |
"""
Downloads bootloader content for all arches for when the user doesn't want to supply their own.
Copyright 2009, Red Hat, Inc
Michael DeHaan <mdehaan@redhat.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 Softwa... | elsonrodriguez/madhatter | cobbler/action_dlcontent.py | Python | gpl-2.0 | 2,907 |
#
# The patch applied in http://bugs.python.org/issue1207589
# changes the structure of rmenu_specs in EditorWindow.py. This breaks a lot of extensions.
# This file is a re-factoring of rmenu code for other extensions to use.
#
| technologiescollege/Blockly-rduino-communication | scripts_XP/Lib/site-packages/idlexlib/extensions/_rmenu.py | Python | gpl-3.0 | 231 |
"""
Default settings for the ``mezzanine.generic`` app. Each of these can be
overridden in your project's settings module, just like regular
Django settings. The ``editable`` argument for each controls whether
the setting is editable via Django's admin.
Thought should be given to how a setting is actually used before
... | orlenko/bccf | src/mezzanine/generic/defaults.py | Python | unlicense | 4,223 |
import glob
import logging
import os
from typing import Any, Dict, List, Optional
from django.conf import settings
from zerver.lib.storage import static_path
# See https://jackstromberg.com/2013/01/useraccountcontrol-attributeflag-values/
# for docs on what these values mean.
LDAP_USER_ACCOUNT_CONTROL_NORMAL = "512"... | rht/zulip | zerver/lib/dev_ldap_directory.py | Python | apache-2.0 | 3,149 |
# Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Add CycleTaskGroupObject.object
Revision ID: 26d9c9c91542
Revises: 19a67dc67c3
Create Date: 2014-07-15 21:49:34.073412
"""
# revision identifiers, used by Alembic.
revision = '26d9c9c91542'
down_revis... | VinnieJohns/ggrc-core | src/ggrc_workflows/migrations/versions/20140715214934_26d9c9c91542_add_cycletaskgroupobject_object.py | Python | apache-2.0 | 1,141 |
# Copyright 2017 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,... | shashankrajput/seq2seq | seq2seq/test/attention_test.py | Python | apache-2.0 | 3,532 |
# 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... | ghchinoy/tensorflow | tensorflow/python/grappler/layout_optimizer_test.py | Python | apache-2.0 | 60,128 |
"""Support for switches through the SmartThings cloud API."""
from __future__ import annotations
from collections.abc import Sequence
from pysmartthings import Capability
from homeassistant.components.switch import SwitchEntity
from . import SmartThingsEntity
from .const import DATA_BROKERS, DOMAIN
async def asyn... | jawilson/home-assistant | homeassistant/components/smartthings/switch.py | Python | apache-2.0 | 1,911 |
#!/usr/bin/env python
"""
split_file.py [-o <dir>] <path>
Take the file at <path> and write it to multiple files, switching to a new file
every time an annotation of the form "// BEGIN file1.swift" is encountered. If
<dir> is specified, place the files in <dir>; otherwise, put them in the
current directory.
"""
impo... | khizkhiz/swift | utils/split_file.py | Python | apache-2.0 | 1,030 |
#!/usr/bin/env python
##
# OOIPLACEHOLDER
#
# Copyright 2014 Raytheon Co.
##
from mi.core.log import get_logger
from mi.core.versioning import version
from mi.dataset.dataset_driver import DataSetDriver
from mi.dataset.dataset_parser import DataSetDriverConfigKeys
from mi.dataset.parser.mmp_cds_base import MmpCdsParse... | janeen666/mi-instrument | mi/dataset/driver/dosta_abcdjm/mmp_cds/dosta_abcdjm_mmp_cds_recovered_driver.py | Python | bsd-2-clause | 1,067 |
# $Id$
from module_base import ModuleBase
from module_mixins import FilenameViewModuleMixin
import module_utils
import vtk
class stlWRT(FilenameViewModuleMixin, ModuleBase):
def __init__(self, module_manager):
# call parent constructor
ModuleBase.__init__(self, module_manager)
# need to... | nagyistoce/devide | modules/writers/stlWRT.py | Python | bsd-3-clause | 2,674 |
__version__=''' $Id'''
__doc__='''basic tests.'''
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, printLocation
setOutDir(__name__)
import unittest
def getrc(defns,depth=1):
from sys import getrefcount, _getframe
f = _getframe(depth)
G0 = f.f_globals
L = f.f_locals
if L is not G... | mattjmorrison/ReportLab | tests/test_rl_accel.py | Python | bsd-3-clause | 6,284 |
"""
Create SQL statements for QuerySets.
The code in here encapsulates all of the SQL construction so that QuerySets
themselves do not have to (and could be backed by things other than SQL
databases). The abstraction barrier only works one way: this module has to know
all about the internals of models in order to get ... | gannetson/django | django/db/models/sql/query.py | Python | bsd-3-clause | 92,461 |
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
def register_types(module):
root_module = module.get_root()
## ipv4-nix-vector-routing.h: ns3::Ipv4NixVectorRouting [class]
module.add_class('Ipv4NixVectorRouting', parent=root_module['ns3::Ipv4RoutingProtocol'])
typ... | annegabrielle/secure_adhoc_network_ns-3 | ns3_source_code/ns-3.10/bindings/python/apidefs/gcc-LP64/ns3_module_nix_vector_routing.py | Python | gpl-2.0 | 11,439 |
# -*- coding: utf-8 -*-
from ..internal.XFSAccount import XFSAccount
class ExashareCom(XFSAccount):
__name__ = "ExashareCom"
__type__ = "account"
__version__ = "0.06"
__status__ = "testing"
__description__ = """Exashare.com account plugin"""
__license__ = "GPLv3"
__authors__ = [("Walter ... | Arno-Nymous/pyload | module/plugins/accounts/ExashareCom.py | Python | gpl-3.0 | 388 |
# This file is part of OpenHatch.
# Copyright (C) 2010 Parker Phinney
# Copyright (C) 2010 Jack Grigg
# Copyright (C) 2011 Krzysztof Tarnowski (krzysztof.tarnowski@ymail.com)
# Copyright (C) 2009, 2010, 2011 OpenHatch, Inc.
# Copyright (C) 2011 Jairo E. Lopez
#
# This program is free software: you can redistribute it a... | nirmeshk/oh-mainline | mysite/base/tests.py | Python | agpl-3.0 | 25,144 |
"""
* Copyright 2007 Google Inc.
# Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
*
* 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.... | spaceone/pyjs | pyjswidgets/pyjamas/ui/RichTextAreaConsts.py | Python | apache-2.0 | 998 |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | peterbraden/tensorflow | tensorflow/python/platform/logging_test.py | Python | apache-2.0 | 1,121 |
#
# 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... | mxm/incubator-beam | sdks/python/apache_beam/runners/test/__init__.py | Python | apache-2.0 | 1,360 |
"""
Preview Browser Widget.
"""
from xml.sax.saxutils import escape
from PyQt4.QtGui import (
QWidget, QLabel, QListView, QAction, QVBoxLayout, QHBoxLayout, QSizePolicy,
QStyleOption, QStylePainter
)
from PyQt4.QtSvg import QSvgWidget
from PyQt4.QtCore import (
Qt, QSize, QByteArray, QModelIndex, QEven... | marinkaz/orange3 | Orange/canvas/preview/previewbrowser.py | Python | bsd-2-clause | 10,352 |
# -*- coding: utf-8 -*-
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Robert Layton <robertlayton@gmail.com>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Philippe Gervais <philippe.gervais@inria.fr>
# Lars Buitinck
... | herilalaina/scikit-learn | sklearn/metrics/pairwise.py | Python | bsd-3-clause | 46,964 |
# Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of so... | js0701/chromium-crosswalk | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py | Python | bsd-3-clause | 27,322 |
#!/usr/bin/env python
"""Renames *.py files to *.py.park."""
import os
import sys
def main():
"""Drives the main script behavior."""
script_dir = os.path.dirname(os.path.realpath(__file__))
for filename in os.listdir(script_dir):
basename, extension = os.path.splitext(filename)
if basename... | endlessm/chromium-browser | third_party/llvm/lldb/test/API/issue_verification/disable.py | Python | bsd-3-clause | 656 |
MAX_SCORE = 10
class ParsedValue():
"""
Possible run-time value.
The value data might either be definite or guessed.
"""
def __init__(self, data, description, score=0, raw=None, type_=None):
"""
Ctor
@param data: The data`s human-readable representation.
@param d... | xujun10110/DIE | DIE/Lib/ParsedValue.py | Python | mit | 1,350 |
import pytest
from .utils import *
import psi4
from qcengine.testing import using
@pytest.mark.parametrize('engine', [
pytest.param('optking'),
pytest.param('geometric', marks=using('geometric')),
]) # yapf: disable
@pytest.mark.parametrize('inp', [
pytest.param({'name': 'hf', 'options': {'scf_type': '... | ashutoshvt/psi4 | tests/pytests/test_geometric.py | Python | lgpl-3.0 | 3,139 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache/incubator-airflow | tests/providers/google/cloud/operators/test_workflows.py | Python | apache-2.0 | 12,510 |
import unittest, time, sys
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
# assume we're at 0xdata with it's hdfs namenod... | rowhit/h2o-2 | py/testdir_0xdata_only/test_hdfs_multi_copies.py | Python | apache-2.0 | 1,029 |
# 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... | karllessard/tensorflow | tensorflow/python/data/experimental/ops/parsing_ops.py | Python | apache-2.0 | 7,348 |
"""The tests for the google calendar component."""
# pylint: disable=protected-access
import logging
import unittest
from unittest.mock import patch, Mock
import pytest
import homeassistant.components.calendar as calendar_base
from homeassistant.components.google import calendar
import homeassistant.util.dt as dt_uti... | PetePriority/home-assistant | tests/components/google/test_calendar.py | Python | apache-2.0 | 16,362 |
import unittest, time, sys
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_glm, h2o_import as h2i
params = {
'response': 1049,
'family': 'binomial',
'beta_epsilon': 0.0001,
'alpha': 1.0,
'lambda': 1e-05,
'n_folds': 1,
'max_iter': 20,
}
class Basic(unittest.TestCase):... | 111t8e/h2o-2 | py/testdir_single_jvm/test_GLM2_syn_2659x1049.py | Python | apache-2.0 | 1,417 |
#
# 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... | wtanaka/beam | sdks/python/apache_beam/version.py | Python | apache-2.0 | 870 |
# 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... | tensorflow/tensorflow | tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py | Python | apache-2.0 | 39,529 |
# Author: Mathieu Blondel <mathieu@mblondel.org>
# License: BSD 3 clause
import time
import matplotlib.pyplot as plt
from sklearn.utils import check_random_state
from sklearn.metrics.pairwise import pairwise_distances
from sklearn.metrics.pairwise import pairwise_kernels
def plot(func):
random_state = check_ran... | manhhomienbienthuy/scikit-learn | benchmarks/bench_plot_parallel_pairwise.py | Python | bsd-3-clause | 1,272 |
#!/usr/bin/env python
'''relay handling module'''
import time
from pymavlink import mavutil
from MAVProxy.modules.lib import mp_module
class RelayModule(mp_module.MPModule):
def __init__(self, mpstate):
super(RelayModule, self).__init__(mpstate, "relay")
self.add_command('relay', self.cmd_relay, "... | fqez/JdeRobot | src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_relay.py | Python | gpl-3.0 | 3,625 |
#!/usr/bin/python
# -*- coding: utf8 -*-
from report_aeroo.ctt_objects import ctt_currency
class trl(ctt_currency):
def _init_currency(self):
self.language = u'tr_TR'
self.code = u'TRL'
self.fractions = 100
self.cur_singular = u' Lira'
# default plural form for currency
... | dhp-denero/LibrERP | report_aeroo/ctt_languages/tr_TR/currencies/trl.py | Python | agpl-3.0 | 623 |
# 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 ... | sgammon/libcloud | libcloud/compute/drivers/gandi.py | Python | apache-2.0 | 20,171 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013, Mirantis 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
#
#... | Havate/havate-openstack | proto-build/gui/horizon/Horizon_GUI/openstack_dashboard/dashboards/project/vpn/urls.py | Python | apache-2.0 | 1,933 |
import calendar
import time
from email.utils import formatdate, parsedate, parsedate_tz
from datetime import datetime, timedelta
TIME_FMT = "%a, %d %b %Y %H:%M:%S GMT"
def expire_after(delta, date=None):
date = date or datetime.utcnow()
return date + delta
def datetime_to_header(dt):
return formatdat... | kushalbhola/MyStuff | venv/Lib/site-packages/pip/_vendor/cachecontrol/heuristics.py | Python | apache-2.0 | 4,144 |
"""Support for MySensors binary sensors."""
from homeassistant.components import mysensors
from homeassistant.components.binary_sensor import (
DEVICE_CLASSES, DOMAIN, BinarySensorDevice)
from homeassistant.const import STATE_ON
SENSORS = {
'S_DOOR': 'door',
'S_MOTION': 'motion',
'S_SMOKE': 'smoke',
... | jnewland/home-assistant | homeassistant/components/mysensors/binary_sensor.py | Python | apache-2.0 | 1,398 |
# sql/crud.py
# Copyright (C) 2005-2016 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
"""Functions used by compiler.py to determine the parameters rendered
within INSERT and ... | pcu4dros/pandora-core | workspace/lib/python3.5/site-packages/sqlalchemy/sql/crud.py | Python | mit | 24,802 |
from gen import *
##########
# shared #
##########
flow_var[0] = """
(declare-fun tau () Real)
(declare-fun x1 () Real)
(declare-fun x2 () Real)
(declare-fun x3 () Real)
"""
flow_dec[0] = """
(define-ode flow_1 ((= d/dt[x1] (/ (- 5 (* (* 0.5 (^ (* 2 9.80665) 0.5)) (^ x1 0.5))) 2))
(= d/dt[x2] (... | wolvre/dreal | benchmarks/network/water/water-triple-ind.py | Python | gpl-2.0 | 6,830 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
# (c) 2014, Ahti Kitsik <ak@ahtik.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 S... | chrismeyersfsu/ansible-modules-core | files/lineinfile.py | Python | gpl-3.0 | 15,603 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Matt Martz <matt@sivel.net>
#
# 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'... | roadmapper/ansible | lib/ansible/modules/cloud/vmware/vmware_deploy_ovf.py | Python | gpl-3.0 | 22,956 |
# 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... | vijaykumar0690/security_monkey | security_monkey/watchers/security_group.py | Python | apache-2.0 | 8,192 |
#!/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 ***
#
... | caphrim007/ansible | lib/ansible/modules/cloud/google/gcp_compute_ssl_policy_facts.py | Python | gpl-3.0 | 7,795 |
import utils
import os
import shutil
import sys
def go( boost_root ):
OUTPUT = "src/third_party/boost"
if os.path.exists( OUTPUT ):
shutil.rmtree( OUTPUT )
cmd = [ "bcp" , "--scan" , "--boost=%s" % boost_root ]
src = utils.getAllSourceFiles()
cmd += src
cmd.append( OUTP... | robotpilot/robomongo | src/third-party/mongodb/buildscripts/bcp.py | Python | gpl-3.0 | 824 |
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
clean_html,
determine_ext,
js_to_json,
)
class FKTVIE(InfoExtractor):
IE_NAME = 'fernsehkritik.tv'
_VALID_URL = r'http://(?:www\.)?fernsehkritik\.tv/folge-(?P<id>[0-9]+)(?:/.*)?'
_TEST = {
... | akirk/youtube-dl | youtube_dl/extractor/fktv.py | Python | unlicense | 1,557 |
from __future__ import unicode_literals
from django.db import models
from imagekit.models.fields import ProcessedImageField
from imagekit.processors import ResizeToFill
from .utils import unique_filename
class DateTimeModel(models.Model):
class Meta:
abstract = True
modified = models.DateTimeField... | beni55/pokeapi | pokemon/models.py | Python | bsd-3-clause | 11,645 |
##########################################################################
#
# Copyright (c) 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:
#
# * Redistribu... | code-google-com/cortex-vfx | test/IECore/LensDistortOpTest.py | Python | bsd-3-clause | 2,750 |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | eharney/nova | nova/db/sqlalchemy/migration.py | Python | apache-2.0 | 2,918 |
# 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 applicable ... | ml6973/Course | tf-hands-on/slim/python/slim/nets/alexnet_test.py | Python | apache-2.0 | 5,839 |
# vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | karthikvadla16/spark-tk | regression-tests/sparktkregtests/testcases/frames/frame_inspect_test.py | Python | apache-2.0 | 4,394 |
from __future__ import absolute_import
from celery import current_app
from celery.backends.base import BaseDictBackend
from celery.utils.timeutils import maybe_timedelta
from ..models import TaskMeta, TaskSetMeta
class DatabaseBackend(BaseDictBackend):
"""The database backend.
Using Django models to store ... | ChristineLaMuse/mozillians | vendor-local/lib/python/djcelery/backends/database.py | Python | bsd-3-clause | 1,952 |
from .base import BasePageTests
from django.contrib.sites.models import Site
from django.contrib.redirects.models import Redirect
class PageViewTests(BasePageTests):
def test_page_view(self):
r = self.client.get('/one/')
self.assertEqual(r.context['page'], self.p1)
# drafts are available... | lsk112233/Clone-test-repo | pages/tests/test_views.py | Python | apache-2.0 | 1,280 |
from __future__ import unicode_literals
import uuid
from django.forms import UUIDField, ValidationError
from django.test import SimpleTestCase
class UUIDFieldTest(SimpleTestCase):
def test_uuidfield_1(self):
field = UUIDField()
value = field.clean('550e8400e29b41d4a716446655440000')
sel... | filias/django | tests/forms_tests/field_tests/test_uuidfield.py | Python | bsd-3-clause | 971 |
self.description = "Backup file relocation"
lp1 = pmpkg("bash")
lp1.files = ["etc/profile*"]
lp1.backup = ["etc/profile"]
self.addpkg2db("local", lp1)
p1 = pmpkg("bash", "1.0-2")
self.addpkg(p1)
lp2 = pmpkg("filesystem")
self.addpkg2db("local", lp2)
p2 = pmpkg("filesystem", "1.0-2")
p2.files = ["etc/profile**"]
p2.... | kylon/pacman-fakeroot | test/pacman/tests/upgrade042.py | Python | gpl-2.0 | 725 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: orderer/configuration.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflec... | cophey/fabric | bddtests/orderer/configuration_pb2.py | Python | apache-2.0 | 7,996 |
# 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... | rahulunair/nova | nova/db/sqlalchemy/api_migrations/migrate_repo/versions/016_resource_providers.py | Python | apache-2.0 | 4,495 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Law.merged_into'
db.add_column('laws_law', 'merged_into', self.gf('django.db.models.fields... | livni/old-OK | src/knesset/laws/migrations/0013_add_law_merged_into.py | Python | bsd-3-clause | 20,248 |
# vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import sys
from powerline.lint.selfcheck import havemarks
class WithPath(object):
def __init__(self, import_paths):
self.import_paths = import_paths
def __enter__(self):
self.oldpath = sys.path
... | xfumihiro/powerline | powerline/lint/imp.py | Python | mit | 1,573 |
from pylab import figure,pcolor,scatter,contour,colorbar,show,subplot,plot,connect
from numpy import array,meshgrid,reshape,linspace,min,max
from numpy import concatenate,transpose,ravel
from modshogun import *
from modshogun import *
from modshogun import *
import util
util.set_title('KernelRidgeRegression')
width=2... | AzamYahya/shogun | examples/undocumented/python_modular/graphical/kernel_ridge_regression.py | Python | gpl-3.0 | 969 |
# Copyright (C) 2007-2011 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# http://www.voidspace.org.uk/python/mock/
from tests.support import unittest2, inPy3k
try:
unicode
except NameError:
# Python 3
unicode = str
long = int
import inspect
from mock import Mock, MagicM... | mzdaniel/oh-mainline | vendor/packages/mock/tests/testmagicmethods.py | Python | agpl-3.0 | 10,336 |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | ivannotes/luigi | test/namespace_test.py | Python | apache-2.0 | 1,739 |
from .provider_base import ExternalPaymentProvider
from tapiriik.database import db
from tapiriik.settings import MOTIVATO_PREMIUM_USERS_LIST_URL
import requests
class MotivatoExternalPaymentProvider(ExternalPaymentProvider):
ID = "motivato"
def RefreshPaymentStateForExternalIDs(self, external_ids):
from tapiriik... | cmgrote/tapiriik | tapiriik/payments/external/motivato.py | Python | apache-2.0 | 2,262 |
# Copyright (c) 2011 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... | harshilasu/GraphicMelon | y/google-cloud-sdk/platform/gsutil/third_party/boto/boto/dynamodb/types.py | Python | gpl-3.0 | 10,121 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you ca... | naparuba/shinken | shinken/db.py | Python | agpl-3.0 | 4,671 |
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... | 0xkag/tornado | tornado/iostream.py | Python | apache-2.0 | 59,061 |
"""
This config file extends the test environment configuration
so that we can run the lettuce acceptance tests.
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import
import os
os.environ... | angelapper/edx-platform | lms/envs/acceptance_docker.py | Python | agpl-3.0 | 2,522 |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | samuell/luigi | examples/foo.py | Python | apache-2.0 | 1,501 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
#
# This file is part of Ansible by Red Hat
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/modules/network/ios/ios_static_route.py | Python | bsd-3-clause | 7,090 |
# Copyright (c) 2005 Divmod, Inc.
# See LICENSE for details.
from twisted.trial import unittest
from twisted.python import lockfile
class LockingTestCase(unittest.TestCase):
def testBasics(self):
lockf = self.mktemp()
lock = lockfile.FilesystemLock(lockf)
self.failUnless(lock.lock())
... | UstadMobile/eXePUB | twisted/test/test_lockfile.py | Python | gpl-2.0 | 1,423 |
"""
Meteorology visualisation examples
==================================
"""
| pp-mo/iris | docs/iris/example_code/Meteorology/__init__.py | Python | lgpl-3.0 | 78 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Eric D Helms <ericdhelms@gmail.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_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version... | tersmitten/ansible | lib/ansible/modules/remote_management/foreman/_katello.py | Python | gpl-3.0 | 20,771 |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python.monkey}.
"""
from __future__ import division, absolute_import
from twisted.trial import unittest
from twisted.python.monkey import MonkeyPatcher
class TestObj:
def __init__(self):
self.foo = 'foo valu... | Architektor/PySnip | venv/lib/python2.7/site-packages/twisted/test/test_monkey.py | Python | gpl-3.0 | 5,637 |
#
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://pyasn1.sf.net/license.html
#
from pyasn1.type import univ, char, tag
__all__ = ['ObjectDescriptor', 'GeneralizedTime', 'UTCTime']
NoValue = univ.NoValue
noValue = univ.noValue
class ObjectDescri... | frerepoulet/ZeroNet | src/lib/pyasn1/type/useful.py | Python | gpl-2.0 | 1,159 |
# 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... | Mega-DatA-Lab/mxnet | example/rcnn/rcnn/tools/reeval.py | Python | apache-2.0 | 2,273 |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# 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 t... | clinton-hall/nzbToMedia | libs/common/beets/vfs.py | Python | gpl-3.0 | 1,839 |
from bar import path | siosio/intellij-community | python/testData/quickFixes/PyAddImportQuickFixTest/combinedElementOrdering/first/second/__init__.py | Python | apache-2.0 | 20 |
from __future__ import division, absolute_import, print_function
import re
import os
import sys
import warnings
import platform
import tempfile
from subprocess import Popen, PIPE, STDOUT
from numpy.distutils.fcompiler import FCompiler
from numpy.distutils.exec_command import exec_command
from numpy.distutils.misc_uti... | tdsmith/numpy | numpy/distutils/fcompiler/gnu.py | Python | bsd-3-clause | 15,266 |
self.description = "CleanMethod = KeepCurrent"
sp = pmpkg("dummy", "2.0-1")
self.addpkg2db("sync", sp)
sp = pmpkg("bar", "2.0-1")
self.addpkg2db("sync", sp)
sp = pmpkg("baz", "2.0-1")
self.addpkg2db("sync", sp)
lp = pmpkg("dummy", "1.0-1")
self.addpkg2db("local", lp)
lp = pmpkg("bar", "2.0-1")
self.addpkg2db("loca... | vodik/pacman | test/pacman/tests/clean002.py | Python | gpl-2.0 | 615 |
# 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... | ChinaMassClouds/copenstack-server | openstack/src/nova-2014.2/nova/db/sqlalchemy/migrate_repo/versions/253_add_pci_requests_to_instance_extra_table.py | Python | gpl-2.0 | 1,402 |
#!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | elkingtonmcb/nupic | tests/unit/nupic/frameworks/opf/opf_metrics_test.py | Python | agpl-3.0 | 33,254 |
#!/usr/bin/env python
# Copyright 2015 gRPC 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 applicable law o... | jboeuf/grpc | tools/run_tests/python_utils/antagonist.py | Python | apache-2.0 | 688 |
# mssql/__init__.py
# Copyright (C) 2005-2017 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
from sqlalchemy.dialects.mssql import base, pyodbc, adodbapi, \
pymssql, zxjdb... | wildchildyn/autism-website | yanni_env/lib/python3.6/site-packages/sqlalchemy/dialects/mssql/__init__.py | Python | gpl-3.0 | 1,081 |
# -*- coding: utf-8 -*-
from __future__ import with_statement
from time import sleep
from os.path import exists, join
from shutil import copy
from traceback import print_exc
from utils import chmod
# ignore these plugin configs, mainly because plugins were wiped out
IGNORE = (
"FreakshareNet", "SpeedManager", "A... | manuelm/pyload | module/ConfigParser.py | Python | gpl-3.0 | 11,895 |
# 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... | nburn42/tensorflow | tensorflow/python/ops/batch_norm_benchmark.py | Python | apache-2.0 | 10,762 |
#!/usr/bin/env python
# Copyright (c) 2014 Intel Corporation. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import optparse
import os
import re
import sys
import shutil
def DoCopy(path, target_path):
if os.path.isfile(path):
package ... | weiyirong/crosswalk-1 | build/android/merge_java_srcs.py | Python | bsd-3-clause | 2,054 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.