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 |
|---|---|---|---|---|---|
firebitsbr/dionaea | modules/python/scripts/http.py | 8 | 15597 | #********************************************************************************
#* Dionaea
#* - catches bugs -
#*
#*
#*
#* Copyright (C) 2009 Paul Baecher & Markus Koetter & Mark Schloesser
#*
#* This program is free software; you can redistribute it and/or
#*... | gpl-2.0 |
Big-B702/python-for-android | python3-alpha/python3-src/Lib/test/test_shelve.py | 57 | 5834 | import unittest
import shelve
import glob
from test import support
from collections import MutableMapping
from test.test_dbm import dbm_iterator
def L1(s):
return s.decode("latin-1")
class byteskeydict(MutableMapping):
"Mapping that supports bytes keys"
def __init__(self):
self.d = {}
def __... | apache-2.0 |
youdonghai/intellij-community | python/helpers/py3only/docutils/_compat.py | 44 | 1538 | # $Id: _compat.py 7486 2012-07-11 12:25:14Z milde $
# Author: Georg Brandl <georg@python.org>
# Copyright: This module has been placed in the public domain.
"""
Python 2/3 compatibility definitions.
This module currently provides the following helper symbols:
* bytes (name of byte string type; str in 2.x, bytes in 3... | apache-2.0 |
dacjames/scrapy | scrapy/telnet.py | 141 | 2946 | """
Scrapy Telnet Console extension
See documentation in docs/topics/telnetconsole.rst
"""
import pprint
import logging
from twisted.internet import protocol
try:
from twisted.conch import manhole, telnet
from twisted.conch.insults import insults
TWISTED_CONCH_AVAILABLE = True
except ImportError:
TWI... | bsd-3-clause |
erikhaverkamp/mppmon | multiplexer.py | 1 | 3438 | from Phidget22.Devices.DigitalOutput import *
from Phidget22.Net import *
import time
class Multiplexer:
def __init__(self):
print('init mp')
try:
self.ch0 = DigitalOutput()
self.ch1 = DigitalOutput()
self.ch2 = DigitalOutput()
self.ch3 = DigitalOutp... | mit |
lianwutech/plugin_serialrtu_modbus | plugin.py | 2 | 3860 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
modbus网络的串口数据采集插件
1、device_id的组成方式为ip_port_slaveid
2、设备类型为0,协议类型为modbus
3、devices_info_dict需要持久化设备信息,启动时加载,变化时写入
4、device_cmd内容:json字符串
"""
import time
from setting import *
from libs.daemon import Daemon
from libs.plugin import *
from libs.mqttclie... | apache-2.0 |
bigdocker/cloud-init | cloudinit/distros/rhel_util.py | 6 | 2930 | # vi: ts=4 expandtab
#
# Copyright (C) 2012 Canonical Ltd.
# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
# Copyright (C) 2012 Yahoo! Inc.
#
# Author: Scott Moser <scott.moser@canonical.com>
# Author: Juerg Haefliger <juerg.haefliger@hp.com>
# Author: Joshua Harlow <harlowja@yaho... | gpl-3.0 |
jwlawson/tensorflow | tensorflow/python/eager/execute.py | 16 | 8289 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
kirbyfan64/pygments-unofficial | pygments/util.py | 10 | 8806 | # -*- coding: utf-8 -*-
"""
pygments.util
~~~~~~~~~~~~~
Utility functions.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import sys
split_path_re = re.compile(r'[/\\ ]')
doctype_lookup_re = re.compile(r'''(?smx)
(<\?... | bsd-2-clause |
felixfontein/ansible | test/lib/ansible_test/_internal/delegation.py | 13 | 21085 | """Delegate test execution to another environment."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import os
import re
import sys
import tempfile
from . import types as t
from .io import (
make_dirs,
read_text_file,
)
from .executor import (
create_... | gpl-3.0 |
nitin-cherian/LifeLongLearning | Python/PythonProgrammingLanguage/Encapsulation/encap_env/lib/python3.5/site-packages/ipykernel/tests/test_message_spec.py | 8 | 14797 | """Test suite for our zeromq-based message specification."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import re
import sys
from distutils.version import LooseVersion as V
try:
from queue import Empty # Py 3
except ImportError:
from Queue import Empt... | mit |
luceatnobis/youtube-dl | youtube_dl/extractor/c56.py | 91 | 2083 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import js_to_json
class C56IE(InfoExtractor):
_VALID_URL = r'https?://(?:(?:www|player)\.)?56\.com/(?:.+?/)?(?:v_|(?:play_album.+-))(?P<textid>.+?)\.(?:html|swf)'
IE_NAME = '56.com'
_TESTS = ... | unlicense |
elliotthill/django-oscar | oscar/apps/payment/abstract_models.py | 2 | 11000 | from decimal import Decimal
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from oscar.core.compat import AUTH_USER_MODEL
from oscar.core.utils import slugify
from oscar.templatetags.currency_filters import currency
from . import bankcards
class... | bsd-3-clause |
rhertzog/django | django/db/backends/postgresql/version.py | 632 | 1517 | """
Extracts the version of the PostgreSQL server.
"""
import re
# This reg-exp is intentionally fairly flexible here.
# Needs to be able to handle stuff like:
# PostgreSQL #.#.#
# EnterpriseDB #.#
# PostgreSQL #.# beta#
# PostgreSQL #.#beta#
VERSION_RE = re.compile(r'\S+ (\d+)\.(\d+)\.?(\d+)?')
def _parse_... | bsd-3-clause |
Byron/bcore | src/python/bkvstore/types.py | 1 | 3079 | #-*-coding:utf-8-*-
"""
@package bkvstore.types
@brief Implements a few types based on our base classes
@author Sebastian Thiel
@copyright [GNU Lesser General Public License](https://www.gnu.org/licenses/lgpl.html)
"""
from __future__ import unicode_literals
__all__ = ['YAMLKeyValueStoreModifier', 'ChangeTrackingJSONK... | lgpl-3.0 |
frouty/odoogoeen | addons/account/report/__init__.py | 68 | 1601 | # -*- 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 |
xmission/d-note | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langgreekmodel.py | 2763 | 12628 | ######################## 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... | agpl-3.0 |
maheshp/novatest | nova/vnc/__init__.py | 25 | 1855 | #!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 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
#
... | apache-2.0 |
hanhlh/hadoop-0.20.2_FatBTree | contrib/hod/testing/main.py | 182 | 2928 | #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 thi... | apache-2.0 |
Shrulik/Open-Knesset | docs/api/source/conf.py | 14 | 7865 | # -*- coding: utf-8 -*-
#
# OpenKnesset documentation build configuration file, created by
# sphinx-quickstart on Mon Nov 28 22:11:32 2011.
#
# 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.
#
#... | bsd-3-clause |
djbpitt/collatex | collatex-pythonport/collatex/tokenindex.py | 3 | 11153 | from ClusterShell.RangeSet import RangeSet
from collatex.block import Block
from collatex.core_classes import Token
from collatex.linsuffarr import SuffixArray
from collatex.linsuffarr import UNIT_BYTE
class Stack(list):
def push(self, item):
self.append(item)
def peek(self):
return self[-1]
... | gpl-3.0 |
ngonzalvez/sentry | src/sentry/quotas/redis.py | 13 | 3036 | """
sentry.quotas.redis
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import time
from django.conf import settings
from rb import Cluster
from sentry.exceptions import InvalidCon... | bsd-3-clause |
AlexStarov/Shop | applications/delivery/migrations/0046_auto_20151120_1304.py | 1 | 3101 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import applications.delivery.models
import datetime
import compat.ImageWithThumbs.models
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
... | apache-2.0 |
edxzw/edx-platform | common/djangoapps/student/management/commands/get_grades.py | 165 | 5207 | """
Management command to generate a list of grades for
all students that are enrolled in a course.
"""
from courseware import grades, courses
from certificates.models import GeneratedCertificate
from django.test.client import RequestFactory
from django.core.management.base import BaseCommand, CommandError
import os
fr... | agpl-3.0 |
ivaano/zato | code/zato-cli/src/zato/cli/zato_command.py | 6 | 11613 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (C) 2010 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# stdlib
import argparse
# ConcurrentLogHandler - updates ... | gpl-3.0 |
cancan101/tensorflow | tensorflow/python/ops/candidate_sampling_ops.py | 55 | 17372 | # 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 |
iancze/EchelleJSON | EchelleJSON.py | 1 | 2136 | import numpy as np
import json
from astropy.utils.misc import JsonCustomEncoder
order_prefix = "order_"
def read(fname):
'''
A simple routine to read a JSON format and return dictionaries of numpy arrays.
'''
f = open(fname, 'r')
echelle_dict = json.load(f)
f.close()
# go through each of... | mit |
diegocortassa/TACTIC | src/tactic/command/notification_cmd.py | 1 | 3344 | ############################################################
#
# Copyright (c) 2010, 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 witho... | epl-1.0 |
valdecdev/odoo | openerp/report/render/rml2pdf/utils.py | 48 | 6141 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import copy
import locale
import logging
import re
import reportlab
import openerp.tools as tools
from openerp.tools.safe_eval import safe_eval as eval
from openerp.tools.misc import ustr
_logger = logging.getLogger(_... | agpl-3.0 |
ooici/pyon | pyon/util/container_stats_plugin.py | 1 | 1723 | """
This plugin requests that the container log all collected statistics
Add this command to the way you execute nose::
--with-stats
Each container will handle the request, so if running --with-pycc,
then statistics will appear in both container.log and pycc-container.log files.
Otherwise, container.log will sho... | bsd-2-clause |
mohseniaref/adore-doris | lib/python/basic/projections/ecef.py | 2 | 1932 | #ecef.py
#https://code.google.com/p/pysatel/source/browse/trunk/coord.py?r=22
from math import pow, degrees, radians
from scipy import mat, cos, sin, arctan, sqrt, pi, arctan2, deg2rad, rad2deg
#TO-DO: UPDATE THESE NUMBERS USING THE earth_radius.py
#
# Constants defined by the World Geodetic System 1984 (WGS84)
a = 6... | gpl-2.0 |
amenonsen/ansible | test/units/modules/storage/netapp/test_na_ontap_vserver_cifs_security.py | 21 | 5961 | # (c) 2019, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit test template for ONTAP Ansible module '''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import pytest
from units.compat import unittest
... | gpl-3.0 |
henriknelson/micropython | tests/pyb/adc.py | 6 | 1529 | from pyb import ADC, Timer
adct = ADC(16) # Temperature 930 -> 20C
print(adct)
adcv = ADC(17) # Voltage 1500 -> 3.3V
print(adcv)
# read single sample; 2.5V-5V is pass range
val = adcv.read()
assert val > 1000 and val < 2000
# timer for read_timed
tim = Timer(5, freq=500)
# read into bytearray
buf = bytearray(b'\xff... | mit |
daoluan/decode-Django | Django-1.5.1/django/contrib/auth/models.py | 74 | 18549 | from __future__ import unicode_literals
import re
import warnings
from django.core.exceptions import ImproperlyConfigured
from django.core.mail import send_mail
from django.core import validators
from django.db import models
from django.db.models.manager import EmptyManager
from django.utils.crypto import get_random_s... | gpl-2.0 |
alexlib/openpiv-python | openpiv/test/test_tools.py | 2 | 1613 | from openpiv.tools import imread, save, display_vector_field, transform_coordinates
from openpiv.pyprocess import extended_search_area_piv, get_coordinates
import pathlib
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.testing import compare
file_a = pathlib.Path(__file__).parent / '../examples/test... | gpl-3.0 |
NikolaYolov/invenio_backup | modules/websubmit/lib/websubmitadmin_regression_tests.py | 13 | 2876 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## Licens... | gpl-2.0 |
ukBaz/python-bluezero | tests/test_dbus_tools.py | 1 | 7790 | import subprocess
import unittest
from unittest.mock import MagicMock
from unittest.mock import patch
import tests.obj_data
from bluezero import constants
class TestDbusModuleCalls(unittest.TestCase):
"""
Testing things that use the Dbus module
"""
experimental = True
bluetooth_service_experimenta... | mit |
sysadmind/ansible-modules-extras | system/capabilities.py | 79 | 6980 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Nate Coraor <nate@bx.psu.edu>
#
# 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... | gpl-3.0 |
ds-hwang/chromium-crosswalk | third_party/WebKit/Source/build/scripts/make_style_shorthands.py | 65 | 3163 | #!/usr/bin/env python
# Copyright (C) 2013 Intel Corporation. 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, thi... | bsd-3-clause |
stevenle/googletv-anymote | googletv/proto/keycodes_pb2.py | 1 | 27774 | # Generated by the protocol buffer compiler. DO NOT EDIT!
from google.protobuf import descriptor
from google.protobuf import message
from google.protobuf import reflection
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
DESCRIPTOR = descriptor.FileDescriptor(
name='keycodes.proto',... | apache-2.0 |
jonzobrist/Percona-Server-5.1 | python-for-subunit2junitxml/testtools/tests/test_compat.py | 62 | 9528 | # Copyright (c) 2010 testtools developers. See LICENSE for details.
"""Tests for miscellaneous compatibility functions"""
import linecache
import os
import sys
import tempfile
import traceback
import testtools
from testtools.compat import (
_b,
_detect_encoding,
_get_source_encoding,
_u,
unicode... | bsd-3-clause |
susansls/zulip | zerver/webhooks/gogs/tests.py | 5 | 3082 | # -*- coding: utf-8 -*-
from typing import Text
from zerver.lib.webhooks.git import COMMITS_LIMIT
from zerver.lib.test_classes import WebhookTestCase
class GogsHookTests(WebhookTestCase):
STREAM_NAME = 'commits'
URL_TEMPLATE = "/api/v1/external/gogs?&api_key={api_key}"
FIXTURE_DIR_NAME = 'gogs'
def t... | apache-2.0 |
DirtyUnicorns/android_external_chromium-org | third_party/closure_linter/closure_linter/checker.py | 135 | 4808 | #!/usr/bin/env python
#
# 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 copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | bsd-3-clause |
JVillella/tensorflow | tensorflow/python/kernel_tests/cholesky_op_test.py | 18 | 13673 | # 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 |
carlmjohnson/texttools | texttools/titlecase.py | 2 | 9428 | #!/usr/bin/env python3
"""
titlecase.py v0.1
Original Perl version by: John Gruber http://daringfireball.net/ 10 May 2008
Python version by Stuart Colville http://muffinresearch.co.uk
License: http://www.opensource.org/licenses/mit-license.php
"""
import unittest
import sys
import re
def titlecase(text):
"""
... | mit |
tmilicic/networkx | networkx/algorithms/bipartite/tests/test_project.py | 14 | 14106 | #!/usr/bin/env python
from nose.tools import assert_equal
import networkx as nx
from networkx.algorithms import bipartite
from networkx.testing import assert_edges_equal, assert_nodes_equal
class TestBipartiteProject:
def test_path_projected_graph(self):
G=nx.path_graph(4)
P=bipartite.projected_gr... | bsd-3-clause |
cecep-edu/edx-platform | common/lib/capa/capa/util.py | 47 | 7335 | """
Utility functions for capa.
"""
import bleach
from decimal import Decimal
from calc import evaluator
from cmath import isinf, isnan
import re
from lxml import etree
#-----------------------------------------------------------------------------
#
# Utility functions used in CAPA responsetypes
default_tolerance = '0... | agpl-3.0 |
paul-rs/amaas-core-sdk-python | amaascore/assets/synthetic_multi_leg.py | 3 | 2129 | from __future__ import absolute_import, division, print_function, unicode_literals
from datetime import date
from amaascore.assets.synthetic import Synthetic
class SyntheticMultiLeg(Synthetic):
"""
A synthetic asset which takes multiple assets as 'legs'. The value of the entire structure is equal to the su... | apache-2.0 |
RominYue/sourceCode | CS231n/assignment1/cs231n/vis_utils.py | 65 | 1951 | from math import sqrt, ceil
import numpy as np
def visualize_grid(Xs, ubound=255.0, padding=1):
"""
Reshape a 4D tensor of image data to a grid for easy visualization.
Inputs:
- Xs: Data of shape (N, H, W, C)
- ubound: Output grid will have values scaled to the range [0, ubound]
- padding: The number of b... | gpl-3.0 |
jwngr/sdow | scripts/replace_titles_in_redirects_file.py | 1 | 2190 | """
Replaces page titles in the redirects file with their corresponding IDs.
Output is written to stdout.
"""
from __future__ import print_function
import io
import sys
import gzip
from sets import Set
# Validate input arguments.
if len(sys.argv) < 3:
print('[ERROR] Not enough arguments provided!')
print('[INFO... | mit |
CSC301H-Fall2013/JuakStore | site-packages/build/lib/django/contrib/databrowse/plugins/calendars.py | 100 | 5855 | from __future__ import unicode_literals
from django import http
from django.db import models
from django.contrib.databrowse.datastructures import EasyModel
from django.contrib.databrowse.sites import DatabrowsePlugin
from django.shortcuts import render_to_response
from django.utils.html import format_html, format_html... | mit |
trondeau/gnuradio | gr-digital/python/digital/ofdm_txrx.py | 27 | 20975 | #
# Copyright 2013 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 version.
#
#... | gpl-3.0 |
OpenBazaar/Network | interfaces.py | 6 | 6090 | __author__ = 'chris'
from zope.interface import Interface, Attribute
class Multiplexer(Interface):
"""
This interface defines the structure of the protocol class that handles creating new network connections
and sending and receiving messages. At present this is only used by the OpenBazaarProtocol class ... | mit |
ycasg/PyNLO | src/validation/pulse_test.py | 4 | 3953 | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 10 10:19:43 2015
This file is part of pyNLO.
pyNLO 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 optio... | gpl-3.0 |
jetskijoe/SickGear | lib/hachoir_metadata/misc.py | 57 | 8595 | from hachoir_metadata.metadata import RootMetadata, registerExtractor
from hachoir_metadata.safe import fault_tolerant
from hachoir_parser.container import SwfFile
from hachoir_parser.misc import TorrentFile, TrueTypeFontFile, OLE2_File, PcfFile
from hachoir_core.field import isString
from hachoir_core.error import war... | gpl-3.0 |
2014c2g14/cda0519 | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/colordict.py | 621 | 24077 | ## pygame - Python Game Library
## Copyright (C) 2000-2003 Pete Shinners
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (... | agpl-3.0 |
mcus/SickRage | lib/babelfish/language.py | 79 | 6874 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2013 the BabelFish authors. All rights reserved.
# Use of this source code is governed by the 3-clause BSD license
# that can be found in the LICENSE file.
#
from __future__ import unicode_literals
from collections import namedtuple
from functools import partial
from pkg_resour... | gpl-3.0 |
saleemjaveds/https-github.com-openstack-nova | nova/openstack/common/fixture/config.py | 69 | 3062 | #
# Copyright 2013 Mirantis, Inc.
# Copyright 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/licen... | apache-2.0 |
biota/sourcetracker2 | sourcetracker/_q2/tests/test_method.py | 1 | 8986 | #!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright (c) 2016--, Biota Technology.
# www.biota.com
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ---------------------... | bsd-3-clause |
simonwydooghe/ansible | test/units/modules/network/fortios/test_fortios_log_syslogd_filter.py | 21 | 9184 | # 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 |
citrix-openstack-build/nova | nova/virt/hyperv/vmops.py | 4 | 16960 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 Cloud.com, Inc
# Copyright 2012 Cloudbase Solutions Srl
# 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 ... | apache-2.0 |
stscieisenhamer/glue | glue/plugins/tools/spectrum_tool/qt/tests/test_spectrum_tool.py | 1 | 8521 | from __future__ import absolute_import, division, print_function
import pytest
import numpy as np
from mock import MagicMock
from glue.core.fitters import PolynomialFitter
from glue.core.roi import RectangularROI
from glue.core import Data, Coordinates
from glue.core.tests.util import simple_session
from glue.tests.h... | bsd-3-clause |
MostafaGazar/tensorflow | tensorflow/contrib/learn/python/learn/dataframe/transforms/densify.py | 22 | 1982 | # 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... | apache-2.0 |
haylesr/angr | angr/analyses/loopfinder.py | 1 | 4933 | import networkx
import logging
from ..analysis import Analysis, register_analysis
l = logging.getLogger('angr.analyses.loops')
class Loop(object):
def __init__(self, entry, entry_edges, break_edges, continue_edges, body_nodes, graph, subloops):
self.entry = entry
self.entry_edges = entry_edges
... | bsd-2-clause |
BartoszCichecki/onlinepython | onlinepython/pypy-2.4.0-win32/lib-python/2.7/ctypes/test/test_macholib.py | 36 | 1798 | import os
import sys
import unittest
# Bob Ippolito:
"""
Ok.. the code to find the filename for __getattr__ should look
something like:
import os
from macholib.dyld import dyld_find
def find_lib(name):
possible = ['lib'+name+'.dylib', name+'.dylib',
name+'.framework/'+name]
for dylib in possible:
... | gpl-2.0 |
esrf-emotion/emotion | tests/TestCustomCommandsAttributes.py | 2 | 1904 | import unittest
import sys
import os
sys.path.insert(
0,
os.path.abspath(
os.path.join(
os.path.dirname(__file__),
"..")))
import emotion
config_xml = """
<config>
<controller class="mockup" name="test">
<host value="mydummyhost1"/>
<port value="5000"/>
<axis nam... | gpl-2.0 |
dkubiak789/odoo | addons/l10n_it/__openerp__.py | 267 | 1992 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010
# OpenERP Italian Community (<http://www.openerp-italia.org>)
# Servabit srl
# Agile Business Group sagl
# Domsense srl
# Albato... | agpl-3.0 |
GoUbiq/pyexchange | tests/exchange2010/test_get_event.py | 5 | 16481 | """
(c) 2013 LinkedIn Corp. 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... | apache-2.0 |
Y3K/django | django/contrib/gis/geos/libgeos.py | 345 | 6218 | """
This module houses the ctypes initialization procedures, as well
as the notice and error handler function callbacks (get called
when an error occurs in GEOS).
This module also houses GEOS Pointer utilities, including
get_pointer_arr(), and GEOM_PTR.
"""
import logging
import os
import re
from ctypes import CD... | bsd-3-clause |
muravjov/ansible | v2/ansible/playbook/role/__init__.py | 7 | 14635 | # (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... | gpl-3.0 |
ztane/zsos | userland/lib/python2.5/distutils/mwerkscompiler.py | 87 | 10325 | """distutils.mwerkscompiler
Contains MWerksCompiler, an implementation of the abstract CCompiler class
for MetroWerks CodeWarrior on the Macintosh. Needs work to support CW on
Windows."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: mwerkscompiler.py 37828 2004-11-10 22:23:15Z loewis... | gpl-3.0 |
ficristo/brackets-shell | gyp/pylib/gyp/generator/xcode.py | 1363 | 58344 | # Copyright (c) 2012 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 filecmp
import gyp.common
import gyp.xcodeproj_file
import gyp.xcode_ninja
import errno
import os
import sys
import posixpath
import re
import shutil
import... | mit |
Venturi/oldcms | env/lib/python2.7/site-packages/django/views/generic/base.py | 82 | 8771 | from __future__ import unicode_literals
import logging
import warnings
from functools import update_wrapper
from django import http
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import NoReverseMatch, reverse
from django.template.response import TemplateResponse
from django.uti... | apache-2.0 |
andmos/ansible | lib/ansible/modules/windows/win_rds_rap.py | 10 | 2933 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Kevin Subileau (@ksubileau)
# 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': ['preview'],
'supported_by': 'commu... | gpl-3.0 |
aral/isvat | django/contrib/admin/helpers.py | 100 | 13631 | from __future__ import unicode_literals
from django import forms
from django.contrib.admin.util import (flatten_fieldsets, lookup_field,
display_for_field, label_for_field, help_text_for_field)
from django.contrib.admin.templatetags.admin_static import static
from django.contrib.contenttypes.models import ContentT... | mit |
tmuelle2/phantomjs | src/qt/qtbase/src/3rdparty/angle/src/libGLESv2/Float16ToFloat32.py | 329 | 1897 | # Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# This script generates a function that converts 16-bit precision floating
# point numbers to 32-bit.
# It is based on ftp://ftp.fox-toolkit.org/p... | bsd-3-clause |
ycaihua/kbengine | kbe/src/lib/python/Lib/test/test_userdict.py | 80 | 6575 | # Check every path through every method of UserDict
from test import support, mapping_tests
import collections
d0 = {}
d1 = {"one": 1}
d2 = {"one": 1, "two": 2}
d3 = {"one": 1, "two": 3, "three": 5}
d4 = {"one": None, "two": None}
d5 = {"one": 1, "two": 1}
class UserDictTest(mapping_tests.TestHashMappingProtocol):
... | lgpl-3.0 |
EvolutionClip/pyload | module/plugins/hoster/FilepostCom.py | 1 | 4945 | # -*- coding: utf-8 -*-
import re
from time import time
from module.common.json_layer import json_loads
from module.plugins.internal.CaptchaService import ReCaptcha
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class FilepostCom(SimpleHoster):
__name__ = "FilepostCom"
__t... | gpl-3.0 |
jjmleiro/hue | desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/PublicKey/__init__.py | 124 | 1876 | # -*- coding: utf-8 -*-
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to e... | apache-2.0 |
xeroc/python-bitshares | bitsharesbase/operations.py | 1 | 43006 | # -*- coding: utf-8 -*-
from collections import OrderedDict
from graphenebase.types import (
Array,
Bool,
Bytes,
Fixed_array,
Id,
Int16,
Int64,
Map,
Optional,
PointInTime,
Set,
Static_variant,
String,
Uint8,
Uint16,
Uint32,
Uint64,
Varint32,
V... | mit |
Stargrazer82301/CAAPR | CAAPR/CAAPR_AstroMagic/PTS/pts/modeling/analysis/heating/launch.py | 1 | 12656 | #!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | mit |
adviti/melange | thirdparty/google_appengine/lib/webob/webob/updatedict.py | 35 | 1063 | """
Dict that has a callback on all updates
"""
class UpdateDict(dict):
updated = None
updated_args = None
def _updated(self):
"""
Assign to new_dict.updated to track updates
"""
updated = self.updated
if updated is not None:
args = self.updated_args
... | apache-2.0 |
vornne/pw_module_system | header_item_modifiers.py | 6 | 1843 | imod_plain = 0
imod_cracked = 1
imod_rusty = 2
imod_bent = 3
imod_chipped = 4
imod_battered = 5
imod_poor = 6
imod_crude = 7
imod_old = 8
imod_cheap = 9
imod_fine = 10
imod_well_made = 11
imod_sharp = 12
imod_balanced = 13
imod_tempered = 14
imod_deadly = 15
imod_exquisite = 16
imod_masterwork = 17
imod_heavy = 18
imod... | bsd-3-clause |
brianwoo/django-tutorial | build/Django/build/lib.linux-x86_64-2.7/django/db/migrations/writer.py | 42 | 20479 | from __future__ import unicode_literals
import collections
import datetime
import decimal
import inspect
import math
import os
import re
import sys
import types
from importlib import import_module
from django.apps import apps
from django.db import migrations, models
from django.db.migrations.loader import MigrationLo... | gpl-3.0 |
huchoi/edx-platform | common/djangoapps/util/tests/test_memcache.py | 101 | 3655 | """
Tests for memcache in util app
"""
from django.test import TestCase
from django.core.cache import get_cache
from util.memcache import safe_key
class MemcacheTest(TestCase):
"""
Test memcache key cleanup
"""
# Test whitespace, control characters, and some non-ASCII UTF-16
UNICODE_CHAR_CODES =... | agpl-3.0 |
nilmini20s/gem5-2016-08-13 | tests/configs/simple-atomic-mp.py | 69 | 2376 | # Copyright (c) 2013 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 |
n0m4dz/odoo | openerp/cli/__init__.py | 185 | 2008 | import logging
import sys
import os
import openerp
from openerp import tools
from openerp.modules import module
_logger = logging.getLogger(__name__)
commands = {}
class CommandType(type):
def __init__(cls, name, bases, attrs):
super(CommandType, cls).__init__(name, bases, attrs)
name = getattr(... | agpl-3.0 |
curtisstpierre/django | django/contrib/gis/db/backends/postgis/operations.py | 168 | 15689 | import re
from django.conf import settings
from django.contrib.gis.db.backends.base.operations import \
BaseSpatialOperations
from django.contrib.gis.db.backends.postgis.adapter import PostGISAdapter
from django.contrib.gis.db.backends.postgis.pgraster import (
from_pgraster, to_pgraster,
)
from django.contrib... | bsd-3-clause |
cseagle/fREedom | pe_loader.py | 1 | 13257 | #!/usr/bin/env python
'''
Crude PE32 / PE32+ loader, conforming to the Loader interface, for a stand-alone binnavi compatible disassembler
'''
__author__ = "Chris Eagle"
__copyright__ = "Copyright 2015, Chris Eagle"
__credits__ = ["Chris Eagle"]
__license__ = "GPL"
__version__ = "2.0"
__maintainer__ = "Chris Eagle"
_... | gpl-2.0 |
nkgilley/home-assistant | homeassistant/components/universal/media_player.py | 3 | 16205 | """Combination of multiple media players for a universal controller."""
from copy import copy
import logging
import voluptuous as vol
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerEntity
from homeassistant.components.media_player.const import (
ATTR_APP_ID,
ATTR_APP_NAME,
A... | apache-2.0 |
Cloudify-PS/cloudify-manager-blueprints | components/nginx/scripts/preconfigure.py | 1 | 4140 | #!/usr/bin/env python
# source: nginx -> target: manager_configuration
from os.path import join, dirname
from collections import namedtuple
from cloudify import ctx
ctx.download_resource(
join('components', 'utils.py'),
join(dirname(__file__), 'utils.py'))
import utils # NOQA
src_runtime_props = ctx.source... | apache-2.0 |
toenuff/treadmill | lib/python/treadmill/zkutils.py | 1 | 18255 | """Treadmill ZooKeeper helper functions."""
from __future__ import absolute_import
import sys
import os
import fnmatch
import importlib
import logging
import pickle
import threading
import types
import kazoo
import kazoo.client
import kazoo.exceptions
import kazoo.security
from kazoo.protocol import states
import y... | apache-2.0 |
richard-willowit/odoo | addons/delivery/tests/test_delivery_cost.py | 6 | 5590 | # -*- coding: utf-8 -*-
from odoo.tests import common
from odoo.tools import float_compare
@common.at_install(False)
@common.post_install(True)
class TestDeliveryCost(common.TransactionCase):
def setUp(self):
super(TestDeliveryCost, self).setUp()
self.SaleOrder = self.env['sale.order']
s... | gpl-3.0 |
vitorio/ocropodium | ocradmin/presets/management/commands/importscripts.py | 1 | 3008 | """
Import a script file or files into the database.
"""
import os
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from ocradmin.presets.models import Preset
from django.core.exceptions import ImproperlyConfigured
from djan... | apache-2.0 |
p4datasystems/CarnotKEdist | dist/Lib/test/test_binop.py | 126 | 10743 | """Tests for binary operators on subtypes of built-in types."""
import unittest
from test import test_support
def gcd(a, b):
"""Greatest common divisor using Euclid's algorithm."""
while a:
a, b = b%a, a
return b
def isint(x):
"""Test whether an object is an instance of int or long."""
re... | apache-2.0 |
guewen/OpenUpgrade | addons/google_account/__openerp__.py | 68 | 1459 | # -*- 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 |
cntnboys/410Lab6 | build/django/django/db/models/sql/datastructures.py | 71 | 2522 | """
Useful auxiliary data structures for query construction. Not useful outside
the SQL domain.
"""
class Col(object):
def __init__(self, alias, target, source):
self.alias, self.target, self.source = alias, target, source
def as_sql(self, qn, connection):
return "%s.%s" % (qn(self.alias), qn... | apache-2.0 |
songmonit/CTTMSONLINE | addons/survey/wizard/__init__.py | 385 | 1026 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY 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 |
tdliu/hoop-picks | lib/requests/packages/chardet/latin1prober.py | 1778 | 5232 | ######################## 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... | apache-2.0 |
sudheesh001/RFID-DBSync | venv/lib/python2.7/site-packages/setuptools/tests/test_upload_docs.py | 522 | 2139 | """build_ext tests
"""
import sys, os, shutil, tempfile, unittest, site, zipfile
from setuptools.command.upload_docs import upload_docs
from setuptools.dist import Distribution
SETUP_PY = """\
from setuptools import setup
setup(name='foo')
"""
class TestUploadDocsTest(unittest.TestCase):
def setUp(self):
... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.