code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
from django.conf.urls import patterns, url
from django.views.generic import RedirectView
from django.conf import settings
from . import views
products = r'/products/(?P<product>\w+)'
versions = r'/versions/(?P<versions>[;\w\.()]+)'
version = r'/versions/(?P<version>[;\w\.()]+)'
perm_legacy_redirect = settings.PERMA... | AdrianGaudebert/socorro | webapp-django/crashstats/crashstats/urls.py | Python | mpl-2.0 | 3,962 |
# -*- coding: utf-8 -*-
# Copyright(C) 2013 Bezleputh
#
# 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 opt... | blckshrk/Weboob | modules/vlille/test.py | Python | agpl-3.0 | 1,148 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('calendars', '0004_auto_20150718_1529'),
]
operations = [
migrations.AlterField(
model_name='event',
... | Fisiu/calendar-oswiecim | webapp/calendars/migrations/0005_auto_20150718_1537.py | Python | agpl-3.0 | 451 |
# ----------------------------------------------------------------------
# Copyright (C) 2014, 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 program is free software: you can redistribute it and/or mo... | subutai/NAB | nab/detectors/numenta/numenta_detector.py | Python | agpl-3.0 | 5,515 |
import unittest
from PySide2.QtGui import QIcon
from PySide2.QtWidgets import QToolBox, QWidget
from helper import UsesQApplication
class OwnershipControl(UsesQApplication):
def setUp(self):
super(OwnershipControl, self).setUp()
self.toolbox = QToolBox()
def tearDown(self):
del sel... | BadSingleton/pyside2 | tests/QtWidgets/qtoolbox_test.py | Python | lgpl-2.1 | 839 |
# 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 PyGooglePasta(PythonPackage):
"""pasta is an AST-based Python refactoring library."""
... | iulian787/spack | var/spack/repos/builtin/packages/py-google-pasta/package.py | Python | lgpl-2.1 | 648 |
##############################################################################
# Copyright (c) 2013-2017, 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... | TheTimmy/spack | var/spack/repos/builtin/packages/ngmlr/package.py | Python | lgpl-2.1 | 1,638 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This file is part of the prometeo project.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option... | zuck/prometeo-erp | core/menus/forms.py | Python | lgpl-3.0 | 1,345 |
# Copyright 2017 Cisco Systems, 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 requi... | Gitweijie/first_project | networking_cisco/apps/saf/agent/topo_disc/topo_disc_constants.py | Python | apache-2.0 | 890 |
from elasticsearch import Elasticsearch
import argparse
import os
import json
import re
def ExportDashboards(es, regex, kibana_index, output_directory):
res = es.search(
index=kibana_index,
doc_type="dashboard",
size=1000)
try:
reg_exp = re.compile(regex, re.IGNORECASE)
ex... | roncohen/apm-server | _beats/dev-tools/cmd/dashboards/export_5x_dashboards.py | Python | apache-2.0 | 3,663 |
import logging
import urllib
from typing import Any, Dict, List, Mapping, Tuple, Union
import orjson
import requests
from django.conf import settings
from django.forms.models import model_to_dict
from django.utils.translation import gettext as _
from analytics.models import InstallationCount, RealmCount
from version ... | andersk/zulip | zerver/lib/remote_server.py | Python | apache-2.0 | 7,292 |
"""AWS platform for notify component."""
import asyncio
import base64
import json
import logging
import aiobotocore
from homeassistant.components.notify import (
ATTR_TARGET,
ATTR_TITLE,
ATTR_TITLE_DEFAULT,
BaseNotificationService,
)
from homeassistant.const import (
CONF_NAME,
CONF_PLATFORM,
... | partofthething/home-assistant | homeassistant/components/aws/notify.py | Python | apache-2.0 | 7,412 |
# -*- coding: utf-8 -*-
'''
State module to manage Elasticsearch indices
.. versionadded:: 2015.8.0
'''
# Import python libs
from __future__ import absolute_import
import logging
# Import salt libs
log = logging.getLogger(__name__)
def absent(name):
'''
Ensure that the named index is absent
'''
r... | smallyear/linuxLearn | salt/salt/states/elasticsearch_index.py | Python | apache-2.0 | 2,188 |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | curoverse/libcloud | libcloud/test/compute/test_gce.py | Python | apache-2.0 | 123,700 |
"""Test suite for phlsys_signal."""
# =============================================================================
# TEST PLAN
# -----------------------------------------------------------------------------
# Here we detail the things we are concerned to test and specify which tests
#... | bloomberg/phabricator-tools | py/phl/phlsys_signal__t.py | Python | apache-2.0 | 7,979 |
import os
import pytest
@pytest.fixture
def os_environ(monkeypatch):
mock_environ = dict(os.environ)
monkeypatch.setattr(os, 'environ', mock_environ)
return mock_environ
def pytest_generate_tests(metafunc):
if hasattr(metafunc.function, "all_locales"):
from babel.localedata import locale_ide... | cloudera/hue | desktop/core/ext-py/Babel-2.5.1/tests/conftest.py | Python | apache-2.0 | 396 |
#
# 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... | vikkyrk/incubator-beam | sdks/python/apache_beam/examples/wordcount_debugging_test.py | Python | apache-2.0 | 2,013 |
import unittest
from apel.db.records import Record, InvalidRecordException
class RecordTest(unittest.TestCase):
'''
Test case for Record
'''
# test for public interface
def test_set_field(self):
record = Record()
self.assertRaises(InvalidRecordException,
... | tofu-rocketry/apel | test/test_record.py | Python | apache-2.0 | 1,067 |
# 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... | karllessard/tensorflow | tensorflow/python/keras/activations_test.py | Python | apache-2.0 | 8,461 |
#
# 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/authentication/authenticationsamlidppolicy_binding.py | Python | apache-2.0 | 4,203 |
"""Support for Zigbee switches."""
import voluptuous as vol
from homeassistant.components.switch import SwitchDevice
from . import PLATFORM_SCHEMA, ZigBeeDigitalOut, ZigBeeDigitalOutConfig
CONF_ON_STATE = "on_state"
DEFAULT_ON_STATE = "high"
STATES = ["high", "low"]
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({vol.O... | leppa/home-assistant | homeassistant/components/zigbee/switch.py | Python | apache-2.0 | 669 |
# encoding: utf-8
"""Tests for io.py"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import io as stdlib_io
import os.path
import stat
import sys
from io import StringIO
from subprocess import Popen, PIPE
import unittest
import nose.tools as nt
from IPython.... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/IPython/utils/tests/test_io.py | Python | bsd-2-clause | 2,734 |
from PyObjCTools.TestSupport import *
from AppKit import *
class TestNSDraggingHelper (NSObject):
def draggingFormation(self): return 1
def setDraggingFormation(self, v): return 1
def animatesToDestination(self): return 1
def setAnimatesToDestination_(self, v): return 1
def numberOfValidItemsForDr... | albertz/music-player | mac/pyobjc-framework-Cocoa/PyObjCTest/test_nsdragging.py | Python | bsd-2-clause | 6,344 |
#!/usr/bin/env python
#
# Curriculum Module Preprocess Script
# - Run once per run of the module by a user
# - Run before job submission. So -not- in an allocation.
# - onramp_run_params.cfg file is available in current working directory
#
import sys
import time
# No postprocessing required
# Exit 0 if all is ok
p... | koepked/onramp | pce/src/testing/testmodulebadpostprocess/bin/onramp_postprocess.py | Python | bsd-3-clause | 498 |
# -*- coding: utf-8 -*-
"""
__init__
Collect all tests here
"""
import unittest
from .test_banner import TestBanner, TestGetHtml
from .test_cms import TestCMS
from .test_menuitem import TestMenuItem
def suite():
test_suite = unittest.TestSuite()
test_suite.addTests([
unittest.TestLoader().l... | fulfilio/nereid-cms | tests/__init__.py | Python | bsd-3-clause | 578 |
"""SCons.Debug
Code for debugging SCons internal things. Not everything here is
guaranteed to work all the way back to Python 1.5.2, and shouldn't be
needed by most users.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# Permission is hereby granted, free of charge... | kuiche/chromium | third_party/scons/scons-local/SCons/Debug.py | Python | bsd-3-clause | 6,593 |
# -*- coding: utf-8 -*-
import re
import types
from datetime import datetime, timedelta
from django.core.exceptions import ValidationError
from django.core.validators import *
from django.utils.unittest import TestCase
NOW = datetime.now()
TEST_DATA = (
# (validator, value, expected),
(validate_integer, '42... | mixman/djangodev | tests/modeltests/validators/tests.py | Python | bsd-3-clause | 7,773 |
from test_admin import * | FrankSalad/django-memcache-status | memcache_status/tests/__init__.py | Python | bsd-3-clause | 24 |
from setuptools import setup
import imp
def get_version():
ver_file = None
try:
ver_file, pathname, description = imp.find_module('__version__', ['src/vcstools'])
vermod = imp.load_module('__version__', ver_file, pathname, description)
version = vermod.version
return version
... | k-okada/vcstools | setup.py | Python | bsd-3-clause | 1,330 |
from __future__ import division
identifier = 'org.vistrails.extra.tej'
name = 'tej'
version = '0.2'
| VisTrails/VisTrails | vistrails/packages/tej/__init__.py | Python | bsd-3-clause | 101 |
from billing import Gateway, GatewayNotConfigured
from billing.signals import transaction_was_successful, transaction_was_unsuccessful
from billing.utils.credit_card import InvalidCard, Visa, MasterCard, \
AmericanExpress, Discover, CreditCard
import stripe
from django.conf import settings
class StripeGateway(Ga... | biddyweb/merchant | billing/gateways/stripe_gateway.py | Python | bsd-3-clause | 8,557 |
#!/usr/bin/env python
"""
Similar to the autocompletion example. But display all the completions in multiple columns.
"""
from __future__ import unicode_literals
from prompt_toolkit.contrib.completers import WordCompleter
from prompt_toolkit.shortcuts import get_input
animal_completer = WordCompleter([
'alligato... | ddalex/python-prompt-toolkit | examples/multi-column-autocompletion.py | Python | bsd-3-clause | 955 |
##########################################################################
#
# Copyright (c) 2014, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of so... | chippey/gaffer | python/GafferSceneTest/PrimitiveVariablesTest.py | Python | bsd-3-clause | 2,924 |
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
from django.template import RequestContext
from django.shortcuts import render_to_response, get_object_or_404
from django.utils.translation import ugettext as _
from django.contrib.auth.decorators import login_required
from rapidsms.utils.pagination im... | dimagi/rapidsms-contrib-apps-dev | scheduler/views.py | Python | bsd-3-clause | 1,431 |
import pygame
import Vector2, BaseObject, Enemy, Resources, Menu
# Classe que gerencia as fases do jogo
class Stage(BaseObject.BaseObject):
# param: manager - instancia do ScreenManager
def __init__(self, manager):
# sempre lembrar de chamar o 'super'
BaseObject.BaseObject.__init__(self, m... | saintdragon2/python-3-lecture-2015 | civil_mid_final/2johack/source/Stage.py | Python | mit | 25,316 |
from __future__ import unicode_literals
from netmiko.f5.f5_ltm_ssh import F5LtmSSH
__all__ = ['F5LtmSSH']
| michaelrosejr/pyaos6 | netmiko/f5/__init__.py | Python | mit | 107 |
import sys
import os
sys.path.insert(0, '.')
sys.path.extend(os.environ.get('PYTHONPATH', '').split(os.pathsep))
import imp
import traceback
__name__ = '__main__'
mainmodule = type(sys)('__main__')
sys.modules['__main__'] = mainmodule
import cffi
# this is a list holding object we do not want to be freed (like call... | pigmej/uwsgi_no_pp | plugins/pypy/pypy_setup.py | Python | gpl-2.0 | 29,660 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2007, Simon Edwards <simon@simonzone.com>
# All rights reserved.
#
# 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... | SrNetoChan/QGIS | cmake/FindSIP.py | Python | gpl-2.0 | 3,000 |
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008 Fluendo, S.L. (www.fluendo.com).
# All rights reserved.
# This file may be distributed and/or modified under the terms of
# the GNU General Public License version 2 as published by
# the ... | flyapen/UgFlu | flumotion/admin/gtk/overlaystep.py | Python | gpl-2.0 | 5,429 |
#!/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 as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that... | avocado-framework-tests/avocado-misc-tests | toolchain/libvecpf.py | Python | gpl-2.0 | 2,281 |
#
# Contain the transformation procedure
#
import sys
import module.loop.ast
#-----------------------------------------
def __makeForLoop(id, lbound, ubound, stride, loop_body):
'''Generate a for loop:
for (id=lbound; id<=ubound; id=id+stride)
loop_body'''
init_exp = None
test_exp = ... | tajkhan/pluto-pocc | annotations/module/loop/submodule/permut/transformator.py | Python | gpl-3.0 | 4,926 |
# Waver module __init__.py
"""
*******************************
WAVER
*******************************
This subpackage contains various utilities for WAVER,
the SuperDARN Wave Analysis Software Package.
DEV: functions/modules/classes with a * have not been developed yet
*******************************
"""
#... | garimamalhotra/davitpy | pydarn/proc/music/__init__.py | Python | gpl-3.0 | 678 |
"""
A tool for converting kv6 models into pmf.
GreaseMonkey, 2013 - Public Domain
WARNING: I haven't checked to ensure that X,Y are around the right way.
If you find your models have been flipped inadvertently, let me know! --GM
"""
from __future__ import print_function
import sys, struct
# Backwards compatibilit... | fkaa/iceball | tools/kv62pmf.py | Python | gpl-3.0 | 3,453 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@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 License, or
# (at your option) an... | Jonnymcc/ansible | lib/ansible/executor/process/worker.py | Python | gpl-3.0 | 5,740 |
# Copyright (c) 2004-2016 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/master/COPYING
"""diagram objects
"""
import astroid
from pylint.pyreverse.... | bgris/ODL_bgris | lib/python3.5/site-packages/pylint/pyreverse/diagrams.py | Python | gpl-3.0 | 8,634 |
import collections
import functools
import hashlib
import logging
import socket
from django.conf import settings
from django.core.cache import cache as default_cache, get_cache, parse_backend_uri
from django.core.cache.backends.base import InvalidCacheBackendError
from django.utils import encoding, translation
try:
... | jicksy/oneanddone_test | vendor-local/lib/python/caching/invalidation.py | Python | mpl-2.0 | 7,039 |
import json
from .base import MyTestCase
from privacyidea.lib.error import (ParameterError, ConfigAdminError)
from urllib import urlencode
PWFILE = "tests/testdata/passwords"
POLICYFILE = "tests/testdata/policy.cfg"
POLICYEMPTY = "tests/testdata/policy_empty_file.cfg"
class APIAuditTestCase(MyTestCase):
def test... | woddx/privacyidea | tests/test_api_audit.py | Python | agpl-3.0 | 1,953 |
# The Hazard Library
# Copyright (C) 2014 GEM Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# Th... | mmpagani/oq-hazardlib | openquake/hazardlib/gsim/fukushima_tanaka_1990.py | Python | agpl-3.0 | 6,500 |
from django.db import models
from django.utils import timezone
class ReceiveAddress(models.Model):
address = models.CharField(max_length=128, blank=True)
available = models.BooleanField(default=True)
@classmethod
def newAddress(cls, address):
receive_address = cls()
receive_address.add... | freedomsponsors/www.freedomsponsors.org | djangoproject/bitcoin_frespo/models.py | Python | agpl-3.0 | 1,943 |
#***************************************************************************
#* *
#* Copyright (c) 2011 *
#* Yorik van Havre <yorik@uncreated.net> *
#* ... | cypsun/FreeCAD | src/Mod/Arch/ArchWindow.py | Python | lgpl-2.1 | 53,323 |
# -*- Mode: Python; py-indent-offset: 4 -*-
# pygobject - Python bindings for the GObject library
# Copyright (C) 2006-2012 Johan Dahlin
#
# glib/__init__.py: initialisation file for glib module
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Pub... | davidmalcolm/pygobject | gi/_glib/__init__.py | Python | lgpl-2.1 | 4,827 |
# Copyright (c) 2012 Citrix Systems, 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 ... | ewindisch/nova | nova/tests/api/openstack/compute/contrib/test_aggregates.py | Python | apache-2.0 | 20,787 |
"""The tests for the litejet component."""
import logging
import unittest
from unittest import mock
from homeassistant import setup
from homeassistant.components import litejet
from tests.common import get_test_home_assistant
from tests.components.scene import common
_LOGGER = logging.getLogger(__name__)
ENTITY_SCE... | fbradyirl/home-assistant | tests/components/litejet/test_scene.py | Python | apache-2.0 | 1,928 |
# Copyright (c) 2013 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 required by applicable law or ... | queria/my-tempest | tempest/services/data_processing/v1_1/client.py | Python | apache-2.0 | 11,290 |
# Natural Language Toolkit: Dependency Grammars
#
# Copyright (C) 2001-2011 NLTK Project
# Author: Jason Narad <jason.narad@gmail.com>
#
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
#
import math
from nltk.grammar import parse_dependency_grammar
from dependencygraph import *
############... | tadgh/ArgoRevisit | third_party/nltk/parse/nonprojectivedependencyparser.py | Python | apache-2.0 | 27,018 |
# 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 agreed to in writing, software
#... | go-bears/rally | tests/unit/plugins/openstack/context/ceilometer/test_samples.py | Python | apache-2.0 | 4,459 |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | andrewsomething/libcloud | libcloud/test/dns/test_route53.py | Python | apache-2.0 | 14,213 |
# Copyright (c) 2013 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | dims/neutron | neutron/db/extradhcpopt_db.py | Python | apache-2.0 | 6,854 |
# 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... | sandvine/horizon | horizon/forms/fields.py | Python | apache-2.0 | 15,925 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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/... | neumerance/deploy | openstack_dashboard/dashboards/project/firewalls/views.py | Python | apache-2.0 | 10,365 |
#!/usr/bin/python
#----------------------------------------------------------------------
# Be sure to add the python path that points to the LLDB shared library.
#
# To use this in the embedded python interpreter using "lldb":
#
# cd /path/containing/crashlog.py
# lldb
# (lldb) script import crashlog
# "crash... | apple/swift-lldb | examples/python/crashlog.py | Python | apache-2.0 | 45,121 |
# This file is part of Viper - https://github.com/viper-framework/viper
# See the file 'LICENSE' for copying permission.
import argparse
import viper.common.out as out
from viper.core.config import console_output
class ArgumentErrorCallback(Exception):
def __init__(self, message, level=''):
self.message ... | cwtaylor/viper | viper/common/abstracts.py | Python | bsd-3-clause | 1,812 |
from django import forms
from django_roa_client.models import RemotePage, RemotePageWithRelations
class TestForm(forms.Form):
test_field = forms.CharField()
remote_page = forms.ModelChoiceField(queryset=RemotePage.objects.all())
class RemotePageForm(forms.ModelForm):
class Meta:
model = RemotePag... | charles-vdulac/django-roa | examples/django_roa_client/forms.py | Python | bsd-3-clause | 432 |
"""
MySQL database backend for Django.
Requires MySQLdb: http://sourceforge.net/projects/mysql-python
"""
from __future__ import unicode_literals
import datetime
import re
import sys
import warnings
try:
import MySQLdb as Database
except ImportError as e:
from django.core.exceptions import ImproperlyConfigur... | dhoffman34/django | django/db/backends/mysql/base.py | Python | bsd-3-clause | 23,595 |
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import math
import unittest
from tracing.value import histogram_serializer
from tracing.value.diagnostics import breakdown
from tracing.value.di... | catapult-project/catapult | tracing/tracing/value/diagnostics/breakdown_unittest.py | Python | bsd-3-clause | 1,818 |
from __future__ import division
from functools import partial
from pathlib import Path
from menpo.base import MenpoMissingDependencyError
try:
from cyffld2 import (load_model, detect_objects,
get_frontal_face_mixture_model)
except ImportError:
raise MenpoMissingDependencyError('cyffld... | jabooth/menpodetect | menpodetect/ffld2/detect.py | Python | bsd-3-clause | 5,711 |
"""SOAP client."""
import collections
from rinse import NS_MAP
from rinse.util import safe_parse_string
class Response(object):
"""Rinse Response object."""
def __init__(self, response):
"""Response init."""
self._response = response
# parse response
self._doc = safe_parse_st... | thedrow/rinse | rinse/response.py | Python | mit | 690 |
from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Example:
url(r'^$', "test_app.views.basic_test", name='test_index'),
(r'^more/', include('test_app.urls')),
# Un... | ionelmc/django-uni-form | test_project/urls.py | Python | mit | 605 |
# -*- coding: utf-8 -*-
"""
pygments.lexers.xorg
~~~~~~~~~~~~~~~~~~~~
Lexers for Xorg configs.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, bygroups
from pygments.token import Comment, String,... | lmregus/Portfolio | python/design_patterns/env/lib/python3.7/site-packages/pygments/lexers/xorg.py | Python | mit | 887 |
# -*- coding: utf-8 -*-
"""
sphinx.util.parallel
~~~~~~~~~~~~~~~~~~~~
Parallel building utilities.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import traceback
try:
import multiprocessing
import threading
except I... | WhySoGeeky/DroidPot | venv/lib/python2.7/site-packages/sphinx/util/parallel.py | Python | mit | 4,139 |
import io
import unittest
import xml.sax
from xml.sax.xmlreader import AttributesImpl
from xml.sax.handler import feature_external_ges
from xml.dom import pulldom
from test.support import findfile
tstfile = findfile("test.xml", subdir="xmltestdata")
# A handy XML snippet, containing attributes, a namespace prefix,... | FFMG/myoddweb.piger | monitor/api/python/Python-3.7.2/Lib/test/test_pulldom.py | Python | gpl-2.0 | 12,628 |
# -*- coding: utf-8 -*-
"""
Exodus Add-on
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 3 of the License, or
(at your option) any later version.
This progra... | mrquim/repository.mrquim | script.module.exodus/lib/resources/lib/sources/fr/fullstream.py | Python | gpl-2.0 | 5,642 |
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import importlib
from django.apps import Ap... | unho/pootle | pootle/apps/accounts/apps.py | Python | gpl-3.0 | 566 |
# Dr. D Studios - Software Disclaimer
#
# Copyright 2009 Dr D Studios Pty Limited (ACN 127 184 954) (Dr. D Studios), its
# affiliates and/or its licensors.
#
###############################################################################
"""
This module will help TD's to convert houdini animation curve... | xxxIsaacPeralxxx/anim-studio-tools | kip/houdini/code/kip_houdini/node_curves.py | Python | gpl-3.0 | 9,795 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from erpnext.shopping_cart import get_quotation, set_item_in_cart
class TestShoppingCart(unittest.TestCase):
"""
Note:... | gangadhar-kadam/verve_test_erp | erpnext/shopping_cart/test_shopping_cart.py | Python | agpl-3.0 | 7,585 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
class StockMoveLine(models.Model):
_inherit = 'stock.move.line'
@api.model_create_multi
def create(self, vals_list):
records = super(StockMoveLine, self).create(vals_li... | ygol/odoo | addons/mrp_subcontracting/models/stock_move_line.py | Python | agpl-3.0 | 1,039 |
"""
Serializer for user API
"""
from rest_framework import serializers
from rest_framework.reverse import reverse
from django.template import defaultfilters
from courseware.access import has_access
from student.models import CourseEnrollment, User
from certificates.models import certificate_status_for_student, Certif... | jamiefolsom/edx-platform | lms/djangoapps/mobile_api/users/serializers.py | Python | agpl-3.0 | 4,109 |
# -*- coding: utf-8 -*-
###############################################################################
#
# SetPhotoLocation
# Sets the geo data (including latitude and longitude) for a specified photo.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0... | jordanemedlock/psychtruths | temboo/core/Library/Flickr/Geo/SetPhotoLocation.py | Python | apache-2.0 | 5,835 |
# 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 u... | dmlc/tvm | python/tvm/topi/generic/image.py | Python | apache-2.0 | 1,606 |
'''
@author: Frank
'''
import unittest
from zstacklib.iptables import iptables
class Test(unittest.TestCase):
def testName(self):
iptc = iptables.from_iptables_xml()
tbl = iptc.get_filter_table()
c = iptables.Chain()
c.name = 'testchain'
r = iptables.Rule()
m = i... | zstackorg/zstack-utility | zstacklib/zstacklib/test/test_table.py | Python | apache-2.0 | 818 |
"""Support for MQTT lights."""
import logging
import voluptuous as vol
from homeassistant.components import light
from homeassistant.components.mqtt import ATTR_DISCOVERY_HASH
from homeassistant.components.mqtt.discovery import (
MQTT_DISCOVERY_NEW,
clear_discovery_hash,
)
from homeassistant.helpers.dispatche... | sdague/home-assistant | homeassistant/components/mqtt/light/__init__.py | Python | apache-2.0 | 2,689 |
# -*- coding:utf-8 -*-
#
# Copyright (C) 2008 The Android Open Source Project
#
# 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 re... | TheQtCompany/git-repo | subcmds/diff.py | Python | apache-2.0 | 1,328 |
# 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... | AsimmHirani/ISpyPi | tensorflow/contrib/tensorflow-master/tensorflow/contrib/linalg/python/kernel_tests/linear_operator_udvh_update_test.py | Python | apache-2.0 | 12,056 |
from troposphere.constants import NUMBER
from troposphere import FindInMap, GetAtt, Join, Output
from troposphere import Parameter, Ref, Template
from troposphere.awslambda import Function, Code, MEMORY_VALUES
from troposphere.cloudformation import CustomResource
from troposphere.ec2 import Instance
from troposphere.ec... | 7digital/troposphere | examples/Lambda.py | Python | bsd-2-clause | 5,154 |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class News(scrapy.Item):
url = scrapy.Field()
title = scrapy.Field()
author_name = scrapy.Field()
raw_content = scrapy.Field()
publis... | pyk/rojak | rojak-pantau/rojak_pantau/items.py | Python | bsd-3-clause | 375 |
from __future__ import division, print_function, absolute_import
import time
from collections import defaultdict
import numpy as np
try:
import scipy.optimize
from scipy.optimize.optimize import rosen, rosen_der, rosen_hess
from scipy.optimize import leastsq
except ImportError:
pass
from . import te... | WillieMaddox/scipy | benchmarks/benchmarks/optimize.py | Python | bsd-3-clause | 10,537 |
#!/usr/bin/env python
#
# Copyright 2015, Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
import unittest
import environment
import utils
import tablet
# shards
shard_0_master = tablet.Tablet()
shard_0_rdonly = tablet.Tablet()
sh... | cgvarela/vitess | test/custom_sharding.py | Python | bsd-3-clause | 7,223 |
from django import forms
from django.contrib.admin.widgets import AutocompleteSelect
from django.forms import ModelChoiceField
from django.test import TestCase, override_settings
from django.utils import translation
from .models import Album, Band
class AlbumForm(forms.ModelForm):
class Meta:
model = Alb... | edmorley/django | tests/admin_widgets/test_autocomplete_widget.py | Python | bsd-3-clause | 5,005 |
#!/usr/bin/python
#_*_ coding: utf-8 _*_
#author:张知临 zhzhl202@163.com
#Filename: ctmutil.py
from random import *
import measure
import math
import os.path
c_p = os.path.dirname(os.getcwd())+"/"
#tc_splitTag="\t"
#str_splitTag = "^" #分词分割的标记
def cons_pro_for_svm(label,text,dic,local_fun=measure.tf,... | AnselCmy/ARPS | tmsvm/src/ctmutil.py | Python | mit | 3,391 |
'''
Storage
=======
.. versionadded:: 1.7.0
.. warning::
This module is still experimental, and the API is subject to change in a
future version.
Usage
-----
The idea behind the Storage module is to be able to load/store keys-value pairs.
The default model is abstract so you cannot use it directly. We prov... | zennobjects/kivy | kivy/storage/__init__.py | Python | mit | 11,191 |
from eventlet import patcher
from eventlet.green import asyncore
from eventlet.green import ftplib
from eventlet.green import threading
from eventlet.green import socket
patcher.inject('test.test_ftplib', globals())
# this test only fails on python2.7/pyevent/--with-xunit; screw that
try:
TestTLS_FTPClass.test_da... | Cue/eventlet | tests/stdlib/test_ftplib.py | Python | mit | 451 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cms.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| polegithub/shopping_web_python | shopping_web/manage.py | Python | mit | 246 |
#!/usr/bin/python
import os
import sys
import time
import logging
import subprocess
replot_poll_period = 1
plot_script_extension = '.gnuplot'
plot_script = None
for f in os.listdir('.'):
if f.endswith(plot_script_extension):
plot_script = f
break
assert plot_script != None, 'No file ending with "%s" found ... | govenius/plotbridge | examples/gnuplot_with_direction/expected_output/gnuplot.interactive.py | Python | gpl-2.0 | 3,554 |
# This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | pmisik/buildbot | master/buildbot/scripts/sendchange.py | Python | gpl-2.0 | 2,058 |
#!/usr/bin/env python
#
# Copyright 2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import math
from gnuradio import gr, gr_unittest, analog, blocks
def avg_mag_sqrd_c(x, alpha):
y = [0, ]
for xi in x:
tmp = alpha * (xi.r... | dl1ksv/gnuradio | gr-analog/python/analog/qa_probe_avg_mag_sqrd.py | Python | gpl-3.0 | 2,618 |
from git import Repo
from util import hook, web
@hook.command
def update(inp, bot=None):
repo = Repo()
git = repo.git
try:
pull = git.pull()
except Exception as e:
return e
if "\n" in pull:
return web.haste(pull)
else:
return pull
@hook.command
def version(in... | Red-M/CloudBot-legacy | plugins/update.py | Python | gpl-3.0 | 1,069 |
# ##### 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... | Microvellum/Fluid-Designer | win64-vc/2.78/scripts/freestyle/styles/apriori_density.py | Python | gpl-3.0 | 1,743 |
# -*- coding: utf-8 -*-
#
__author__ = "Epsirom"
class BaseError(Exception):
def __init__(self, code, msg):
super(BaseError, self).__init__(msg)
self.code = code
self.msg = msg
def __repr__(self):
return '[ERRCODE=%d] %s' % (self.code, self.msg)
class InputError(BaseErro... | liuzhenyang14/Meeting | codex/baseerror.py | Python | gpl-3.0 | 629 |
# Copyright (c) 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... | rickerc/cinder_audit | cinder/openstack/common/scheduler/weights/__init__.py | Python | apache-2.0 | 1,305 |
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import sys
from cfgm_common import jsonutils as json
import string
from provision_defaults import *
from cfgm_common.exceptions import *
from pysandesh.gen_py.sandesh.ttypes import SandeshLevel
class VncPermissions(object):
mode_str = {PERMS_R: ... | vpramo/contrail-controller | src/config/api-server/vnc_perms.py | Python | apache-2.0 | 3,590 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.