repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
danieljaouen/ansible | lib/ansible/modules/cloud/cloudstack/cs_staticnat.py | 21 | 6799 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, René Moser <mail@renemoser.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
'supported... | gpl-3.0 |
geerlingguy/ansible | lib/ansible/modules/fetch.py | 7 | 3790 | #!/usr/bin/python
# -*- 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)
# This is a virtual module that is entirely implemented as an action plugin and runs on the controller
from __future__ import absolute_import, ... | gpl-3.0 |
willharris/django | tests/sites_tests/tests.py | 8 | 8628 | from __future__ import unicode_literals
from django.apps import apps
from django.conf import settings
from django.contrib.sites import models
from django.contrib.sites.management import create_default_site
from django.contrib.sites.middleware import CurrentSiteMiddleware
from django.contrib.sites.models import Site, c... | bsd-3-clause |
weblyzard/ewrt | tests/ws/wikidata/test_bundle_wikipedia_requests.py | 1 | 15715 | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
Created on October 04, 2018
@author: jakob <jakob.steixner@modul.ac.at>
'''
from __future__ import print_function
from builtins import next
from builtins import str
from builtins import range
import datetime
import mock
import pytest
from eWRT.ws.wikidata.bundle_wikipedia... | gpl-3.0 |
Pajinek/spacewalk | backend/server/action/image.py | 14 | 1837 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2011 SUSE LLC
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have... | gpl-2.0 |
pleaseproject/python-for-android | python3-alpha/extra_modules/gdata/Crypto/Hash/HMAC.py | 45 | 3337 | """HMAC (Keyed-Hashing for Message Authentication) Python module.
Implements the HMAC algorithm as described by RFC 2104.
This is just a copy of the Python 2.2 HMAC module, modified to work when
used on versions of Python before 2.2.
"""
__revision__ = "$Id: HMAC.py,v 1.5 2002/07/25 17:19:02 z3p Exp $"
import strin... | apache-2.0 |
akash1808/nova | nova/tests/functional/v3/test_extended_server_attributes.py | 28 | 2687 | # Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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... | apache-2.0 |
miyakz1192/neutron | neutron/db/migration/models/frozen.py | 10 | 72451 | # Copyright (c) 2014 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... | apache-2.0 |
walteryang47/ovirt-engine | packaging/setup/plugins/ovirt-engine-setup/ovirt-engine-common/distro-rpm/packages.py | 6 | 17845 | #
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2013-2015 Red Hat, 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
#
# Unl... | apache-2.0 |
zxjzxj9/FlaskBoard | web/lib/python2.7/site-packages/psycopg2/tests/testconfig.py | 10 | 1249 | # Configure the test suite from the env variables.
import os
dbname = os.environ.get('PSYCOPG2_TESTDB', 'psycopg2_test')
dbhost = os.environ.get('PSYCOPG2_TESTDB_HOST', None)
dbport = os.environ.get('PSYCOPG2_TESTDB_PORT', None)
dbuser = os.environ.get('PSYCOPG2_TESTDB_USER', None)
dbpass = os.environ.get('PSYCOPG2_T... | apache-2.0 |
dayatz/taiga-back | taiga/users/gravatar.py | 1 | 1419 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2017 Anler Hernández ... | agpl-3.0 |
JakeBrand/CMPUT410-E6 | v1/lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/schema.py | 57 | 3048 | import logging
from django.contrib.gis.db.models.fields import GeometryField
from django.db.utils import OperationalError
from django.db.backends.mysql.schema import DatabaseSchemaEditor
logger = logging.getLogger('django.contrib.gis')
class MySQLGISSchemaEditor(DatabaseSchemaEditor):
sql_add_spatial_index = 'C... | apache-2.0 |
aclevy/vcrpy | vcr/request.py | 3 | 3068 | from six import BytesIO, text_type
from six.moves.urllib.parse import urlparse, parse_qsl
class Request(object):
"""
VCR's representation of a request.
There is a weird quirk in HTTP. You can send the same header twice. For
this reason, headers are represented by a dict, with lists as the values.
... | mit |
DailyActie/Surrogate-Model | 01-codes/scipy-master/scipy/special/lambertw.py | 33 | 3041 | from __future__ import division, print_function, absolute_import
from ._ufuncs import _lambertw
def lambertw(z, k=0, tol=1e-8):
r"""
lambertw(z, k=0, tol=1e-8)
Lambert W function.
The Lambert W function `W(z)` is defined as the inverse function
of ``w * exp(w)``. In other words, the value of ``... | mit |
kdwink/intellij-community | python/helpers/sphinxcontrib/napoleon/docstring.py | 44 | 32526 | # -*- coding: utf-8 -*-
# Copyright 2014 Rob Ruana
# Licensed under the BSD License, see LICENSE file for details.
"""Classes for docstring parsing and formatting."""
import collections
import inspect
import re
import sys
from six.moves import range
from pockets import modify_iter
from six import string_types
_dire... | apache-2.0 |
MjnMixael/knossos | knossos/__main__.py | 1 | 3121 | #!/usr/bin/python
## Copyright 2017 Knossos authors, see NOTICE file
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless requ... | apache-2.0 |
diegoguimaraes/django | django/contrib/syndication/views.py | 31 | 8809 | from __future__ import unicode_literals
from calendar import timegm
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from django.http import HttpResponse, Http404
from django.template import loader,... | bsd-3-clause |
gregvonkuster/icqsol | shapes/icqShape.py | 2 | 2584 | #!/usr/bin/env python
"""
@brief A base class for constructing shapes
@author alexander@gokliya.net
"""
from __future__ import print_function
from csg.core import CSG
from csg.geom import Vector
import numpy
DEFAULTS = dict(origin=[0.0, 0.0, 0.0],
lengths=[1.0, 1.0, 1.0],
radius=1.0,
... | mit |
Vishruit/DDP_models | tf1/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/sbcsgroupprober.py | 2936 | 3291 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | gpl-3.0 |
siliconsmiley/QGIS | python/plugins/processing/algs/gdal/gdal2xyz.py | 1 | 2574 | # -*- coding: utf-8 -*-
"""
***************************************************************************
gdal2xyz.py
---------------------
Date : September 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
**************... | gpl-2.0 |
IKholopov/HackUPC2017 | hackupc/env/lib/python3.5/site-packages/django/utils/timezone.py | 57 | 11145 | """
Timezone-related classes and functions.
This module uses pytz when it's available and fallbacks when it isn't.
"""
import sys
import time as _time
from datetime import datetime, timedelta, tzinfo
from threading import local
from django.conf import settings
from django.utils import lru_cache, six
from django.util... | apache-2.0 |
ssanderson/numpy | numpy/f2py/cb_rules.py | 153 | 22230 | #!/usr/bin/env python
"""
Build call-back mechanism for f2py2e.
Copyright 2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
$Date: 20... | bsd-3-clause |
alexcuellar/odoo | addons/payment_ogone/tests/test_ogone.py | 430 | 9309 | # -*- coding: utf-8 -*-
from lxml import objectify
import time
import urlparse
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment.tests.common import PaymentAcquirerCommon
from openerp.addons.payment_ogone.controllers.main import OgoneController
from openerp.tools i... | agpl-3.0 |
dennis-sheil/commandergenius | project/jni/python/src/Lib/test/test_float.py | 51 | 33323 |
import unittest, struct
import os
from test import test_support
import math
from math import isinf, isnan, copysign, ldexp
import operator
import random, fractions
INF = float("inf")
NAN = float("nan")
class GeneralFloatCases(unittest.TestCase):
def test_float(self):
self.assertEqual(float(3.14), 3.14)
... | lgpl-2.1 |
zstackio/zstack-woodpecker | integrationtest/vm/installation/api_perimission_check/test_zs_upgd_3.5.2_latest_on_cos74_22976.py | 1 | 2730 | '''
#Cover 22976
based on test_zs_upgd_3.5.2_latest_on_cos74.py
Test the upgrade master from 3.5.2.53 & check API permissions
@author: Zhaohao
'''
import os
import tempfile
import uuid
import time
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_s... | apache-2.0 |
ClusterLabs/pcs | pcs_test/tier0/lib/cib/test_nvpair.py | 3 | 16477 | from unittest import TestCase
from lxml import etree
from pcs_test.tools.assertions import assert_xml_equal
from pcs_test.tools.xml import etree_to_str
from pcs.lib.cib import nvpair
from pcs.lib.cib.tools import IdProvider
# pylint: disable=no-self-use, protected-access
class AppendNewNvpair(TestCase):
def te... | gpl-2.0 |
partofthething/home-assistant | homeassistant/components/climate/__init__.py | 16 | 16930 | """Provides functionality to interact with climate devices."""
from abc import abstractmethod
from datetime import timedelta
import functools as ft
import logging
from typing import Any, Dict, List, Optional
import voluptuous as vol
from homeassistant.const import (
ATTR_TEMPERATURE,
PRECISION_TENTHS,
PRE... | mit |
undu/irc | botnet/boss.py | 1 | 12237 | #!/usr/bin/env python
import gevent
import logging
import os
import random
import re
import sys
import time
from gevent import socket
from gevent.event import Event
from gevent.queue import Queue
from logging.handlers import RotatingFileHandler
from optparse import OptionParser
from irc import IRCConnection, IRCBot
... | mit |
andras-tim/sqlalchemy-migrate | migrate/tests/versioning/test_script.py | 63 | 10322 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import imp
import os
import sys
import shutil
import six
from migrate import exceptions
from migrate.versioning import version, repository
from migrate.versioning.script import *
from migrate.versioning.util import *
from migrate.tests import fixture
from migrate.tests.f... | mit |
codename13/kylessopen-3.4-port | tools/perf/util/setup.py | 4998 | 1330 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
NinjahMeh/android_kernel_huawei_angler | scripts/build-all.py | 704 | 14699 | #! /usr/bin/env python
# Copyright (c) 2009-2014, The Linux Foundation. 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 the above copyright
# ... | gpl-2.0 |
petrvanblokland/Xierpa3 | xierpa3/sites/examples/helloworldpages/make.py | 1 | 8420 | # -*- coding: UTF-8 -*-
# -----------------------------------------------------------------------------
# xierpa server
# Copyright (c) 2014+ buro@petr.com, www.petr.com, www.xierpa.com
#
# X I E R P A 3
# Distribution by the MIT License.
#
# -----------------------------------------------------------... | mit |
anntzer/scikit-learn | sklearn/tests/test_multiclass.py | 5 | 32749 | import numpy as np
import scipy.sparse as sp
import pytest
from re import escape
from sklearn.utils._testing import assert_array_equal
from sklearn.utils._testing import assert_almost_equal
from sklearn.utils._testing import ignore_warnings
from sklearn.utils._mocking import CheckingClassifier
from sklearn.multiclass... | bsd-3-clause |
mchristopher/PokemonGo-DesktopMap | app/pywin/Lib/audiodev.py | 286 | 7597 | """Classes for manipulating audio devices (currently only for Sun and SGI)"""
from warnings import warnpy3k
warnpy3k("the audiodev module has been removed in Python 3.0", stacklevel=2)
del warnpy3k
__all__ = ["error","AudioDev"]
class error(Exception):
pass
class Play_Audio_sgi:
# Private instance variables
... | mit |
Oncilla/scion | acceptance/common/base.py | 1 | 7373 | # Copyright 2019 Anapaya Systems
#
# 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... | apache-2.0 |
unho/pootle | tests/pootle_app/forms.py | 5 | 1571 | # -*- 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 pytest
from pootle_app.forms import ... | gpl-3.0 |
glwu/python-for-android | python3-alpha/python3-src/Lib/cgi.py | 46 | 34484 | #! /usr/local/bin/python
# NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is
# intentionally NOT "/usr/bin/env python". On many systems
# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
# scripts, and /usr/local/bin is the default directory where Python is
# installed, so /usr/bin/env w... | apache-2.0 |
clstl/servo | tests/wpt/css-tests/tools/html5lib/html5lib/treewalkers/__init__.py | 1229 | 2323 | """A collection of modules for iterating through different kinds of
tree, generating tokens identical to those produced by the tokenizer
module.
To create a tree walker for a new type of tree, you need to do
implement a tree walker object (called TreeWalker by convention) that
implements a 'serialize' method taking a ... | mpl-2.0 |
hurrinico/l10n-italy | l10n_it_ricevute_bancarie/__openerp__.py | 1 | 2257 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2012 Andrea Cometa.
# Email: info@andreacometa.it
# Web site: http://www.andreacometa.it
# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
# Copyright (C) 2012 ... | agpl-3.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.0/Lib/test/test_errno.py | 5 | 1160 | #! /usr/bin/env python
"""Test the errno module
Roger E. Masse
"""
import errno
from test import support
import unittest
std_c_errors = frozenset(['EDOM', 'ERANGE'])
class ErrnoAttributeTests(unittest.TestCase):
def test_for_improper_attributes(self):
# No unexpected attributes should be on the modul... | mit |
nbcesar/sabergrade | lib/python2.7/site-packages/werkzeug/testsuite/debug.py | 101 | 7859 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.debug
~~~~~~~~~~~~~~~~~~~~~~~~
Tests some debug utilities.
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
import sys
import re
from werkzeug.testsuite import WerkzeugTestCase
from werkzeug.deb... | apache-2.0 |
DarkArtek/FFXIVITAFC | news2/migrations/0001_initial.py | 1 | 1204 | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-07-28 08:26
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
depend... | unlicense |
shingonoide/odoo | addons/hr_contract/__openerp__.py | 260 | 1834 | # -*- 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... | agpl-3.0 |
sYnfo/samba-1 | python/samba/tests/upgradeprovisionneeddc.py | 32 | 7461 | # Unix SMB/CIFS implementation.
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007-2008
#
# 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 opti... | gpl-3.0 |
johnraz/django-rest-framework | tests/test_fields.py | 1 | 54851 | import datetime
import os
import uuid
from decimal import Decimal
import pytest
from django.http import QueryDict
from django.test import TestCase, override_settings
from django.utils import six, timezone
import rest_framework
from rest_framework import serializers
# Tests for field keyword arguments and core funct... | bsd-2-clause |
CarlosMontilla/FxM | scripts/test/check_tests.py | 1 | 4412 | #!/usr/bin/env python3
"""!
@file
"""
import glob
import sys
import time
# @todo: manage test that have to be checked manually (such as plots)
def analyse_log(filename):
"""!
@brief Analyse a test log to find passed and failed tests
@param filename Name of the log file
@return res @todo doc this
... | gpl-3.0 |
Weil0ng/gem5 | tests/configs/tsunami-minor.py | 13 | 2346 | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | bsd-3-clause |
duramato/SickRage | lib/hachoir_parser/audio/mpeg_audio.py | 86 | 13752 | """
MPEG audio file parser.
Creation: 12 decembre 2005
Author: Victor Stinner
"""
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet,
MissingField, ParserError, createOrphanField,
Bit, Bits, Enum,
PaddingBits, PaddingBytes,
RawBytes)
from hachoir_parser.audio.id3 import ID3v1, ... | gpl-3.0 |
xcgoner/dist-mxnet | example/reinforcement-learning/dqn/atari_game.py | 25 | 7148 | # 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... | apache-2.0 |
LukeMurphey/splunk-network-tools | tests/selenium/webdriver/blackberry/webdriver.py | 44 | 4870 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
hotdoc/hotdoc | hotdoc/extensions/gi/annotation_parser.py | 1 | 7809 | # -*- coding: utf-8 -*-
#
# Copyright © 2015,2016 Mathieu Duponchelle <mathieu.duponchelle@opencreed.com>
# Copyright © 2015,2016 Collabora Ltd
#
# 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 Found... | lgpl-2.1 |
MER-GROUP/intellij-community | plugins/hg4idea/testData/bin/mercurial/bdiff.py | 96 | 2318 | # bdiff.py - Python implementation of bdiff.c
#
# Copyright 2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import struct, difflib, re
def splitnewlines(text):
'''like str.splitl... | apache-2.0 |
nitin-cherian/Webapps | SimpleIsBetterThanComplex.com/myproject/.env/lib/python3.5/site-packages/django/contrib/auth/hashers.py | 64 | 22352 | from __future__ import unicode_literals
import base64
import binascii
import hashlib
import importlib
import warnings
from collections import OrderedDict
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.signals import setting_changed
from django.dispatch import... | mit |
beswarm/django-allauth | allauth/socialaccount/providers/edmodo/views.py | 40 | 1075 | import requests
from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter,
OAuth2LoginView,
OAuth2CallbackView)
from allauth.socialaccount.providers import registry
from .provider import E... | mit |
rvalyi/OpenUpgrade | addons/survey/controllers/main.py | 20 | 19094 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
andrewtholt/My-amforth-6.1 | avr8/devices/atmega6490p/device.py | 5 | 6779 | # Partname: ATmega6490P
# generated automatically, do not edit
MCUREGS = {
'ADMUX': '&124',
'ADMUX_REFS': '$C0',
'ADMUX_ADLAR': '$20',
'ADMUX_MUX': '$1F',
'ADCSRA': '&122',
'ADCSRA_ADEN': '$80',
'ADCSRA_ADSC': '$40',
'ADCSRA_ADATE': '$20',
'ADCSRA_ADIF': '$10',
'ADCSRA_ADIE': '$08',
'ADCSR... | gpl-3.0 |
baidu/Paddle | python/paddle/fluid/tests/unittests/test_ir_memory_optimize_nlp.py | 5 | 1878 | # Copyright (c) 2019 PaddlePaddle 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 appli... | apache-2.0 |
rtrwalker/geotecha | geotecha/mathematics/quadrature.py | 1 | 74253 | # geotecha - A software suite for geotechncial engineering
# Copyright (C) 2018 Rohan T. Walker (rtrwalker@gmail.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the L... | gpl-3.0 |
soldag/home-assistant | homeassistant/components/nut/const.py | 10 | 7810 | """The nut component."""
from homeassistant.components.sensor import (
DEVICE_CLASS_BATTERY,
DEVICE_CLASS_POWER,
DEVICE_CLASS_TEMPERATURE,
)
from homeassistant.const import (
ELECTRICAL_CURRENT_AMPERE,
ELECTRICAL_VOLT_AMPERE,
FREQUENCY_HERTZ,
PERCENTAGE,
POWER_WATT,
TEMP_CELSIUS,
... | apache-2.0 |
Sorsly/subtle | google-cloud-sdk/lib/third_party/apitools/base/protorpclite/descriptor.py | 6 | 19700 | #!/usr/bin/env python
#
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | mit |
teamacid/android_kernel_teamacid | tools/perf/scripts/python/syscall-counts.py | 944 | 1429 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
JiscPER/magnificent-octopus | octopus/modules/swordv2/client_http.py | 1 | 1816 | from sword2 import HttpLayer, HttpResponse
from octopus.lib import http
import json
from requests.auth import HTTPBasicAuth
class OctopusHttpResponse(HttpResponse):
def __init__(self, *args, **kwargs):
self.resp = None
if len(args) > 0:
self.resp = args[0]
def __getitem__(self, att... | apache-2.0 |
awni/tensorflow | tensorflow/python/training/coordinator_test.py | 6 | 4200 | # 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 applicable law or a... | apache-2.0 |
fujunwei/chromium-crosswalk | native_client_sdk/src/tools/decode_dump.py | 51 | 6717 | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Utility to decode a crash dump generated by untrusted_crash_dump.[ch]
Currently this produces a simple stack trace.
"""
import... | bsd-3-clause |
apollo13/ansible | test/support/integration/plugins/modules/aws_step_functions_state_machine_execution.py | 27 | 6479 | #!/usr/bin/python
# Copyright (c) 2019, Prasad Katti (@prasadkatti)
# 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',
'status': ['... | gpl-3.0 |
nburn42/tensorflow | tensorflow/python/training/slot_creator.py | 16 | 7900 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
qma/pants | tests/python/pants_test/java/jar/test_manifest.py | 33 | 1127 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import unittest
fro... | apache-2.0 |
mylons/kubernetes | cluster/juju/charms/trusty/kubernetes-master/hooks/kubernetes_installer.py | 149 | 4138 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | apache-2.0 |
ubiar/odoo | addons/stock_landed_costs/stock_landed_costs.py | 56 | 18361 | # -*- 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... | agpl-3.0 |
jpshort/odoo | addons/l10n_at/__init__.py | 438 | 1050 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) conexus.at
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public ... | agpl-3.0 |
titasakgm/brc-stock | openerp/addons/sale_crm/report/__init__.py | 54 | 1087 | # -*- 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... | agpl-3.0 |
nathanial/lettuce | tests/integration/lib/Django-1.3/tests/modeltests/get_object_or_404/tests.py | 92 | 2623 | from django.http import Http404
from django.shortcuts import get_object_or_404, get_list_or_404
from django.test import TestCase
from models import Author, Article
class GetObjectOr404Tests(TestCase):
def test_get_object_or_404(self):
a1 = Author.objects.create(name="Brave Sir Robin")
a2 = Author... | gpl-3.0 |
VishvajitP/django-extensions | django_extensions/admin/filter.py | 16 | 1997 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.admin import FieldListFilter
try:
from django.contrib.admin.utils import prepare_lookup_value
except ImportError:
# django < 1.7
from django.contrib.admin.util import prepare_lookup_value
from django.utils.translation impor... | mit |
Zac-HD/home-assistant | homeassistant/components/media_player/apple_tv.py | 3 | 9307 | """
Support for Apple TV.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.apple_tv/
"""
import asyncio
import logging
import hashlib
import aiohttp
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.componen... | apache-2.0 |
thrive-refugee/thrive-refugee | donors/migrations/0005_auto_20141108_1219.py | 1 | 1067 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
('donors', '0004_auto_20141108_1110'),
]
operations = [
migrations.CreateModel(
name='Donation',
... | mit |
davidvon/pipa-pay-server | site-packages/jinja2/visitor.py | 1401 | 3316 | # -*- coding: utf-8 -*-
"""
jinja2.visitor
~~~~~~~~~~~~~~
This module implements a visitor for the nodes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from jinja2.nodes import Node
class NodeVisitor(object):
"""Walks the abstract syntax tree and call visitor functions for every... | apache-2.0 |
isaac-philip/loolu | common/django/core/servers/basehttp.py | 9 | 25759 | """
BaseHTTPServer that implements the Python WSGI protocol (PEP 333, rev 1.21).
Adapted from wsgiref.simple_server: http://svn.eby-sarna.com/wsgiref/
This is a simple server for use in testing or debugging Django apps. It hasn't
been reviewed for security issues. Don't use it for production use.
"""
from BaseHTTPSe... | mit |
ccowmu/whatistheplan.com | tests/test_routes.py | 1 | 1776 | from django.contrib.auth.models import User
from django.test import Client, TestCase
from django.core.urlresolvers import reverse
class RoutesTest(TestCase):
def setUp(self):
self.client = Client()
self.logged_in_client = Client()
self.user = User.objects.create_user("testuser", "test@email... | mit |
bblais/plasticity | plasticity/dialogs/waxy/textbox.py | 1 | 4652 | # textbox.py
import waxyobject
import wx
import core
import styles
class TextBox(wx.TextCtrl, waxyobject.WaxyObject):
__events__ = {
'Char': wx.EVT_CHAR, # do all controls have this?
'MaxLength': wx.EVT_TEXT_MAXLEN, # alias for TextMaxLen
'Text': wx.EVT_TEXT,
'Tex... | mit |
wcevans/grpc | src/python/grpcio_tests/tests/qps/benchmark_client.py | 23 | 7701 | # Copyright 2016, Google Inc.
# 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 the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
joaormatos/anaconda | Chowdren/chowdren/writers/extensions/EasyScrollbar.py | 1 | 1944 | from chowdren.writers.objects import ObjectWriter
from chowdren.common import get_animation_name, to_c, make_color
from chowdren.writers.events import (ComparisonWriter, ActionMethodWriter,
ConditionMethodWriter, ExpressionMethodWriter, make_table)
from mmfparser.bitdict import BitDict
from mmfparser.data.font i... | gpl-3.0 |
0k/OpenUpgrade | addons/sale_stock/res_config.py | 331 | 5235 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
play113/swer | heekscam-read-only/nc/nc.py | 25 | 20718 | ################################################################################
# nc.py
#
# Base class for NC code creation
# And global functions for calling current creator
#
# Hirutso Enni, 2009-01-13
# altered by Dan Falck 2010-08-04
# added tap() arguments Michael Haberler 2010-10-07
####################... | mit |
MiniSEC/GRR_clone | parsers/osx_quarantine.py | 6 | 2638 | #!/usr/bin/env python
#
# Copyright 2012 Google Inc. All Rights Reserved.
"""Parser for OSX quarantine sqlite files."""
__program__ = "osx_quarantine.py"
import datetime
import glob
import locale
import sys
from grr.parsers import sqlite_file
class OSXQuarantineEvents(sqlite_file.SQLiteFile):
"""Class for han... | apache-2.0 |
rbrito/pkg-youtube-dl | docs/conf.py | 39 | 2276 | # coding: utf-8
#
# youtube-dl documentation build configuration file, created by
# sphinx-quickstart on Fri Mar 14 21:05:43 2014.
#
# 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.
#
# All co... | unlicense |
Southpaw-TACTIC/TACTIC | src/pyasm/security/security_test.py | 1 | 30165 | #!/usr/bin/env python
###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way... | epl-1.0 |
xbmc/atv2 | xbmc/lib/libPython/Python/Lib/test/test_format.py | 8 | 10198 | from test.test_support import verbose, have_unicode, TestFailed
import sys
# test string formatting operator (I am not sure if this is being tested
# elsewhere but, surely, some of the given cases are *not* tested because
# they crash python)
# test on unicode strings as well
overflowok = 1
def testformat(formatstr,... | gpl-2.0 |
BuildingLink/sentry | tests/sentry/models/test_project.py | 8 | 1099 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from sentry.models import OrganizationMember, OrganizationMemberTeam
from sentry.testutils import TestCase
class ProjectTest(TestCase):
def test_member_set_simple(self):
user = self.create_user()
org = self.create_organization(owner=... | bsd-3-clause |
shiney-wh/phpsploit | src/api/plugin.py | 2 | 1672 | import re
from core import plugins
class Plugin:
"""Triggering plugin attributes.
Get attributes of the currently running plugin.
This object is generally imported like this:
>>> from api import plugin
The following attributes descriptions include some
examples, based on an imaginative plug... | gpl-3.0 |
cynngah/uofthacksIV | generate-jobs/lib/python2.7/site-packages/pip/commands/check.py | 336 | 1382 | import logging
from pip.basecommand import Command
from pip.operations.check import check_requirements
from pip.utils import get_installed_distributions
logger = logging.getLogger(__name__)
class CheckCommand(Command):
"""Verify installed packages have compatible dependencies."""
name = 'check'
usage =... | mit |
paran0ids0ul/infernal-twin | build/pip/build/lib.linux-i686-2.7/pip/commands/wheel.py | 239 | 7442 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
import os
import warnings
from pip.basecommand import RequirementCommand
from pip.index import PackageFinder
from pip.exceptions import CommandError, PreviousBuildDirError
from pip.req import RequirementSet
from pip.utils import import_or_r... | gpl-3.0 |
aldarionsevero/datalogger-ROS-rasp | sensors/mq135_sensor.py | 1 | 1548 | # Copyright (c) 2015 "aldarionsevero Lucas Severo Alves
# <lucassalves65@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 ri... | mit |
cberry777/dd-agent | checks.d/tokumx.py | 5 | 18952 | # (C) Datadog, Inc. 2014-2016
# (C) Leif Walsh <leif.walsh@gmail.com> 2014
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
import time
import types
# 3p
import bson
from pymongo import (
MongoClient,
ReadPreference,
uri_parser,
version as py_version,
)
# project
f... | bsd-3-clause |
paweljasinski/ironpython3 | Src/StdLib/Lib/tkinter/test/test_tkinter/test_loadtk.py | 162 | 1503 | import os
import sys
import unittest
import test.support as test_support
from tkinter import Tcl, TclError
test_support.requires('gui')
class TkLoadTest(unittest.TestCase):
@unittest.skipIf('DISPLAY' not in os.environ, 'No $DISPLAY set.')
def testLoadTk(self):
tcl = Tcl()
self.assertRaises(Tc... | apache-2.0 |
CS-SI/QGIS | python/plugins/processing/algs/gdal/gdalcalc.py | 7 | 7588 | # -*- coding: utf-8 -*-
"""
***************************************************************************
gdalcalc.py
---------------------
Date : Janaury 2015
Copyright : (C) 2015 by Giovanni Manghi
Email : giovanni dot manghi at naturalgis dot pt
**********... | gpl-2.0 |
wkeyword/pip | pip/_vendor/pkg_resources/__init__.py | 252 | 106466 | """
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path operations to manipul... | mit |
dorotan/pythontraining | env/Lib/site-packages/selenium/webdriver/common/utils.py | 3 | 4191 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
kapari/django-oscar | src/oscar/apps/catalogue/receivers.py | 60 | 1249 | # -*- coding: utf-8 -*-
from django.conf import settings
if settings.OSCAR_DELETE_IMAGE_FILES:
from oscar.core.loading import get_model
from django.db import models
from django.db.models.signals import post_delete
from sorl import thumbnail
from sorl.thumbnail.helpers import ThumbnailError
... | bsd-3-clause |
willhaines/scikit-rf | skrf/calibration/calibrationSet.py | 10 | 4426 |
'''
.. module:: skrf.calibration.calibrationSet
================================================================
calibrationSet (:mod:`skrf.calibration.calibrationSet`)
================================================================
Contains the CalibrationSet class, and supporting functions
CalibrationSet Class
... | bsd-3-clause |
matthiasdiener/spack | var/spack/repos/builtin/packages/nghttp2/package.py | 5 | 2319 | ##############################################################################
# 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... | lgpl-2.1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.