repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
paweljasinski/ironpython3 | Tests/interop/net/field/test_field_misc.py | 3 | 1571 | #####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of t... | apache-2.0 |
ahojjati/grr | lib/flows/general/filetypes.py | 6 | 2223 | #!/usr/bin/env python
"""File-type specific flows."""
from grr.lib import aff4
from grr.lib import flow
# For AFF4PlistQuery pylint: disable=unused-import
from grr.lib.aff4_objects import filetypes
# pylint: enable=unused-import
from grr.lib.rdfvalues import structs as rdf_structs
from grr.proto import flows_pb2
cl... | apache-2.0 |
googleapis/python-shell | google/cloud/shell/__init__.py | 1 | 2691 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
kashiif/ShaniXBMCWork | script.video.F4mProxy/lib/utils/cipherfactory.py | 151 | 2934 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""Factory functions for symmetric cryptography."""
import os
from tlslite.utils import python_aes
from tlslite.utils import python_rc4
from tlslite.utils import cryptomath
tripleDESPresent = False
if cryptomath.m2cry... | gpl-2.0 |
Manishearth/servo | tests/wpt/harness/wptrunner/reduce.py | 156 | 6086 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import sys
import tempfile
from cStringIO import StringIO
from collections import defaultdict
import wptrunner
import w... | mpl-2.0 |
IsCoolEntertainment/debpkg_python-boto | boto/s3/lifecycle.py | 14 | 8221 | # Copyright (c) 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 without ... | mit |
tkinz27/ansible | test/integration/gce_credentials.py | 275 | 1809 | import collections
import os
import yaml
try:
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
_ = Provider.GCE
except ImportError:
print("failed=True " + \
"msg='libcloud with GCE support (0.13.3+) required for this module'")
sys.exit(1)
def a... | gpl-3.0 |
Peddle/hue | desktop/core/ext-py/python-daemon/test/test_daemon.py | 38 | 68378 | # -*- coding: utf-8 -*-
#
# test/test_daemon.py
# Part of python-daemon, an implementation of PEP 3143.
#
# Copyright © 2008–2009 Ben Finney <ben+python@benfinney.id.au>
#
# This is free software: you may copy, modify, and/or distribute this work
# under the terms of the Python Software Foundation License, version 2 or... | apache-2.0 |
michaelpog/kernel_baytrail_snd_card_driver | tools/perf/scripts/python/syscall-counts-by-pid.py | 1996 | 2105 | # system call counts, by pid
# (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, sys
sys.path.append(os.env... | gpl-2.0 |
nkalodimas/invenio | modules/bibrank/lib/bibrankadmin_regression_tests.py | 18 | 2835 | # -*- 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 |
tartakynov/enso | enso/platform/win32/selection/__init__.py | 9 | 3451 | # Copyright (c) 2008, Humanized, 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:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of ... | bsd-3-clause |
kikkomep/compose | tests/integration/resilience_test.py | 26 | 1648 | from __future__ import absolute_import
from __future__ import unicode_literals
from .. import mock
from .testcases import DockerClientTestCase
from compose.project import Project
from compose.service import ConvergenceStrategy
class ResilienceTest(DockerClientTestCase):
def setUp(self):
self.db = self.cr... | apache-2.0 |
sweetmandm/aenea | client/_server_plugin_example.py | 7 | 2001 | # This is a command module for Dragonfly. It provides support for several of
# Aenea's built-in capabilities. This module is NOT required for Aenea to
# work correctly, but it is strongly recommended.
# This file is part of Aenea
#
# Aenea is free software: you can redistribute it and/or modify it under
# the terms of... | lgpl-3.0 |
rahulbahal7/cloud-gateway | server.py | 1 | 7070 | from flask import Flask, render_template, request, g
import os
import subprocess
import requests
import sqlite3
import yaml
app = Flask(__name__)
dnat_cmd = "sudo iptables -t nat %s PREROUTING -d %s -j DNAT --to-destination %s"
port_fwd_cmd = "sudo iptables -t nat %s PREROUTING -p %s -d %s --dport %s -j DNAT --to-de... | apache-2.0 |
fbradyirl/home-assistant | tests/components/script/test_init.py | 1 | 9084 | """The tests for the Script component."""
# pylint: disable=protected-access
import unittest
from unittest.mock import patch, Mock
import pytest
from homeassistant.components import script
from homeassistant.components.script import DOMAIN
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_NAME,
SERVI... | apache-2.0 |
JamesAng/lx-stb | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program i... | gpl-2.0 |
cloudera/ibis | ibis/backends/pandas/tests/conftest.py | 1 | 1158 | from pathlib import Path
import pandas as pd
import ibis
import ibis.expr.operations as ops
from ibis.backends.tests.base import BackendTest, RoundHalfToEven
class TestConf(BackendTest, RoundHalfToEven):
check_names = False
additional_skipped_operations = frozenset({ops.StringSQLLike})
supported_to_time... | apache-2.0 |
ActiveState/code | recipes/Python/523003_Find_cyclical_references/recipe-523003.py | 2 | 2367 | import gc
from types import FrameType
def print_cycles(objects, outstream=sys.stdout, show_progress=False):
"""
objects: A list of objects to find cycles in. It is often useful
to pass in gc.garbage to find the cycles that are
preventing some objects from being garb... | mit |
tarzan0820/odoo | addons/crm/validate_email.py | 462 | 5978 | # RFC 2822 - style email validation for Python
# (c) 2012 Syrus Akbary <me@syrusakbary.com>
# Extended from (c) 2011 Noel Bush <noel@aitools.org>
# for support of mx and user check
# This code is made available to you under the GNU LGPL v3.
#
# This module provides a single method, valid_email_address(),
# which return... | agpl-3.0 |
NickelMedia/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/layouttestresultsreader_unittest.py | 124 | 6488 | # Copyright (c) 2011 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 ... | bsd-3-clause |
mtdewulf/incubator-airflow | tests/contrib/sensors/emr_job_flow_sensor.py | 56 | 4122 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
jjs0sbw/CSPLN | apps/scaffolding/mac/web2py/web2py.app/Contents/Resources/gluon/contrib/pyrtf/Renderer.py | 44 | 26038 | from types import StringType, ListType, TupleType
from copy import deepcopy
from Elements import *
DEFAULT_TAB_WIDTH = 720
ParagraphAlignmentMap = { ParagraphPropertySet.LEFT : 'ql',
ParagraphPropertySet.RIGHT : 'qr',
ParagraphPropertySet.CENTER : 'qc... | gpl-3.0 |
shaufi/odoo | addons/website_event_track/controllers/event.py | 332 | 8323 | # -*- 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 |
fabiobatalha/publication_stats | publication/thrift/server.py | 1 | 7000 | # coding: utf-8
import json
import argparse
import logging
import os
import sys
from publication.controller import stats, ServerError
import thriftpy
import thriftpywrap
from thriftpy.rpc import make_server
logger = logging.getLogger(__name__)
publication_stats_thrift = thriftpy.load(
os.path.join(os.path.dirna... | bsd-2-clause |
arabenjamin/scikit-learn | sklearn/externals/joblib/format_stack.py | 238 | 15536 | """
Represent an exception with a lot of information.
Provides 2 useful functions:
format_exc: format an exception into a complete traceback, with full
debugging instruction.
format_outer_frames: format the current position in the stack call.
Adapted from IPython's VerboseTB.
"""
# Authors: Gael Varoqua... | bsd-3-clause |
jhona22baz/blog-flask | python2.7/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/pg8000.py | 35 | 3801 | # postgresql/pg8000.py
# Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Support for the PostgreSQL database via the pg8000 driver.
Connecting
-------... | mit |
jefffohl/nupic | src/nupic/frameworks/opf/expdescriptionapi.py | 31 | 12491 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | gpl-3.0 |
witcxc/scipy | scipy/_lib/_numpy_compat.py | 71 | 1488 | """Functions copypasted from newer versions of numpy.
"""
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from scipy._lib._version import NumpyVersion
if NumpyVersion(np.__version__) > '1.7.0.dev':
_assert_warns = np.testing.assert_warns
else:
def _assert... | bsd-3-clause |
Zelgadis87/Sick-Beard | lib/hachoir_core/stream/output.py | 90 | 5471 | from cStringIO import StringIO
from lib.hachoir_core.endian import BIG_ENDIAN
from lib.hachoir_core.bits import long2raw
from lib.hachoir_core.stream import StreamError
from errno import EBADF
MAX_READ_NBYTES = 2 ** 16
class OutputStreamError(StreamError):
pass
class OutputStream(object):
def __init__(self, ... | gpl-3.0 |
pauloremoli/pywall | dist/pywall-0.1.0/pywall/wall/jobwall.py | 2 | 3640 | # -*- coding: utf-8 -*-
import logging
from wall import Wall
class JobWall(Wall):
views = []
itView = 0
jobs = []
default_offset = 5
jobWidth = 0
jobHeight = 0
def __init__(self, canvas, jenkins_url, views):
Wall.__init__(self, canvas, jenkins_url)
self.views = views
def update_info(self):
if (self.j... | lgpl-3.0 |
lzedl/PyMySQL | pymysql/tests/test_issues.py | 7 | 19280 | import datetime
import time
import warnings
import sys
import pymysql
from pymysql.tests import base
import unittest2
try:
import imp
reload = imp.reload
except AttributeError:
pass
__all__ = ["TestOldIssues", "TestNewIssues", "TestGitHubIssues"]
class TestOldIssues(base.PyMySQLTestCase):
def test_... | mit |
maxkondr/onos-porta | tools/test/topos/attmplsfast.py | 3 | 6445 | #!/usr/bin/env python
"""
"""
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.node import RemoteController
from mininet.node import Node
from mininet.node import CPULimitedHost
from mininet.link import TCLink
from mininet.cli import CLI
from mininet.log import setLogLevel
from mininet.util i... | apache-2.0 |
suiyuan2009/tensorflow | tensorflow/contrib/seq2seq/python/ops/beam_search_ops.py | 124 | 1149 | # 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 |
jbarry510/telescope-mount-code | raspberry_pi/Adafruit_GPIO/GPIO.py | 13 | 17147 | # Copyright (c) 2014 Adafruit Industries
# Author: Tony DiCola
#
# 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 rights
# to use, copy, m... | mit |
ishay2b/tensorflow | tensorflow/contrib/keras/python/keras/applications/xception_test.py | 52 | 1569 | # 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 |
cneill/designate-testing | designate/api/v2/__init__.py | 7 | 1947 | # Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Author: Kiall Mac Innes <kiall@hp.com>
#
# 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/L... | apache-2.0 |
iWuzHere/node-gyp | gyp/tools/pretty_sln.py | 1831 | 5099 | #!/usr/bin/env python
# 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.
"""Prints the information in a sln file in a diffable way.
It first outputs each projects in alphabetical order with their
dependenci... | mit |
dagar/Firmware | Tools/px4airframes/srcscanner.py | 13 | 1242 | import os
import re
import codecs
class SourceScanner(object):
"""
Traverses directory tree, reads all source files, and passes their contents
to the Parser.
"""
def ScanDir(self, srcdir, parser):
"""
Scans provided path and passes all found contents to the parser using
par... | bsd-3-clause |
fedelemantuano/thug | thug/ActiveX/modules/SymantecAppStream.py | 2 | 1043 | # Symantec AppStream LaunchObj ActiveX Arbitrary File Download and Execute
# CVE-2008-4388
import logging
log = logging.getLogger("Thug")
def installAppMgr(self, url):
log.ThugLogging.log_exploit_event(self._window.url,
"Symantec AppStream LaunchObj ActiveX",
... | gpl-2.0 |
FHannes/intellij-community | python/lib/Lib/pstats.py | 94 | 25940 | """Class for printing reports on profiled python code."""
# Class for printing reports on profiled python code. rev 1.0 4/1/94
#
# Based on prior profile module by Sjoerd Mullender...
# which was hacked somewhat by: Guido van Rossum
#
# see profile.doc and profile.py for more info.
# Copyright 1994, by InfoSeek Co... | apache-2.0 |
houzhenggang/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib/python2.7/test/test_set.py | 61 | 62916 |
import unittest
from test import test_support
import gc
import weakref
import operator
import copy
import pickle
from random import randrange, shuffle
import sys
import collections
class PassThru(Exception):
pass
def check_pass_thru():
raise PassThru
yield 1
class BadCmp:
def __hash__(self):
... | gpl-2.0 |
chipsCode/cocosbuilder3 | CocosBuilder/libs/nodejs/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py | 126 | 54475 | # 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 errno
import os
import sys
import posixpath
import re
import shutil
import subprocess
import temp... | mit |
ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/django-1.4/django/utils/six.py | 84 | 24371 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2014 Benjamin Peterson
#
# 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 with... | bsd-3-clause |
ConsciousCode/u413 | api/pi.py | 2 | 1132 | '''u413 - an open-source BBS/terminal/PI-themed forum
Copyright (C) 2012 PiMaster
Copyright (C) 2012 EnKrypt
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation,either version 3 of the License... | agpl-3.0 |
myang321/django | django/core/checks/security/csrf.py | 477 | 1796 | from django.conf import settings
from .. import Tags, Warning, register
W003 = Warning(
"You don't appear to be using Django's built-in "
"cross-site request forgery protection via the middleware "
"('django.middleware.csrf.CsrfViewMiddleware' is not in your "
"MIDDLEWARE_CLASSES). Enabling the middle... | bsd-3-clause |
seckcoder/lang-learn | python/sklearn/examples/covariance/plot_lw_vs_oas.py | 4 | 2864 | """
=============================
Ledoit-Wolf vs OAS estimation
=============================
The usual covariance maximum likelihood estimate can be regularized
using shrinkage. Ledoit and Wolf proposed a close formula to compute
the asymptotical optimal shrinkage parameter (minimizing a MSE
criterion), yielding the ... | unlicense |
2ndy/RaspIM | usr/lib/python2.7/hmac.py | 253 | 4531 | """HMAC (Keyed-Hashing for Message Authentication) Python module.
Implements the HMAC algorithm as described by RFC 2104.
"""
import warnings as _warnings
trans_5C = "".join ([chr (x ^ 0x5C) for x in xrange(256)])
trans_36 = "".join ([chr (x ^ 0x36) for x in xrange(256)])
# The size of the digests returned by HMAC ... | gpl-2.0 |
dharmabumstead/ansible | lib/ansible/plugins/callback/profile_roles.py | 95 | 3490 | # (c) 2017, Tennis Smith, https://github.com/gamename
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
c... | gpl-3.0 |
satoshi-nakamoto/UserInfuser | serverside/dao/logs_dao.py | 14 | 1313 | # Copyright (C) 2011, CloudCaptive
#
# 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 i... | agpl-3.0 |
lenovor/bosen | app/NMF/script/partition_data.py | 14 | 2513 | #!/usr/bin/python
import os, sys
if len(sys.argv) < 6:
print 'Partition matrix data by rows for the Petuum NMF application'
print ''
print 'Usage: python %s <data-file> <data-format> <m> <n> <num-clients> [<output-dirname>]' % sys.argv[0]
print ''
print 'Output: <num-clients> files, ending with ".c... | bsd-3-clause |
plotly/python-api | packages/python/plotly/plotly/graph_objs/splom/marker/_line.py | 1 | 24938 | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Line(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "splom.marker"
_path_str = "splom.marker.line"
_valid_props = {
"autocolorscale",
... | mit |
alexholehouse/SBMLIntegrator | libsbml-5.0.0/src/bindings/python/test/sbml/TestRateRule.py | 1 | 3765 | #
# @file TestRateRule.py
# @brief RateRule unit tests
#
# @author Akiya Jouraku (Python conversion)
# @author Ben Bornstein
#
# $Id$
# $HeadURL$
#
# ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
#
# DO NOT EDIT THIS FILE.
#
# This file was generated automatically by converting t... | gpl-3.0 |
lukw00/buck | third-party/py/twitter-commons/src/python/twitter/common/python/environment.py | 18 | 6210 | from __future__ import absolute_import, print_function
import os
import site
import sys
import uuid
from .common import open_zip, safe_mkdir, safe_rmtree
from .interpreter import PythonInterpreter
from .package import distribution_compatible
from .pex_builder import PEXBuilder
from .pex_info import PexInfo
from .trac... | apache-2.0 |
alexandrucoman/vbox-nova-driver | nova/tests/unit/virt/xenapi/stubs.py | 11 | 13554 | # Copyright (c) 2010 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable la... | apache-2.0 |
abdoosh00/edx-rtl-final | common/lib/xmodule/xmodule/tests/test_poll.py | 227 | 1133 | # -*- coding: utf-8 -*-
"""Test for Poll Xmodule functional logic."""
from xmodule.poll_module import PollDescriptor
from . import LogicTest
class PollModuleTest(LogicTest):
"""Logic tests for Poll Xmodule."""
descriptor_class = PollDescriptor
raw_field_data = {
'poll_answers': {'Yes': 1, 'Dont_kn... | agpl-3.0 |
vmindru/ansible-modules-core | cloud/openstack/os_subnets_facts.py | 66 | 4674 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# This module 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 late... | gpl-3.0 |
GitHublong/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/db/models/sql/aggregates.py | 114 | 1812 | from django.db.models.sql.aggregates import *
from django.contrib.gis.db.models.fields import GeometryField
class GeoAggregate(Aggregate):
# Default SQL template for spatial aggregates.
sql_template = '%(function)s(%(field)s)'
# Conversion class, if necessary.
conversion_class = None
# Flags for ... | apache-2.0 |
gautamkrishnar/hatter | venv/lib/python2.7/site-packages/pip/_vendor/html5lib/filters/lint.py | 979 | 4306 | from __future__ import absolute_import, division, unicode_literals
from gettext import gettext
_ = gettext
from . import _base
from ..constants import cdataElements, rcdataElements, voidElements
from ..constants import spaceCharacters
spaceCharacters = "".join(spaceCharacters)
class LintError(Exception):
pass
... | gpl-3.0 |
antoviaque/edx-platform | common/djangoapps/track/tests/test_tracker.py | 35 | 3443 | from django.conf import settings
from django.test import TestCase
from django.test.utils import override_settings
import track.tracker as tracker
from track.backends import BaseBackend
SIMPLE_SETTINGS = {
'default': {
'ENGINE': 'track.tests.test_tracker.DummyBackend',
'OPTIONS': {
'fl... | agpl-3.0 |
vrenaville/OCB | addons/sale/edi/__init__.py | 454 | 1065 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
vmanoria/bluemix-hue-filebrowser | hue-3.8.1-bluemix/desktop/core/ext-py/Django-1.6.10/tests/model_inheritance_regress/tests.py | 48 | 17310 | """
Regression tests for Model inheritance behavior.
"""
from __future__ import absolute_import, unicode_literals
import datetime
from operator import attrgetter
from django import forms
from django.test import TestCase
from django.utils.unittest import expectedFailure
from .models import (Place, Restaurant, Italian... | gpl-2.0 |
petrutlucian94/cinder | cinder/volume/drivers/solidfire.py | 1 | 52455 | # All Rights Reserved.
# Copyright 2013 SolidFire 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... | apache-2.0 |
almarklein/visvis.dev | examples/embeddingInWx.py | 5 | 1783 | #!/usr/bin/env python
"""
This example illustrates embedding a visvis figure in a wx application.
"""
import wx
import visvis as vv
# Create a visvis app instance, which wraps a wx application object.
# This needs to be done *before* instantiating the main window.
app = vv.use('wx')
class MainWindow(wx.Frame):
... | bsd-3-clause |
willingc/oh-mainline | vendor/packages/kombu/kombu/message.py | 30 | 5113 | """
kombu.transport.message
=======================
Message class.
"""
from __future__ import absolute_import
import sys
from .compression import decompress
from .exceptions import MessageStateError
from .five import reraise, text_t
from .serialization import loads
ACK_STATES = frozenset(['ACK', 'REJECTED', 'REQUE... | agpl-3.0 |
shinglyu/servo | tests/wpt/web-platform-tests/conformance-checkers/tools/build-svg-tests.py | 71 | 10627 | #!/usr/bin/env python2.7
# Copyright (c) 2016 PowerMapper Software
#
# 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 rights to use, co... | mpl-2.0 |
edgarcosta92/ns3 | src/visualizer/visualizer/base.py | 160 | 3799 | import ns.point_to_point
import ns.csma
import ns.wifi
import ns.bridge
import ns.internet
import ns.mesh
import ns.wimax
import ns.wimax
import ns.lte
import gobject
import os.path
import sys
PIXELS_PER_METER = 3.0 # pixels-per-meter, at 100% zoom level
class PyVizObject(gobject.GObject):
__gtype_name__ = "PyVi... | gpl-2.0 |
amasiero/approach_control | approach_control_manipulator/nodes/approach_control_manipulator/OpenGripper.py | 1 | 1219 | #!/usr/bin/env python
import rospy
import smach
import numpy as np
from std_msgs.msg import Float64
from dynamixel_msgs.msg import JointState
class OpenGripper(smach.State):
def __init__(self):
smach.State.__init__(self, outcomes = ['success', 'in_progress', 'fail'])
self.joint4 = rospy.Publishe... | gpl-2.0 |
DayGitH/Python-Challenges | DailyProgrammer/DP20140702B.py | 1 | 2885 | """
[7/2/2014] Challenge #169 [Intermediate] Home-row Spell Check
https://www.reddit.com/r/dailyprogrammer/comments/29od55/722014_challenge_169_intermediate_homerow_spell/
#User Challenge:
Thanks to /u/Fruglemonkey. This is from our idea subreddit.
http://www.reddit.com/r/dailyprogrammer_ideas/comments/26pak5/interme... | mit |
davidsims9t/itis-graphql | venv/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/charsetgroupprober.py | 2929 | 3791 | ######################## 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 ... | gpl-3.0 |
maryokhin/django-rest-framework | tests/test_relations_slug.py | 79 | 12064 | from django.test import TestCase
from rest_framework import serializers
from tests.models import (
ForeignKeySource, ForeignKeyTarget, NullableForeignKeySource
)
class ForeignKeyTargetSerializer(serializers.ModelSerializer):
sources = serializers.SlugRelatedField(
slug_field='name',
queryset=... | bsd-2-clause |
jswanljung/iris | docs/iris/example_code/General/inset_plot.py | 7 | 2357 | """
Test Data Showing Inset Plots
=============================
This example demonstrates the use of a single 3D data cube with time, latitude
and longitude dimensions to plot a temperature series for a single latitude
coordinate, with an inset plot of the data region.
"""
import matplotlib.pyplot as plt
import nump... | lgpl-3.0 |
habibiefaried/ryu | ryu/tests/unit/packet/test_vlan.py | 27 | 6748 | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
#
# 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 |
dstanek/keystone | keystone/common/sql/migrate_repo/versions/073_insert_assignment_inherited_pk.py | 11 | 5043 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
qianyu668899/Django | django-articles/articles/models.py | 3 | 18667 | from hashlib import sha1
from datetime import datetime
import logging
import mimetypes
import re
import urllib
from django.db import models
from django.db.models import Q
from django.contrib.auth.models import User
from django.contrib.markup.templatetags import markup
from django.contrib.sites.models import Site
from ... | apache-2.0 |
weaverch/super8scan | Scripts/Capture/super8scan/__init__.py | 1 | 2102 | ###################################################################
# This file is a modification of the file "__init__.py" from the #
# RPi Telecine project. I've included that project's header and #
# copyright below. #
##############################################... | bsd-3-clause |
archen/django | tests/admin_validation/models.py | 192 | 1332 | """
Tests of ModelAdmin validation logic.
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class Album(models.Model):
title = models.CharField(max_length=150)
@python_2_unicode_compatible
class Song(models.Model):
title = models.CharField(max_length=150)
al... | bsd-3-clause |
ua-snap/downscale | snap_scripts/downscaling_L48/downscale_cmip5_L48.py | 1 | 6512 | # downscale the prepped cmip5 data used in running the TEM model (IEM)
# author: Michael Lindgren
if __name__ == '__main__':
import glob, os, rasterio, itertools
from functools import partial
import downscale
from downscale import preprocess
import numpy as np
import argparse
# # parse the commandline argument... | mit |
mpetyx/palmdrop | venv/lib/python2.7/site-packages/cms/test_utils/fixtures/navextenders.py | 29 | 1146 | # -*- coding: utf-8 -*-
from __future__ import with_statement
from cms.api import create_page
from cms.models.pagemodel import Page
from cms.test_utils.util.context_managers import SettingsOverride
class NavextendersFixture(object):
def create_fixtures(self):
"""
Tree from fixture:
... | apache-2.0 |
HugoLnx/fofix | src/tests/ViewTest.py | 5 | 2591 | #####################################################################
# -*- coding: iso-8859-1 -*- #
# #
# FoFiX #
# Copyright (C) 2009 Team FoFiX ... | gpl-2.0 |
edevil/django | django/contrib/gis/measure.py | 9 | 12286 | # Copyright (c) 2007, Robert Coup <robert.coup@onetrackmind.co.nz>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
#... | bsd-3-clause |
jtl999/certbot | certbot/tests/display/util_test.py | 2 | 14199 | """Test :mod:`certbot.display.util`."""
import os
import unittest
import mock
import certbot.errors as errors
from certbot.display import util as display_util
CHOICES = [("First", "Description1"), ("Second", "Description2")]
TAGS = ["tag1", "tag2", "tag3"]
TAGS_CHOICES = [("1", "tag1"), ("2", "tag2"), ("3", "tag3"... | apache-2.0 |
matrixise/epcon | conference/management/commands/ranking_of_talks.py | 7 | 1604 | # -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
from conference import models
from conference import utils
from collections import defaultdict
from optparse import make_option
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--mis... | bsd-2-clause |
guruxu/dd-agent | aggregator.py | 34 | 36931 | # stdlib
import logging
from time import time
# project
from checks.metric_types import MetricTypes
log = logging.getLogger(__name__)
# This is used to ensure that metrics with a timestamp older than
# RECENT_POINT_THRESHOLD_DEFAULT seconds (or the value passed in to
# the MetricsAggregator constructor) get discard... | bsd-3-clause |
pchrapka/brain-modelling | external/bayesopt/python/demo_cam.py | 2 | 2041 | #!/usr/bin/env python
# -------------------------------------------------------------------------
# This file is part of BayesOpt, an efficient C++ library for
# Bayesian optimization.
#
# Copyright (C) 2011-2015 Ruben Martinez-Cantin <rmcantin@unizar.es>
#
# BayesOpt is free software: you can redistribut... | mit |
mozilla/relman-auto-nag | auto_nag/tests/test_cache.py | 2 | 1250 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import json
import unittest
from dateutil.relativedelta import relativedelta
from libmozdata import utils as lmdutils
... | bsd-3-clause |
MQQiang/kbengine | kbe/res/scripts/common/Lib/distutils/tests/test_config.py | 90 | 3148 | """Tests for distutils.pypirc.pypirc."""
import sys
import os
import unittest
import tempfile
from distutils.core import PyPIRCCommand
from distutils.core import Distribution
from distutils.log import set_threshold
from distutils.log import WARN
from distutils.tests import support
from test.support import run_unittes... | lgpl-3.0 |
tsabi/Odoo-tsabi-fixes | addons/sale_mrp/tests/__init__.py | 114 | 1122 | # -*- 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 |
varunarya10/tempest | tempest/api/object_storage/test_object_formpost_negative.py | 2 | 5292 | # Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# 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 applicabl... | apache-2.0 |
takeflight/django | django/core/management/commands/testserver.py | 63 | 2075 | from django.core.management import call_command
from django.core.management.base import BaseCommand
from django.db import connection
class Command(BaseCommand):
help = 'Runs a development server with data from the given fixture(s).'
args = '[fixture ...]'
requires_system_checks = False
def add_argum... | bsd-3-clause |
gviejo/ThalamusPhysio | python/main_make_MAPinfo.py | 1 | 14284 | #!/usr/bin/env python
'''
File name: main_make_movie.py
Author: Guillaume Viejo
Date created: 09/10/2017
Python Version: 3.5.2
To make shank mapping
'''
import numpy as np
import pandas as pd
# from matplotlib.pyplot import plot,show,draw
import scipy.io
from functions import *
from pylab import *
from skle... | gpl-3.0 |
100stacks/python-django | blog/urls.py | 2 | 1596 | from django.conf.urls import url
from . import views
# Blog - URL Routes
urlpatterns = [
url(r'^$', views.post_list),
url(r'^post/(?P<pk>[0-9]+)/$', views.post_detail),
url(r'^post/new/$', views.post_new, name='post_new'),
url(r'^post/(?P<pk>[0-9]+)/edit/$', views.post_edit, name='post_edit'),
url(r'^drafts/$', ... | mit |
c72578/poedit | deps/boost/libs/mpi/test/python/nonblocking_test.py | 64 | 3767 | # (C) Copyright 2007
# Andreas Kloeckner <inform -at- tiker.net>
#
# Use, modification and distribution is subject to the Boost Software
# License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# Authors: Andreas Kloeckner
import boost.mpi as mpi
import r... | mit |
pepeportela/edx-platform | common/djangoapps/student/tests/test_reset_password.py | 1 | 15742 | """
Test the various password reset flows
"""
import json
import re
import unittest
import ddt
from django.conf import settings
from django.contrib.auth.hashers import UNUSABLE_PASSWORD_PREFIX
from django.contrib.auth.models import User
from django.contrib.auth.tokens import default_token_generator
from django.core.ca... | agpl-3.0 |
ubc/edx-platform | cms/djangoapps/contentstore/tests/test_clone_course.py | 147 | 6812 | """
Unit tests for cloning a course between the same and different module stores.
"""
import json
from django.conf import settings
from opaque_keys.edx.locator import CourseLocator
from xmodule.modulestore import ModuleStoreEnum, EdxJSONEncoder
from contentstore.tests.utils import CourseTestCase
from contentstore.task... | agpl-3.0 |
MatthewWilkes/reportlab | src/reportlab/pdfbase/_fontdata_widths_courierbold.py | 224 | 3664 | widths = {'A': 600,
'AE': 600,
'Aacute': 600,
'Acircumflex': 600,
'Adieresis': 600,
'Agrave': 600,
'Aring': 600,
'Atilde': 600,
'B': 600,
'C': 600,
'Ccedilla': 600,
'D': 600,
'E': 600,
'Eacute': 600,
'Ecircumflex': 600,
'Edieresis': 600,
'Egrave': 600,
'Eth': 600,
'Euro': 600,
'F': 600,
'G': 600,
'... | bsd-3-clause |
PiJoules/python-type-inference | pytype.py | 1 | 13687 | class PyType:
NEW_METHOD = "__new__"
INIT_METHOD = "__init__"
DEL_METHOD = "__del__"
REPR_METHOD = "__repr__"
STR_METHOD = "__str__"
BYTES_METHOD = "__bytes__"
FORMAT_METHOD = "__format__"
LT_METHOD = "__lt__"
LE_METHOD = "__le__"
EQ_METHOD = "__eq__"
NE_METHOD = "__ne__"
... | mit |
nburn42/tensorflow | tensorflow/contrib/distributions/__init__.py | 3 | 7928 | # 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 |
Intel-Corporation/tensorflow | tensorflow/python/framework/error_interpolation_test.py | 12 | 13051 | # 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 |
piyush0609/scipy | scipy/spatial/tests/test__plotutils.py | 71 | 1463 | from __future__ import division, print_function, absolute_import
from numpy.testing import dec, assert_, assert_array_equal
try:
import matplotlib
matplotlib.rcParams['backend'] = 'Agg'
import matplotlib.pyplot as plt
has_matplotlib = True
except:
has_matplotlib = False
from scipy.spatial import ... | bsd-3-clause |
CalebSLane/openelisglobal-core | liquibase/OE5.1/testCatalogKenya/Scripts/sampleTypeTest.py | 9 | 2448 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
existing_types = []
def get_split_names( name ):
split_name_list = name.split("/")
for i in range(0, len(split_name_list)):
split_name_list[i] = split_name_list[i].strip()
return split_name_list
type = []
test_names = []
descripti... | mpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.