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 |
|---|---|---|---|---|---|
skython/eXe | twisted/internet/iocpreactor/process.py | 14 | 15266 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""Support for IReactorProcess for the IOCP proactor.
API Stability: unstable
Maintainer: U{Justin Johnson<mailto:justinjohnson@gmail.com>}
This code is potentially unstable. I have performed numerous tests
but couldn't get someone w... | gpl-2.0 |
endlessm/chromium-browser | third_party/chromite/cli/cros/cros_deploy_unittest.py | 1 | 3712 | # -*- coding: utf-8 -*-
# Copyright 2015 The Chromium OS 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 module tests the cros deploy command."""
from __future__ import print_function
import sys
from chromite.cli import comm... | bsd-3-clause |
msteinhoff/foption-bot | src/python/interaction/irc/commands.py | 1 | 42748 | # -*- coding: UTF-8 -*-
"""
$Id$
$URL$
Copyright (c) 2010 foption
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, modif... | mit |
adsorensen/girder | girder/api/v1/resource.py | 1 | 18333 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2013 Kitware 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 cop... | apache-2.0 |
johndamen/pyeasyplot | easyplot/gui/plotsettings.py | 1 | 4044 | from PyQt4 import QtGui, QtCore
from .settings import PlotSettings
from . import basewidgets as bw
from .. import datasets
def _marker_field(**kwargs):
return bw.Dropdown(
['.', ',', 'o', '*',
'+', 'x', 'd', 'D',
'v', '^', '<', '>',
's', 'p', '|', '_'], **kwargs)
def _label_f... | gpl-3.0 |
tectronics/pychess | lib/pychess/Players/ICPlayer.py | 20 | 10779 | from collections import defaultdict
from pychess.compat import Queue
from pychess.Players.Player import Player, PlayerIsDead, TurnInterrupt
from pychess.Utils.Move import parseSAN, toAN
from pychess.Utils.lutils.lmove import ParsingError
from pychess.Utils.Offer import Offer
from pychess.Utils.const import *
from pych... | gpl-3.0 |
florentx/OpenUpgrade | openerp/modules/registry.py | 37 | 17291 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
iut-ibk/P8-WSC-GUI | 3dparty/Editra/src/extern/dexml/_util.py | 1 | 4954 | import copy
class Error(Exception):
"""Base exception class for the dexml module."""
pass
class ParseError(Error):
"""Exception raised when XML could not be parsed into objects."""
pass
class RenderError(Error):
"""Exception raised when object could not be rendered into XML."""
pass
class Xm... | gpl-2.0 |
jimi-c/ansible | lib/ansible/modules/network/avi/avi_sslkeyandcertificate.py | 20 | 5892 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... | gpl-3.0 |
jameslovejoy/apportionment | scripts/apportion.py | 1 | 1096 | import math
class Apportion:
populations = {}
seats = {}
def __init__(self):
f = open('../data/2010.csv', 'r')
for line in f:
state, pop = [s.strip() for s in line.split(',')]
self.seats[state] = 1
self.populations[state] = int(pop.strip())
@classmethod
def find_highest_priority(cls):
highest = ... | mit |
pasmod/simurg | simurg/scrapper/template.py | 1 | 4965 | from selector_finder import find_selector
from dragnet import content_extractor
from collections import OrderedDict
from unidecode import unidecode
from bs4 import BeautifulSoup
from simurg.clients.fetcher import fetch
from simurg.util import is_valid
import logging
import os.path
import time
import re
def clean_soup... | mit |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/setuptools/command/test.py | 33 | 8865 | import os
import operator
import sys
import contextlib
import itertools
from distutils.errors import DistutilsError, DistutilsOptionError
from distutils import log
from unittest import TestLoader
from setuptools.extern import six
from setuptools.extern.six.moves import map, filter
from pkg_resources import (resource_... | gpl-3.0 |
misterdanb/midi.py | midi.py | 1 | 21677 | import sys
import os
import struct
import array
from enum import Enum
def bytes_to_uint16(byte_list):
return struct.unpack('>H', byte_list[:4])[0]
def uint16_to_bytes(value):
return struct.pack('>H', value)
def bytes_to_uint24(byte_list):
return struct.unpack('>I', b'\x00' + byte_list[:3])[0]
def uint2... | gpl-3.0 |
braams/shtoom | shtoom/ui/qtui/shtoommainwindow.py | 1 | 7392 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'shtoommainwindow.ui'
#
# Created: Wed Jan 19 15:16:20 2005
# by: The PyQt User Interface Compiler (pyuic) 3.13
#
# WARNING! All changes made in this file will be lost!
from qt import *
class ShtoomMainWindow(QMainWindow):
def __i... | lgpl-2.1 |
hkariti/ansible | lib/ansible/modules/network/avi/avi_cluster.py | 26 | 3935 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
ANSIB... | gpl-3.0 |
jiahaoliang/group-based-policy | gbpservice/nfp/service_vendor_agents/haproxy/haproxy-agent/src/local.py | 101 | 1745 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apac... | apache-2.0 |
barnsnake351/nova | nova/tests/unit/scheduler/filters/test_availability_zone_filters.py | 57 | 2170 | # 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
# d... | apache-2.0 |
N3da/incubator-airflow | airflow/contrib/hooks/spark_submit_hook.py | 6 | 10915 | # -*- 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 |
NeilBryant/check_mk | doc/treasures/wato_geo_fields.py | 6 | 2020 | #!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... | gpl-2.0 |
Glasgow2015/team-10 | env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/big5freq.py | 3133 | 82594 | ######################## 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... | apache-2.0 |
upliftaero/MissionPlanner | Lib/lib2to3/fixes/fix_exec.py | 61 | 1042 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for exec.
This converts usages of the exec statement into calls to a built-in
exec() function.
exec code in ns1, ns2 -> exec(code, ns1, ns2)
"""
# Local imports
from .. import pytree
from .. imp... | gpl-3.0 |
pforret/python-for-android | python-modules/twisted/twisted/internet/epollreactor.py | 56 | 8121 | # Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
An epoll() based implementation of the twisted main loop.
To install the event loop (and you should do this before any connections,
listeners or connectors are added)::
from twisted.internet import epollreactor
epollreactor... | apache-2.0 |
chand3040/sree_odoo | openerp/addons/account/company.py | 384 | 2814 | # -*- 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 |
ThePletch/ansible | lib/ansible/modules/cloud/amazon/ec2_win_password.py | 23 | 5690 | #!/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 |
dbones/linux | tools/perf/python/twatch.py | 1565 | 1316 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
grzes/djangae | djangae/fields/charfields.py | 2 | 1862 | from django.core.exceptions import ImproperlyConfigured
from django.db import models
from djangae.core import validators
from google.appengine.api.datastore_types import _MAX_STRING_LENGTH
class CharOrNoneField(models.CharField):
""" A field that stores only non-empty strings or None (it won't store empty strin... | bsd-3-clause |
wolfe-pack/moro | public/javascripts/brat/tools/norm_db_lookup.py | 3 | 4451 | #!/usr/bin/env python
# Test script for lookup in a normalization SQL DB, intended for
# DB testing.
# TODO: duplicates parts of primary norm DB implementation, dedup.
import sys
import os.path
import sqlite3 as sqlite
TYPE_TABLES = ["names", "attributes", "infos"]
NON_EMPTY_TABLES = set(["names"])
def argparser()... | bsd-2-clause |
goodwinnk/intellij-community | plugins/hg4idea/testData/bin/hgext/convert/bzr.py | 94 | 11295 | # bzr.py - bzr support for the convert extension
#
# Copyright 2008, 2009 Marek Kubica <marek@xivilization.net> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
# This module is for handling 'bzr', that was formerly kno... | apache-2.0 |
glaubitz/fs-uae-debian | launcher/arcade/arcade_main.py | 2 | 4015 | from arcade.Application import Application
from arcade.glui.imageloader import ImageLoader
from arcade.ui.arcade_window import (
ArcadeWindow,
check_argument,
fullscreen,
maximized,
)
from fsbc.settings import Settings
from fsbc.system import macosx
from .gnome3 import running_in_gnome_3, handle_gnome_e... | gpl-2.0 |
PfarrCh/openrsa | test/solovaystrassen_testcase.py | 1 | 1957 | # -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2017 Christian Pfarr
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, cop... | mit |
Ichimonji10/robottelo | tests/foreman/performance/test_candlepin_concurrent_subscription_attach.py | 2 | 3812 | """Test class for concurrent subscription by register and attach
@Requirement: Candlepin concurrent subscription attach
@CaseAutomation: Automated
@CaseLevel: Acceptance
@CaseComponent: OTHER
@TestType: Functional
@CaseImportance: High
@Upstream: No
"""
from robottelo.performance.constants import (
ATTACH_EN... | gpl-3.0 |
bjodah/symengine.py | symengine/tests/test_sets.py | 2 | 3799 | from symengine.utilities import raises
from symengine.lib.symengine_wrapper import (Interval, EmptySet, UniversalSet,
FiniteSet, Union, Complement, ImageSet, ConditionSet, Reals, Integers,
And, Or, oo, Symbol, true, Ge, Eq, Gt)
def test_Interval():
assert Interval(0, oo) == Interval(0, oo, False, True)
... | mit |
simartin/servo | tests/wpt/web-platform-tests/tools/third_party/h2/examples/fragments/client_upgrade_fragment.py | 14 | 3726 | # -*- coding: utf-8 -*-
"""
Client Plaintext Upgrade
~~~~~~~~~~~~~~~~~~~~~~~~
This example code fragment demonstrates how to set up a HTTP/2 client that uses
the plaintext HTTP Upgrade mechanism to negotiate HTTP/2 connectivity. For
maximum explanatory value it uses the synchronous socket API that comes with
the Pytho... | mpl-2.0 |
unnikrishnankgs/va | venv/lib/python3.5/site-packages/tensorflow/contrib/learn/python/learn/utils/inspect_checkpoint.py | 123 | 2686 | # 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... | bsd-2-clause |
thienluong/SAFplus-Availability-Scalability-Platform | src/ide/genshi/build/lib.linux-x86_64-2.7/genshi/template/tests/base.py | 25 | 1473 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2007 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | gpl-2.0 |
ahmed-mahran/hue | desktop/core/ext-py/South-1.0.2/south/utils/__init__.py | 119 | 1945 | """
Generally helpful utility functions.
"""
def _ask_for_it_by_name(name):
"Returns an object referenced by absolute path."
bits = str(name).split(".")
## what if there is no absolute reference?
if len(bits) > 1:
modulename = ".".join(bits[:-1])
else:
modulename = bits[0]
mo... | apache-2.0 |
lakshayg/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/distribution_test.py | 96 | 8140 | # 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 |
azlanismail/prismgames | examples/games/car/networkx/algorithms/isomorphism/vf2userfunc.py | 1 | 7715 | """
Module to simplify the specification of user-defined equality functions for
node and edge attributes during isomorphism checks.
During the construction of an isomorphism, the algorithm considers two
candidate nodes n1 in G1 and n2 in G2. The graphs G1 and G2 are then
compared with respec... | gpl-2.0 |
Donnerbart/hazelcast-simulator | dist/src/main/dist/bin/benchmark-report.py | 1 | 32024 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# todo:
# - writing html
# - pruning of dstats to match running time
# - when comparing benchmarks; use 1 color for all plots from 1 benchmark
# - if no latency info is found; print warning
# - when not a lot of data points, them time issues in gnuplot (use WORKER_PERFORMA... | apache-2.0 |
smsolivier/VEF | code/hlimit.py | 1 | 2247 | #!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
import ld as LD
import dd as DD
from hidespines import *
import sys
''' compares difference between Sn and moment equations as cell width --> 0 '''
if (len(sys.argv) > 1):
outfile = sys.argv[1]
else:
outfile = None
def getDiff(sol... | mit |
instana/python-sensor | instana/instrumentation/urllib3.py | 1 | 3690 | # (c) Copyright IBM Corp. 2021
# (c) Copyright Instana Inc. 2017
from __future__ import absolute_import
import opentracing
import opentracing.ext.tags as ext
import wrapt
from ..log import logger
from ..singletons import agent
from ..util.traceutils import get_active_tracer
from ..util.secrets import strip_secrets_f... | mit |
pulsar-chem/Pulsar-Core | test/system/TestBasisSet.py | 1 | 2740 | import pulsar as psr
def run_test():
tester = psr.PyTester("Testing the BasisSet and BasisSetShell")
cGTO = psr.ShellType.CartesianGaussian
sGTO = psr.ShellType.SphericalGaussian
alpha=[3.42525091, 0.62391373, 0.16885540]
c=[0.15432897, 0.53532814, 0.44463454]
FakeD=psr.BasisShellInfo(cGTO,2,3... | bsd-3-clause |
jimberlage/servo | components/script/dom/bindings/codegen/parser/tests/test_attr_sequence_type.py | 276 | 1626 | def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
interface AttrSequenceType {
attribute sequence<object> foo;
};
""")
results = parser.finish()
except:
threw = True
harness.ok(threw, "Attribute type must not be a... | mpl-2.0 |
WillianPaiva/1flow | oneflow/core/migrations/0097_auto__add_field_twitterfeed_backfill_completed.py | 2 | 54712 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'TwitterFeed.backfill_completed'
db.add_column(u'core_twit... | agpl-3.0 |
geekboxzone/lollipop_external_chromium_org_third_party_WebKit | Tools/Scripts/webkitpy/common/find_files.py | 181 | 3872 | # 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 |
Yannig/ansible | test/units/module_utils/facts/test_facts.py | 80 | 22585 | # This file is part of Ansible
# -*- coding: utf-8 -*-
#
#
# 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 later version.
#
# Ansible is dis... | gpl-3.0 |
undp-aprc/undp-alm-old | modules/contrib/proj4js/lib/proj4js/build/build.py | 129 | 3416 | #!/usr/bin/env python
import sys
sys.path.append("../tools")
import mergejs
import optparse
def build(config_file = None, output_file = None, options = None):
have_compressor = []
try:
import jsmin
have_compressor.append("jsmin")
except ImportError:
print "No jsmin"
try:
... | gpl-2.0 |
jhaux/tensorflow | tensorflow/contrib/signal/python/kernel_tests/shape_ops_test.py | 23 | 2282 | # 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 |
tongwang01/tensorflow | tensorflow/contrib/slim/python/slim/data/parallel_reader.py | 12 | 10476 | # 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 applicable ... | apache-2.0 |
bintoro/schematics | tests/test_dict_type.py | 12 | 3771 | from schematics.models import Model
from schematics.types import IntType, StringType
from schematics.types.serializable import serializable
from schematics.types.compound import ModelType, DictType
try:
long
except NameError:
long = int
def test_basic_type():
class PlayerInfo(Model):
categories = ... | bsd-3-clause |
jakevdp/pelican-plugins | sub_parts/sub_parts.py | 59 | 2671 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from pelican import signals
import logging
logger = logging.getLogger(__name__)
def patch_subparts(generator):
generator.subparts = []
slugs = {}
for article in generator.articles:
slugs[article.slug] = article
if '--' in art... | agpl-3.0 |
otherness-space/myProject002 | my_project_002/lib/python2.7/site-packages/django/utils/translation/__init__.py | 110 | 4690 | """
Internationalization support.
"""
from __future__ import unicode_literals
from django.utils.encoding import force_text
from django.utils.functional import lazy
from django.utils import six
__all__ = [
'activate', 'deactivate', 'override', 'deactivate_all',
'get_language', 'get_language_from_request',
... | mit |
biotrump/xbmc | tools/Fake Episode Maker/main.py | 169 | 2669 | # -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 Team XBMC
# http://xbmc.org
#
# 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, or (at your option)
# any l... | gpl-2.0 |
nguyentu1602/numpy | numpy/testing/tests/test_decorators.py | 66 | 4157 | from __future__ import division, absolute_import, print_function
from numpy.testing import dec, assert_, assert_raises, run_module_suite
from numpy.testing.noseclasses import KnownFailureTest
import nose
def test_slow():
@dec.slow
def slow_func(x, y, z):
pass
assert_(slow_func.slow)
def test_set... | bsd-3-clause |
tuhangdi/django | tests/model_validation/tests.py | 292 | 2117 | from django.core import management
from django.core.checks import Error, run_checks
from django.db.models.signals import post_init
from django.test import SimpleTestCase
from django.test.utils import override_settings
from django.utils import six
class OnPostInit(object):
def __call__(self, **kwargs):
pas... | bsd-3-clause |
jphilipsen05/zulip | zproject/local_settings.py | 2 | 5562 | # This file is the Zulip local_settings.py configuration for the
# zulip.com installation of Zulip. It shouldn't be used in other
# environments, but you may find it to be a a helpful reference when
# setting up your own Zulip installation to see how Zulip can be
# configured.
#
# On a normal Zulip production server, ... | apache-2.0 |
LaoZhongGu/kbengine | kbe/src/lib/python/Tools/scripts/mailerdaemon.py | 97 | 8039 | #!/usr/bin/env python3
"""Classes to parse mailer-daemon messages."""
import calendar
import email.message
import re
import os
import sys
class Unparseable(Exception):
pass
class ErrorMessage(email.message.Message):
def __init__(self):
email.message.Message.__init__(self)
self.sub = ''
... | lgpl-3.0 |
lidabing/xgyp | Python27/Tools/Scripts/checkappend.py | 100 | 4658 | #! /usr/bin/env python
# Released to the public domain, by Tim Peters, 28 February 2000.
"""checkappend.py -- search for multi-argument .append() calls.
Usage: specify one or more file or directory paths:
checkappend [-v] file_or_dir [file_or_dir] ...
Each file_or_dir is checked for multi-argument .append() ca... | bsd-3-clause |
ubuntu/ubuntu-make | tests/small/test_ui.py | 15 | 6281 | # -*- coding: utf-8 -*-
# Copyright (C) 2014 Canonical
#
# Authors:
# Didier Roche
#
# 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; version 3.
#
# This program is distributed in the hope that ... | gpl-3.0 |
thorwhalen/ut | pdict/special.py | 1 | 5569 | """Special dicts"""
__author__ = 'thor'
from collections import defaultdict, UserDict
from ut.pdict.get import set_value_in_nested_key_path
val_unlikely_to_be_value_of_dict = (1987654321, 8239080923)
class keydefaultdict(defaultdict):
def __missing__(self, key):
ret = self[key] = self.default_factory(ke... | mit |
MOA-2011/enigma2.pli4.0 | lib/python/Components/Sources/CurrentService.py | 72 | 1404 | from Components.PerServiceDisplay import PerServiceBase
from enigma import iPlayableService
from Source import Source
from Components.Element import cached
import NavigationInstance
class CurrentService(PerServiceBase, Source):
def __init__(self, navcore):
Source.__init__(self)
PerServiceBase.__init__(self, navco... | gpl-2.0 |
Yelp/elastalert | tests/loaders_test.py | 1 | 18593 | # -*- coding: utf-8 -*-
import copy
import datetime
import os
import mock
import pytest
import elastalert.alerts
import elastalert.ruletypes
from elastalert.config import load_conf
from elastalert.loaders import FileRulesLoader
from elastalert.util import EAException
test_config = {'rules_folder': 'test_folder',
... | apache-2.0 |
nelmiux/CarnotKE | jyhton/lib-python/2.7/test/test_datetime.py | 72 | 134923 | """Test date/time type.
See http://www.zope.org/Members/fdrake/DateTimeWiki/TestCases
"""
from __future__ import division
import sys
import pickle
import cPickle
import unittest
from test import test_support
from datetime import MINYEAR, MAXYEAR
from datetime import timedelta
from datetime import tzinfo
from datetim... | apache-2.0 |
makinacorpus/django | tests/custom_managers/models.py | 9 | 2042 | """
23. Giving models a custom manager
You can use a custom ``Manager`` in a particular model by extending the base
``Manager`` class and instantiating your custom ``Manager`` in your model.
There are two reasons you might want to customize a ``Manager``: to add extra
``Manager`` methods, and/or to modify the initial... | bsd-3-clause |
phobson/wqio | wqio/tests/test_datacollections.py | 2 | 28761 | from distutils.version import LooseVersion
from textwrap import dedent
from io import StringIO
import numpy
import scipy
from scipy import stats
import pandas
from unittest import mock
import pytest
import pandas.testing as pdtest
from wqio.tests import helpers
from wqio.features import Location, Dataset
from wqio.d... | bsd-3-clause |
radicalbit/ambari | ambari-server/src/main/resources/common-services/STORM/1.0.1.3.0/package/scripts/nimbus.py | 1 | 3638 | #!/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 |
emilk/sproxel | distro/common/lib/lib-tk/test/test_tkinter/test_text.py | 7 | 1172 | import unittest
import Tkinter
from test.test_support import requires, run_unittest
from ttk import setup_master
requires('gui')
class TextTest(unittest.TestCase):
def setUp(self):
self.root = setup_master()
self.text = Tkinter.Text(self.root)
def tearDown(self):
self.t... | bsd-3-clause |
cedi4155476/QGIS | python/plugins/fTools/tools/doSpatialJoin.py | 9 | 12355 | # -*- coding: utf-8 -*-
#-----------------------------------------------------------
#
# fTools
# Copyright (C) 2008-2011 Carson Farmer
# EMAIL: carson.farmer (at) gmail.com
# WEB : http://www.ftools.ca/fTools.html
#
# A collection of data management and analysis tools for vector data
#
#-----------------------------... | gpl-2.0 |
z-plot/z-plot | examples/basics-svg/verticalbars.py | 1 | 2343 | #! /usr/bin/env python
from zplot import *
# populate zplot table from data file
t = table('verticalbars.data')
# create the postscript file we'll use as our canvas
canvas = svg('verticalbars.svg')
# on the x-axis, we want categories, not numbers. Thus, we
# determine the number of categories by checking the max
#... | bsd-3-clause |
jocave/snapcraft | snapcraft/_options.py | 3 | 4856 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... | gpl-3.0 |
svfat/django-docs | setup.py | 2 | 1415 | import os
from setuptools import setup, find_packages
def read_file(filename):
"""Read a file into a string"""
path = os.path.abspath(os.path.dirname(__file__))
filepath = os.path.join(path, filename)
try:
return open(filepath).read()
except IOError:
return ''
try:
REQUIREMENT... | bsd-3-clause |
ChrisBeaumont/luigi | test/date_interval_test.py | 13 | 5774 | # -*- 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 |
cs-au-dk/Artemis | WebKit/Tools/Scripts/webkitpy/common/net/layouttestresults_unittest.py | 1 | 7183 | # Copyright (c) 2010, 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... | gpl-3.0 |
Chitrank-Dixit/django-fcm | setup.py | 1 | 1550 | import os
from setuptools import find_packages, setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-fcm',
versio... | mit |
kennedyshead/home-assistant | tests/components/zha/conftest.py | 2 | 7337 | """Test configuration for the ZHA component."""
from unittest.mock import AsyncMock, MagicMock, PropertyMock, patch
import pytest
import zigpy
from zigpy.application import ControllerApplication
import zigpy.config
import zigpy.group
import zigpy.types
from homeassistant.components.zha import DOMAIN
import homeassist... | apache-2.0 |
klynch/emacs.d-old | python-libs/ropemode/refactor.py | 23 | 15727 | import re
import rope.base.change
import rope.contrib.generate
import rope.refactor.change_signature
import rope.refactor.extract
import rope.refactor.inline
import rope.refactor.introduce_factory
import rope.refactor.method_object
import rope.refactor.move
import rope.refactor.rename
import rope.refactor.restructure
... | gpl-3.0 |
BradAJ/zipflights | web_app/app/models.py | 1 | 5577 | from app import *
def ita_search(faa_orig, faa_dest, start_date, end_date, duration = None, out_constraints = None, return_constraints = None, month_search = True):
"""
faa_orig, faa_dest: FAA airport code strs e.g. 'SFO'
start_date, end_date: datetime objs e.g. datetime.date.today(), datetime.date(2015, 2... | mit |
onceuponatimeforever/oh-mainline | vendor/packages/Django/django/utils/safestring.py | 208 | 4185 | """
Functions for working with "safe strings": strings that can be displayed safely
without further escaping in HTML. Marking something as a "safe string" means
that the producer of the string has already turned characters that should not
be interpreted by the HTML engine (e.g. '<') into the appropriate entities.
"""
f... | agpl-3.0 |
vadimtk/chrome4sdp | native_client_sdk/src/build_tools/nacl-mono-builder.py | 51 | 5243 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import os
import sys
import tarfile
import buildbot_common
from build_paths import SCRIPT_DIR
SDK_BUILD_DIR = SCR... | bsd-3-clause |
Pablo126/SSBW | Entrega1/lib/python3.5/site-packages/pymongo/collection.py | 15 | 113009 | # Copyright 2009-2015 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | gpl-3.0 |
kvar/ansible | lib/ansible/modules/cloud/vmware/_vmware_host_vmhba_facts.py | 21 | 8352 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Christian Kotte <christian.kotte@gmx.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metad... | gpl-3.0 |
ansible/ansible | test/units/config/test_data.py | 113 | 1266 | # Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from units.compat import unittest
from ansible.config.data import ConfigData
from ansible.config.manager import Setting
mykey = Setting('mykey', 'myvalue', 'test', 'string')
mykey2 = Setting('mykey... | gpl-3.0 |
legacysurvey/rapala | ninetyprime/linearitycheck.py | 2 | 17953 | #!/usr/bin/env python
import os
import glob
import numpy as np
import fitsio
import matplotlib.pyplot as plt
from matplotlib import ticker
from matplotlib.backends.backend_pdf import PdfPages
from astropy.table import Table
from bokpipe import *
from bokpipe.bokoscan import _convertfitsreg
def init_data_map(datadir,... | bsd-3-clause |
Jailander/COSMOS | kriging_exploration/scripts/explorator.py | 1 | 34183 | #!/usr/bin/env python
import cv2
import sys
import yaml
import signal
import numpy as np
#import utm
import matplotlib as mpl
import matplotlib.cm as cm
import rospy
import argparse
import actionlib
from cosmos_msgs.msg import KrigInfo
from cosmos_msgs.srv import CompareModels
import kriging_exploration.map_c... | mit |
ntt-sic/cinder | cinder/api/contrib/hosts.py | 3 | 10182 | # Copyright (c) 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
azumimuo/family-xbmc-addon | script.module.youtube.dl/lib/youtube_dl/extractor/vyborymos.py | 73 | 2031 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
class VyboryMosIE(InfoExtractor):
_VALID_URL = r'https?://vybory\.mos\.ru/(?:#precinct/|account/channels\?.*?\bstation_id=)(?P<id>\d+)'
_TESTS = [{
'url': 'http://vybory.mos.ru/#p... | gpl-2.0 |
mekanix/geonode | geonode/people/tests.py | 19 | 2719 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | gpl-3.0 |
jkonecny12/anaconda | pyanaconda/modules/network/nm_client.py | 1 | 63957 | #
# utility functions using libnm
#
# Copyright (C) 2018 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distri... | gpl-2.0 |
Glorf/servo | tests/wpt/web-platform-tests/tools/py/testing/path/test_local.py | 160 | 29652 | # -*- coding: utf-8 -*-
from __future__ import with_statement
import py
import pytest
import os, sys
from py.path import local
import common
failsonjython = py.test.mark.xfail("sys.platform.startswith('java')")
failsonjywin32 = py.test.mark.xfail("sys.platform.startswith('java') "
"and getattr(os, '_name', No... | mpl-2.0 |
MwanzanFelipe/rockletonfortune | lib/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... | bsd-3-clause |
Asquera/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Debug.py | 61 | 6766 | """SCons.Debug
Code for debugging SCons internal things. Shouldn't be
needed by most users.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documen... | apache-2.0 |
RohitDas/cubeproject | lib/django/contrib/gis/geos/geometry.py | 82 | 24691 | """
This module contains the 'base' GEOSGeometry object -- all GEOS Geometries
inherit from this object.
"""
from __future__ import unicode_literals
# Python, ctypes and types dependencies.
from ctypes import addressof, byref, c_double
from django.contrib.gis.gdal.error import SRSException
from django.contrib.gis.g... | bsd-3-clause |
williamFalcon/pytorch-lightning | tests/trainer/test_dataloaders.py | 1 | 9641 | import pytest
import tests.models.utils as tutils
from pytorch_lightning import Trainer
from tests.models import (
TestModelBase,
LightningTestModel,
LightEmptyTestStep,
LightValidationMultipleDataloadersMixin,
LightTestMultipleDataloadersMixin,
LightTestFitSingleTestDataloadersMixin,
Light... | apache-2.0 |
ModdedPA/android_external_chromium_org | tools/deep_memory_profiler/tests/mock_gsutil.py | 131 | 1558 | #!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import re
import sys
import zipfile
def main():
ZIP_PATTERN = re.compile('dmprof......\.zip')
assert len(sys.argv)... | bsd-3-clause |
3manuek/kubernetes | examples/cluster-dns/images/backend/server.py | 468 | 1313 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | apache-2.0 |
MiniPlayer/log-island | logisland-plugins/logisland-scripting-processors-plugin/src/main/resources/nltk/test/doctest_nose_plugin.py | 28 | 6008 | # -*- coding: utf-8 -*-
from __future__ import print_function
from nose.suite import ContextList
import re
import sys
import os
import codecs
import doctest
from nose.plugins.base import Plugin
from nose.util import tolist, anyp
from nose.plugins.doctests import Doctest, log, DocFileCase
ALLOW_UNICODE = doctest.regist... | apache-2.0 |
mpasternak/pyglet-fix-issue-552 | experimental/mt_media/drivers/directsound/__init__.py | 28 | 18147 | #!/usr/bin/python
# $Id:$
import ctypes
import math
import sys
import threading
import time
import pyglet
_debug = pyglet.options['debug_media']
import mt_media
import lib_dsound as lib
from pyglet.window.win32 import _user32, _kernel32
class DirectSoundException(mt_media.MediaException):
pas... | bsd-3-clause |
JCBarahona/edX | common/djangoapps/monkey_patch/django_utils_translation.py | 128 | 2819 | """
Monkey-patch `django.utils.translation` to not dump header info
Modify Django's translation module, such that the *gettext functions
always return an empty string when attempting to translate an empty
string. This overrides the default behavior [0]:
> It is convention with GNU gettext to include meta-data as the
>... | agpl-3.0 |
rmcgibbo/mdtraj | tests/test_xtc.py | 5 | 12672 | ##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2013 Stanford University and the Authors
#
# Authors: Robert McGibbon
# Contributors:
#
# MDTraj is free software: y... | lgpl-2.1 |
mujiansu/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/encodings/mac_arabic.py | 593 | 36723 | """ Python Character Mapping Codec generated from 'VENDORS/APPLE/ARABIC.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_map)
def decode(self,input,errors='strict'):
... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.