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
# (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or
# https://www.gnu.org/licenses/gpl-3.0.txt)
'''
Element Software Node Operation
'''
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | veger/ansible | lib/ansible/modules/storage/netapp/na_elementsw_node.py | Python | gpl-3.0 | 8,394 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
from . import SearchBa... | electrolinux/pootle | pootle/core/search/broker.py | Python | gpl-3.0 | 2,440 |
# -*- coding: utf-8 -*-
from odoo import api, fields, models, tools
from odoo.exceptions import UserError
import os
from odoo.tools import misc
import re
# 成本计算方法,已实现 先入先出
CORE_COST_METHOD = [('average', u'全月一次加权平均法'),
('std',u'定额成本'),
('fifo', u'先进先出法'),
]
... | luoguizhou/gooderp_addons | core/models/res_company.py | Python | agpl-3.0 | 2,323 |
"""
Tests for the LTI user management functionality
"""
import string
from django.contrib.auth.models import User
from django.core.exceptions import PermissionDenied
from django.test import TestCase
from django.test.client import RequestFactory
from mock import MagicMock, patch
import lti_provider.users as users
fro... | miptliot/edx-platform | lms/djangoapps/lti_provider/tests/test_users.py | Python | agpl-3.0 | 9,455 |
# Copyright (C) 2003-2009 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko 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 2.1 of the License, or (a... | reaperhulk/paramiko | tests/test_sftp_big.py | Python | lgpl-2.1 | 14,044 |
import pandas as pd
import numpy as np
import pymbar
from pymbar.testsystems.pymbar_datasets import load_gas_data, load_8proteins_data
import time
def load_oscillators(n_states, n_samples):
name = "%dx%d oscillators" % (n_states, n_samples)
O_k = np.linspace(1, 5, n_states)
k_k = np.linspace(1, 3, n_states... | kyleabeauchamp/pymbar | scripts/benchmark_covariance.py | Python | lgpl-2.1 | 2,091 |
# -*- coding: utf-8 -*-
#
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Flex compatibility tests.
@since: 0.1.0
"""
import unittest
import pyamf
from pyamf import flex, util, amf3, amf0
from pyamf.tests.util import EncoderMixIn
class ArrayCollectionTestCase(unittest.TestCase, EncoderMixIn)... | ProfessionalIT/professionalit-webiste | sdk/google_appengine/lib/PyAMF-0.7.2/pyamf/tests/test_flex.py | Python | lgpl-3.0 | 7,175 |
""" Python Character Mapping Codec iso8859_1 generated from 'MAPPINGS/ISO8859/8859-1.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='... | lfcnassif/MultiContentViewer | release/modules/ext/libreoffice/program/python-core-3.3.0/lib/encodings/iso8859_1.py | Python | lgpl-3.0 | 13,225 |
# Copyright 2015 TellApart, 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 writi... | WiserTogether/aurproxy | tellapart/aurproxy/share/adjusters/ramp.py | Python | apache-2.0 | 2,700 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Ver... | sparkslabs/kamaelia_ | Sketches/MPS/BugReports/FixTests/Kamaelia/Examples/Backplane/Forwarding.py | Python | apache-2.0 | 1,406 |
# 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... | tensorflow/tensorflow | tensorflow/python/distribute/multi_worker_util_test.py | Python | apache-2.0 | 9,133 |
# __init__.py is a special Python file that allows a directory to become
# a Python package so it can be accessed using the 'import' statement.
| xke/nash | app/__init__.py | Python | bsd-2-clause | 145 |
import sys
tests=[
("testExecs/testFeatures.exe","",{}),
]
longTests=[
]
if __name__=='__main__':
import sys
from rdkit import TestRunner
failed,tests = TestRunner.RunScript('test_list.py',0,1)
sys.exit(len(failed))
| soerendip42/rdkit | Code/Features/test_list.py | Python | bsd-3-clause | 233 |
import re
import os
from autotest.client.shared import error
from virttest import virsh
from provider import libvirt_version
def run(test, params, env):
"""
Test command: virsh net-list.
The command returns list of networks.
1.Get all parameters from configuration.
2.Get current network's status(... | will-Do/tp-libvirt_v2v | libvirt/tests/src/virsh_cmd/network/virsh_net_list.py | Python | gpl-2.0 | 6,096 |
# See utils/checkpackagelib/readme.txt before editing this file.
# There are already dependency checks during the build, so below check
# functions don't need to check for things already checked by exploring the
# menu options using "make menuconfig" and by running "make" with appropriate
# packages enabled.
import re... | uniphier/buildroot-unph | utils/checkpackagelib/lib_mk.py | Python | gpl-2.0 | 11,938 |
#!/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 distribut... | KMK-ONLINE/ansible-modules-core | network/openswitch/ops_config.py | Python | gpl-3.0 | 7,945 |
# vi: ts=4 expandtab
#
# Copyright (C) 2009-2010 Canonical Ltd.
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
#
# Author: Scott Moser <scott.moser@canonical.com>
# Author: Juerg Haefliger <juerg.haefliger@hp.com>
#
# This program is free software: you can redistribute it and/or modify
# ... | racker/cloud-init-debian-pkg | cloudinit/config/cc_puppet.py | Python | gpl-3.0 | 5,166 |
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import re
from ansible import constants as C
from ansible.... | ganeshrn/ansible | lib/ansible/vars/clean.py | Python | gpl-3.0 | 6,161 |
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... | le9i0nx/ansible | test/units/modules/network/mlnxos/mlnxos_module.py | Python | gpl-3.0 | 2,693 |
#!/usr/bin/env python
"""
Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
from lib.core.exception import SqlmapUnsupportedFeatureException
from plugins.generic.filesystem import Filesystem as GenericFilesystem
class Filesystem(GenericFilesystem):
... | goofwear/raspberry_pwn | src/pentest/sqlmap/plugins/dbms/oracle/filesystem.py | Python | gpl-3.0 | 792 |
#!/usr/bin/env python2
import config
import comm
import sys
import time
import signal
from jderobotTypes import BumperData
if __name__ == '__main__':
cfg = config.load(sys.argv[1])
jdrc= comm.init(cfg, "Test")
client = jdrc.getBumperClient("Test.Bumper")
while True:
#print("client1", end... | fqez/JdeRobot | src/libs/comm_py/tests/testBumper.py | Python | gpl-3.0 | 501 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import unittest
from cert import test_user_agent
class Logger(object):
"""Dummy logger"""
def test_status(this,... | mozilla-b2g/fxos-certsuite | mcts/certsuite/test_cert.py | Python | mpl-2.0 | 2,006 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, cint
from frappe import throw, _
from frappe.model.document import Document
class RootNotEditable(frappe.V... | hatwar/buyback-erpnext | erpnext/accounts/doctype/account/account.py | Python | agpl-3.0 | 8,576 |
# Copyright 2015 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/LICENSE-2.... | coreycb/horizon | openstack_dashboard/test/integration_tests/tests/test_floatingips.py | Python | apache-2.0 | 4,543 |
import pytest
from api.base.settings.defaults import API_BASE
from api_tests.nodes.views.test_node_institutions_list import TestNodeInstitutionList
from osf_tests.factories import DraftRegistrationFactory, AuthUserFactory
@pytest.fixture()
def user():
return AuthUserFactory()
@pytest.fixture()
def user_two():
... | mfraezz/osf.io | api_tests/draft_registrations/views/test_draft_registration_institutions_list.py | Python | apache-2.0 | 2,214 |
# Copyright 2012 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 applicable law... | gtest-org/test10 | jenkins_jobs/modules/zuul.py | Python | apache-2.0 | 6,120 |
# Copyright (C) 2017 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Rename admin role from gGRC Admin to Administrator.
Create Date: 2016-06-03 12:02:09.438599
"""
from alembic import op
import sqlalchemy as sa
from sqlalch... | VinnieJohns/ggrc-core | src/ggrc_basic_permissions/migrations/versions/20160603120209_c9218e757bc_rename_admin_role_from_ggrc_admin_to_.py | Python | apache-2.0 | 1,169 |
"""Python AST pretty-printer.
Copyright(C) 2007, Martin Blais <blais@furius.ca>
This module exports a function that can be used to print a human-readable
version of the AST.
This code is downloaded verbatim from:
http://code.activestate.com/recipes/533146/
"""
__author__ = 'Martin Blais <blais@furius.ca>'
impo... | minghuascode/pyj | pyjs/src/pyjs/lib_trans/pycompiler/astpprint.py | Python | apache-2.0 | 2,379 |
# 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 ... | dims/nova | nova/cmd/api_metadata.py | Python | apache-2.0 | 1,706 |
###############################################################################
##
## Copyright 2011,2012 Tavendo GmbH
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http:... | normanmaurer/autobahntestsuite-maven-plugin | src/main/resources/autobahntestsuite/wamptestserver.py | Python | apache-2.0 | 7,727 |
#!/usr/bin/env python
# Copyright 2015 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... | cncf/cross-cloud | validate-cluster/cluster/juju/layers/kubernetes-worker/reactive/kubernetes_worker.py | Python | apache-2.0 | 36,222 |
# 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 ... | airbnb/kafka | tests/kafkatest/services/monitor/jmx.py | Python | apache-2.0 | 5,768 |
from __future__ import unicode_literals
def device_from_request(request):
"""
Determine's the device name from the request by first looking for an
overridding cookie, and if not found then matching the user agent.
Used at both the template level for choosing the template to load and
also at the ca... | TecnoSalta/bg | mezzanine/utils/device.py | Python | bsd-2-clause | 2,013 |
import unittest
import numpy as np
import pysal
import pysal.spreg as EC
from scipy import sparse
from pysal.common import RTOL
PEGP = pysal.examples.get_path
class TestBaseOLS(unittest.TestCase):
def setUp(self):
db = pysal.open(PEGP('columbus.dbf'),'r')
y = np.array(db.by_col("HOVAL"))
s... | TaylorOshan/pysal | pysal/spreg/tests/test_ols_sparse.py | Python | bsd-3-clause | 4,960 |
class Foo(object):
def mm(self, barparam):
'''
@param barparam: this is barparam
'''
f = Foo()
f.mm(barparam=10)
| aptana/Pydev | tests/com.python.pydev.refactoring.tests/src/pysrcrefactoring/reflib/renameparameter/methoddef2.py | Python | epl-1.0 | 145 |
#!/usr/bin/python
# Copyright: Ansible Project
# 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.0',
'status': ['preview'],
... | bearstech/ansible | lib/ansible/modules/cloud/google/gce_instance_template.py | Python | gpl-3.0 | 19,122 |
"""
Build the zipped robofab + dependency distros for RoboFab.
Check out fresh copies of the code from SVN.
Compile into zips.
Write optional html page.
"""
import os, glob, time
def getRevision(url):
""" Ask svn for the revision."""
cmd = "svn info \"%s\""%url
d = os.popen(cmd... | schriftgestalt/robofab | Tools/buildRoboFabDistroFromSVN.py | Python | bsd-3-clause | 5,807 |
# stdlib
from collections import namedtuple
# project
from resources import (
agg,
ResourcePlugin,
SnapshotDescriptor,
SnapshotField,
)
from utils.subprocess_output import get_subprocess_output
class Processes(ResourcePlugin):
RESOURCE_KEY = "processes"
FLUSH_INTERVAL = 1 # in minutes
... | huhongbo/dd-agent | resources/processes.py | Python | bsd-3-clause | 3,086 |
'''tzinfo timezone information for Africa/Accra.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Accra(DstTzInfo):
'''Africa/Accra timezone definition. See datetime.tzinfo for details'''
zone = 'Africa/Accra'
_utc_tr... | newvem/pytz | pytz/zoneinfo/Africa/Accra.py | Python | mit | 1,008 |
#!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, Benno Joy <benno@ansible.com>
#
# 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 later ... | cchurch/ansible-modules-core | cloud/openstack/_quantum_network.py | Python | gpl-3.0 | 10,283 |
from osv import osv, fields
class html_view(osv.osv):
_name = 'html.view'
_columns = {
'name': fields.char('Name', size=128, required=True, select=True),
'comp_id': fields.many2one('res.company', 'Company', select=1),
'bank_ids': fields.one2many('res.partner.bank', 'partner_id', 'Bank... | crmccreary/openerp_server | openerp/addons/html_view/html_view.py | Python | agpl-3.0 | 415 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016-2017 Ircam
# Copyright (c) 2016-2017 Guillaume Pellerin
# Copyright (c) 2016-2017 Emilie Zawadzki
# This file is part of mezzanine-organization.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | Ircam-Web/mezzanine-organization | organization/shop/management/commands/__init__.py | Python | agpl-3.0 | 846 |
# 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 re
import signal
import subprocess
import sys
import tempfile
from telemetry.core import platform
from telemetry.core import... | chromium2014/src | tools/telemetry/telemetry/core/platform/profiler/perf_profiler.py | Python | bsd-3-clause | 8,787 |
# -*- coding: utf-8 -*-
# -*- coding: utf8 -*-
"""Autogenerated file - DO NOT EDIT
If you spot a bug, please report it on the mailing list and/or change the generator."""
import os
from ....base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine,
TraitedSpec, File, Directory, traits, ... | carolFrohlich/nipype | nipype/interfaces/semtools/diffusion/tractography/commandlineonly.py | Python | bsd-3-clause | 1,894 |
from django.contrib.auth import get_user, get_user_model
from django.contrib.auth.models import AnonymousUser, User
from django.core.exceptions import ImproperlyConfigured
from django.db import IntegrityError
from django.http import HttpRequest
from django.test import TestCase, override_settings
from django.utils impor... | edmorley/django | tests/auth_tests/test_basic.py | Python | bsd-3-clause | 5,627 |
#!/usr/bin/env python
# Copyright 2020 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.
"""
Unit tests for generator_utils.py
"""
import os
import unittest
import generator_utils
# Absolute path to chrome/src.
SCRIPT_DIR =... | chromium/chromium | tools/traffic_annotation/scripts/generator_utils_tests.py | Python | bsd-3-clause | 5,005 |
"""
The `compat` module provides support for backwards compatibility with older
versions of Django/Python, and compatibility wrappers around optional packages.
"""
# flake8: noqa
from __future__ import unicode_literals
import inspect
import django
from django.apps import apps
from django.conf import settings
from dj... | steventimberman/masterDebater | venv/lib/python2.7/site-packages/rest_framework/compat.py | Python | mit | 10,280 |
#!/usr/bin env python
from tests.unit import unittest
from httpretty import HTTPretty
import urlparse
import json
import mock
import requests
from boto.cloudsearch.search import SearchConnection, SearchServiceException
HOSTNAME = "search-demo-userdomain.us-east-1.cloudsearch.amazonaws.com"
FULL_URL = 'http://%s/201... | harshilasu/LinkurApp | y/google-cloud-sdk/platform/gsutil/third_party/boto/tests/unit/cloudsearch/test_search.py | Python | gpl-3.0 | 13,603 |
# 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... | cg31/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/operator_pd_full_test.py | Python | apache-2.0 | 2,294 |
# ----------------------------------------------------------------------------
# Copyright 2015 Nervana Systems Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.o... | SalemAmeen/neon | tests/test_linear_layer.py | Python | apache-2.0 | 6,132 |
#!/usr/bin/python
import sys
import btceapi
# This sample shows use of a KeyHandler. For each API key in the file
# passed in as the first argument, all pending orders for the specified
# pair and type will be canceled.
if len(sys.argv) < 4:
print "Usage: cancel_orders.py <key file> <pair> <order type>"
pri... | blorenz/btce-api | samples/cancel-orders.py | Python | mit | 1,343 |
#!/usr/bin/env python
#
# Perform the following tests:
# 1. Generate a POT file from a set of marked SQL statements
# 2. Generate an SQL file from a translated PO file
import filecmp
import os
import subprocess
import testhelper
import unittest
class TestSQLFramework(unittest.TestCase):
basedir = os.path.dirna... | JuliaLima/Evergreen | build/i18n/tests/testSQL.py | Python | gpl-2.0 | 1,833 |
# -*- coding: utf-8 -*-
"""Convenience interface to a locally spawned QGIS Server, e.g. for unit tests
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(a... | dracos/QGIS | tests/src/python/qgis_local_server.py | Python | gpl-2.0 | 29,318 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import TransactionCase
from odoo.exceptions import ValidationError
class TestHasGroup(TransactionCase):
def setUp(self):
super(TestHasGroup, self).setUp()
self.group0 = 'test... | ddico/odoo | odoo/addons/base/tests/test_user_has_group.py | Python | agpl-3.0 | 11,831 |
"""
Exposes Django utilities for consumption in the xmodule library
NOTE: This file should only be imported into 'django-safe' code, i.e. known that this code runs int the Django
runtime environment with the djangoapps in common configured to load
"""
import webpack_loader
# NOTE: we are importing this method so that... | edx/edx-platform | common/lib/xmodule/xmodule/util/xmodule_django.py | Python | agpl-3.0 | 1,184 |
# This file is part of DEAP.
#
# DEAP is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# DEAP is distributed ... | marcioweck/PSSLib | reference/deap/doc/code/tutorials/part_4/4_4_Using_Cpp_NSGA.py | Python | lgpl-3.0 | 4,997 |
'd'
def x():
print j
j = 0
def y():
for x in []:
print x
| lavjain/incubator-hawq | tools/bin/pythonSrc/pychecker-0.8.18/test_input/test33.py | Python | apache-2.0 | 80 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE... | Juniper/neutron | neutron/db/migration/alembic_migrations/versions/1d76643bcec4_nvp_netbinding.py | Python | apache-2.0 | 2,197 |
from redash.models import db, Change, AccessPermission, Query, Dashboard
from playhouse.migrate import PostgresqlMigrator, migrate
if __name__ == '__main__':
if not Change.table_exists():
Change.create_table()
if not AccessPermission.table_exists():
AccessPermission.create_table()
migrat... | M32Media/redash | old_migrations/0026_add_access_control_tables.py | Python | bsd-2-clause | 684 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from rollyourown import seo
from django.conf import settings
class DefaultMetadata(seo.Metadata):
""" A very basic default class for those who do not wish to write their own.
"""
title = seo.Tag(head=True, max_length=68)
keywords = seo.MetaTag()
... | sandow-digital/django-seo | rollyourown/seo/default.py | Python | bsd-3-clause | 1,038 |
from __future__ import division, absolute_import, print_function
import warnings
import numpy.core.numeric as _nx
from numpy.core.numeric import (
asarray, zeros, outer, concatenate, isscalar, array, asanyarray
)
from numpy.core.fromnumeric import product, reshape
from numpy.core import vstack, atleast_3d
_... | jankoslavic/numpy | numpy/lib/shape_base.py | Python | bsd-3-clause | 25,676 |
#!/usr/bin/python
#coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.com>
#
# 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 optio... | adityacs/ansible | lib/ansible/modules/web_infrastructure/ansible_tower/tower_host.py | Python | gpl-3.0 | 5,874 |
from django import forms
__all__ = ('RatingField',)
class RatingField(forms.ChoiceField):
pass | hzlf/openbroadcast | website/djangoratings/forms.py | Python | gpl-3.0 | 100 |
from .views import TriggerCRUDL
urlpatterns = TriggerCRUDL().as_urlpatterns()
| ewheeler/rapidpro | temba/triggers/urls.py | Python | agpl-3.0 | 79 |
#!/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 distribut... | QijunPan/ansible | lib/ansible/modules/network/ios/ios_system.py | Python | gpl-3.0 | 12,626 |
"""Middleware to set the request context."""
from aiohttp.web import middleware
from homeassistant.core import callback
# mypy: allow-untyped-defs
@callback
def setup_request_context(app, context):
"""Create request context middleware for the app."""
@middleware
async def request_context_middleware(re... | tchellomello/home-assistant | homeassistant/components/http/request_context.py | Python | apache-2.0 | 502 |
# -*- coding: utf-8 -*-
# <Lettuce - Behaviour Driven Development for python>
# Copyright (C) <2010-2012> Gabriel Falc達o <gabriel@nacaolivre.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundatio... | yangming85/lettuce | tests/functional/language_specific_features/test_ja.py | Python | gpl-3.0 | 6,962 |
#!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import struct... | ashang/calibre | src/calibre/ebooks/mobi/debug/mobi6.py | Python | gpl-3.0 | 32,481 |
# pylint: disable=missing-docstring
from django.core.management.base import CommandError
from mock import patch
from nose.plugins.attrib import attr
from openedx.core.djangoapps.content.course_overviews.management.commands import generate_course_overview
from openedx.core.djangoapps.content.course_overviews.models impo... | solashirai/edx-platform | openedx/core/djangoapps/content/course_overviews/management/commands/tests/test_generate_course_overview.py | Python | agpl-3.0 | 3,134 |
# 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... | ashaarunkumar/spark-tk | python/sparktk/dicom/ops/drop_rows_by_keywords.py | Python | apache-2.0 | 4,404 |
"""Project URLs for authenticated users"""
from django.conf.urls import patterns, url
from readthedocs.projects.views.private import AliasList, ProjectDashboard, ImportView
from readthedocs.projects.backends.views import ImportWizardView, ImportDemoView
urlpatterns = patterns(
# base view, flake8 complains if i... | royalwang/readthedocs.org | readthedocs/projects/urls/private.py | Python | mit | 4,653 |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
int_or_none,
unescapeHTML,
ExtractorError,
xpath_text,
)
class BiliBiliIE(InfoExtractor):
_VALID_URL = r'http://www\.bilibili\.(?:tv|com)/vide... | Hakuba/youtube-dl | youtube_dl/extractor/bilibili.py | Python | unlicense | 3,778 |
{% if cookiecutter.use_celery == "y" %}
from __future__ import absolute_import
import os
from celery import Celery
from django.apps import AppConfig
from django.conf import settings
if not settings.configured:
# set the default Django settings module for the 'celery' program.
os.environ.setdefault("DJANGO_SETT... | kaidokert/cookiecutter-django | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/taskapp/celery.py | Python | bsd-3-clause | 1,017 |
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))
... | bvamanan/ns3 | src/internet/bindings/modulegen__gcc_LP64.py | Python | gpl-2.0 | 946,654 |
from __future__ import print_function
import mxnet as mx
import numpy as np
from timeit import default_timer as timer
from dataset.testdb import TestDB
from dataset.iterator import DetIter
class Detector(object):
"""
SSD detector which hold a detection network and wraps detection API
Parameters:
-----... | wolfram2012/nimo | perception/ros_track_ssd/scripts/detect/detector.py | Python | gpl-3.0 | 6,261 |
#
# 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... | shaneknapp/spark | python/pyspark/tests/test_context.py | Python | apache-2.0 | 13,901 |
#!/usr/bin/env python
import os, sys
from django.core.management import execute_manager
sys.path.insert(0, os.path.abspath('./../../'))
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory conta... | drayanaindra/django-shop | tests/testapp/manage.py | Python | bsd-3-clause | 609 |
# (C) 2017 Red Hat Inc.
# Copyright (C) 2017 Lenovo.
#
# GNU General Public License v3.0+
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for ... | alexlo03/ansible | lib/ansible/plugins/cliconf/enos.py | Python | gpl-3.0 | 2,594 |
import sys
import platform
import twisted
import scrapy
from scrapy.command import ScrapyCommand
class Command(ScrapyCommand):
def syntax(self):
return "[-v]"
def short_desc(self):
return "Print Scrapy version"
def add_options(self, parser):
ScrapyCommand.add_options(self, pars... | openhatch/oh-mainline | vendor/packages/scrapy/scrapy/commands/version.py | Python | agpl-3.0 | 850 |
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2020 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... | nathawes/swift | utils/build_swift/tests/build_swift/test_shell.py | Python | apache-2.0 | 26,680 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Account Journal Always Check Date module for OpenERP
# Copyright (C) 2013-2014 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free so... | raycarnes/account-financial-tools | account_journal_always_check_date/__openerp__.py | Python | agpl-3.0 | 2,081 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
rasterize_over.py
---------------------
Date : September 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
********... | pblottiere/QGIS | python/plugins/processing/algs/gdal/rasterize_over.py | Python | gpl-2.0 | 5,222 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage Check Point Firewall (c) 2019
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... | Dhivyap/ansible | lib/ansible/modules/network/check_point/cp_mgmt_address_range_facts.py | Python | gpl-3.0 | 4,188 |
from itertools import chain
from pyprint.ClosableObject import ClosableObject
from coalib.parsing.StringProcessing import escape
from coalib.settings.Section import Section
class ConfWriter(ClosableObject):
def __init__(self,
file_name,
key_value_delimiters=('=',),
... | AdeshAtole/coala | coalib/output/ConfWriter.py | Python | agpl-3.0 | 4,015 |
#!/usr/bin/python
# Copyright: Ansible Project
# 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': ['preview'],
... | roadmapper/ansible | lib/ansible/modules/cloud/azure/azure_rm_keyvaultsecret.py | Python | gpl-3.0 | 7,639 |
#
# ElementTree
# $Id: HTMLTreeBuilder.py 3265 2007-09-06 20:42:00Z fredrik $
#
# a simple tree builder, for HTML input
#
# history:
# 2002-04-06 fl created
# 2002-04-07 fl ignore IMG and HR end tags
# 2002-04-07 fl added support for 1.5.2 and later
# 2003-04-13 fl added HTMLTreeBuilder alias
# 2004-12-02 fl ... | geary/claslite | web/app/lib/elementtree/HTMLTreeBuilder.py | Python | unlicense | 7,826 |
# -*- coding: utf-8 -*-
"""
pygments.lexers.rdf
~~~~~~~~~~~~~~~~~~~
Lexers for semantic web and RDF query languages and markup.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups... | wandb/client | wandb/vendor/pygments/lexers/rdf.py | Python | mit | 9,398 |
# Copyright (c) 2015 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 restriction, including
# without limitation the rights... | catapult-project/catapult | third_party/gsutil/gslib/vendored/boto/boto/cloudhsm/__init__.py | Python | bsd-3-clause | 1,726 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name' : 'Account Tax Cash Basis',
'version' : '1.1',
'author' : 'OpenERP SA',
'summary': 'Allow to have cash basis on tax',
'sequence': 4,
'description': """
Add an option on tax to allow th... | minhphung171093/GreenERP_V9 | openerp/addons/account_tax_cash_basis/__openerp__.py | Python | gpl-3.0 | 740 |
from django.contrib.gis.db.models import GeometryField
from django.contrib.gis.db.models.functions import Distance
from django.contrib.gis.measure import (
Area as AreaMeasure, Distance as DistanceMeasure,
)
from django.db.utils import NotSupportedError
from django.utils.functional import cached_property
class Ba... | georgemarshall/django | django/contrib/gis/db/backends/base/operations.py | Python | bsd-3-clause | 6,371 |
# Copyright 2009 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, ... | termie/jaikuengine | common/protocol/pshb.py | Python | apache-2.0 | 1,524 |
#!/usr/bin/python
# Copyright: (c) 2015, Google Inc. All Rights Reserved.
# 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',
... | hryamzik/ansible | lib/ansible/modules/clustering/k8s/_kubernetes.py | Python | gpl-3.0 | 16,555 |
from __future__ import absolute_import | rmwdeveloper/webhack | webhack/__init__.py | Python | mit | 38 |
from LogAnalyzer import Test,TestResult
import DataflashLog
from VehicleType import VehicleType
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 o... | lekston/ardupilot | Tools/LogAnalyzer/tests/TestPitchRollCoupling.py | Python | gpl-3.0 | 6,463 |
# 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 ... | capturePointer/or-tools | examples/python/nontransitive_dice.py | Python | apache-2.0 | 5,680 |
# 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... | adit-chandra/tensorflow | tensorflow/python/training/server_lib_same_variables_clear_test.py | Python | apache-2.0 | 2,744 |
#!/usr/bin/env python
import logging
__author__ = 'rolandh'
from pymongo import Connection
#import cjson
import time
from datetime import datetime
from saml2 import time_util
from saml2.cache import ToOld
from saml2.time_util import TIME_FORMAT
logger = logging.getLogger(__name__)
class Cache(object):
def __i... | tpazderka/pysaml2 | src/saml2/mdbcache.py | Python | bsd-2-clause | 6,873 |
import json
from wtforms.fields import TextAreaField
from shapely.geometry import shape, mapping
from .widgets import LeafletWidget
from sqlalchemy import func
import geoalchemy2
#from types import NoneType
#from .. import db how do you get db.session in a Field?
class JSONField(TextAreaField):
def _value(self):
... | hexlism/css_platform | sleepyenv/lib/python2.7/site-packages/Flask_Admin-1.2.0-py2.7.egg/flask_admin/contrib/geoa/fields.py | Python | apache-2.0 | 2,340 |
xkcd_rgb = {'acid green': '#8ffe09',
'adobe': '#bd6c48',
'algae': '#54ac68',
'algae green': '#21c36f',
'almost black': '#070d0d',
'amber': '#feb308',
'amethyst': '#9b5fc0',
'apple': '#6ecb3c',
'apple green': '#76cd26',
... | kyleam/seaborn | seaborn/xkcd_rgb.py | Python | bsd-3-clause | 35,379 |
from __future__ import division, absolute_import, print_function
__all__ = ['logspace', 'linspace']
from . import numeric as _nx
from .numeric import result_type, NaN
def linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None):
"""
Return evenly spaced numbers over a specified interval.
... | LumPenPacK/NetworkExtractionFromImages | win_build/nefi2_win_amd64_msvc_2015/site-packages/numpy/core/function_base.py | Python | bsd-2-clause | 6,518 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.