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 |
|---|---|---|---|---|---|
maoy/zknova | nova/scheduler/host_manager.py | 1 | 15124 | # Copyright (c) 2011 OpenStack, LLC.
# 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... | apache-2.0 |
flyingfish007/tempest | tempest/thirdparty/boto/test_s3_ec2_images.py | 17 | 5955 | # Copyright 2012 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 requ... | apache-2.0 |
h3llrais3r/Auto-Subliminal | lib/oauthlib/oauth1/rfc5849/endpoints/resource.py | 10 | 7434 | # -*- coding: utf-8 -*-
"""
oauthlib.oauth1.rfc5849.endpoints.resource
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of the resource protection provider logic of
OAuth 1.0 RFC 5849.
"""
from __future__ import absolute_import, unicode_literals
import logging
from .. import errors
from .b... | gpl-3.0 |
berndf/avg_q | python/avg_q/Sleep/freiburg_setup.py | 1 | 3547 | # Copyright (C) 2008-2011,2013 Bernd Feige
# This file is part of avg_q and released under the GPL v3 (see avg_q/COPYING).
# Entry is [schemas,booknos,channelnames] where each is a list of strings
setups=[
# 7 Channels= `DAISY'
[['DAISY'], [],
["vEOG", "hEOGl", "hEOGr", "C3", "C4", "EMG", "EKG"]],
# 8 Channels= `... | gpl-3.0 |
xianggong/m2c_unit_test | test/integer/sub_sat_charchar/compile.py | 1861 | 4430 | #!/usr/bin/python
import os
import subprocess
import re
def runCommand(command):
p = subprocess.Popen(command,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
p.wait()
return iter(p.stdout.readline, b'')
def dumpRunCommand(command,... | gpl-2.0 |
campbe13/openhatch | vendor/packages/scrapy/scrapy/contrib/pipeline/media.py | 25 | 4683 | from collections import defaultdict
from twisted.internet.defer import Deferred, DeferredList
from twisted.python.failure import Failure
from scrapy.utils.defer import mustbe_deferred, defer_result
from scrapy import log
from scrapy.utils.request import request_fingerprint
from scrapy.utils.misc import arg_to_iter
cl... | agpl-3.0 |
UviDTE-UviSpace/UviSpace | uvispace/uvisensor/imgprocessing.py | 2 | 9235 | #!/usr/bin/env python
"""This module contains the Image class, for image processing operations.
The operations implemented in the class methods are focused to the
images obtained from the external FPGAs in the UviSpace project. Thus,
once obtained a grey scale image, this module provide functions for
getting the sh... | gpl-3.0 |
kennedyshead/home-assistant | homeassistant/components/ozw/const.py | 8 | 2059 | """Constants for the ozw integration."""
from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR_DOMAIN
from homeassistant.components.climate import DOMAIN as CLIMATE_DOMAIN
from homeassistant.components.cover import DOMAIN as COVER_DOMAIN
from homeassistant.components.fan import DOMAIN as FAN_DOMAIN... | apache-2.0 |
arthurschneider/.dotfiles | ranger/commands.py | 20 | 2624 | # This is a sample commands.py. You can add your own commands here.
#
# Please refer to commands_full.py for all the default commands and a complete
# documentation. Do NOT add them all here, or you may end up with defunct
# commands when upgrading ranger.
# You always need to import ranger.api.commands here to get ... | mit |
vergecurrency/VERGE | test/functional/wallet_backup.py | 1 | 7836 | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet backup features.
Test case is:
4 nodes. 1 2 and 3 send transactions between each other... | mit |
Shrhawk/edx-platform | common/djangoapps/student/tests/test_login_registration_forms.py | 91 | 8536 | """Tests for the login and registration form rendering. """
import urllib
import unittest
import ddt
from mock import patch
from django.conf import settings
from django.core.urlresolvers import reverse
from util.testing import UrlResetMixin
from xmodule.modulestore.tests.factories import CourseFactory
from third_part... | agpl-3.0 |
kmoocdev2/edx-platform | openedx/core/djangoapps/credentials/migrations/0001_initial.py | 63 | 1847 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operati... | agpl-3.0 |
dannyperry571/theapprentice | script.module.liveresolver/lib/liveresolver/resolvers/theactionlive.py | 10 | 1246 | # -*- coding: utf-8 -*-
import re,urllib,urlparse
from liveresolver.modules import client,constants
from liveresolver.modules.log_utils import log
def resolve(url):
#try:
try: referer = urlparse.parse_qs(urlparse.urlparse(url).query)['referer'][0]
except: referer = url
id = urlparse.parse_qs(ur... | gpl-2.0 |
axinging/chromium-crosswalk | third_party/tlslite/tlslite/utils/aesgcm.py | 56 | 6772 | # Author: Google
# See the LICENSE file for legal information regarding use of this file.
# GCM derived from Go's implementation in crypto/cipher.
#
# https://golang.org/src/crypto/cipher/gcm.go
# GCM works over elements of the field GF(2^128), each of which is a 128-bit
# polynomial. Throughout this implementation, ... | bsd-3-clause |
hperala/kontuwikibot | tests/script_tests.py | 1 | 15582 | # -*- coding: utf-8 -*-
"""Test that each script can be compiled and executed."""
#
# (C) Pywikibot team, 2014
#
# Distributed under the terms of the MIT license.
#
from __future__ import print_function, unicode_literals
__version__ = '$Id: bf11a8b4baf2c189e30655bce6838795dd6294c4 $'
import os
import sys
from pywiki... | mit |
marcusmueller/gnuradio | gr-analog/python/analog/wfm_tx.py | 6 | 3471 | #
# Copyright 2005,2007,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later ve... | gpl-3.0 |
flowersteam/naminggamesal | naminggamesal/ngmeth_utils/srtheo_utils.py | 1 | 8354 | #==================
def srtheo_voc_old(voc1,voc2=None,voc2_m=None,voc2_w=None,m=None,w=None,role='both',force_ngmeth=False):
if (not force_ngmeth) and voc2 is not None and hasattr(voc1.__class__,'srtheo_voc') and hasattr(voc2.__class__,'srtheo_voc') and voc1.__class__.srtheo_voc == voc2.__class__.srtheo_voc:
retur... | agpl-3.0 |
lkastler/Analysis-UriPositions | python/CountURIs.py | 1 | 1610 | '''
Created on Sep 16, 2014
@author: lkastler
'''
import Config
import gzip as gz
import logging as log
from _collections import defaultdict
import pprint
from operator import itemgetter
subj = defaultdict(int)
pred = defaultdict(int)
obj = defaultdict(int)
total = defaultdict(int)
def readFile(fileName):
f = gz.op... | apache-2.0 |
zhuwenping/python-for-android | python-modules/twisted/twisted/conch/ssh/service.py | 61 | 1418 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
The parent class for all the SSH services. Currently implemented services
are ssh-userauth and ssh-connection.
Maintainer: Paul Swartz
"""
from twisted.python import log
class SSHService(log.Logger):
name = None # this is th... | apache-2.0 |
PCextreme/oauth2-server-manager-laravel | node_modules/laravel-elixir/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py | 2698 | 3270 | #!/usr/bin/env python
# Copyright (c) 2011 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.
""" Unit tests for the easy_xml.py file. """
import gyp.easy_xml as easy_xml
import unittest
import StringIO
class TestSequenceFunctions(... | mit |
rupran/ansible | lib/ansible/plugins/shell/csh.py | 118 | 1477 | # (c) 2014, Chris Church <chris@ninemoreminutes.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) any lat... | gpl-3.0 |
jeroyang/newsletter | newsletter/_version.py | 1 | 15760 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | bsd-3-clause |
TansyArron/pants | src/python/pants/backend/jvm/targets/exclude.py | 18 | 1290 | # coding=utf-8
# Copyright 2014 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)
class Exclude(objec... | apache-2.0 |
ATNF/askapsdp | Code/Base/py-iceutils/current/askap/iceutils/monitorpublisher.py | 1 | 4664 | # Copyright (c) 2014 CSIRO
# Australia Telescope National Facility (ATNF)
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)
# PO Box 76, Epping NSW 1710, Australia
# atnf-enquiries@csiro.au
#
# This file is part of the ASKAP software distribution.
#
# The ASKAP software distribution is free softwar... | gpl-2.0 |
HyechurnJang/archon | application/asa/urls.py | 2 | 3853 | # -*- coding: utf-8 -*-
################################################################################
# _____ _ _____ _ #
# / ____(_) / ____| | | #
# | | _ ___ ___ ___ | (___ _ _ ___... | apache-2.0 |
vladistan/percona-pam-plugin | test/dbqp/lib/test_mgmt/test_management.py | 22 | 11911 | #! /usr/bin/env python
# -*- mode: python; indent-tabs-mode: nil; -*-
# vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
#
# Copyright (C) 2010 Patrick Crews
#
# 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 ... | gpl-2.0 |
zookeepr/zookeepr | alembic/versions/14_436760a3036b_Add_missing_contraints_to_alembic.py | 8 | 1098 | """Add missing contraints to alembic
* Unique constraint for fulfilment.code
* Unique constraint for person_social_network_map.person_id and person_social_network_map.social_network_id
Revision ID: 436760a3036b
Revises: 624cf57a935
Create Date: 2015-05-02 04:29:39.013291
"""
# revision identifiers, used by Alembic... | gpl-2.0 |
totto82/opm-common | python/pybind11/tests/test_gil_scoped.py | 11 | 2717 | import multiprocessing
import threading
from pybind11_tests import gil_scoped as m
def _run_in_process(target, *args, **kwargs):
"""Runs target in process and returns its exitcode after 10s (None if still alive)."""
process = multiprocessing.Process(target=target, args=args, kwargs=kwargs)
process.daemon ... | gpl-3.0 |
nagyistoce/odoo-dev-odoo | addons/base_import_module/tests/test_module/__openerp__.py | 377 | 1290 | # -*- 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 |
Novartis/yap | examples/preconfigured_workflows/bacterial_classification/mothur_classification_summary.py | 1 | 2353 | #!/usr/bin/env python
from sys import *
from operator import add
import glob
import os
if len(argv)==5:
input_path = argv[2]
output_path = argv[4]
else:
print "Please issue the command in the following way:\n\n\tpython mothur_classification_summary -i <input_path> -o <output_path>"
exit()
## ... | apache-2.0 |
luca76/QGIS | python/plugins/db_manager/layer_preview.py | 3 | 4355 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... | gpl-2.0 |
robin-lai/scikit-learn | sklearn/datasets/covtype.py | 178 | 3821 | """Forest covertype dataset.
A classic dataset for classification benchmarks, featuring categorical and
real-valued features.
The dataset page is available from UCI Machine Learning Repository
http://archive.ics.uci.edu/ml/datasets/Covertype
Courtesy of Jock A. Blackard and Colorado State University.
"""
# Aut... | bsd-3-clause |
andriisoldatenko/Django-facebook | docs/docs_env/Lib/encodings/koi8_r.py | 593 | 14035 | """ Python Character Mapping Codec koi8_r generated from 'MAPPINGS/VENDORS/MISC/KOI8-R.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors... | bsd-3-clause |
betrisey/home-assistant | homeassistant/components/sensor/deutsche_bahn.py | 6 | 3468 | """
Support for information about the German train system.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.deutsche_bahn/
"""
import logging
from datetime import timedelta
import voluptuous as vol
from homeassistant.components.sensor import PLATF... | mit |
yanheven/cinder | cinder/volume/drivers/huawei/__init__.py | 4 | 4189 | # Copyright (c) 2013 - 2014 Huawei Technologies Co., Ltd.
# 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.... | apache-2.0 |
gavin-feng/odoo | addons/mail/tests/test_mail_features.py | 76 | 59326 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
dlyle65535/incubator-metron | metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/params/params_linux.py | 2 | 18636 | #!/usr/bin/env python
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License");... | apache-2.0 |
ossdemura/django-miniblog | Lib/site-packages/django/core/management/utils.py | 67 | 3739 | from __future__ import unicode_literals
import os
import sys
from subprocess import PIPE, Popen
from django.apps import apps as installed_apps
from django.utils import six
from django.utils.crypto import get_random_string
from django.utils.encoding import DEFAULT_LOCALE_ENCODING, force_text
from .base import Command... | mit |
tima/ansible | lib/ansible/modules/cloud/amazon/aws_kms_facts.py | 24 | 14663 | #!/usr/bin/python
#
# This is a 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 Ansible library is distributed in the hope that i... | gpl-3.0 |
dkm/skylines | skylines/config/app_cfg.py | 1 | 2846 | # -*- coding: utf-8 -*-
"""
Global configuration file for TG2-specific settings in SkyLines.
This file complements development/deployment.ini.
Please note that **all the argument values are strings**. If you want to
convert them into boolean, for example, you should use the
:func:`paste.deploy.converters.asbool` func... | agpl-3.0 |
ahmadio/edx-platform | lms/djangoapps/discussion_api/permissions.py | 79 | 2651 | """
Discussion API permission logic
"""
from lms.lib.comment_client.comment import Comment
from lms.lib.comment_client.thread import Thread
def _is_author(cc_content, context):
"""
Return True if the requester authored the given content, False otherwise
"""
return context["cc_requester"]["id"] == cc_c... | agpl-3.0 |
caiocsalvador/whats_the_craic | lib/python3.4/site-packages/django/contrib/gis/geoip2/base.py | 335 | 9054 | import os
import socket
import geoip2.database
from django.conf import settings
from django.core.validators import ipv4_re
from django.utils import six
from django.utils.ipv6 import is_valid_ipv6_address
from .resources import City, Country
# Creating the settings dictionary with any settings, if needed.
GEOIP_SETT... | mit |
macbre/mobify | mobify/test/test_medium.py | 1 | 1265 | # -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
from . import MobifyTestCase
from mobify.sources import MediumSource
class MediumSourceTest(MobifyTestCase):
_source = None
def setUp(self):
self._source = MediumSource(
url=str('https://medium.com/javascrip... | mit |
Glorf/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/filters/whitespace.py | 1730 | 1142 | from __future__ import absolute_import, division, unicode_literals
import re
from . import _base
from ..constants import rcdataElements, spaceCharacters
spaceCharacters = "".join(spaceCharacters)
SPACES_REGEX = re.compile("[%s]+" % spaceCharacters)
class Filter(_base.Filter):
spacePreserveElements = frozenset... | mpl-2.0 |
DMSC-Instrument-Data/lewis | src/lewis/core/approaches.py | 2 | 2133 | # -*- coding: utf-8 -*-
# *********************************************************************
# lewis - a library for creating hardware device simulators
# Copyright (C) 2016-2017 European Spallation Source ERIC
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU G... | gpl-3.0 |
shaunstanislaus/grab | grab/spider/task.py | 12 | 10652 | from __future__ import absolute_import
from datetime import datetime, timedelta
from grab.spider.error import SpiderMisuseError
from grab.base import copy_config
class BaseTask(object):
pass
class Task(BaseTask):
"""
Task for spider.
"""
def __init__(self, name=None, url=None, grab=None, grab_... | mit |
LearningRegistry/LearningRegistry | config/nginx_util.py | 2 | 12301 |
import pystache, os
ssl_template = '''
ssl_certificate {{ssl_certificate}};
ssl_certificate_key {{ssl_certificate_key}};
server {
listen {{port_https}} ssl;
server_name $hostname localhost;
access_log {{nginx_logs}}/learningregistry.access.log lr_log_query;
ssl_protocols SSLv3;
ssl_sessi... | apache-2.0 |
rapilabs/django | tests/transaction_hooks/tests.py | 288 | 6402 | from django.db import connection, transaction
from django.test import TransactionTestCase, skipUnlessDBFeature
from .models import Thing
class ForcedError(Exception):
pass
class TestConnectionOnCommit(TransactionTestCase):
"""
Tests for transaction.on_commit().
Creation/checking of database object... | bsd-3-clause |
skbly7/serc | website/wiki/templatetags/wiki_tags.py | 2 | 5389 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
import re
from django.conf import settings as django_settings
from django import template
from django.contrib.contenttypes.models import ContentType
from django.db.models import Model
from django.forms import BaseFo... | mit |
jmolloy/pedigree | images/install/disk-contents/libraries/python2.6/_abcoll.py | 51 | 13625 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
DON'T USE THIS MODULE DIRECTLY! The classes here should be imported
via collections; they are defined here only to alleviate certain
bootstrappin... | isc |
GiantSteps/essentia | test/src/unittest/spectral/test_spectralcomplexity.py | 10 | 2323 | #!/usr/bin/env python
# Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia 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 (FSF), e... | agpl-3.0 |
timlinux/QGIS | tests/src/python/test_qgsfeedback.py | 45 | 1210 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsFeedback.
.. note:: 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.
"""
__aut... | gpl-2.0 |
lucychambers/pepperrage | .bundle/ruby/2.0.0/gems/pygments.rb-0.6.0/vendor/simplejson/simplejson/tests/__init__.py | 64 | 2125 | import unittest
import doctest
class OptionalExtensionTestSuite(unittest.TestSuite):
def run(self, result):
import simplejson
run = unittest.TestSuite.run
run(self, result)
simplejson._toggle_speedups(False)
run(self, result)
simplejson._toggle_speedups(True)
... | mit |
patrickm/chromium.src | chrome/common/extensions/docs/server2/reference_resolver.py | 1 | 7929 | # 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.
from copy import deepcopy
import logging
import re
from file_system import FileNotFoundError
def _ClassifySchemaNode(node_name, api):
"""Attempt to ... | bsd-3-clause |
nukru/projectQ | app/auth/forms.py | 1 | 1977 | # -*- coding: utf-8 -*-
from flask.ext.wtf import Form
from flask.ext.babel import gettext
from wtforms.validators import Required, Email, Length, EqualTo
from wtforms import TextField,StringField, PasswordField, BooleanField, SubmitField
from wtforms import ValidationError
from validator import ValidateEmail, Validate... | apache-2.0 |
fhaoquan/kbengine | kbe/src/lib/python/Lib/copy.py | 93 | 8991 | """Generic (shallow and deep) copying operations.
Interface summary:
import copy
x = copy.copy(y) # make a shallow copy of y
x = copy.deepcopy(y) # make a deep copy of y
For module specific errors, copy.Error is raised.
The difference between shallow and deep copying is only relev... | lgpl-3.0 |
JMSkelton/ModeMap | ExtractTotalEnergies.py | 1 | 1636 | # ExtractTotalEnergies.py by J. M. Skelton
import csv;
import os;
import re;
# This script assumes that the single-point calculations on the modulated structures were run in numbered directories, e.g. 001, 002, ..., NNN.
# It expects each directory matching this pattern to contain a VASP OSSICAR file with a total e... | gpl-3.0 |
petewarden/tensorflow | tensorflow/python/keras/utils/io_utils.py | 3 | 2688 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
ataylor32/django | tests/lookup/tests.py | 153 | 37208 | from __future__ import unicode_literals
from datetime import datetime
from operator import attrgetter
from unittest import skipUnless
from django.core.exceptions import FieldError
from django.db import connection
from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature
from .models import Article, ... | bsd-3-clause |
springcoil/luigi | test/wrap_test.py | 72 | 2886 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | apache-2.0 |
supermari0/ironic | ironic/tests/test_disk_partitioner.py | 4 | 8829 | # Copyright 2014 Red Hat, 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... | apache-2.0 |
zhiyisun/linux | tools/perf/scripts/python/net_dropmonitor.py | 185 | 1784 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
# SPDX-License-Identifier: GPL-2.0
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import ... | gpl-2.0 |
kidmaple/CoolWall | user/python/Tools/idle/Debugger.py | 3 | 9449 | import os
import bdb
import traceback
from Tkinter import *
from WindowList import ListedToplevel
import StackViewer
class Debugger(bdb.Bdb):
interacting = 0
vstack = vsource = vlocals = vglobals = None
def __init__(self, pyshell):
bdb.Bdb.__init__(self)
self.pyshell = pyshell
... | gpl-2.0 |
williamfeng323/py-web | flask/lib/python3.6/site-packages/psycopg2/tests/dbapi20_tpc.py | 28 | 4138 | """ Python DB API 2.0 driver Two Phase Commit compliance test suite.
"""
import unittest
class TwoPhaseCommitTests(unittest.TestCase):
driver = None
def connect(self):
"""Make a database connection."""
raise NotImplementedError
_last_id = 0
_global_id_prefix = "dbapi20_tpc:"
... | mit |
Cinntax/home-assistant | homeassistant/components/esphome/binary_sensor.py | 2 | 1831 | """Support for ESPHome binary sensors."""
import logging
from typing import Optional
from aioesphomeapi import BinarySensorInfo, BinarySensorState
from homeassistant.components.binary_sensor import BinarySensorDevice
from . import EsphomeEntity, platform_async_setup_entry
_LOGGER = logging.getLogger(__name__)
asy... | apache-2.0 |
foodszhang/kbengine | kbe/res/scripts/common/Lib/collections/__main__.py | 213 | 1275 | ################################################################################
### Simple tests
################################################################################
# verify that instances can be pickled
from collections import namedtuple
from pickle import loads, dumps
Point = namedtuple('Point', 'x, y'... | lgpl-3.0 |
blackball/an-test6 | sdss/test_dr8.py | 1 | 2122 | import matplotlib
matplotlib.use('Agg')
import pylab as plt
import sys
from astrometry.sdss.dr8 import *
import numpy as np
def test_astrans(sdss, r,c,f,b):
bandnum = band_index(b)
sdss.retrieve('frame', r, c, f, b)
frame = sdss.readFrame(r, c, f, b)
astrans = frame.getAsTrans()
sdss.retrieve('photoObj', r, c, f... | gpl-2.0 |
astrobin/astrobin | astrobin/tests/test_utils.py | 1 | 6164 | from datetime import timedelta
from django.test import TestCase
from django.utils import timezone
from mock import patch
from astrobin import utils
from astrobin.tests.generators import Generators
class UtilsTest(TestCase):
@patch("astrobin.utils.get_client_ip")
@patch("django.contrib.gis.geoip2.GeoIP2.coun... | agpl-3.0 |
rzr/synapse | tests/rest/client/v1/test_typing.py | 3 | 5290 | # -*- coding: utf-8 -*-
# Copyright 2014 OpenMarket Ltd
#
# 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 la... | apache-2.0 |
josephkane/neighborhood | nh_rest/neighborhood/serializers.py | 1 | 2548 | from rest_framework import serializers
from django.contrib.auth.models import User
from neighborhood.models import *
class NeighborhoodSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Neighborhood
fields = ("id", "url", "name", "house", "request")
class UserSerializer(serial... | mit |
jakesyl/androguard | androguard/core/bytecodes/arm.py | 48 | 2306 | # Radare !
from r2 import r_bin
from r2 import r_asm
from r2 import r_anal
from r2 import r_core
from miasm.arch.arm_arch import arm_mn
from miasm.core.bin_stream import bin_stream
from miasm.core import asmbloc
class ARM2 :
def __init__(self) :
b = r_bin.RBin ()
b.load("./apks/exploits/617efb2... | apache-2.0 |
jedie/pypyjs-standalone | website/js/pypy.js-0.3.0/lib/modules/compiler/pyassem.py | 65 | 24260 | """A flow graph representation for Python bytecode"""
import dis
import types
import sys
from compiler import misc
from compiler.consts \
import CO_OPTIMIZED, CO_NEWLOCALS, CO_VARARGS, CO_VARKEYWORDS
class FlowGraph:
def __init__(self):
self.current = self.entry = Block()
self.exit = Block("... | mit |
jopohl/urh | src/urh/ui/ui_analysis.py | 1 | 40020 | # -*- coding: utf-8 -*-
#
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_TabAnalysis(object):
def setupUi(self, TabAnalysis):
TabAnalysis.setObjectName("TabAnalysis")
TabAnalysis.resize(1331, 739)
sizePolicy = QtWidgets.QSize... | gpl-3.0 |
jopohl/urh | src/urh/ui/actions/EditSignalAction.py | 1 | 9075 | import copy
import numpy as np
from PyQt5.QtWidgets import QUndoCommand
from urh.signalprocessing.Filter import Filter
from urh.signalprocessing.IQArray import IQArray
from urh.signalprocessing.ProtocolAnalyzer import ProtocolAnalyzer
from urh.signalprocessing.Signal import Signal
from enum import Enum
from urh.uti... | gpl-3.0 |
civiclaboratories/planbox | src/planbox_data/migrations/0009_profileprojecttemplate.py | 4 | 1996 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import models, migrations
import django.utils.timezone
import planbox_data.models
def create_default_templates(apps, schema_editor):
# try:
templates_profile_slug = settings.TEMPLATES_PROFILE
#... | gpl-3.0 |
popazerty/try | lib/python/Plugins/Extensions/FileCommander/Inputmod.py | 3 | 6786 | from Components.HTMLComponent import HTMLComponent
from Components.GUIComponent import GUIComponent
from Components.VariableText import VariableText
from enigma import eLabel
from Tools.NumericalTextInput import NumericalTextInput
#import os
class Input(VariableText, HTMLComponent, GUIComponent, NumericalTextInput):... | gpl-2.0 |
techieshark/tweepy | tweepy/binder.py | 40 | 10796 | # Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
from __future__ import print_function
import time
import re
from six.moves.urllib.parse import quote
import requests
import logging
from tweepy.error import TweepError, RateLimitError, is_rate_limit_error_message
from tweepy.utils import co... | mit |
agrista/odoo-saas | addons/l10n_ec/__openerp__.py | 260 | 1695 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2010-2012 Cristian Salamea Gnuthink Software Labs Cia. Ltda
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lic... | agpl-3.0 |
mattrobenolt/django | tests/admin_widgets/widgetadmin.py | 368 | 1345 | from django.contrib import admin
from . import models
class WidgetAdmin(admin.AdminSite):
pass
class CarAdmin(admin.ModelAdmin):
list_display = ['make', 'model', 'owner']
list_editable = ['owner']
class CarTireAdmin(admin.ModelAdmin):
def formfield_for_foreignkey(self, db_field, request, **kwargs... | bsd-3-clause |
bzamecnik/sms-tools | smst/ui/__init__.py | 1 | 1156 | from __future__ import print_function
import os
import sys
import importlib
import pkgutil
_sound_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../sounds')
def demo_sound_path(file_name):
'locates a demo sound file'
return os.path.join(_sound_dir, file_name)
# this allow to run an examp... | agpl-3.0 |
EKiefer/edge-starter | py34env/Lib/site-packages/pip/index.py | 22 | 36776 | """Routines related to PyPI, indexes"""
from __future__ import absolute_import
import logging
import cgi
from collections import namedtuple
import itertools
import sys
import os
import re
import mimetypes
import posixpath
import warnings
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.... | mit |
s0enke/boto | boto/ec2/elb/__init__.py | 110 | 32520 | # Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software wi... | mit |
kushalbhola/MyStuff | Practice/PythonApplication/env/Lib/site-packages/pandas/tests/generic/test_label_or_level_utils.py | 9 | 9968 | import pytest
from pandas.core.dtypes.missing import array_equivalent
import pandas as pd
# Fixtures
# ========
@pytest.fixture
def df():
"""DataFrame with columns 'L1', 'L2', and 'L3' """
return pd.DataFrame({"L1": [1, 2, 3], "L2": [11, 12, 13], "L3": ["A", "B", "C"]})
@pytest.fixture(params=[[], ["L1"],... | apache-2.0 |
402231466/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/ui/widget.py | 706 | 1774 | import random
from browser import doc
def getMousePosition(e):
if e is None:
e=win.event
if e.pageX or e.pageY:
return {'x': e.pageX, 'y': e.pageY}
if e.clientX or e.clientY:
_posx=e.clientX + doc.body.scrollLeft + doc.documentElement.scrollLeft;
_posy=e.clientY + doc.body.scr... | gpl-3.0 |
uwosh/uwosh.fieldworkflow | uwosh/fieldworkflow/events.py | 1 | 3938 | from interfaces import IFieldWorkflowEnabled
from zope.interface import classImplements
from Products.CMFCore.utils import getToolByName
#do not allow all attributes to be dynamic...
#these are things that usually are not needed to be dynamic anyways
#changing some of these things dynamically would otherwise cause p... | gpl-2.0 |
trachelr/mne-python | doc/sphinxext/numpy_ext/docscrape.py | 298 | 15441 | """Extract reference documentation from the NumPy source tree.
"""
import inspect
import textwrap
import re
import pydoc
from warnings import warn
# Try Python 2 first, otherwise load from Python 3
try:
from StringIO import StringIO
except:
from io import StringIO
class Reader(object):
"""A line-based s... | bsd-3-clause |
opensourcechipspark/platform_external_chromium_org | third_party/closure_linter/closure_linter/gjslint.py | 135 | 7991 | #!/usr/bin/env python
# python2.6 for command-line runs using p4lib. pylint: disable-msg=C6301
#
# Copyright 2007 The Closure Linter 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 co... | bsd-3-clause |
nuagenetworks/vspk-python | vspk/v6/fetchers/nuikegateways_fetcher.py | 2 | 2121 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# 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 copyrigh... | bsd-3-clause |
mfherbst/spack | lib/spack/external/jinja2/utils.py | 73 | 20629 | # -*- coding: utf-8 -*-
"""
jinja2.utils
~~~~~~~~~~~~
Utility functions.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import json
import errno
from collections import deque
from threading import Lock
from jinja2._compat import text_type, string... | lgpl-2.1 |
uiri/pxqz | venv/lib/python2.7/site-packages/django/core/files/storage.py | 78 | 10329 | import os
import errno
import urlparse
import itertools
from datetime import datetime
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, SuspiciousOperation
from django.core.files import locks, File
from django.core.files.move import file_move_safe
from django.utils.encoding impo... | gpl-3.0 |
anryko/ansible | test/units/modules/network/fortios/test_fortios_log_memory_filter.py | 21 | 14770 | # Copyright 2019 Fortinet, Inc.
#
# 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 program is distributed in the... | gpl-3.0 |
datawagovau/datacats | datacats/docker.py | 3 | 13797 | # Copyright 2014-2015 Boxkite Inc.
# This file is part of the DataCats package and is released under
# the terms of the GNU Affero General Public License version 3.0.
# See LICENSE.txt or http://www.fsf.org/licensing/licenses/agpl-3.0.html
from __future__ import absolute_import
import sys
from datacats.scripts impo... | agpl-3.0 |
Kazade/NeHe-Website | django/conf/locale/sk/formats.py | 232 | 1288 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'G:i:s'
DATETIME_FORMAT = 'j. F Y G:i:s'
YEAR_MONTH... | bsd-3-clause |
mistermocha/jenkinsapi | jenkinsapi/utils/requester.py | 7 | 5454 | """
Module for jenkinsapi requester (which is a wrapper around python-requests)
"""
import requests
try:
import urlparse
except ImportError:
# Python3
import urllib.parse as urlparse
from jenkinsapi.custom_exceptions import JenkinsAPIException, PostRequired
# import logging
# # these two lines enable deb... | mit |
ehirt/odoo | addons/portal/mail_mail.py | 320 | 2625 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
sodexis/odoo | addons/google_spreadsheet/google_spreadsheet.py | 242 | 5617 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General... | agpl-3.0 |
ama-jharrison/agdc | agdc/api/source/main/python/datacube/api/utils.py | 1 | 37332 | # ===============================================================================
# Copyright 2015 Geoscience Australia
#
# 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.apac... | apache-2.0 |
FlashGordon95/Financial-Portfolio-Flask | venv/lib/python2.7/site-packages/requests/packages/chardet/langbulgarianmodel.py | 2965 | 12784 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
javadev/ukrainiantolatin | src/test/python/UkrainianToLatinTest.py | 1 | 6459 | '''
* $Id$
*
* Copyright 2014 Valentyn Kolesnikov
*
* 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 |
RCOS-Grading-Server/HWserver | tests/integrationTests/tests/tutorial_04_python_static_analysis/__init__.py | 2 | 3366 | # Necessary imports. Provides library functions to ease writing tests.
from lib import prebuild, testcase, SUBMITTY_TUTORIAL_DIR
import subprocess
import os
import glob
import shutil
import traceback
############################################################################
# COPY THE ASSIGNMENT FROM THE SAMPLE ASS... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.