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 |
|---|---|---|---|---|---|
"""
sentry.interfaces.exception
~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
__all__ = ('Exception',)
from django.conf import settings
from sentry.interfaces.base impor... | nicholasserra/sentry | src/sentry/interfaces/exception.py | Python | bsd-3-clause | 9,328 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
class ParserException(Exception):
pass
| dergraaf/xpcc | tools/system_design/xmlparser/parser_exception.py | Python | bsd-3-clause | 88 |
# This is an example on how to use complex columns
import tables as tb
class Particle(tb.IsDescription):
name = tb.StringCol(16, pos=1) # 16-character String
lati = tb.ComplexCol(itemsize=16, pos=2)
longi = tb.ComplexCol(itemsize=8, pos=3)
vector = tb.ComplexCol(itemsize=8, shape=(2,), pos=4)
ma... | avalentino/PyTables | examples/table3.py | Python | bsd-3-clause | 1,660 |
"""A single source for all units in known ATS variables (WIP!)"""
native_units = { 'pressure' : 'Pa',
'temperature' : 'K',
'ponded_depth' : 'm',
'saturation_liquid' : '-',
'saturation_gas' : '-',
'saturation_ice' : '-',
... | amanzi/ats-dev | tools/utils/ats_units.py | Python | bsd-3-clause | 517 |
from __future__ import print_function
import unittest2
from lldbsuite.test.decorators import *
from lldbsuite.test.concurrent_base import ConcurrentEventsBase
from lldbsuite.test.lldbtest import TestBase
@skipIfWindows
class ConcurrentTwoBreakpointsOneSignal(ConcurrentEventsBase):
mydir = ConcurrentEventsBase.... | youtube/cobalt | third_party/llvm-project/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointsOneSignal.py | Python | bsd-3-clause | 713 |
# License: BSD 3 clause
import sys
from warnings import warn
import numpy as np
from tick.base_model import LOSS_AND_GRAD
from tick.hawkes.model.build.hawkes_model import (
ModelHawkesSumExpKernLeastSq as _ModelHawkesSumExpKernLeastSq)
from .base import ModelHawkes
class ModelHawkesSumExpKernLeastSq(ModelHawke... | X-DataInitiative/tick | tick/hawkes/model/model_hawkes_sumexpkern_leastsq.py | Python | bsd-3-clause | 5,875 |
# -*- coding: utf-8 -*-
#
# Briefcase documentation build configuration file, created by
# sphinx-quickstart on Sat Jul 27 14:58:42 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... | pombredanne/briefcase | docs/conf.py | Python | bsd-3-clause | 7,797 |
"""
A Canarydrop ties a canarytoken to an alerting mechanisms,
and records accounting information about the Canarytoken.
Maps to the object stored in Redis.
"""
import datetime
import random
import md5
from constants import OUTPUT_CHANNEL_EMAIL, OUTPUT_CHANNEL_TWILIO_SMS
from queries import get_all_canary_sites, ge... | tdr130/canarytokens | canarydrop.py | Python | bsd-3-clause | 6,563 |
"""
The Response class in REST framework is similar to HTTPResponse, except that
it is initialized with unrendered data, instead of a pre-rendered string.
The appropriate renderer is called during Django's template response rendering.
"""
from __future__ import unicode_literals
import django
from django.core.handlers.... | gminds/rapidnewsng | rest_framework/response.py | Python | bsd-3-clause | 3,316 |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2015, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#----------------------------------------... | clairetang6/bokeh | bokeh/io.py | Python | bsd-3-clause | 20,374 |
# -*- coding: utf-8 -*-
"""
flaskbb.message.models
~~~~~~~~~~~~~~~~~~~~~~
The models for the conversations and messages are located here.
:copyright: (c) 2014 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
from sqlalchemy_utils import UUIDType
from flaskbb.extensions import... | realityone/flaskbb | flaskbb/message/models.py | Python | bsd-3-clause | 3,612 |
import inspect
from chatterbot import languages
from unittest import TestCase
class LanguageClassTests(TestCase):
def test_classes_have_correct_attributes(self):
language_classes = languages.get_language_classes()
for name, obj in language_classes:
self.assertTrue(inspect.isclass(obj... | vkosuri/ChatterBot | tests/test_languages.py | Python | bsd-3-clause | 599 |
from django.test import SimpleTestCase
from couchexport.transforms import couch_to_excel_datetime
class ExportTransformTest(SimpleTestCase):
def test_couch_to_excel_datetime_current_fmt(self):
self.assertEqual('2015-05-14 13:03:06', couch_to_excel_datetime('2015-05-14T13:03:06.455000Z', {}))
def tes... | dimagi/commcare-hq | corehq/ex-submodules/couchexport/tests/test_transforms.py | Python | bsd-3-clause | 462 |
# Copyright (c) 2021-2022 Renata Hodovan, Akos Kiss.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
from inspect import signature
class FormatterDecorator(object):
... | renatahodovan/fuzzinator | fuzzinator/formatter/formatter_decorator.py | Python | bsd-3-clause | 4,802 |
import numpy
from numpy.distutils.misc_util import Configuration
def configuration(parent_package="", top_path=None):
config = Configuration("tree", parent_package, top_path)
config.add_extension("_tree",
sources=["_tree.c"],
include_dirs=[numpy.get_include()]... | cdegroc/scikit-learn | sklearn/tree/setup.py | Python | bsd-3-clause | 486 |
from uuid import uuid4
from celery import shared_task, current_app, Task
from django.utils.timezone import now
from django_celery_fulldbresult import serialization
from django_celery_fulldbresult.errors import SchedulingStopPublishing
from django_celery_fulldbresult.models import (
TaskResultMeta, SCHEDULED, SCHE... | resulto/django-celery-fulldbresult | django_celery_fulldbresult/tasks.py | Python | bsd-3-clause | 2,426 |
# -*- coding: utf-8 -*-
"""
force_rekey.py forces a VSD keyserver to reissue Seed, SEKs, and other primitives.
--- Author ---
Roman Dodin <dodin.roman@gmail.com>
--- Usage ---
python force_rekey.py
--- Documentation ---
https://github.com/nuagenetworks/vspk-examples/blob/master/python/force_rekey.md
"""
from __futur... | nuagenetworks/vspk-examples | python/force_rekey.py | Python | bsd-3-clause | 1,673 |
#!/usr/bin/env python
import argparse
import os.path as osp
import instance_occlsegm_lib
if __name__ == '__main__':
here = osp.dirname(osp.abspath(__file__))
default_logs_dir = osp.join(here, 'logs')
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
p... | start-jsk/jsk_apc | demos/instance_occlsegm/examples/instance_occlsegm/instance_occlusion_segmentation/summarize_logs.py | Python | bsd-3-clause | 1,538 |
"""
Tests for FormGroups
"""
from django import forms
from unittest import TestCase
from rebar.group import formgroup_factory, FormGroup
class FormGroupTests(TestCase):
def test_factory(self):
FormGroupClass = formgroup_factory([])
self.assert_(issubclass(FormGroupClass, FormGroup))
def t... | dawalama/rebar | src/rebar/tests/test_formgroup.py | Python | bsd-3-clause | 4,134 |
import os
import pkgutil
import re
import shutil
import subprocess
import sys
from distutils.version import LooseVersion
from distutils import log
from sphinx.setup_command import BuildDoc as SphinxBuildDoc
SUBPROCESS_TEMPLATE = """
import os
import sys
{build_main}
os.chdir({srcdir!r})
{sys_path_inserts}
for b... | astropy/astropy-helpers | astropy_helpers/commands/build_sphinx.py | Python | bsd-3-clause | 8,176 |
# ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
# Redistribution and use in ... | tacaswell/scikit-xray | skbeam/core/tests/test_correlation.py | Python | bsd-3-clause | 15,145 |
#!/usr/bin/env python
import os
import sys
import numpy as np
from ..galaxymakers import ExpNGMixGalaxyMaker
from ..medsmakers import MemoryMEDSMaker
import fitsio
import copy
class BlendedPairMEDSMaker(object):
def __init__(self,Np,Npsf=25,**kwargs):
if 'seed' in kwargs:
self.rs = np.random.Ra... | esheldon/egret | egret/blendmakers/medspairblendmaker.py | Python | bsd-3-clause | 9,993 |
# -*- coding: utf-8 -*-
from __future__ import with_statement
import itertools
import warnings
from django.conf import settings
from django.contrib import admin
from django.contrib.auth.models import Permission
from django.contrib.messages.storage import default_storage
from django.core.cache import cache
from django.... | jrief/django-cms | cms/tests/placeholder.py | Python | bsd-3-clause | 50,452 |
"""
human_curl.async
~~~~~~~~~~~~~~~~
Async module
:copyright: (c) 2011 - 2012 by Alexandr Lispython (alex@obout.ru).
:license: BSD, see LICENSE for more details.
"""
from logging import getLogger
from types import FunctionType
try:
import pycurl2 as pycurl
except ImportError:
import pycurl
# Lib imports
f... | andrewleech/script.module.human_curl | lib/human_curl/async.py | Python | bsd-3-clause | 11,756 |
def func():
return 'something'
class Integer(object):
def __init__(self, value=None):
self.value = value
def add_value(self, value):
self.value = value
def convert_val_to_str(self):
self.value = self.__str__()
def con_val_to_str(self):
self.value = str(self.value)
def con_to_str(self):
return str... | noisebridge/PythonClass | instructors/need-rework/15_classy_OOP/reimp.py | Python | mit | 360 |
# -*- test-case-name: twisted.application.test.test_service -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Service architecture for Twisted.
Services are arranged in a hierarchy. At the leafs of the hierarchy,
the services which actually interact with the outside world are started.
Se... | whitehorse-io/encarnia | pyenv/lib/python2.7/site-packages/twisted/application/service.py | Python | mit | 11,938 |
from toolchain import Recipe, shprint
from os.path import join
import sh
import os
class pkg_resources(Recipe):
depends = ["hostpython", "python"]
archs = ['i386']
url = ""
def prebuild_arch(self, arch):
sh.cp("pkg_resources.py", join(self.ctx.dist_dir, "root", "python", "lib", "python2.7", "... | rnixx/kivy-ios | recipes/pkgresources/__init__.py | Python | mit | 385 |
"""
Example sentences to test spaCy and its language models.
>>> from spacy.lang.he.examples import sentences
>>> docs = nlp.pipe(sentences)
"""
sentences = [
"סין מקימה קרן של 440 מיליון דולר להשקעה בהייטק בישראל",
'רה"מ הודיע כי יחרים טקס בחסותו',
"הכנסת צפויה לאשר איכון אוטומטי של שיחות למוקד 100",
... | explosion/spaCy | spacy/lang/he/examples.py | Python | mit | 994 |
#!/usr/bin/env python
#Copyright (C) 2011 by Benedict Paten (benedictpaten@gmail.com)
#
#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 rig... | cooketho/jobTree | scriptTree/target.py | Python | mit | 7,809 |
import pg
import random
PIPES = 8
SIZE = 16
TURN_PROBABILITY = 0.3
UPDATE_RATE = 0.05
RESTART_RATE = 30
DIRECTIONS = [
(0, -1, 0, 0), (0, 1, 0, 0),
(1, 0, -1, 0), (1, 0, 1, 0),
(2, 0, 0, -1), (2, 0, 0, 1),
]
COLORS = [
0x1f77b4, 0xaec7e8, 0xff7f0e, 0xffbb78, 0x2ca02c, 0x98df8a,
0xd62728, 0xff9896... | stuaxo/pg | examples/pipes.py | Python | mit | 3,922 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_generated/v7_2/_configuration.py | Python | mit | 2,192 |
import logging
from autotest.client.shared import error
from virttest import utils_misc
def kdump_enable(vm, vm_name, crash_kernel_prob_cmd,
kernel_param_cmd, kdump_enable_cmd, timeout):
"""
Check, configure and enable the kdump
:param vm_name: vm name
:param crash_kernel_prob_cmd: c... | ypu/tp-qemu | generic/tests/kdump.py | Python | gpl-2.0 | 5,293 |
# -*- coding: utf-8 -*-
"""
werkzeug.testsuite.cache
~~~~~~~~~~~~~~~~~~~~~~~~
Tests the cache system
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import time
import unittest
import tempfile
import shutil
from werkzeug.testsuite import Werkzeug... | jackTheRipper/iotrussia | web_server/lib/werkzeug-master/werkzeug/testsuite/contrib/cache.py | Python | gpl-2.0 | 4,699 |
from debug_toolbar.panels import Panel
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
class MisagoACLDebugPanel(Panel):
name = 'MisagoACL'
has_content = True
def nav_title(self):
return _('Misago ACL')
def title(self):
retur... | Maronato/aosalunos | misago/acl/panels.py | Python | gpl-2.0 | 821 |
# This file is part of Invenio.
# Copyright (C) 2009, 2010, 2011, 2014, 2015 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) any later v... | chokribr/invenio | invenio/legacy/oairepository/server.py | Python | gpl-2.0 | 34,702 |
#!/usr/bin/python2.7
#coding:utf-8
import requests
from dummy import *
info = {
'NAME':'Wordpress Reflect XSS',
'AUTHOR':'owlinrye,yangbh',
'TIME':'20140811',
'WEB':'',
'DESCRIPTION':'CVE-2012-3414'
}
opts = {
'url':'http://testasp.vulnweb.com', #'target ip'
}
# opts = [
# ['url','http://testasp.vulnweb.com','... | GHubgenius/Hammer | plugins/Web_Applications/wordpress_reflect_xss.py | Python | gpl-2.0 | 1,188 |
from navmazing import NavigateToSibling
from widgetastic.widget import View
from widgetastic_patternfly import Accordion
from widgetastic_patternfly import Dropdown
from cfme.base import Server
from cfme.common import BaseLoggedInPage
from cfme.utils.appliance.implementations.ui import CFMENavigateStep
from cfme.utils... | nachandr/cfme_tests | cfme/control/explorer/__init__.py | Python | gpl-2.0 | 1,733 |
#! /usr/bin/env python
#
# This file is part of the LibreOffice project.
#
# 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 unittest
from collections ... | beppec56/core | dbaccess/qa/python/fdo84315.py | Python | gpl-3.0 | 2,691 |
#!/usr/bin/python
#====================================================================#
# Script to get the eigenvalues from an abinit _EIG.nc netcdf file #
#====================================================================#
#########
#IMPORTS#
#########
import numpy as N
import matplotlib.pyplot as P
import ne... | jmbeuken/abinit | scripts/post_processing/ab_extended_scissors_guess.py | Python | gpl-3.0 | 101,073 |
#!/usr/bin/env python
"""Translation service using Google Translate"""
import re
import simplejson
from madcow.util import strip_html
from madcow.util.http import geturl
from madcow.util import Module
class BabelError(Exception):
"""Raised to stop translation due to internal error"""
class Main(Module):
... | ToxicFrog/lancow | madcow/modules/translate.py | Python | gpl-3.0 | 5,891 |
# -*- coding: utf-8 -*-
import re
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class TwoSharedCom(SimpleHoster):
__name__ = "TwoSharedCom"
__type__ = "hoster"
__version__ = "0.13"
__pattern__ = r'http://(?:www\.)?2shared\.com/(account/)?(download|get|file|docu... | immenz/pyload | module/plugins/hoster/TwoSharedCom.py | Python | gpl-3.0 | 922 |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import logging
import random
from apollo import accessible_organisms
from apollo.util import GuessOrg, OrgOrGuess, retry
from arrow.apollo import get_apollo_instance
from webapollo import UserObj, handle_credentials
logging.basicConfig(lev... | TAMU-CPT/galaxy-tools | tools/webapollo/shareOrg/delete_features.py | Python | gpl-3.0 | 2,847 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import res_users
import sale_crm
import crm_lead
import account_invoice | orchidinfosys/odoo | addons/sale_crm/__init__.py | Python | gpl-3.0 | 171 |
"""A light version of test points."""
from __future__ import division
from ..vectormath.euclid import Point3, Vector3
class AnalysisPointLite(object):
"""A radiance analysis point.
Attributes:
location: Location of analysis points as (x, y, z).
direction: Direction of analysis point as (x, y,... | ladybug-tools/honeybee | honeybee_plus/radiance/analysispointlite.py | Python | gpl-3.0 | 3,943 |
#!/usr/bin/env python
###############################################################################
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License... | Ecogenomics/CheckM | scripts/simulationScaffoldsRandom.py | Python | gpl-3.0 | 18,716 |
import os, re
class Test1(object):
pass
class Test2(object):
pass
class Test3(object):
pass
__all__ = ('Test1', 'Test2', 'Test3')
| euclio/eclim | org.eclim.pydev/test/eclim_unit_test_python/test/common/objects.py | Python | gpl-3.0 | 140 |
#
# Copyright 2010 Free Software Foundation, Inc.
#
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-howto
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
"""
A base class is created.
Classes based upon this are used to make more user-friendly interfaces
to the... | skoslowski/gnuradio | gr-utils/modtool/templates/gr-newmod/docs/doxygen/doxyxml/base.py | Python | gpl-3.0 | 6,283 |
# -*- Mode: Python; test-case-name: whipper.test.test_image_table -*-
# vi:si:et:sw=4:sts=4:ts=4
from whipper.image import table
from whipper.test import common as tcommon
def h(i):
return "0x%08x" % i
class TrackTestCase(tcommon.TestCase):
def testRepr(self):
track = table.Track(1)
self.... | Freso/morituri | whipper/test/test_image_table.py | Python | gpl-3.0 | 3,651 |
import pymongo
def migrate(db, validate_production):
print 'Starting data migration..'
# ** Migrate one collection (production) to two (production & exchanges)
col_production = db['production']
col_exchange = db['exchange']
col_old = db['realtime']
for row in col_old.find():
# Extract e... | Pantkowsky/electricitymap | feeder/migrate_db.py | Python | gpl-3.0 | 1,926 |
# Utilities for parsing DOLFIN files and generaton of SWIG files
#
# Copyright (C) 2012 Johan Hake
#
# This file is part of DOLFIN.
#
# DOLFIN 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 vers... | MiroK/dolfin | site-packages/dolfin_utils/cppparser/utils.py | Python | gpl-3.0 | 6,332 |
# IMPORTANT: the same tests are run from "test_xml_etree_c" in order
# to ensure consistency between the C implementation and the Python
# implementation.
#
# For this purpose, the module-level "ET" symbol is temporarily
# monkey-patched when running the "test_xml_etree_c" test suite.
import html
import io
import oper... | mancoast/CPythonPyc_test | fail/335_test_xml_etree.py | Python | gpl-3.0 | 90,629 |
# pylint: disable=invalid-name, too-many-public-methods
from __future__ import (absolute_import, division, print_function)
import unittest
from mantid.kernel import DateAndTime
from mantid.api import EventType
from mantid.dataobjects import EventList
class EventListTest(unittest.TestCase):
def test_event_list_c... | dymkowsk/mantid | Framework/PythonInterface/test/python/mantid/dataobjects/EventListTest.py | Python | gpl-3.0 | 888 |
# 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 flt, cint, nowdate
from frappe import throw, _
import frappe.defaults
from frappe.utils import getdate
from erp... | adityaduggal/erpnext | erpnext/stock/doctype/purchase_receipt/purchase_receipt.py | Python | gpl-3.0 | 16,520 |
#
# Copyright (C) 2016 FreeIPA Contributors see COPYING for license
#
from __future__ import absolute_import
import pytest
from ipalib import errors, api
from ipaplatform.services import knownservices
from ipatests.test_xmlrpc.tracker.location_plugin import LocationTracker
from ipatests.test_xmlrpc.tracker.server_pl... | encukou/freeipa | ipatests/test_xmlrpc/test_location_plugin.py | Python | gpl-3.0 | 7,773 |
import unittest
from releasetasks.test.desktop import make_task_graph, do_common_assertions, \
get_task_by_name, create_firefox_test_args
from releasetasks.test import generate_scope_validator, PVT_KEY_FILE, verify
from voluptuous import Schema, truth
class TestVersionBump(unittest.TestCase):
maxDiff = 30000... | mozilla/releasetasks | releasetasks/test/desktop/test_version_bump.py | Python | mpl-2.0 | 2,641 |
# -*- coding: utf-8 -*-
## File autogenerated by SQLAutoCode
## see http://code.google.com/p/sqlautocode/
from sqlalchemy import *
from sqlalchemy.dialects.postgresql import *
from geoalchemy2 import Geography
from models import metadata
object_type = Table('object_type', metadata,*[
Column('id', INTEGER(), prima... | TeXitoi/navitia | source/sql/models/navitia.py | Python | agpl-3.0 | 26,527 |
# Copyright (C) 2015 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import res_config_settings
from . import l10n_br_zip
from . import format_address_mixin
| OCA/l10n-brazil | l10n_br_zip/models/__init__.py | Python | agpl-3.0 | 206 |
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public tr... | xlqian/navitia | source/navitiacommon/navitiacommon/log.py | Python | agpl-3.0 | 2,328 |
"""
Functionality for generating grade reports.
"""
import logging
import re
from collections import OrderedDict
from datetime import datetime
from itertools import chain, izip, izip_longest
from time import time
from lazy import lazy
from pytz import UTC
from six import text_type
from courseware.courses import get_c... | procangroup/edx-platform | lms/djangoapps/instructor_task/tasks_helper/grades.py | Python | agpl-3.0 | 25,153 |
# 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)
class PyAzureKeyvault(PythonPackage):
"""Microsoft Azure Key Vault Client Libraries for Python."""
homepage = "h... | rspavel/spack | var/spack/repos/builtin/packages/py-azure-keyvault/package.py | Python | lgpl-2.1 | 1,385 |
#!/usr/bin/env python
#
# spyne - Copyright (C) Spyne contributors.
#
# 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 your option) any later ve... | plq/spyne | spyne/test/interop/server/soap12/httprpc_soap_basic.py | Python | lgpl-2.1 | 1,851 |
# 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)
"""This package contains modules with hooks for various stages in the
Spack install process. You can add modules here and ... | LLNL/spack | lib/spack/spack/hooks/__init__.py | Python | lgpl-2.1 | 3,426 |
# 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 NvptxTools(AutotoolsPackage):
"""nvptx-tools: A collection of tools for use with nvptx-non... | rspavel/spack | var/spack/repos/builtin/packages/nvptx-tools/package.py | Python | lgpl-2.1 | 1,002 |
# 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 *
import os
class Gnuplot(AutotoolsPackage):
"""Gnuplot is a portable command-line driven graphing... | iulian787/spack | var/spack/repos/builtin/packages/gnuplot/package.py | Python | lgpl-2.1 | 6,582 |
#!/usr/bin/python3
import argparse as ap
import shared
def create_parser():
parser = ap.ArgumentParser()
parser.add_argument("old-version", type=shared.version_type)
parser.add_argument("new-version", type=shared.version_type)
shared.update_parser_with_common_stuff(parser)
return parser
def cr... | mpreisler/openscap | release_tools/move-milestones.py | Python | lgpl-2.1 | 1,424 |
# 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 Coin3d(AutotoolsPackage):
"""Coin is an OpenGL-based, 3D graphics library that has its roo... | rspavel/spack | var/spack/repos/builtin/packages/coin3d/package.py | Python | lgpl-2.1 | 2,287 |
# -*- coding: utf-8 -*-
"""
sphinxcontrib.plantuml
~~~~~~~~~~~~~~~~~~~~~~
Embed PlantUML diagrams on your documentation.
:copyright: Copyright 2010 by Yuya Nishihara <yuya@tcha.org>.
:license: BSD, see LICENSE for details.
"""
import codecs
import errno
import hashlib
import os
import re
import s... | a1ezzz/wasp-launcher | thirdparty/sphinxcontrib-plantuml-0.8.1/sphinxcontrib/plantuml.py | Python | lgpl-3.0 | 12,436 |
# -*- 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
#... | Tagar/incubator-airflow | airflow/contrib/hooks/spark_sql_hook.py | Python | apache-2.0 | 6,107 |
# Copyright 2012 Nebula, 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 agree... | bac/horizon | horizon/base.py | Python | apache-2.0 | 39,077 |
#!/usr/bin/env python
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _|
# | |) | (_) | | .` | (_) || | | _|| |) | | ... | rhdedgar/openshift-tools | ansible/roles/lib_gcloud/library/gcloud_project_policy.py | Python | apache-2.0 | 23,977 |
#!/usr/bin/python
#
# Copyright 2014 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... | falbassini/googleads-dfa-reporting-samples | python/v2.1/get_user_role_permissions.py | Python | apache-2.0 | 2,332 |
#!/router/bin/python
import trex_root_path
from client.trex_stateless_client import *
from common.trex_exceptions import *
import cmd
from termstyle import termstyle
# import termstyle
import os
from argparse import ArgumentParser
import socket
import errno
import ast
import json
class InteractiveStatelessTRex(cmd.C... | dimagol/trex-core | scripts/automation/trex_control_plane/examples/interactive_stateless.py | Python | apache-2.0 | 5,035 |
import asyncio
import functools
import logging
import traceback
import typing
from starlette.websockets import WebSocket, WebSocketState
from starlette.status import WS_1001_GOING_AWAY
from . import serialize
from opentrons.protocols.execution.errors import ExceptionInProtocolError
from concurrent.futures import Thre... | OpenTrons/opentrons-api | robot-server/robot_server/service/legacy/rpc/rpc.py | Python | apache-2.0 | 11,213 |
# Copyright 2015 Cisco Systems
# 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/agent/linux/pd_driver.py | Python | apache-2.0 | 1,796 |
#
# 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... | chenc10/Spark-PAF | examples/src/main/python/ml/random_forest_classifier_example.py | Python | apache-2.0 | 2,991 |
"""Support for Legacy MQTT vacuum."""
import json
import logging
import voluptuous as vol
from homeassistant.components import mqtt
from homeassistant.components.mqtt import (
CONF_UNIQUE_ID,
MqttAttributes,
MqttAvailability,
MqttDiscoveryUpdate,
MqttEntityDeviceInfo,
subscription,
)
from home... | leppa/home-assistant | homeassistant/components/mqtt/vacuum/schema_legacy.py | Python | apache-2.0 | 19,559 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google 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... | googleads/google-ads-python | google/ads/googleads/v9/services/services/customer_asset_service/__init__.py | Python | apache-2.0 | 690 |
# Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | viktorTarasov/PyKMIP | kmip/core/errors.py | Python | apache-2.0 | 4,483 |
# (c) Copyright 2014 Brocade Communications Systems Inc.
# All Rights Reserved.
#
# Copyright 2014 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
#
# ... | tmenjo/cinder-2015.1.0 | cinder/zonemanager/fc_zone_manager.py | Python | apache-2.0 | 9,613 |
# 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 ... | StackStorm/st2 | st2common/st2common/transport/execution.py | Python | apache-2.0 | 1,909 |
import django_filters
from django.contrib.auth.models import User, Group
from rest_framework import viewsets, mixins
from rest_framework.response import Response
from rest_framework.authentication import TokenAuthentication
from rest_framework import filters
from api.pagination import LargeResultsSetPagination
from api... | Oinweb/py-fly | api/views/notification.py | Python | bsd-2-clause | 942 |
# django-openid-auth - OpenID integration for django.contrib.auth
#
# Copyright (C) 2009-2013 Canonical Ltd.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above ... | somcomltd/django-openid-auth | django_openid_auth/tests/test_admin.py | Python | bsd-2-clause | 3,301 |
from __future__ import unicode_literals
import json
from django.test import TestCase, RequestFactory
from django.core.urlresolvers import reverse
from ..models import get_application_model
from ..settings import oauth2_settings
from ..views import ProtectedResourceView
from ..compat import get_user_model
from .test_... | Natgeoed/django-oauth-toolkit | oauth2_provider/tests/test_password.py | Python | bsd-2-clause | 3,715 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pymisp import PyMISP
from keys import url, key
import argparse
import tools
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Create a given number of event containing a given number of attributes eachh.')
parser.add_argument("-l", "--... | iglocska/PyMISP | examples/events/create_massive_dummy_events.py | Python | bsd-2-clause | 777 |
# Fix for older setuptools
import re
import os
from setuptools import setup, find_packages
def fpath(name):
return os.path.join(os.path.dirname(__file__), name)
def read(fname):
return open(fpath(fname)).read()
def desc():
info = read('README.rst')
try:
return info + '\n\n' + read('doc/ch... | pawl/flask-admin | setup.py | Python | bsd-3-clause | 1,731 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
TODO
"""
from __future__ import absolute_import
__docformat__ = 'restructuredtext'
from . import fmristat
from nipy.testing import Tester
test = Tester().test
bench = Tester().bench
| alexis-roche/nipy | nipy/modalities/fmri/__init__.py | Python | bsd-3-clause | 303 |
import logging
from optparse import make_option
from django.core.management.base import BaseCommand
from amo.utils import chunked
from mkt.developers.tasks import refresh_iarc_ratings
log = logging.getLogger('z.task')
class Command(BaseCommand):
"""
Refresh old or corrupt IARC ratings by re-fetching the ... | jinankjain/zamboni | mkt/developers/management/commands/refresh_iarc_ratings.py | Python | bsd-3-clause | 985 |
import copy
import weakref
import numpy
import six
from chainer import cuda
from chainer.utils import type_check
from chainer import variable
class Function(object):
"""Function on variables with backpropagation ability.
All function implementations defined in :mod:`chainer.functions` inherit
this cla... | masia02/chainer | chainer/function.py | Python | mit | 15,610 |
"""Unicode Properties (autogen)."""
from __future__ import unicode_literals
unicode_alias = {
"_": {
"age": "age",
"bc": "bidiclass",
"blk": "block",
"ccc": "canonicalcombiningclass",
"dt": "decompositiontype",
"ea": "eastasianwidth",
"gc": "generalcategory",... | okoala/sublime-bak | Packages/backrefs/st3/backrefs/uniprops/unidata/alias.py | Python | mit | 19,024 |
# -*- coding: utf-8 -*-
from gettext import gettext as _
from logging import getLogger
import os
from pulp.plugins.distributor import Distributor
from pulp.server.db import model
from pulp.server.managers import factory
from pulp.server.config import config as pulp_conf
from pulp.server.compat import json
from pulp_... | rbramwell/pulp | nodes/parent/pulp_node/distributors/http/distributor.py | Python | gpl-2.0 | 10,260 |
##
# Copyright 2012-2021 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... | hpcugent/easybuild-framework | easybuild/toolchains/compiler/__init__.py | Python | gpl-2.0 | 1,255 |
#!/usr/bin/env python
import distutils.ccompiler
from distutils.core import setup, Extension
from distutils.command.build import build
from distutils.command.build_ext import build_ext
from distutils.command.install_lib import install_lib
import os, sys
from glob import glob
if not hasattr(sys, 'version_info') or sys... | codeimpossible/ohcount | python/setup.py | Python | gpl-2.0 | 5,447 |
#!/usr/bin/env python
# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. ... | golden1232004/webrtc_new | tools/network_emulator/emulate.py | Python | gpl-3.0 | 8,370 |
# Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# Based on chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# (c) 2013, Michael Scherer <misc@zarb.org>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gene... | ralphbean/ansible | v2/ansible/plugins/connections/libvirt_lxc.py | Python | gpl-3.0 | 5,075 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 Lice... | foufou55/Sick-Beard | sickbeard/webserve.py | Python | gpl-3.0 | 152,830 |
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | ctrlaltdel/neutrinator | vendor/openstack/config/exceptions.py | Python | gpl-3.0 | 699 |
###############################################################################
# ilastik: interactive learning and segmentation toolkit
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/or
# mod... | nielsbuwen/ilastik | tests/test_applets/objectClassification/testTransferLabels.py | Python | gpl-3.0 | 2,796 |
import multiprocessing
import os
import platform
import queue
import re
import subprocess
import sys
import unittest
from pyprint.ConsolePrinter import ConsolePrinter
from coalib.output.printers.LogPrinter import LogPrinter
from coalib.processes.CONTROL_ELEMENT import CONTROL_ELEMENT
from coalib.processes.Processing ... | abhiroyg/coala | tests/processes/ProcessingTest.py | Python | agpl-3.0 | 25,894 |
# -*- 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... | andreparames/odoo | addons/account/account.py | Python | agpl-3.0 | 191,211 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 Cubic ERP - Teradata SAC (<http://cubicerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the... | jolevq/odoopub | extra-addons/account_einvoice/__openerp__.py | Python | agpl-3.0 | 2,041 |