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 |
|---|---|---|---|---|---|
import unittest
import random
import threading
import time
from test import test_support
if test_support.is_jython:
from java.util import ArrayList
from java.lang import String
class ListTestCase(unittest.TestCase):
def test_recursive_list_slices(self):
x = [1,2,3,4,5]
x[1:] = x
s... | zephyrplugins/zephyr | zephyr.plugin.jython/jython2.5.2rc3/Lib/test/test_list_jy.py | Python | epl-1.0 | 3,309 |
import socket
import requests
import threading
import hashlib
import json
try:
import PyQt4
except Exception:
sys.exit("Error: Could not import PyQt4 on Linux systems, you may try 'sudo apt-get install python-qt4'")
from PyQt4.QtGui import *
from PyQt4.QtCore import *
import PyQt4.QtCore as QtCore
import PyQt... | doged/electrum-doged-tor | plugins/labels.py | Python | gpl-3.0 | 6,913 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Matt Makai <matthew.makai@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the ... | mattbernst/polyhartree | support/ansible/modules/extras/notification/twilio.py | Python | gpl-3.0 | 4,325 |
import asyncio
import datetime
import json
from collections import Counter, defaultdict
from pathlib import Path
from typing import Mapping
import aiohttp
import discord
from redbot.core import Config
from redbot.core.bot import Red
from redbot.core.commands import Cog
from redbot.core.data_manager import cog_data_p... | palmtree5/Red-DiscordBot | redbot/cogs/audio/core/__init__.py | Python | gpl-3.0 | 5,241 |
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.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, including
# without limitation the rights to use, copy, modi... | nanocell/lsync | python/boto/cloudformation/connection.py | Python | gpl-3.0 | 15,766 |
""" JobMonitoringHandler is the implementation of the JobMonitoring service
in the DISET framework
The following methods are available in the Service interface
"""
__RCSID__ = "$Id$"
from types import IntType, LongType, ListType, DictType, StringTypes, StringType, NoneType
from DIRAC.Core.DISET.RequestHandle... | rajanandakumar/DIRAC | WorkloadManagementSystem/Service/JobMonitoringHandler.py | Python | gpl-3.0 | 18,825 |
# Copyright (c) 2010-2012 extras developers. See LICENSE for details.
"""Extensions to the Python standard library."""
import sys
__all__ = [
'safe_hasattr',
'try_import',
'try_imports',
]
# same format as sys.version_info: "A tuple containing the five components of
# the version number: major, mino... | javierag/samba | lib/extras/extras/__init__.py | Python | gpl-3.0 | 3,957 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from operator import attrgetter
import re
import openerp
from openerp import SUPERUSER_ID
from openerp.osv import osv, fields
from openerp.tools import ustr
from openerp.tools.translate import _
from opene... | minhphung171093/GreenERP | openerp/addons/base/res/res_config.py | Python | gpl-3.0 | 31,737 |
from modeltranslation.translator import translator, TranslationOptions
from nsms.text.models import *
from django.utils.translation import ugettext as _
from django.utils.translation import get_language as _get_language
from modeltranslation import utils
class TextTranslationOptions(TranslationOptions):
fields = ... | eHealthAfrica/ureport | ureport/translation.py | Python | agpl-3.0 | 646 |
# -*- coding: utf-8 -*-
# Copyright(C) 2013 Christophe Lampin
# Copyright(C) 2009-2012 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 ... | sputnick-dev/weboob | modules/hellobank/perso/transactions.py | Python | agpl-3.0 | 4,962 |
# 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)
import os.path
import re
from llnl.util.filesystem import mkdirp, touch
import spack.cmd.license
import spack.paths
from... | LLNL/spack | lib/spack/spack/test/cmd/license.py | Python | lgpl-2.1 | 3,129 |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | tmerrick1/spack | var/spack/repos/builtin/packages/fyba/package.py | Python | lgpl-2.1 | 2,243 |
# 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 Libxi(AutotoolsPackage, XorgPackage):
"""libXi - library for the X Input Extension."""
... | LLNL/spack | var/spack/repos/builtin/packages/libxi/package.py | Python | lgpl-2.1 | 934 |
# Copyright 2011 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 req... | paninetworks/neutron | neutron/extensions/quotasv2.py | Python | apache-2.0 | 5,149 |
"""The test for light device automation."""
from datetime import timedelta
import pytest
import homeassistant.components.automation as automation
from homeassistant.components.light import DOMAIN
from homeassistant.const import CONF_PLATFORM, STATE_OFF, STATE_ON
from homeassistant.helpers import device_registry
from ... | tboyce021/home-assistant | tests/components/light/test_device_trigger.py | Python | apache-2.0 | 8,300 |
data = (
'ggwem', # 0x00
'ggweb', # 0x01
'ggwebs', # 0x02
'ggwes', # 0x03
'ggwess', # 0x04
'ggweng', # 0x05
'ggwej', # 0x06
'ggwec', # 0x07
'ggwek', # 0x08
'ggwet', # 0x09
'ggwep', # 0x0a
'ggweh', # 0x0b
'ggwi', # 0x0c
'ggwig', # 0x0d
'ggwigg', # 0x0e
'ggwigs... | google/contentbox | third_party/unidecode/x0b0.py | Python | apache-2.0 | 5,111 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from rest_framework import permissions as drf_permissions
from api.base.utils import get_user_auth
from osf.models.action import ReviewAction
from osf.models.mixins import ReviewableMixin, ReviewProviderMixin
from osf.utils.workflows import ReviewTrigger... | pattisdr/osf.io | api/actions/permissions.py | Python | apache-2.0 | 2,521 |
#
# 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... | fluo-io/fluo-deploy | lib/muchos/config/ec2.py | Python | apache-2.0 | 9,189 |
#
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | eayunstack/ceilometer | ceilometer/api/app.py | Python | apache-2.0 | 3,764 |
##
## Bayesian and frequentist approaches to hypothesis testing for MISO
##
from numpy import *
import os
import scipy
from scipy import stats
from scipy.stats import gaussian_kde
from decimal import Decimal
import misopy
from misopy.samples_utils import *
from misopy.credible_intervals import *
import misopy.misc_util... | kdaily/altanalyze | misopy/hypothesis_test.py | Python | apache-2.0 | 15,310 |
# module pyparsing.py
#
# Copyright (c) 2003-2011 Paul T. McGuire
#
# 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, cop... | vsemionov/wordbase | src/wordbase/pyparsing.py | Python | bsd-3-clause | 146,612 |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2015, Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -------------------------------------------------------------------------... | sbtlaarzc/vispy | vispy/visuals/text/text.py | Python | bsd-3-clause | 21,058 |
# -*- coding: utf-8 -*-
#
#
# Project name: OpenVAS2Report: A set of tools to manager OpenVAS XML report files.
# Project URL: https://github.com/cr0hn/openvas_to_report
#
# Copyright (c) 2015, cr0hn<-AT->cr0hn.com
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modificatio... | cr0hn/openvas_to_report | openvas_to_report/examples/__init__.py | Python | bsd-3-clause | 1,761 |
# (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
import os
# project
from tests.checks.common import AgentCheckTest, Fixtures
DEPLOYMENT_METRICS_CONFIG = {
'init_config': {
'default_timeout': 5
},
'instances': [
{
... | varlib1/servermall | marathon/test_marathon.py | Python | bsd-3-clause | 2,285 |
from __future__ import unicode_literals
import codecs
import os
import re
from django.conf import settings
from django.core.management.base import CommandError
from django.db import models
from django.db.models import get_models
def sql_create(app, style, connection):
"Returns a list of the CREATE TABLE SQL sta... | pjdelport/django | django/core/management/sql.py | Python | bsd-3-clause | 7,970 |
from pandac.PandaModules import *
from toontown.toonbase import TTLocalizer
from toontown.toonbase import ToontownGlobals
ENDLESS_GAME = config.GetBool('endless-ring-game', 0)
NUM_RING_GROUPS = 16
MAX_TOONXZ = 15.0
MAX_LAT = 5
MAX_FIELD_SPAN = 135
CollisionRadius = 1.5
CollideMask = ToontownGlobals.CatchGameBitmask
TAR... | ToonTownInfiniteRepo/ToontownInfinite | toontown/minigame/TargetGameGlobals.py | Python | mit | 7,031 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... | felixturner/three.js | utils/exporters/blender/2.64/scripts/addons/io_mesh_threejs/__init__.py | Python | mit | 17,429 |
#!/usr/bin/env python
"""
Scans the source directories for
memory initializers and finalizers and
emits and implementation of
``void mem_initialize()`` and
``void mem_finalize()`` into ``mem_initializer.cpp``
in the destination directory.
"""
import mk_genfile_common
import argparse
import logging
import os
import sys
... | mschlaipfer/z3 | scripts/mk_mem_initializer_cpp.py | Python | mit | 1,138 |
#!/usr/bin/env python
# encoding: utf-8
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2009 Prof. William H. Green (whgreen@mit.edu) and the
# RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby granted, free of cha... | pierrelb/RMG-Py | rmgpy/quantityTest.py | Python | mit | 38,311 |
import unittest
import tempfile
import shutil
import os.path
import tuned.profiles.exceptions
from tuned.profiles.loader import Loader
from flexmock import flexmock
class MockProfile(object):
def __init__(self, name, config):
self.name = name
self.options = {}
self.units = {}
self.test_config = config
class ... | adamBrinek/tuned | tuned/tests/profiles/test_loader.py | Python | gpl-2.0 | 3,581 |
#
# SelfTest/Signature/test_dss.py: Self-test for DSS signatures
#
# ===================================================================
#
# Copyright (c) 2014, Legrandin <helderijs@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted pr... | mrquim/repository.mrquim | script.module.pycryptodome/lib/Crypto/SelfTest/Signature/test_dss.py | Python | gpl-2.0 | 28,054 |
import numpy as N
import sys as SYS
import os as OS
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties
from matplotlib import rc
rc('text', usetex=True)
font = FontProperties()
font.set_size(20)
#------------------------------------------------------
# ... | mostofi/wannier90 | examples/example33/kdotp_plot.py | Python | gpl-2.0 | 6,672 |
# Copyright (C) 2012 Brian Parma
#
# 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 1, or (at your option)
# any later version.
#
# This program is distributed in the hope that it ... | virtuald/exaile | plugins/ipconsole/ipconsoleprefs.py | Python | gpl-2.0 | 1,656 |
#!/usr/bin/env python
#
# Copyright (C) 2011 Andy Aschwanden
#
# This file is part of PISM.
#
# PISM 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 l... | JohannesFeldmann/pism | examples/storglaciaren/sg_create_3d.py | Python | gpl-2.0 | 7,325 |
#!/usr/bin/env python2
# dev-host-cl Copyright (c) 2013 by GermainZ <germanosz@gmail.om>
# Requirements: python2
# python2-requests
#
# Dev-Host API documentation
# http://d-h.st/api
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Li... | AndroidOpenSourceXperia/android_scripts | devhost.py | Python | gpl-2.0 | 15,780 |
"""scons.Node.Alias
Alias nodes.
This creates a hash of global Aliases (dummy targets).
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentat... | qewerty/moto.old | tools/scons/engine/SCons/Node/Alias.py | Python | gpl-2.0 | 4,276 |
# encoding: utf-8
"Module for homogeneous deformation and calculations of elastic constants."
import gtk
from gettext import gettext as _
from ase.gui.simulation import Simulation
from ase.gui.minimize import MinimizeMixin
from ase.gui.energyforces import OutputFieldMixin
from ase.gui.widgets import oops, pack, AseGu... | grhawk/ASE | tools/ase/gui/scaling.py | Python | gpl-2.0 | 19,786 |
#!/usr/bin/env python
#
# Generate an input mesh
#
from boututils import DataFile # Wrapper around NetCDF4 libraries
nx = 5 # Minimum is 5: 2 boundary, one evolved
ny = 32 # Minimum 5. Should be divisible by number of processors (so powers of 2 nice)
dy = 1. # distance between points in y, in m/g22/lengthunit
ixs... | bendudson/BOUT | examples/test-staggered/generate.py | Python | gpl-3.0 | 522 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.com>
#
# This file is part of Ansible
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3... | tanderegg/ansible-modules-core | network/cumulus/cl_bridge.py | Python | gpl-3.0 | 13,081 |
from bears.yml.RAMLLintBear import RAMLLintBear
from tests.LocalBearTestHelper import verify_local_bear
good_file = """
#%RAML 0.8
title: World Music API
baseUri: http://example.api.com/{version}
version: v1
"""
bad_file = """#%RAML 0.8
title: Failing RAML
version: 1
baseUri: http://example.com
/resource:
descr... | SanketDG/coala-bears | tests/yml/RAMLLintBearTest.py | Python | agpl-3.0 | 602 |
"""
Management commands for third_party_auth
"""
import logging
from django.core.management.base import BaseCommand, CommandError
from common.djangoapps.third_party_auth.tasks import fetch_saml_metadata
class Command(BaseCommand):
""" manage.py commands to manage SAML/Shibboleth SSO """
help = '''Configur... | edx/edx-platform | common/djangoapps/third_party_auth/management/commands/saml.py | Python | agpl-3.0 | 1,687 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | jeffery9/mixprint_addons | sale/report/sale_report.py | Python | agpl-3.0 | 5,578 |
#!/usr/bin/env python
# Author: Pau Miquel i Mir <pau.miquel.mir@cern.ch> <pmm1g15@soton.ac.uk>>
# Date: July, 2016
#
# DISCLAIMER: This script is a prototype and a work in progress. Indeed, it is possible that
# it may not work for certain tutorials, and that it, or the tutorial, might need to be
# tweaked slightly to... | Y--/root | documentation/doxygen/converttonotebook.py | Python | lgpl-2.1 | 35,405 |
"""
Support for D-link W215 smart switch.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.dlink/
"""
import logging
import voluptuous as vol
from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA)
from homeassistant.const impo... | JshWright/home-assistant | homeassistant/components/switch/dlink.py | Python | apache-2.0 | 4,666 |
#!/usr/bin/env python
"""Gather information from the registry on windows."""
import re
import stat
from grr.lib import aff4
from grr.lib import artifact
from grr.lib import artifact_lib
from grr.lib import flow
from grr.lib import rdfvalue
from grr.lib import utils
from grr.proto import flows_pb2
class RegistryFind... | ojengwa/grr | lib/flows/general/registry.py | Python | apache-2.0 | 6,980 |
#!/usr/bin/python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | tgracchus/spinnaker | pylib/spinnaker/reconfigure_spinnaker.py | Python | apache-2.0 | 891 |
# -*- coding: utf-8 -*-
###############################################################################
#
# ListZones
# Retrieves the list of Zone resources for the specified project.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
#... | jordanemedlock/psychtruths | temboo/core/Library/Google/ComputeEngine/Zones/ListZones.py | Python | apache-2.0 | 5,734 |
# Copyright 2013 VMware, 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 ... | noironetworks/neutron | neutron/extensions/l3_ext_gw_mode.py | Python | apache-2.0 | 820 |
# 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 applicab... | xcyan/models | ptn/model_ptn.py | Python | apache-2.0 | 8,258 |
"""The tests for the hassio component."""
import aiohttp
import pytest
from homeassistant.components.hassio.handler import HassioAPIError
async def test_api_ping(hassio_handler, aioclient_mock):
"""Test setup with API ping."""
aioclient_mock.get("http://127.0.0.1/supervisor/ping", json={"result": "ok"})
... | jawilson/home-assistant | tests/components/hassio/test_handler.py | Python | apache-2.0 | 7,540 |
"""
Copyright (C) 2010 David Fong and Michael Saunders
LSMR uses an iterative method.
07 Jun 2010: Documentation updated
03 Jun 2010: First release version in Python
David Chin-lung Fong clfong@stanford.edu
Institute for Computational and Mathematical Engineering
Stanford University
Michael Saunders ... | Eric89GXL/scipy | scipy/sparse/linalg/isolve/lsmr.py | Python | bsd-3-clause | 15,128 |
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <headingcell level=2>
# Usage of IC 7433
# <codecell>
from __future__ import print_function
from BinPy import *
# <codecell>
# Usage of IC 7433:
ic = IC_7433()
print(ic.__doc__)
# <codecell>
# The Pin configuration is:
inp = {2: 0, 3: 0, 5: 0, 6: 0, 7: 0, ... | daj0ker/BinPy | BinPy/examples/source/ic/Series_7400/IC7433.py | Python | bsd-3-clause | 1,247 |
# -*- coding: utf-8 -*-
"""
line.client
~~~~~~~~~~~
LineClient for sending and receiving message from LINE server.
:copyright: (c) 2014 by Taehoon Kim.
:license: BSD, see LICENSE for more details.
"""
import rsa
import requests
try:
import simplejson as json
except ImportError:
import json... | samsam2310/LINE | line/api.py | Python | bsd-3-clause | 11,264 |
# PyVision License
#
# Copyright (c) 2006-2010 David S. Bolme
# 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, thi... | tigerking/pyvision | src/samples/TutFaceEyes.py | Python | bsd-3-clause | 3,860 |
#!/usr/bin/env python
"""
Implementation of the hyperref package
TO DO:
- \autoref doesn't look for \*autorefname, it only looks for \*name
- Layouts
- Forms optional parameters
"""
from plasTeX import Command, Environment
from plasTeX.Base.LaTeX.Crossref import ref, pageref
from nameref import Nameref, nameref
imp... | themutt/plastex | plasTeX/Packages/hyperref.py | Python | mit | 4,885 |
import os
module = None
for module in os.listdir(os.path.dirname(__file__)):
if module == '__init__.py' or module[-3:] != '.py':
continue
__import__(module[:-3], locals(), globals())
del module
| sdgdsffdsfff/redis-ctl | models/__init__.py | Python | mit | 211 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2010, 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 opt... | NikolaYolov/invenio_backup | modules/miscutil/lib/invenio_connector_regression_tests.py | Python | gpl-2.0 | 3,515 |
import sys, unittest, re, os.path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', '..', 'src'))
import Exscript
import Exscript.util.start
from multiprocessing import Value
def count_calls(job, host, conn, data, **kwargs):
# Warning: Assertions raised in this function happen in a subprocess... | egroeper/exscript | tests/Exscript/util/startTest.py | Python | gpl-2.0 | 2,091 |
from sympy.core import symbols, Symbol, Tuple, oo, Dummy
from sympy.core.compatibility import iterable, range
from sympy.tensor.indexed import IndexException
from sympy.utilities.pytest import raises, XFAIL
# import test:
from sympy import IndexedBase, Idx, Indexed, S, sin, cos, Sum, Piecewise, And, Order, LessThan, S... | wxgeo/geophar | wxgeometrie/sympy/tensor/tests/test_indexed.py | Python | gpl-2.0 | 14,359 |
# -*- coding: utf-8 -*-
"""
Confocal-refocus task.
Qudi 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.
Qudi is distributed in the hope tha... | tobiasgehring/qudi | logic/tasks/refocus.py | Python | gpl-3.0 | 2,217 |
# -*- coding: utf-8 -*-
import re
import time
from module.plugins.internal.Account import Account
class DebridItaliaCom(Account):
__name__ = "DebridItaliaCom"
__type__ = "account"
__version__ = "0.15"
__status__ = "testing"
__description__ = """Debriditalia.com account plugin"""
__li... | fayf/pyload | module/plugins/accounts/DebridItaliaCom.py | Python | gpl-3.0 | 1,385 |
import orange
data = orange.ExampleTable("iris")
classifier = orange.LinearLearner(data)
for i, cls_name in enumerate(data.domain.classVar.values):
print "Attribute weights for %s vs. rest classification:\n\t" % cls_name,
for attr, w in zip(data.domain.attributes, classifier.weights[i]):
print "%s: %... | qPCR4vir/orange | Orange/testing/regression/tests_20/reference_linear-learner.py | Python | gpl-3.0 | 353 |
# -*- coding: utf-8 -*-
#
# gPodder - A media aggregator and podcast client
# Copyright (c) 2005-2015 Thomas Perl and the gPodder Team
#
# gPodder 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... | daneoshiga/gpodder | src/gpodder/gtkui/interface/__init__.py | Python | gpl-3.0 | 764 |
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# inventory cache
DOCUMENTATION = r'''
options:
aws_profile:
description: The AWS profile
type: str
alia... | ujenmr/ansible | lib/ansible/plugins/doc_fragments/aws_credentials.py | Python | gpl-3.0 | 1,170 |
from gmpy2 import *
from math import log
from time import time
# This test is designed to detect issues when allocating memory for large
# numbers. If it crashes and you need to work with very large numbers,
# you will need to compile GMP from scratch and try a different memory
# allocation option.
def p... | andreamartire/gmpy | test2/test_large.py | Python | lgpl-3.0 | 884 |
# Copyright 2013 New Dream Network, LLC (DreamHost)
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | CingHu/neutron-ustack | neutron/tests/unit/services/loadbalancer/drivers/haproxy/test_namespace_driver.py | Python | apache-2.0 | 25,764 |
# -*- coding: utf-8 -*-
# Copyright 2013 Google Inc. 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 to u... | BrandonY/gsutil | gslib/tests/test_util.py | Python | apache-2.0 | 14,742 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | julianwang/cinder | cinder/db/sqlalchemy/migrate_repo/versions/038_add_driver_initiator_data_table.py | Python | apache-2.0 | 2,020 |
from __future__ import absolute_import
from __future__ import print_function
from typing import Any
from argparse import ArgumentParser
from optparse import make_option
from django.core.management.base import BaseCommand
from zerver.models import RealmFilter, all_realm_filters, get_realm_by_string_id
from zerver.lib... | arpith/zulip | zerver/management/commands/realm_filters.py | Python | apache-2.0 | 2,982 |
# Copyright 2019 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/eager/lift_to_graph_test.py | Python | apache-2.0 | 3,531 |
#!/usr/bin/python
# Author: Zion Orent <zorent@ics.com>
# Copyright (c) 2015 Intel Corporation.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limi... | whbruce/upm | examples/python/mhz16.py | Python | mit | 2,680 |
#!/usr/bin/python
import time
import urllib2
import sys
import simplejson as json
import ConfigParser
import logging
CONF_FILE = '/etc/zabbix/check_api.conf'
LOGGING_LEVELS = {
'CRITICAL': logging.CRITICAL,
'WARNING': logging.WARNING,
'INFO': logging.INFO,
'DEBUG': logging.DEBUG
}
def get_logger(level... | att-innovate/occam | puppet/occam/profile/files/monitoring/zabbix/scripts/check_api.py | Python | mit | 3,518 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
SagaAlgorithmProvider.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*****************... | geopython/QGIS | python/plugins/processing/algs/saga/SagaAlgorithmProvider.py | Python | gpl-2.0 | 6,154 |
import orange
import sys
from SDRule import *
true = 1
false = 0
class CN2_SD:
def __init__(self,k):
self.k = k
self.counter = orange.newmetaid()
self.weightID = orange.newmetaid()
self.rbf = orange.RuleBeamFinder()
self.rbf.evaluator = RuleEvaluator_WRAcc()
... | anirudhvenkats/clowdflows | workflows/subgroup_discovery/SubgroupDiscovery/CN2_SD.py | Python | gpl-3.0 | 4,116 |
import re
import bleach
from tower import ugettext_lazy as _lazy
ALLOWED_TAGS = bleach.ALLOWED_TAGS + [
'div', 'span', 'p', 'br', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
'pre', 'code', 'cite',
'dl', 'dt', 'dd', 'small', 'sub', 'sup', 'u', 'strike', 'samp', 'abbr',
'ul', 'ol', 'li',
'nobr', 'dfn', 'cap... | robhudson/kuma | kuma/wiki/constants.py | Python | mpl-2.0 | 12,819 |
{
'name' : 'Use partner language in mail',
'version' : '1.0.0',
'author' : 'Ivan Yelizariev',
'category' : 'Mail',
'website' : 'https://yelizariev.github.io',
'depends' : ['mail'],
'data':[],
'installable': True,
}
| litnimax/addons-yelizariev | mail_partner_lang/__openerp__.py | Python | lgpl-3.0 | 248 |
"""
Create new streamparse project template.
"""
from __future__ import absolute_import
from streamparse.bootstrap import quickstart
def subparser_hook(subparsers):
""" Hook to add subparser for this command. """
subparser = subparsers.add_parser('quickstart',
descripti... | hodgesds/streamparse | streamparse/cli/quickstart.py | Python | apache-2.0 | 643 |
# This file is part of the MapProxy project.
# Copyright (C) 2010 Omniscale <http://omniscale.de>
#
# 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... | procrastinatio/mapproxy | mapproxy/test/unit/test_collections.py | Python | apache-2.0 | 3,064 |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
# @param a ListNode
# @return a ListNode
def swapPairs(self, head):
if head is None:
return head
res = None
res_end = Non... | huanqi/leetcode-python | swap_nodes_in_pairs/solution2.py | Python | bsd-2-clause | 1,177 |
#!/usr/bin/env python
# Copyright 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.
'''Publishes a set of extensions to the webstore.
Given an unpacked extension, compresses and sends to the Chrome webstore.
Relea... | danakj/chromium | chrome/browser/resources/chromeos/chromevox/tools/publish_webstore_extension.py | Python | bsd-3-clause | 4,983 |
from django.core.management.base import BaseCommand, CommandError
import commonware.log
from olympia.access.models import Group, GroupUser
from olympia.users.models import UserProfile
class Command(BaseCommand):
help = ('Remove a user from a group. Syntax: \n'
' ./manage.py removeuserfromgroup <u... | mstriemer/olympia | src/olympia/zadmin/management/commands/removeuserfromgroup.py | Python | bsd-3-clause | 1,740 |
# -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
import copy
import grp
import inspect
try:
import argparse
except ImportError: # python 2.6
from . import argparse_compat as argparse
import os
import pwd
import ssl
import sys
import ... | havard024/prego | venv/lib/python2.7/site-packages/gunicorn/config.py | Python | mit | 44,412 |
"""
homeassistant.components.rollershutter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Rollershutter component.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/rollershutter/
"""
import os
import logging
from homeassistant.config import load_yaml_config_file
... | toddeye/home-assistant | homeassistant/components/rollershutter/__init__.py | Python | mit | 4,537 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet :
# This file is part of Fail2Ban.
#
# Fail2Ban 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;... | TylerMoeller/fail2ban | fail2ban/helpers.py | Python | gpl-2.0 | 3,914 |
from app import current_app as app
from app.helpers.data_getter import DataGetter
from tests.unittests import OpenEventTestCase
from tests.unittests.auth_helper import create_super_admin, login
from tests.unittests.setup_database import Setup
def get_or_create_super_admin():
user = DataGetter.get_user_by_email("t... | Princu7/open-event-orga-server | tests/unittests/views/view_test_case.py | Python | gpl-3.0 | 824 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
import webnotes.defaults
import json
from webnotes import msgprint, _
from webnotes.utils import cstr, flt, cint
from stock.stock_led... | saurabh6790/omn-app | stock/doctype/stock_reconciliation/stock_reconciliation.py | Python | agpl-3.0 | 11,140 |
"""Interface for adding certificate generation tasks to the XQueue. """
import json
import random
import logging
import lxml.html
from lxml.etree import XMLSyntaxError, ParserError # pylint:disable=no-name-in-module
from django.test.client import RequestFactory
from django.conf import settings
from django.core.urlres... | dkarakats/edx-platform | lms/djangoapps/certificates/queue.py | Python | agpl-3.0 | 19,745 |
# -*- coding: utf-8 -*-
#
# This file is part of PyBuilder
#
# Copyright 2011-2015 PyBuilder Team
#
# 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/l... | Danielweber7624/pybuilder | src/main/python/pybuilder/plugins/exec_plugin.py | Python | apache-2.0 | 3,101 |
#!/usr/bin/python
############################################################
# <bsn.cl fy=2013 v=onl>
#
# Copyright 2013, 2014 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 ... | capveg/ONL | tools/py/pcgen.py | Python | epl-1.0 | 4,616 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# 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',
... | ATIX-AG/ansible | lib/ansible/modules/network/f5/bigip_profile_dns.py | Python | gpl-3.0 | 20,772 |
"""
rename this to test_assumptions.py when the old assumptions system is deleted
"""
from sympy.abc import x, y
from sympy.assumptions.assume import global_assumptions, Predicate
from sympy.assumptions.ask import _extract_facts, Q
from sympy.core import symbols
from sympy.logic.boolalg import Or
from sympy.printing im... | NikNitro/Python-iBeacon-Scan | sympy/assumptions/tests/test_assumptions_2.py | Python | gpl-3.0 | 1,849 |
"""
Realtek Semiconductor Corp.
RTL8195A elf2bin script
"""
import sys, array, struct, os, re, subprocess
import hashlib
import shutil
import time
import binascii
import elftools
from tools.paths import TOOLS_BOOTLOADERS
from tools.toolchains import TOOLCHAIN_PATHS
# Constant Variables
TAG = 0x81950001
VER = 0x8195... | betzw/mbed-os | tools/targets/REALTEK_RTL8195AM.py | Python | apache-2.0 | 5,555 |
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-DisableMachineAcctChange',
'Author': ['@harmj0y'],
'Description': ('Disables the machine account for the target system '
'f... | EmpireProject/Empire | lib/modules/powershell/persistence/misc/disable_machine_acct_change.py | Python | bsd-3-clause | 2,520 |
#!/usr/bin/env python
import argparse
import errno
import os
import subprocess
import sys
import tempfile
from lib.config import PLATFORM, get_target_arch, get_chromedriver_version, \
get_platform_key
from lib.util import atom_gyp, execute, get_atom_shell_version, parse_version, \
... | thingsinjars/electron | script/upload.py | Python | mit | 7,675 |
""" Test for too many branches. """
# pylint: disable=using-constant-test
def wrong(): # [too-many-branches]
""" Has too many branches. """
if 1:
pass
elif 1:
pass
elif 1:
pass
elif 1:
pass
elif 1:
pass
elif 1:
pass
try:
... | ruchee/vimrc | vimfiles/bundle/vim-python/submodules/pylint/tests/functional/t/too/too_many_branches.py | Python | mit | 1,099 |
# Volatility
# Copyright (C) 2007-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 Version 2 as
# published by the Free Software Foundation. You may not use, modify or
# distribu... | thaskell1/volatility | volatility/plugins/linux/lsmod.py | Python | gpl-2.0 | 25,003 |
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | skg-net/ansible | lib/ansible/module_utils/network/edgeos/edgeos.py | Python | gpl-3.0 | 4,592 |
from openalpr import Alpr
| peters/openalpr | src/bindings/python/openalpr/__init__.py | Python | agpl-3.0 | 26 |
# Copyright 2013, Big Switch 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 required by applic... | zouyapeng/horizon-newtouch | openstack_dashboard/dashboards/project/firewalls/tabs.py | Python | apache-2.0 | 5,342 |
"""Config flow to configure Heos."""
from urllib.parse import urlparse
from pyheos import Heos, HeosError
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components import ssdp
from homeassistant.const import CONF_HOST
from .const import DATA_DISCOVERED_HOSTS, DOMAIN
def format... | tboyce021/home-assistant | homeassistant/components/heos/config_flow.py | Python | apache-2.0 | 3,211 |