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 |
|---|---|---|---|---|---|
#!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2013 Riverbank Computing Limited.
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
##
## This file is part of the examples of PyQt.
##
## $QT_BEGIN_LICENS... | baoboa/pyqt5 | examples/mainwindows/mdi/mdi.py | Python | gpl-3.0 | 16,057 |
from PyQt4.QtCore import Qt
from PyQt4.QtGui import QFrame, QLabel, QVBoxLayout, QHBoxLayout, QScrollArea, QWidget, QGridLayout
from ert_gui.ertwidgets.models.ertsummary import ErtSummary
class SummaryTemplate(object):
def __init__(self, title):
super(SummaryTemplate, self).__init__()
self.text ... | arielalmendral/ert | python/python/ert_gui/ertwidgets/summarypanel.py | Python | gpl-3.0 | 2,674 |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
This file is part of OpenSesame.
OpenSesame 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.... | eort/OpenSesame | opensesame_unittest/translations.py | Python | gpl-3.0 | 3,743 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2014, Chris Schmidt <chris.schmidt () contrastsecurity.com>
#
# Built using https://github.com/hamnis/useful-scripts/blob/master/python/download-maven-artifact
# as a reference and starting point.
#
# GNU General Public License v3.0+ (see COPYING or https://www... | fernandezcuesta/ansible | lib/ansible/modules/packaging/language/maven_artifact.py | Python | gpl-3.0 | 15,518 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Artyom Topchyan <artyom.topchyan@live.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
# Based on Copyright (C) 2014 Radim Rehurek <radimrehurek@seznam.cz>
"""Python wrapper for `Dynamic Topic Models (DTM) <http://www.... | midnightradio/gensim | gensim/models/wrappers/dtmmodel.py | Python | gpl-3.0 | 21,273 |
# 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 os
import re
import shutil
from mozpack.executables import (
is_executable,
may_strip,
strip,
may... | SlateScience/MozillaJS | js/src/python/mozbuild/mozpack/files.py | Python | mpl-2.0 | 17,845 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# 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/.
###
### Author: Chris Iatrou (ichrispa@core-vector.net)
### Version: rev 14... | AGIsmail/open62541 | tools/pyUANamespace/generate_open62541CCode.py | Python | mpl-2.0 | 7,804 |
""" Code for propagating Nylas datastore changes to account backends.
Syncback actions don't update anything in the local datastore; the Nylas
datastore is updated asynchronously (see namespace.py) and bookkeeping about
the account backend state is updated when the changes show up in the mail sync
engine.
Dealing wit... | nylas/sync-engine | inbox/actions/base.py | Python | agpl-3.0 | 7,046 |
"""Add queryable value column to Metadata
Revision ID: 2dbf6da0775b
Revises: 25129e0316d4
Create Date: 2016-07-18 23:33:52.050259
"""
# revision identifiers, used by Alembic.
revision = '2dbf6da0775b'
down_revision = '25129e0316d4'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('m... | jobscore/sync-engine | migrations/versions/226_add_queryable_value_column_to_metadata.py | Python | agpl-3.0 | 703 |
__author__ = 'tony'
HOME_CRUMB = {
'link': '/',
'name': 'Home'
} | stonestone/stonefreedomsponsors | djangoproject/core/views/__init__.py | Python | agpl-3.0 | 73 |
import json
import logging
from lxml import etree
from xmodule.capa_module import ComplexEncoder
from xmodule.progress import Progress
from xmodule.stringify import stringify_children
import openendedchild
from .combined_open_ended_rubric import CombinedOpenEndedRubric
log = logging.getLogger("edx.courseware")
cla... | pelikanchik/edx-platform | common/lib/xmodule/xmodule/open_ended_grading_classes/self_assessment_module.py | Python | agpl-3.0 | 11,675 |
"""
Module for running content split tests
"""
import logging
import json
from webob import Response
from xmodule.progress import Progress
from xmodule.seq_module import SequenceDescriptor
from xmodule.x_module import XModule, module_attr
from lxml import etree
from xblock.core import XBlock
from xblock.fields impo... | nanolearning/edx-platform | common/lib/xmodule/xmodule/split_test_module.py | Python | agpl-3.0 | 11,395 |
# 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 Biobloom(AutotoolsPackage):
"""BioBloom Tools (BBT) provides the means to create filters f... | iulian787/spack | var/spack/repos/builtin/packages/biobloom/package.py | Python | lgpl-2.1 | 946 |
# 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 Vt(MakefilePackage):
"""A tool set for short variant discovery in genetic sequence data.""... | iulian787/spack | var/spack/repos/builtin/packages/vt/package.py | Python | lgpl-2.1 | 759 |
# 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)
import os
import stat
import pytest
import collections
import spack.spec
import spack.modules.tcl
from spack.modules.comm... | iulian787/spack | lib/spack/spack/test/modules/common.py | Python | lgpl-2.1 | 5,670 |
# 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)
import argparse
import os
import pytest
import sys
from llnl.util.filesystem import FileFilter
import spack.paths
from s... | iulian787/spack | lib/spack/spack/test/cmd/flake8.py | Python | lgpl-2.1 | 2,434 |
# 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 PerlXmlTwig(PerlPackage):
"""This module provides a way to process XML documents. It is bu... | iulian787/spack | var/spack/repos/builtin/packages/perl-xml-twig/package.py | Python | lgpl-2.1 | 1,320 |
from proxy import CartProxy, ItemAlreadyExists, ItemDoesNotExist
| sidja/django-changuito | changuito/__init__.py | Python | lgpl-3.0 | 65 |
"""
Force import of all modules in this package in order to get the standard test
runner to pick up the tests. Yowzers.
"""
import os
import django
modules = [filename.rsplit('.', 1)[0]
for filename in os.listdir(os.path.dirname(__file__))
if filename.endswith('.py') and not filename.startswith... | tumb1er/django-celery-rpc | celery_rpc/tests/tests.py | Python | unlicense | 459 |
#!/usr/bin/env python3
# Copyright 2018 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 ... | adjackura/compute-image-tools | image_test/configuration/linux/freebsd.py | Python | apache-2.0 | 3,674 |
from ncclient.operations.lock import *
import unittest
try:
from unittest.mock import patch # Python 3.4 and later
except ImportError:
from mock import patch
from ncclient import manager
import ncclient.manager
import ncclient.transport
from ncclient.xml_ import *
from ncclient.operations import RaiseMode
from... | nwautomator/ncclient | test/unit/operations/test_lock.py | Python | apache-2.0 | 4,013 |
#!/usr/bin/env python
# Copyright 2011 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... | AwesomeTurtle/personfinder | tools/pfif-tools/tests/__init__.py | Python | apache-2.0 | 1,480 |
#!/usr/bin/env python
# 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 ... | apache/incubator-allura | scripts/perf/call_count.py | Python | apache-2.0 | 5,886 |
"""Alexa state report code."""
import asyncio
import json
import logging
import aiohttp
import async_timeout
from homeassistant.const import MATCH_ALL, STATE_ON
import homeassistant.util.dt as dt_util
from .const import API_CHANGE, Cause
from .entities import ENTITY_ADAPTERS
from .messages import AlexaResponse
_LOG... | leppa/home-assistant | homeassistant/components/alexa/state_report.py | Python | apache-2.0 | 7,913 |
# Copyright 2015 ETH Zurich
#
# 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, sof... | dmpiergiacomo/scion | python/lib/packet/scion_l4.py | Python | apache-2.0 | 1,817 |
from collections import namedtuple
TomcatJVMFeature = namedtuple('TomcatJVMFeature', [
'free',
'total',
'max'
])
TomcatMemoryFeature = namedtuple('TomcatMemoryFeature', [
... | cloudviz/agentless-system-crawler | crawler/plugins/applications/tomcat/feature.py | Python | apache-2.0 | 1,653 |
#!/usr/bin/python -u
# 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
# ... | larsbutler/swift | test/probe/brain.py | Python | apache-2.0 | 8,284 |
# -*- coding: utf-8 -*-
#
# 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
... | MetrodataTeam/incubator-airflow | tests/models.py | Python | apache-2.0 | 53,455 |
#
# Copyright (c) 2008-2015 Citrix 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.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | benfinke/ns_python | nssrc/com/citrix/netscaler/nitro/resource/config/cluster/clusternodegroup_streamidentifier_binding.py | Python | apache-2.0 | 6,728 |
# 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... | chemelnucfin/tensorflow | tensorflow/contrib/eager/python/examples/spinn/spinn_test.py | Python | apache-2.0 | 18,370 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Cloudbase Solutions SRL
# Copyright 2013 Pedro Navarro Perez
# 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... | sajuptpm/neutron-ipam | neutron/tests/unit/hyperv/test_hyperv_rpcapi.py | Python | apache-2.0 | 4,541 |
# -*- encoding: utf-8 -*-
#
# Copyright © 2013 Intel Corp
#
# Authors: Lianhao Lu <lianhao.lu@intel.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/license... | NeCTAR-RC/ceilometer | ceilometer/tests/hardware/pollsters/base.py | Python | apache-2.0 | 3,105 |
"""DataUpdateCoordinator for WLED."""
from __future__ import annotations
import asyncio
from typing import Callable
from wled import WLED, Device as WLEDDevice, WLEDConnectionClosed, WLEDError
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST, EVENT_HOMEASSISTANT_STOP
fro... | Danielhiversen/home-assistant | homeassistant/components/wled/coordinator.py | Python | apache-2.0 | 3,789 |
import numpy as np
from pych.extern import Chapel
@Chapel()
def ex_numpy(a=np.ndarray):
"""
use Time;
var b: [a.domain] real;
b = 2.0;
for i in a.domain {
a[i] = getCurrentTime() / 60;
writeln(a[i]);
}
writeln(a);
writeln("Done.");
"""
return None
def test_chape... | chapel-lang/pychapel | docs/source/examples/test_chapel_slicing_inline.py | Python | apache-2.0 | 1,302 |
# Copyright (c) 2013-2015, Rethink Robotics
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditio... | UCRoboticsLab/BaxterTictactoe | src/baxter_interface/src/head_action/__init__.py | Python | apache-2.0 | 1,596 |
# 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... | dongjoon-hyun/tensorflow | tensorflow/python/kernel_tests/conv_ops_3d_test.py | Python | apache-2.0 | 25,745 |
# -*- coding: utf-8 -*-
# Copyright 2014 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
#
# Unless requi... | huntxu/fuel-web | nailgun/nailgun/test/unit/test_expression_parser.py | Python | apache-2.0 | 4,177 |
# -*- coding: utf-8 -*-
"""
License: BSD
(c) 2009 ::: www.CodeResort.com - BV Network AS (simon-code@bvnetwork.no)
"""
import unittest
import xmlrpclib
import os
import time
from trac.util.compat import sorted
from tracrpc.tests import rpc_testenv, TracRpcTestCase
from tracrpc.util import StringIO
class RpcW... | hexenxp14/tracxmlrpc | tracrpc/tests/wiki.py | Python | bsd-2-clause | 4,849 |
import unittest
from pyramid import testing
from pyramid.compat import (
text_,
PY3,
)
class TestRoute(unittest.TestCase):
def _getTargetClass(self):
from pyramid.urldispatch import Route
return Route
def _makeOne(self, *arg):
return self._getTargetClass()(*arg)
def te... | danielpronych/pyramid-doxygen | pyramid/tests/test_urldispatch.py | Python | bsd-2-clause | 23,774 |
__all__ = ['ttypes', 'constants', 'SpartsFooService', 'SpartsBarService']
| djipko/sparts | sparts/gen/sparts_examples/__init__.py | Python | bsd-3-clause | 74 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
logging.getLogger().setLevel(logging.DEBUG)
from vilya.libs.mlock import MLock
from vilya.models.project import CodeDoubanProject
from vilya.models.ticket import Ticket
from vilya.models.lru_counter import (
ProjectOwnLRUCounter, Projec... | douban/code | vilya/models/pull.py | Python | bsd-3-clause | 7,853 |
# *- encoding: utf-8 -*-
"""
nistats version, required package versions, and utilities for checking
"""
# Author: Bertrand Thirion
# License: simplified BSD
# PEP0440 compatible formatted version, see:
# https://www.python.org/dev/peps/pep-0440/
#
# Generic release markers:
# X.Y
# X.Y.Z # For bugfix releases
#
# Admi... | salma1601/process-asl | procasl/externals/nistats/version.py | Python | bsd-3-clause | 3,756 |
import sys
import numpy as np
import pandas as pd
from pvlib import iam, modelchain, pvsystem, temperature, inverter
from pvlib.modelchain import ModelChain
from pvlib.pvsystem import PVSystem
from pvlib.tracking import SingleAxisTracker
from pvlib.location import Location
from pvlib._deprecation import pvlibDeprecat... | mikofski/pvlib-python | pvlib/tests/test_modelchain.py | Python | bsd-3-clause | 88,076 |
"""Utilities and extensions for use with `argparse`."""
import os
import argparse
def directory(arg):
"""
An argument type (for use with the ``type=`` argument to
`argparse.ArgumentParser.add_argument` which determines if the argument is
an existing directory (and returns the absolute path).
""... | stargaser/astropy | astropy/utils/argparse.py | Python | bsd-3-clause | 1,549 |
from __future__ import absolute_import
from sentry.api.serializers.rest_framework import OriginField
from rest_framework import serializers
from sentry.testutils import TestCase
class DummySerializer(serializers.Serializer):
origin_field = OriginField()
class OriginFieldTest(TestCase):
def test_valid_orig... | mvaled/sentry | tests/sentry/api/serializers/rest_framework/test_origin.py | Python | bsd-3-clause | 697 |
"""Compare the speed of exact one-norm calculation vs. its estimation.
"""
import numpy as np
from .common import Benchmark, safe_import
with safe_import():
import scipy.sparse
import scipy.special # import cycle workaround for some versions
import scipy.sparse.linalg
class BenchmarkOneNormEst(Benchmar... | grlee77/scipy | benchmarks/benchmarks/sparse_linalg_onenormest.py | Python | bsd-3-clause | 1,881 |
from datetime import datetime
from django.conf import settings
from django.template.loader import render_to_string
from django.utils.timezone import now
from remo.base.tasks import send_remo_mail
from remo.base.utils import get_date
from remo.reports.models import NGReport
def count_user_ng_reports(user, current_st... | chirilo/remo | remo/reports/utils.py | Python | bsd-3-clause | 2,561 |
from __future__ import absolute_import
import json
import uuid
import copy
from IPython.display import display, publish_display_data
from . import utils
class VegaBase(object):
"""A custom Vega-Lite display object."""
JS_TEMPLATE = "static/vega.js"
render_type = '' # vega or vega-lite
def __init... | uwdata/ipython-vega | vega/base.py | Python | bsd-3-clause | 1,259 |
from datetime import datetime
import io
import os
from pathlib import Path
import dateutil.parser
import numpy as np
import pytest
from pandas.errors import EmptyDataError
import pandas.util._test_decorators as td
import pandas as pd
import pandas._testing as tm
# https://github.com/cython/cython/issues/1720
@pyte... | rs2/pandas | pandas/tests/io/sas/test_sas7bdat.py | Python | bsd-3-clause | 12,576 |
"""
Unit tests for Cantera's Cython-based Python module.
This script gathers all the tests defined 'cantera.test' module, runs them,
and prints a report. Extra command line arguments can be used to run subsets
of the test suite, e.g.:
all tests from 'test_thermo.py' and 'test_kinetics.py':
python runCythonTests.... | Heathckliff/cantera | test/python/runCythonTests.py | Python | bsd-3-clause | 2,874 |
from django.core.management.base import NoArgsCommand
from time import sleep, time
from django_bitcoin.utils import bitcoind
from django_bitcoin.models import BitcoinAddress
from django_bitcoin.models import Wallet
from django.conf import settings
from decimal import Decimal
class Command(NoArgsCommand):
help = "... | texib/bitcoin-zoo | django_bitcoin/management/commands/FixLastBalancesConcurrency.py | Python | mit | 518 |
from . import sale_currency
from . import pricelist
from . import multico
| sidzan/netforce | netforce_sale/netforce_sale/migrations/__init__.py | Python | mit | 74 |
# The MIT License (MIT)
#
# Copyright (c) 2013 Numenta, Inc.
#
# 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, mod... | ilblackdragon/nupic-hackathon-2014 | pycept/pycept/cept.py | Python | mit | 4,743 |
#!/usr/bin/env python
class MergedCell(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually."""
def __init__(self):
"""
Attributes:
swaggerTypes (dict): The key is attribute name and the value is attribute type.
... | aspose-cells/Aspose.Cells-for-Cloud | SDKs/Aspose.Cells-Cloud-SDK-for-Python/asposecellscloud/models/MergedCell.py | Python | mit | 967 |
#
# e32calendar.py
#
# Copyright (c) 2006-2009 Nokia 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 required by appl... | pymo/pymo | symbian/PythonForS60_1.9.6/module-repo/dev-modules/e32calendar/e32calendar.py | Python | mit | 13,582 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
sys.path.append('..')
from tamil.txt2unicode import auto2unicode, tscii2unicode
BUF_SIZE = 100
infile = 'sample_encode_documents/tscii.sample1.txt'
outfile = 'sample_encode_documents/tscii.sample1.unicode.txt'
inf = open(infile)
outf = open(outfile, 'w')
de... | atvKumar/open-tamil | examples/txt2unicode/demo_bigfiles_auto2unicode.py | Python | mit | 738 |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals, print_function
import warnings
import os
import numpy as np
from monty.serialization import loadfn
from pymatgen.analysis.bond_valence import BVAnalyzer
fro... | czhengsci/pymatgen | pymatgen/analysis/structure_prediction/volume_predictor.py | Python | mit | 9,318 |
#
# Copyright (c) 2012,2013 Big Switch Networks, Inc.
#
# Licensed under the Eclipse Public License, Version 1.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.eclipse.org/legal/epl-v10.html
#
# Unless required by applica... | mandeepdhami/netvirt-ctrl | cli/vnsw.py | Python | epl-1.0 | 8,594 |
#!/usr/bin/env python
from distutils.core import setup
from distutils.extension import Extension
from distutils.sysconfig import get_config_vars
from build_config import *
if local_compiler is not None:
# Kludge: Force compiler of choice for building _rho_j_k.c.
# _rho_j_k.c only contains a plain c-function ... | slabanja/dynsf | setup.py | Python | gpl-2.0 | 2,461 |
# Copyright 2018 Christoph Reiter
#
# 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.
from .gnome import GnomeSessionClie... | ptitjes/quodlibet | quodlibet/session/xfce.py | Python | gpl-2.0 | 570 |
import os
import re
import logging
from tempfile import mktemp
from autotest.client.shared import error
from virttest import virsh
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):
"""... | waynesun09/tp-libvirt | libvirt/tests/src/virsh_cmd/nodedev/virsh_nodedev_create_destroy.py | Python | gpl-2.0 | 10,403 |
# Copyright (c) 2005 VMware, Inc.
#
# 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, publish, distri... | kaiw/meld | meld/ui/wraplabel.py | Python | gpl-2.0 | 2,398 |
# SETS up everything you need for tweepy. Just edit 4 lines below to match your api.
import tweepy
consumer_key = 'Yours'
consumer_secret = 'Yours'
access_key = 'Yours'
access_secret = 'Yours'
#authorize twitter, initialize tweepy
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access... | junwoo091400/MyCODES | small_Projects(memory)/Twitter/Screen_name_to_CSV/credentials.py | Python | gpl-3.0 | 363 |
# Copyright (C) 2017,2018
# Max Planck Institute for Polymer Research
#
# This file is part of ESPResSo++.
#
# ESPResSo++ 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 Licen... | kkreis/espressopp | src/analysis/SubregionTracking.py | Python | gpl-3.0 | 4,220 |
#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import itertools, operator
from functools import partial
from future_builtins import map
from collections import OrderedDic... | nozuono/calibre-webserver | src/calibre/gui2/library/views.py | Python | gpl-3.0 | 46,406 |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
###########################################################################
## ##
## Copyrights Frédéric Rodrigo 2012 ##
## ... | tkasp/osmose-backend | analysers/disabled/analyser_merge_street_number.py | Python | gpl-3.0 | 2,397 |
-1 + 1
1 + 1.0
#! 2 type-error-operation
1 + '1'
#! 2 type-error-operation
1 - '1'
-1 - - 1
-1 - int()
int() - float()
float() - 3.0
a = 3
b = ''
#! 2 type-error-operation
a + b
| snakeleon/YouCompleteMe-x86 | third_party/ycmd/third_party/JediHTTP/vendor/jedi/test/static_analysis/operations.py | Python | gpl-3.0 | 180 |
#!/usr/bin/env python
from __future__ import division
from nose.tools import *
import networkx as nx
def example1a_G():
G = nx.Graph()
G.add_node(1, percolation=0.1)
G.add_node(2, percolation=0.2)
G.add_node(3, percolation=0.2)
G.add_node(4, percolation=0.2)
G.add_node(5, percolation=0.3)
... | kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/networkx/algorithms/centrality/tests/test_percolation_centrality.py | Python | gpl-3.0 | 2,836 |
# 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 cint, cstr, flt
from frappe import _
from erpnext.setup.utils import get_exchange_rate
from frappe.website.websit... | emakis/erpnext | erpnext/manufacturing/doctype/bom/bom.py | Python | gpl-3.0 | 19,770 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 Sharoon Thomas
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it ... | jmesteve/saas3 | openerp/addons/email_template/wizard/email_template_preview.py | Python | agpl-3.0 | 3,741 |
"""
Serializers for all Course Enrollment related return objects.
"""
from rest_framework import serializers
from student.models import CourseEnrollment
from course_modes.models import CourseMode
class StringListField(serializers.CharField):
"""Custom Serializer for turning a comma delimited string into a list.
... | eestay/edx-platform | common/djangoapps/enrollment/serializers.py | Python | agpl-3.0 | 3,036 |
# Copyright 2013-2021 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 Imagemagick(AutotoolsPackage):
"""ImageMagick is a software suite to create, edit, compose... | LLNL/spack | var/spack/repos/builtin/packages/imagemagick/package.py | Python | lgpl-2.1 | 1,598 |
# 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... | gojira/tensorflow | tensorflow/contrib/checkpoint/__init__.py | Python | apache-2.0 | 2,226 |
#!/usr/bin/env python
# coding: utf-8
#
# Copyright (c) Greenplum Inc 2008. All Rights Reserved.
#
import sys
import unittest2 as unittest
import tempfile, os, shutil
from gppylib.commands.base import CommandResult, Command, ExecutionError
from gppylib.operations.backup_utils import *
from gppylib.operations.restore ... | rubikloud/gpdb | gpMgmt/bin/gppylib/operations/test/unit/test_unit_restore.py | Python | apache-2.0 | 69,482 |
# Copyright 2016 Tesora 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 a... | zhangg/trove | trove/tests/unittests/guestagent/test_datastore_manager.py | Python | apache-2.0 | 932 |
# Copyright 2016 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... | googleinterns/wss | third_party/slim/datasets/build_imagenet_data.py | Python | apache-2.0 | 26,229 |
#
# Copyright 2012 WebFilings, LLC
#
# 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... | Workiva/furious | example/callback.py | Python | apache-2.0 | 4,446 |
#
# 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... | wileeam/airflow | tests/providers/amazon/aws/sensors/test_sqs.py | Python | apache-2.0 | 4,197 |
# $Id: statemachine.py 7320 2012-01-19 22:33:02Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
A finite state machine specialized for regular-expression-based text filters,
this module defines the following classes:
- `StateMachine`, a state m... | ddd332/presto | presto-docs/target/sphinx/docutils/statemachine.py | Python | apache-2.0 | 57,566 |
# 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/ops/image_ops_test.py | Python | apache-2.0 | 250,893 |
"""Entry point for launching an IPython kernel.
This is separate from the ipykernel package so we can avoid doing imports until
after removing the cwd from sys.path.
"""
import sys
if __name__ == '__main__':
# Remove the CWD from sys.path while we load stuff.
# This is added back by InteractiveShellApp.init_... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/ipykernel_launcher.py | Python | bsd-2-clause | 451 |
import datetime
from decimal import Decimal as D
from django.test import TestCase
from django.core import exceptions
from django.utils.timezone import utc
from django_dynamic_fixture import G
from oscar.apps.voucher.models import Voucher
from oscar.apps.order.models import Order
from oscar.core.compat import get_user... | jinnykoo/wuyisj.com | tests/unit/voucher/model_tests.py | Python | bsd-3-clause | 3,630 |
import pyvision as pv
import scipy as sp
if __name__ == '__main__':
im = pv.Image(sp.zeros((128,128)))
pts = [pv.Point(48,55),pv.Point(80,55)]
im.annotatePoints(pts)
elipse = pv.CenteredRect(64,64,96,96)
im.annotateEllipse(elipse)
im.annotateLabel(pv.Point(40,36),"MMM")
im.annota... | svohara/pyvision | samples/WACV2012_Tutorial/tutorials/TutorialAnnotations.py | Python | bsd-3-clause | 508 |
# encoding: utf-8
"""
med.py
Created by Thomas Mangin on 2009-11-05.
Copyright (c) 2009-2015 Exa Networks. All rights reserved.
"""
from struct import pack
from struct import unpack
from exabgp.bgp.message.update.attribute.attribute import Attribute
# ===============================================================... | earies/exabgp | lib/exabgp/bgp/message/update/attribute/med.py | Python | bsd-3-clause | 1,087 |
#!/usr/bin/env python
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2012, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
"""
Usage: python show_samples <path_to_a_saved_DBM.pkl>
Displays a batch of data from the DBM's training set.
Then int... | skearnes/pylearn2 | pylearn2/scripts/dbm/show_samples.py | Python | bsd-3-clause | 5,434 |
# Django settings for protected_downloads project.
import os.path
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3'... | nathanielvarona/django-sendfile | examples/protected_downloads/settings.py | Python | bsd-3-clause | 2,706 |
# -*- coding: utf-8 -*-
"""
sphinx.websupport.search.xapiansearch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Xapian search adapter.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import xapian
from sphinx.util.osutil import ensuredir
from ... | WhySoGeeky/DroidPot | venv/lib/python2.7/site-packages/sphinx/websupport/search/xapiansearch.py | Python | mit | 2,581 |
#!/usr/bin/python
# Author: Chris Liechti
# Contact: cliechti@gmx.net
# Revision: $Revision: 4156 $
# Date: $Date: 2005-12-08 05:43:13 +0100 (Thu, 08 Dec 2005) $
# Copyright: This module has been placed in the public domain.
"""
A minimal front end to the Docutils Publisher, producing HTML slides using
the S5 templat... | alon/polinax | libs/external_libs/docutils-0.4/tools/rst2s5.py | Python | gpl-2.0 | 684 |
# -*- coding: utf-8 -*-
# Copyright 2008 Jaap Karssenberg <jaap.karssenberg@gmail.com>
'''Test cases for the zim.notebook module.'''
import tests
import os
from zim.fs import File, Dir
from zim.config import ConfigManager, XDG_CONFIG_HOME
from zim.notebook import *
from zim.index import *
import zim.errors
from zi... | fabricehong/zim-desktop | tests/notebook.py | Python | gpl-2.0 | 27,661 |
# -*- test-case-name: openid.test.test_consumer -*-
"""OpenID support for Relying Parties (aka Consumers).
This module documents the main interface with the OpenID consumer
library. The only part of the library which has to be used and isn't
documented in full here is the store required to create an
C{L{Consumer}} in... | wtanaka/google-app-engine-django-openid | src/openid/consumer/consumer.py | Python | gpl-3.0 | 75,015 |
#!/usr/bin/env python
# Only needed until we can enable a pylint test for this. We may have to write
# one or add it to another existing test (like the one to warn on inappropriate
# variable names). Adding to an existing test may be hard as we may have many
# other things that are not compliant with that test.
imp... | Jorge-Rodriguez/ansible | test/sanity/code-smell/no-underscore-variable.py | Python | gpl-3.0 | 6,781 |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) 2008-2014 - Lionel Dricot & Bertrand Rousseau
#
# This program is free software: you can redistribute it and/or modify it under
# t... | shtrom/gtg | tests/tools/test_networkmanager.py | Python | gpl-3.0 | 1,196 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Nandor Sivok <nandor@gawker.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': '1.1',
... | nrwahl2/ansible | lib/ansible/modules/network/citrix/netscaler.py | Python | gpl-3.0 | 4,912 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2016, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | ywcui1990/nupic | examples/sp/sp_tutorial.py | Python | agpl-3.0 | 12,463 |
"""
Synchronizes a mailchimp list with the students of a course.
"""
import itertools
import logging
import math
import random
from collections import namedtuple
from itertools import chain
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from mailsnake import MailSnak... | pepeportela/edx-platform | lms/djangoapps/mailing/management/commands/mailchimp_sync_course.py | Python | agpl-3.0 | 12,350 |
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Romain Bignon
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... | blckshrk/Weboob | modules/aum/antispam.py | Python | agpl-3.0 | 5,066 |
"""
Unit tests for instructor dashboard
Based on (and depends on) unit tests for courseware.
Notes for running by hand:
./manage.py lms --settings test test lms/djangoapps/instructor
"""
from django.test.utils import override_settings
# Need access to internal func to put users in the right group
from django.contr... | mjg2203/edx-platform-seas | lms/djangoapps/instructor/tests/test_legacy_download_csv.py | Python | agpl-3.0 | 3,149 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2015 Smile (<http://www.smile.fr>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | ovnicraft/odoo_addons | smile_document/models/document.py | Python | agpl-3.0 | 2,926 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache Licen... | fenglu-g/incubator-airflow | tests/contrib/operators/test_gcp_bigtable_operator_system_helper.py | Python | apache-2.0 | 2,458 |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | danielvdende/incubator-airflow | airflow/operators/__init__.py | Python | apache-2.0 | 4,581 |