code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
"""
This module contains code for handling dependency graphs.
"""
import os, time
from subprocess import Popen
from rubber.util import _, msg
class Set (dict):
"""
Represents a set of dependency nodes. Nodes can be accessed by absolute
path name using the dictionary interface.
"""
pass
# constants for the retu... | sre/rubber | src/depend.py | Python | gpl-2.0 | 7,332 |
# coding: utf-8
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRA... | cmouse/buildbot | master/buildbot/reporters/words.py | Python | gpl-2.0 | 50,996 |
import logging
from functools import partial
from unittest import (
TestCase,
mock,
)
from pcs.common import file_type_codes
from pcs.common.reports import ReportItemSeverity as severity
from pcs.common.reports import codes as report_codes
from pcs.lib.env import LibraryEnvironment
from pcs_test.tools.asserti... | tomjelinek/pcs | pcs_test/tier0/lib/test_env.py | Python | gpl-2.0 | 6,324 |
#!/usr/bin/env python
from nose.tools import *
from networkx import *
from networkx.convert import *
from networkx.algorithms.operators import *
from networkx.generators.classic import barbell_graph,cycle_graph
class TestRelabel():
def test_convert_node_labels_to_integers(self):
# test that empty graph co... | ChristianKniep/QNIB | serverfiles/usr/local/lib/networkx-1.6/networkx/tests/test_relabel.py | Python | gpl-2.0 | 5,962 |
# Volatility
# Copyright (c) 2008-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 o... | fengxiaoiie/volatility | volatility/plugins/overlays/windows/win2003.py | Python | gpl-2.0 | 6,956 |
# -*- coding: utf-8 -*-
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
# This is by no means an exhaustive list, but covered most of the time
# zones selected by existing developers at the time I wrot... | archhurd/archweb | devel/migrations/0007_auto_assign_countries.py | Python | gpl-2.0 | 9,946 |
import unittest
from PyFoam.Applications.CompareDictionary import CompareDictionary
theSuite=unittest.TestSuite()
| Unofficial-Extend-Project-Mirror/openfoam-extend-Breeder-other-scripting-PyFoam | unittests/Applications/test_CompareDictionary.py | Python | gpl-2.0 | 116 |
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014, 2015 CERN.
#
# INSPIRE is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any... | jalavik/inspire-next | inspire/modules/forms/fields/__init__.py | Python | gpl-2.0 | 999 |
# -*- coding: utf-8 -*-
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 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... | MSusik/invenio | invenio/legacy/websearch_external_collections/__init__.py | Python | gpl-2.0 | 21,464 |
import os
import re
import logging
from tempfile import mktemp
from virttest import virsh
from autotest.client.shared import error
from virttest.libvirt_xml.nodedev_xml import NodedevXML
from provider import libvirt_version
_FC_HOST_PATH = "/sys/class/fc_host"
def check_nodedev(dev_name, dev_parent=None):
"""
... | liuzzfnst/tp-libvirt | libvirt/tests/src/virsh_cmd/nodedev/virsh_nodedev_create_destroy.py | Python | gpl-2.0 | 10,402 |
# copies.py - copy detection for Mercurial
#
# Copyright 2008 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import util
import heapq
def _nonoverlap(d1, d2, d3):
"Return list of elements in d1... | vmg/hg-stable | mercurial/copies.py | Python | gpl-2.0 | 12,819 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2011 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... | Markus-Goetz/CDS-Invenio-Authorlist | modules/bibauthorid/lib/bibauthorid_personid_tables_utils.py | Python | gpl-2.0 | 129,744 |
"""
This module exists only to simplify retrieving the version number of chardet
from within setup.py and from chardet subpackages.
:author: Dan Blanchard (dan.blanchard@gmail.com)
"""
__version__ = "4.0.0"
VERSION = __version__.split('.')
| SickGear/SickGear | lib/chardet/version.py | Python | gpl-3.0 | 251 |
import re
# Resolutions
resolution = re.compile(r'(?P<vres>4320|2160|1080|720|480|360)(?P<scan>[pi])', re.I)
# Sources
tv = re.compile(r'([sph]d).?tv|tv(rip|mux)', re.I)
dvd = re.compile(r'(?P<hd>hd)?dvd(?P<rip>rip|mux)?', re.I)
web = re.compile(r'(web(?P<type>rip|mux|hd|.?dl|\b))', re.I)
bluray = re.compile(r'(blu... | kingmotley/SickRage | sickrage/recompiled/tags.py | Python | gpl-3.0 | 869 |
########################################################################
#
# File Name: HTMLDocument.py
#
# Documentation: http://docs.4suite.com/4DOM/HTMLDocument.py.html
#
"""
WWW: http://4suite.com/4DOM e-mail: support@4suite.com
Copyright (c) 2000 Fourthought Inc, USA. All Rights Reserv... | iCarto/siga | extScripting/scripts/jython/Lib/xml/dom/html/HTMLDocument.py | Python | gpl-3.0 | 11,605 |
# -*- coding: utf-8 -*-
#
# deluge/ui/common.py
#
# Copyright (C) Damien Churchill 2008-2009 <damoxc@gmail.com>
# Copyright (C) Andrew Resch 2009 <andrewresch@gmail.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 ... | laanwj/deluge | deluge/ui/common.py | Python | gpl-3.0 | 13,980 |
from __future__ import print_function
import os.path
def fix_source_eol(path, is_dry_run = True, verbose = True, eol = '\n'):
"""Makes sure that all sources have the specified eol sequence (default: unix)."""
if not os.path.isfile(path):
raise ValueError('Path "%s" is not a file' % path)
try:
... | TixLo/kademlia | lib/jsoncpp/devtools/fixeol.py | Python | gpl-3.0 | 1,974 |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from cms.models import CMSPlugin, Page
from django.conf import settings
class InheritPagePlaceholder(CMSPlugin):
"""
Provides the ability to inherit plugins for a certain placeholder from an associated "parent" page instance
... | hzlf/openbroadcast | website/cms/plugins/inherit/models.py | Python | gpl-3.0 | 681 |
###############################################################################
# Name: postscript.py #
# Purpose: Define Postscript syntax for highlighting and other features #
# Author: Cody Precord <cprecord@editra.org> #
... | ezequielpereira/Time-Line | libs/wx/tools/Editra/src/syntax/_postscript.py | Python | gpl-3.0 | 9,149 |
# coding=utf-8
"""Definitions for basic report.
"""
from __future__ import absolute_import
from safe.utilities.i18n import tr
__copyright__ = "Copyright 2016, The InaSAFE Project"
__license__ = "GPL version 3"
__email__ = "info@inasafe.org"
__revision__ = '$Format:%H$'
# Meta description about component
# component... | Gustry/inasafe | safe/definitions/reports/__init__.py | Python | gpl-3.0 | 2,816 |
# TODO: to be moved to TestDIRAC and transformed into a real test
########################################################################
# File: ReplicateAndRegisterTests.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/05/13 18:38:55
########################################################################
"... | sposs/DIRAC | DataManagementSystem/test/IntegrationFCT.py | Python | gpl-3.0 | 6,261 |
"""
A test module which has a required module and a config
"""
TYPE = "Test"
NAME = "test_2"
REQUIRES = ["test_1"]
DEFAULTCONF = {'a': 1, 'b': 2}
def check(conf=DEFAULTCONF):
if None in REQUIRES:
return False
return True
def scan(filelist, conf=DEFAULTCONF):
results = []
result1, meta1 = RE... | jmlong1027/multiscanner | tests/modules/test_2.py | Python | mpl-2.0 | 649 |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from django.http import HttpResponseRedirect
from shuup import co... | suutari-ai/shoop | shuup/front/views/misc.py | Python | agpl-3.0 | 730 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('main', '0006_levelofdescription'),
]
operations = [
migrations.AlterField(
model_name='agent',
name=... | sevein/archivematica | src/dashboard/src/main/migrations/0007_django_upgrade_tweaks.py | Python | agpl-3.0 | 4,909 |
# Copyright (c) 2017 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from UM.Settings.ContainerRegistry import ContainerRegistry
from UM.Settings.InstanceContainer import InstanceContainer
from cura.MachineAction import MachineAction
from PyQt5.QtCore import pyqtSlot, pyqtSignal, pyqtProp... | Curahelper/Cura | plugins/UltimakerMachineActions/UM2UpgradeSelection.py | Python | agpl-3.0 | 3,052 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Xmessage(AutotoolsPackage, XorgPackage):
"""xmessage displays a message or query in a wind... | iulian787/spack | var/spack/repos/builtin/packages/xmessage/package.py | Python | lgpl-2.1 | 845 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RSdmtools(RPackage):
"""Species Distribution Modelling Tools: Tools for processing data
... | rspavel/spack | var/spack/repos/builtin/packages/r-sdmtools/package.py | Python | lgpl-2.1 | 1,363 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Sfcgal(CMakePackage):
"""
SFCGAL is a C++ wrapper library around CGAL with the aim of ... | iulian787/spack | var/spack/repos/builtin/packages/sfcgal/package.py | Python | lgpl-2.1 | 1,183 |
"""Tests for parallel client.py
Authors:
* Min RK
"""
#-------------------------------------------------------------------------------
# Copyright (C) 2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this soft... | cloud9ers/gurumate | environment/lib/python2.7/site-packages/IPython/parallel/tests/test_client.py | Python | lgpl-3.0 | 16,414 |
import pyuaf
import unittest
from pyuaf.util.unittesting import parseArgs
ARGS = parseArgs()
def suite(args=None):
if args is not None:
global ARGS
ARGS = args
return unittest.TestLoader().loadTestsFromTestCase(LocalizedTextTest)
class LocalizedTextTest(unittest.TestCase):
d... | robi-wan/uaf | unittests/pyuaftests/util/localizedtext.py | Python | lgpl-3.0 | 1,323 |
#!/usr/bin/env python
# coding: utf-8
#
# Copyright 2016, Marcos Salomão.
#
# 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... | salomax/livremarketplace | app_test/purchase_test.py | Python | apache-2.0 | 4,115 |
#
# 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... | airbnb/airflow | tests/dags/test_task_view_type_check.py | Python | apache-2.0 | 1,768 |
"""Support for the Forecast.Solar sensor service."""
from __future__ import annotations
from datetime import datetime
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN, SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.h... | mezz64/home-assistant | homeassistant/components/forecast_solar/sensor.py | Python | apache-2.0 | 2,649 |
# 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-2.0
#
# Unless required by applicable law or agreed to in... | rushiagr/keystone | keystone/contrib/ec2/controllers.py | Python | apache-2.0 | 17,344 |
# Copyright 2012 OpenStack Foundation.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | vichoward/python-neutronclient | neutronclient/tests/unit/test_name_or_id.py | Python | apache-2.0 | 5,590 |
#pylint: skip-file
import io
import struct
import pytest
from kafka.protocol.api import RequestHeader
from kafka.protocol.commit import GroupCoordinatorRequest
from kafka.protocol.fetch import FetchRequest, FetchResponse
from kafka.protocol.message import Message, MessageSet, PartialMessage
from kafka.protocol.metada... | ohmu/kafka-python | test/test_protocol.py | Python | apache-2.0 | 12,430 |
# -*- coding: utf-8 -*-
"""A place to store information about events, such as format strings, etc."""
# TODO: move this class to events/definitions.py or equiv.
class EventTimestamp(object):
"""Class to manage event data."""
# The timestamp_desc values.
ACCESS_TIME = u'Last Access Time'
CHANGE_TIME = u'Metada... | ostree/plaso | plaso/lib/eventdata.py | Python | apache-2.0 | 1,819 |
"""Support for IKEA Tradfri."""
import logging
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
import homeassistant.helpers.config_validation as cv
from homeassistant.util.json import load_json
from .const import (
CONF_IMPORT_GROUPS, CON... | HydrelioxGitHub/home-assistant | homeassistant/components/tradfri/__init__.py | Python | apache-2.0 | 3,856 |
# Copyright 2013 UnitedStack 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... | dims/ironic | ironic/api/controllers/v1/port.py | Python | apache-2.0 | 16,875 |
# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... | nzlosh/st2 | st2common/st2common/util/db.py | Python | apache-2.0 | 1,690 |
"""Test Yeelight."""
import asyncio
from datetime import timedelta
from unittest.mock import AsyncMock, patch
import pytest
from yeelight import BulbException, BulbType
from yeelight.aio import KEY_CONNECTED
from homeassistant.components.yeelight.const import (
CONF_DETECTED_MODEL,
CONF_NIGHTLIGHT_SWITCH,
... | mezz64/home-assistant | tests/components/yeelight/test_init.py | Python | apache-2.0 | 22,950 |
#!/usr/bin/python
#
# Copyright 2013 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 b... | lociii/googleads-python-lib | examples/adspygoogle/dfp/v201306/creative_service/get_creatives_by_statement.py | Python | apache-2.0 | 2,090 |
#!/usr/bin/python
#
# Copyright 2012 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 b... | caioserra/apiAdwords | examples/adspygoogle/dfa/v1_19/get_user_roles.py | Python | apache-2.0 | 2,451 |
# 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 ... | faizan-barmawer/openstack_ironic | ironic/common/exception.py | Python | apache-2.0 | 12,909 |
# Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | vedujoshi/os_tempest | tempest/services/volume/json/admin/volume_hosts_client.py | Python | apache-2.0 | 1,436 |
'''
'''
def main():
info('trap in pipette')
close(description='Bone to Minibone')
close(description='Minibone to Bone')
sleep(2)
open(description='Bone to Turbo')
sleep(15)
close(description='Bone to Turbo')
sleep(2)
open(description='Bone to Minibone')
| UManPychron/pychron | docs/user_guide/operation/scripts/examples/helix/extraction/felix/TrapInBonePipette.py | Python | apache-2.0 | 291 |
# Copyright (c) The University of Edinburgh 2014
#
# 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... | akrause2014/registry | test/__init__.py | Python | apache-2.0 | 636 |
#!/usr/bin/python
import sys
import os
################################################################################
if len(sys.argv) >= 2:
gtf_filename = sys.argv[1]
else:
print("usage: python GTF2refFlat.py GTFfilename")
print("or ./GTF2refFlat.py GTFfilename")
sys.exit(1)
#####################... | jason-weirather/IDP | utilities/gtf2genepred.py | Python | apache-2.0 | 3,498 |
# Copyright (c) 2010-2012 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-2.0
#
# Unless required by applicable law or agree... | psachin/swift | swift/obj/replicator.py | Python | apache-2.0 | 38,417 |
"""
altgraph.ObjectGraph - Graph of objects with an identifier
==========================================================
A graph of objects that have a "graphident" attribute.
graphident is the key for the object in the graph
"""
from __future__ import print_function
from __future__ import absolute_import
from altgr... | catapult-project/catapult | telemetry/third_party/altgraph/altgraph/ObjectGraph.py | Python | bsd-3-clause | 6,431 |
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..dti import BEDPOSTX5
def test_BEDPOSTX5_inputs():
input_map = dict(all_ard=dict(argstr='--allard',
xor=('no_ard', 'all_ard'),
),
args=dict(argstr='%s',
),
burn_in=dict(argstr='-b %d',
),
b... | FCP-INDI/nipype | nipype/interfaces/fsl/tests/test_auto_BEDPOSTX5.py | Python | bsd-3-clause | 2,691 |
from __future__ import absolute_import
import filecmp
import os
import sys
import llvmbuild.componentinfo as componentinfo
from llvmbuild.util import fatal, note
###
def cmake_quote_string(value):
"""
cmake_quote_string(value) -> str
Return a quoted form of the given value that is suitable for use in C... | endlessm/chromium-browser | third_party/swiftshader/third_party/llvm-7.0/llvm/utils/llvm-build/llvmbuild/main.py | Python | bsd-3-clause | 34,146 |
# -*- coding: utf-8 -*-
"""
Identification of spectral properties in analog signals (e.g., the power
spectrum).
:copyright: Copyright 2015-2016 by the Elephant team, see AUTHORS.txt.
:license: Modified BSD, see LICENSE.txt for details.
"""
import warnings
import numpy as np
import scipy.signal
import scipy.fftpack a... | Junji110/elephant | elephant/spectral.py | Python | bsd-3-clause | 20,790 |
import mock
import pytest
from mock import Mock
from olympia import amo
from olympia.amo import models as amo_models
from olympia.amo.tests import TestCase
from olympia.amo import models as context
from olympia.addons.models import Addon
from olympia.users.models import UserProfile
pytestmark = pytest.mark.django_db... | andymckay/addons-server | src/olympia/amo/tests/test_models.py | Python | bsd-3-clause | 5,717 |
#!/usr/bin/env python3
import os
import re
import sys
from io import StringIO
from plex import Scanner, Str, Lexicon, Opt, Bol, State, AnyChar, TEXT, IGNORE
from plex.traditional import re as Re
class MyScanner(Scanner):
def __init__(self, info, name='<default>'):
Scanner.__init__(self, self.lexicon, inf... | pbrod/numpy | numpy/linalg/lapack_lite/clapack_scrub.py | Python | bsd-3-clause | 8,661 |
# Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from telemetry.core.timeline import model
from telemetry.core.backends.chrome import tracing_timeline_data
class TimelineModelUnittest(... | patrickm/chromium.src | tools/telemetry/telemetry/core/timeline/model_unittest.py | Python | bsd-3-clause | 529 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from vilya.libs.template import st
from vilya.models.feed import get_user_inbox, get_public_feed
MAX_ACT_COUNT = 100
_q_exports = ['actions', 'public_timeline']
def _q_index(request):
return st('/m/feed.html', **locals())
def public_timeline(re... | douban/code | vilya/views/m.py | Python | bsd-3-clause | 1,035 |
#STANDARD LIB
import datetime
import decimal
import warnings
#LIBRARIES
from django.conf import settings
from django.db.backends import (
BaseDatabaseOperations,
BaseDatabaseClient,
BaseDatabaseIntrospection,
BaseDatabaseWrapper,
BaseDatabaseFeatures,
BaseDatabaseValidation
)
try:
from dja... | pablorecio/djangae | djangae/db/backends/appengine/base.py | Python | bsd-3-clause | 17,365 |
import sys
from .calc import *
from .colls import *
from .tree import *
from .decorators import *
from .funcolls import *
from .funcs import *
from .seqs import *
from .types import *
from .strings import *
from .flow import *
from .objects import *
from .namespaces import namespace
from .debug import *
from .primitiv... | musicpax/funcy | funcy/py2.py | Python | bsd-3-clause | 765 |
#!/usr/bin/env python
"""This module contains some sample symbolic models used for testing and
examples."""
# Internal imports
from sympy.core import backend as sm
import sympy.physics.mechanics as me
def multi_mass_spring_damper(n=1, apply_gravity=False,
apply_external_forces=False):
... | kaushik94/sympy | sympy/physics/mechanics/models.py | Python | bsd-3-clause | 6,458 |
#!/usr/bin/env python
# Copyright (c) 2009 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.
# TODO: remove this script when GYP has for loops
from __future__ import print_function
import sys
import optparse
def main(argv... | endlessm/chromium-browser | build/apply_locales.py | Python | bsd-3-clause | 1,497 |
# coding: utf-8
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
},
}
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.sessions',
'django.contrib.contenttypes',
'registration',... | pando85/django-registration | test_app/settings_test.py | Python | bsd-3-clause | 1,575 |
"""
Quantities and units
====================
The Quantity module provides two classes to work with quantities and units.
.. inheritance-diagram:: acoustics.quantity
"""
from acoustics.standards.iso_tr_25417_2007 import REFERENCE_PRESSURE
quantities = {
'pressure' : ('Pressure', 'pascal', True, 'p', '$p$', RE... | FRidh/python-acoustics | acoustics/quantity.py | Python | bsd-3-clause | 2,707 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class DefaultValue(Document):
pass
def on_doctype_update():
"""Create indexes for `tabDefaultValue` on `(parent, defk... | vjFaLk/frappe | frappe/core/doctype/defaultvalue/defaultvalue.py | Python | mit | 607 |
import numpy as np
import copy
import random
import deepchem
class TicTacToeEnvironment(deepchem.rl.Environment):
"""
Play tictactoe against a randomly acting opponent
"""
X = np.array([1.0, 0.0])
O = np.array([0.0, 1.0])
EMPTY = np.array([0.0, 0.0])
ILLEGAL_MOVE_PENALTY = -3.0
LOSS_PENALTY = -3.... | Agent007/deepchem | deepchem/rl/envs/tictactoe.py | Python | mit | 3,149 |
import pytest
from thefuck.rules.git_remote_seturl_add import match, get_new_command
from thefuck.types import Command
@pytest.mark.parametrize('command', [
Command('git remote set-url origin url', "fatal: No such remote")])
def test_match(command):
assert match(command)
@pytest.mark.parametrize('command', ... | nvbn/thefuck | tests/rules/test_git_remote_seturl_add.py | Python | mit | 920 |
import json
from django.contrib.auth.decorators import user_passes_test
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template.loader import render_to_string
from django.template import RequestContext
from crits.core.user_tools import user_can_view_data
from crits.re... | jinverar/crits | crits/relationships/views.py | Python | mit | 13,325 |
"""
WSGI Utilities
(from web.py)
"""
import os, sys
import http
import webapi as web
from utils import listget
from net import validaddr, validip
import httpserver
def runfcgi(func, addr=('localhost', 8000)):
"""Runs a WSGI function as a FastCGI server."""
import flup.server.fcgi as flups
return flup... | merckhung/bokken | lib/web/wsgi.py | Python | gpl-2.0 | 2,060 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2014 University of Dundee & Open Microscopy Environment.
# All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foun... | simleo/openmicroscopy | components/tools/OmeroWeb/omeroweb/webclient/show.py | Python | gpl-2.0 | 37,362 |
#
# Copyright 2015 Red Hat, 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in th... | simon3z/virt-deploy | virtdeploy/errors.py | Python | gpl-2.0 | 1,201 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import copy
from itertools import tee, izip
import logging
from rdkit import Chem
from rdkit.Chem.rdchem import BondType, BondStereo, BondDir
__author__ = 'Matt Swain'
__email__ = 'm.swain@me.com'
__license__ = 'MIT'
log = logging.getLogger('tautomer')
BONDMAP = {'-': B... | jlec/coot | pyrogen/tautomer.py | Python | gpl-3.0 | 25,160 |
# -*- coding: utf-8 -*-
# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at you... | thuydang/ocrfeeder | src/ocrfeeder/odf/office.py | Python | gpl-3.0 | 3,311 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Fabrizio Colonna <colofabrix@tin.it>
#
# 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 ... | sidartaoliveira/ansible | lib/ansible/modules/system/parted.py | Python | gpl-3.0 | 22,160 |
import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... | batxes/4Cin | SHH_WT_models_highres/SHH_WT_models_highres_final_output_0.1_-0.1_5000/mtx1_models/SHH_WT_models_highres12150.py | Python | gpl-3.0 | 88,213 |
#!/usr/bin/env python
#
# Copyright 2005,2007,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your ... | iohannez/gnuradio | gr-comedi/python/comedi/qa_comedi.py | Python | gpl-3.0 | 1,256 |
# This is a very simple script to import basic CSV with the following columns:
#
# person_name
# position_title
# place_kind
# place_name
# organisation_kind
# organisation_name
#
# The various person etc entries will be created if needed (ie if there is no
# exact match).
#
# GOTCHAS
#
# * If the organis... | hzj123/56th | pombola/core/management/commands/core_import_basic_positions_csv.py | Python | agpl-3.0 | 2,345 |
from tests.util.base import event
def test_invite_generation(event, default_account):
from inbox.events.ical import generate_icalendar_invite
event.sequence_number = 1
event.participants = [{'email': 'helena@nylas.com'},
{'email': 'myles@nylas.com'}]
cal = generate_icalendar... | Eagles2F/sync-engine | tests/events/test_inviting.py | Python | agpl-3.0 | 2,071 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from copy import deepcopy
from django.db import migrations, models
from treemap.util import to_object_name
from treemap.search_fields import DEFAULT_WEB_DETAIL_FIELDS
def add_udfs_to_web_detail_fields(apps, schema_editor):
Instance = apps.get_mode... | maurizi/otm-core | opentreemap/treemap/migrations/0032_add_udfs_to_web_detail_fields.py | Python | agpl-3.0 | 1,638 |
##############################################################################
#
# Copyright (c) 2008-2011 Alistek Ltd (http://www.alistek.com) All Rights Reserved.
# General contacts <info@alistek.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take th... | kailIII/emaresa | trunk.pe/report_aeroo_sample/report/parser.py | Python | agpl-3.0 | 1,951 |
# -*- coding: utf-8 -*-
#!/usr/bin/python
# -*- coding: utf-8 -*-
##############################################
#
# ChriCar Beteiligungs- und Beratungs- GmbH
# Copyright (C) ChriCar Beteiligungs- und Beratungs- GmbH
# all rights reserved
# created 2009-07-11 12:22:10+02
#
# WARNING: This program as such is intended t... | VitalPet/c2c-rd-addons | chricar_room/room.py | Python | agpl-3.0 | 3,108 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | Grirrane/odoo | addons/project/tests/test_project_flow.py | Python | agpl-3.0 | 6,325 |
"""
Integration tests for third_party_auth LTI auth providers
"""
import unittest
import django
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from oauthlib.oauth1.rfc5849 import Client, SIGNATURE_TYPE_BODY
from openedx.tests.util import expecte... | hastexo/edx-platform | common/djangoapps/third_party_auth/tests/specs/test_lti.py | Python | agpl-3.0 | 7,528 |
#
# Copyright (c) 2001 - 2015 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge... | stefanklug/mapnik | scons/scons-local-2.3.6/SCons/compat/__init__.py | Python | lgpl-2.1 | 8,150 |
# =============================================================================
# 2013+ Copyright (c) Kirill Smorodinnikov <shaitkir@gmail.com>
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Fre... | tempbottle/elliptics | tests/pytests/test_session_parameters.py | Python | lgpl-3.0 | 7,542 |
from cgi import parse_qs, escape, FieldStorage
import time
import shutil
def ping_app(environ, start_response):
status = '200 OK'
output = 'Pong!'
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
... | ameyjadiye/nxweb | sample_config/python/hello.py | Python | lgpl-3.0 | 2,478 |
# Copyright (c) 2008-2009 Pedro Matiello <pmatiello@gmail.com>
# Salim Fadhley <sal@stodge.org>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction... | sebastienhupin/qxrad | qooxdoo/tool/pylib/graph/algorithms/heuristics/__init__.py | Python | lgpl-3.0 | 1,517 |
"""Support for an Intergas heater via an InComfort/InTouch Lan2RF gateway."""
from __future__ import annotations
from dataclasses import dataclass
from typing import Any
from homeassistant.components.sensor import (
DOMAIN as SENSOR_DOMAIN,
SensorEntity,
SensorEntityDescription,
)
from homeassistant.const... | jawilson/home-assistant | homeassistant/components/incomfort/sensor.py | Python | apache-2.0 | 3,056 |
# Copyright 2017 Google 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | dhermes/gcloud-python | logging/tests/unit/handlers/test__helpers.py | Python | apache-2.0 | 6,817 |
"""
This module contains stacking strategies (meta-algorithms of machine learning).
"""
from __future__ import division, print_function, absolute_import
import numpy
from sklearn.base import clone
from ..estimators import Classifier
from ..estimators.utils import check_inputs, _get_features
__author__ = 'Alex Rogoz... | vkuznet/rep | rep/metaml/stacking.py | Python | apache-2.0 | 4,905 |
#
# Copyright (c) Microsoft and contributors. 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 a... | crwilcox/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/networkresourceprovider.py | Python | apache-2.0 | 866,693 |
from __future__ import unicode_literals
import ctypes
import json
import random
from binascii import a2b_hex, b2a_hex
from io import BytesIO
from unittest import skipUnless
from django.contrib.gis import gdal
from django.contrib.gis.geos import (
HAS_GEOS, GeometryCollection, GEOSException, GEOSGeometry, LinearRi... | kawamon/hue | desktop/core/ext-py/Django-1.11.29/tests/gis_tests/geos_tests/test_geos.py | Python | apache-2.0 | 54,041 |
#
# Copyright 2015 BMC Software, 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 i... | jdgwartney/boundary-api-cli | boundary/plugin_add.py | Python | apache-2.0 | 2,132 |
"""Family Hub camera for Samsung Refrigerators."""
import logging
import voluptuous as vol
from homeassistant.components.camera import Camera, PLATFORM_SCHEMA
from homeassistant.const import CONF_IP_ADDRESS, CONF_NAME
from homeassistant.helpers.aiohttp_client import async_get_clientsession
import homeassistant.helper... | joopert/home-assistant | homeassistant/components/familyhub/camera.py | Python | apache-2.0 | 1,553 |
"""
The :mod:`sklearn.pls` module implements Partial Least Squares (PLS).
"""
# Author: Edouard Duchesnay <edouard.duchesnay@cea.fr>
# License: BSD 3 clause
from ..base import BaseEstimator, RegressorMixin, TransformerMixin
from ..utils import check_arrays
from ..externals import six
import warnings
from abc import ... | chaluemwut/fbserver | venv/lib/python2.7/site-packages/sklearn/cross_decomposition/pls_.py | Python | apache-2.0 | 28,612 |
# -*- coding: utf-8 -*-
from validator import Validator
class Cpp(Validator):
__filetype__ = "cpp"
checker = "clang-tidy"
binary_option = "clang_tidy"
args_file = ".clang-tidy-config"
regex = r"""
.+:
(?P<lnum>\d+):
(?P<col>\d+):
.*
\s
... | accdias/dotfiles | vim/pythonx/lints/cpp.py | Python | artistic-2.0 | 611 |
from flask_example.models import user
from social.apps.flask_app import models
| nvbn/python-social-auth | examples/flask_example/models/__init__.py | Python | bsd-3-clause | 79 |
#! /usr/bin/env python
# SCardConnect_DIRECT.py : Unitary test for SCardConnect in DIRECT mode
# Copyright (C) 2009 Ludovic Rousseau
#
# 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;... | vicamo/pcsc-lite-android | UnitaryTests/SCardConnect_DIRECT.py | Python | bsd-3-clause | 3,325 |
import warnings
from django.contrib.localflavor.cz.forms import (CZPostalCodeField,
CZRegionSelect, CZBirthNumberField, CZICNumberField)
from django.core.exceptions import ValidationError
from utils import LocalFlavorTestCase
class CZLocalFlavorTests(LocalFlavorTestCase):
def setUp(self):
self.save_... | mitsuhiko/django | tests/regressiontests/forms/localflavor/cz.py | Python | bsd-3-clause | 3,835 |
from django.conf import settings
# lfs imports
from lfs.core.signals import customer_added
from lfs.core.signals import order_submitted
from lfs.core.signals import order_sent
from lfs.core.signals import order_paid
from lfs.mail import utils as mail_utils
# reviews imports
from reviews.signals import review_added
... | pigletto/django-lfs | lfs/mail/listeners.py | Python | bsd-3-clause | 1,383 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import sys
from contextlib import contextmanager
from case import patch, skip
from kombu.five import bytes_t, string_t, string
from kombu.utils.encoding import (
get_default_encoding_file, safe_str,
set_default_encoding_file, d... | urbn/kombu | t/unit/utils/test_encoding.py | Python | bsd-3-clause | 3,499 |