repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
diogovk/ansible | refs/heads/devel | v1/ansible/runner/lookup_plugins/lines.py | 176 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... |
loopCM/chromium | refs/heads/trunk | tools/PRESUBMIT.py | 35 | # 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.
"""Top-level presubmit script for bisect trybot.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on the presubmi... |
Dandandan/wikiprogramming | refs/heads/master | jsrepl/extern/python/unclosured/lib/python2.7/lib2to3/fixes/fix_operator.py | 326 | """Fixer for operator functions.
operator.isCallable(obj) -> hasattr(obj, '__call__')
operator.sequenceIncludes(obj) -> operator.contains(obj)
operator.isSequenceType(obj) -> isinstance(obj, collections.Sequence)
operator.isMappingType(obj) -> isinstance(obj, collections.Mapping)
operator.isNumberType(obj) ... |
dwf/numpy | refs/heads/master | numpy/core/tests/test_indexerrors.py | 7 | import numpy as np
from numpy.testing import TestCase, run_module_suite, assert_raises, assert_equal, assert_
import sys
class TestIndexErrors(TestCase):
'''Tests to exercise indexerrors not covered by other tests.'''
def test_arraytypes_fasttake(self):
'take from a 0-length dimension'
x = np.... |
rancherio/cattle-cli | refs/heads/master | cattle.py | 2 | #!/usr/bin/env python
import time
import gdapi
import os
from gdapi import * # NOQA
DEFAULT_TIMEOUT = 45
class Client(gdapi.Client):
def __init__(self, *args, **kw):
super(Client, self).__init__(*args, **kw)
def wait_success(self, obj, timeout=-1):
obj = self.wait_transitioning(obj, timeout... |
lovexiaov/SandwichApp | refs/heads/master | .eggs/py2app-0.9-py2.7.egg/py2app/bootstrap/virtualenv_site_packages.py | 10 | def _site_packages(prefix, real_prefix, global_site_packages):
import site, sys, os
paths = []
prefixes = [sys.prefix]
paths.append(os.path.join(prefix, 'lib', 'python' + sys.version[:3],
'site-packages'))
if os.path.join('.framework', '') in os.path.join(prefix, ''):
home = os.envi... |
loafbaker/django_ecommerce2 | refs/heads/master | orders/__init__.py | 2 | default_app_config = 'orders.apps.OrdersConfig' |
iceman1989/Check_mk | refs/heads/master | doc/treasures/Event_Console/message_to_syslog.py | 6 | #!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... |
odootr/odoo | refs/heads/8.0 | addons/point_of_sale/report/__init__.py | 381 | # -*- 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... |
smlng/RIOT | refs/heads/master | tests/gnrc_ipv6_nib_6ln/tests/01-run.py | 59 | #!/usr/bin/env python3
# Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de>
# Copyright (C) 2016 Takuo Yonezawa <Yonezawa-T2@mail.dnp.co.jp>
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
... |
jernsthausen/datesplitter | refs/heads/master | lib/python2.7/site-packages/setuptools/tests/test_find_packages.py | 151 | """Tests for setuptools.find_packages()."""
import os
import sys
import shutil
import tempfile
import platform
import pytest
import setuptools
from setuptools import find_packages
find_420_packages = setuptools.PEP420PackageFinder.find
# modeled after CPython's test.support.can_symlink
def can_symlink():
TESTFN... |
tiborsimko/invenio-webhooks | refs/heads/master | invenio_webhooks/errors.py | 2 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016 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
# License, or (at your option) any later... |
guorendong/iridium-browser-ubuntu | refs/heads/ubuntu/precise | third_party/trace-viewer/third_party/tvcm/third_party/rjsmin/bench/main.py | 12 | #!/usr/bin/env python
# -*- coding: ascii -*-
r"""
=================================
Benchmark jsmin implementations
=================================
Benchmark jsmin implementations.
:Copyright:
Copyright 2011 - 2014
Andr\xe9 Malo or his licensors, as applicable
:License:
Licensed under the Apache License, Ve... |
viz-dev/viz | refs/heads/master | qa/rpc-tests/create_cache.py | 97 | #!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Helper script to create the cache
# (see BitcoinTestFramework.setup_chain)
#
from test_framework.test_fra... |
OpenBounds/Processing | refs/heads/master | validate.py | 1 | #!/usr/bin/env python3
import json
import logging
import re
import sys
import click
import jsonschema
import utils
@click.command()
@click.argument("schema", type=click.File("r"), required=True)
@click.argument("jsonfiles", type=click.Path(exists=True), required=True)
def validate(schema, jsonfiles):
"""Validat... |
justyns/home-assistant | refs/heads/dev | tests/components/test_zone.py | 12 | """Test zone component."""
import unittest
from homeassistant.components import zone
from tests.common import get_test_home_assistant
class TestComponentZone(unittest.TestCase):
"""Test the zone component."""
def setUp(self): # pylint: disable=invalid-name
"""Setup things to be run when tests are ... |
the-it/WS_THEbotIT | refs/heads/main | archive/online/2018/convert_deprecated_re_templates.py | 1 | # successful processed on 2018-06-22
# successful processed on 2018-06-21
import traceback
from pywikibot import Site, Page
from service.ws_re.scanner import ERROTask
from service.ws_re.template import ReDatenException
from service.ws_re.template.re_page import RePage
from tools.bots.pi import OneTimeBot
from tools.p... |
nickhand/nbodykit | refs/heads/master | nbodykit/source/catalog/array.py | 1 | from nbodykit.base.catalog import CatalogSource
from nbodykit.utils import is_structured_array
from nbodykit import CurrentMPIComm
from astropy.table import Table
import numpy
class ArrayCatalog(CatalogSource):
"""
A CatalogSource initialized from an in-memory :obj:`dict`,
structured :class:`numpy.ndarray`... |
GunoH/intellij-community | refs/heads/master | python/helpers/py2only/docutils/utils/math/math2html.py | 106 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# math2html: convert LaTeX equations to HTML output.
#
# Copyright (C) 2009-2011 Alex Fernández
#
# Released under the terms of the `2-Clause BSD license'_, in short:
# Copying and distribution of this file, with or without modification,
# are permitted in any m... |
team-ferret/pip-in-toto | refs/heads/master | pip/_vendor/html5lib/_trie/__init__.py | 456 | from __future__ import absolute_import, division, unicode_literals
from .py import Trie as PyTrie
Trie = PyTrie
# pylint:disable=wrong-import-position
try:
from .datrie import Trie as DATrie
except ImportError:
pass
else:
Trie = DATrie
# pylint:enable=wrong-import-position
|
nikolas/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/django/contrib/gis/db/backends/spatialite/introspection.py | 401 | from django.contrib.gis.gdal import OGRGeomType
from django.db.backends.sqlite3.introspection import DatabaseIntrospection, FlexibleFieldLookupDict
class GeoFlexibleFieldLookupDict(FlexibleFieldLookupDict):
"""
Sublcass that includes updates the `base_data_types_reverse` dict
for geometry field types.
... |
adviti/melange | refs/heads/master | thirdparty/google_appengine/google/appengine/_internal/django/template/loaders/cached.py | 23 | """
Wrapper class that takes a list of template loaders as an argument and attempts
to load templates from them in order, caching the result.
"""
from google.appengine._internal.django.core.exceptions import ImproperlyConfigured
from google.appengine._internal.django.template import TemplateDoesNotExist
from google.ap... |
basicthinker/THNVM | refs/heads/master | tests/configs/realview-simple-atomic.py | 61 | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... |
40223214/-2015cd_midterm2 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/_weakrefset.py | 766 | # Access WeakSet through the weakref module.
# This code is separated-out because it is needed
# by abc.py to load everything else at startup.
from _weakref import ref
__all__ = ['WeakSet']
class _IterationGuard:
# This context manager registers itself in the current iterators of the
# weak container, such ... |
mmauroy/SickRage | refs/heads/master | lib/rtorrent/lib/xmlrpc/http.py | 180 | # Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.com>
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, ... |
sergiorb/askkit | refs/heads/master | allauth/socialaccount/providers/persona/tests.py | 61 | try:
from mock import patch
except ImportError:
from unittest.mock import patch
from django.test import TestCase
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from allauth.utils import get_user_model
SOCIALACCOUNT_PROVIDERS = {'persona':
... |
deepesch/scikit-learn | refs/heads/master | examples/manifold/plot_compare_methods.py | 259 | """
=========================================
Comparison of Manifold Learning methods
=========================================
An illustration of dimensionality reduction on the S-curve dataset
with various manifold learning methods.
For a discussion and comparison of these algorithms, see the
:ref:`manifold module... |
reingart/web2conf | refs/heads/master | models/app_settings.py | 4 | # -*- coding: utf-8 -*-
# set user selected language (default spanish)
if request.vars.lang: session.lang=request.vars.lang
T.force(session.lang or "es")
# Return service unavailable
# for maintenance
SUSPEND_SERVICE = False
# True for accepting user activity votes
ALLOW_VOTE = False
# call for proposals
CFP = True... |
postlund/home-assistant | refs/heads/dev | tests/components/somfy/__init__.py | 29 | """Tests for the Somfy component."""
|
bobeirasa/virtualenvs | refs/heads/master | pygeckozabbix/lib/python2.7/site-packages/requests/certs.py | 961 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
certs.py
~~~~~~~~
This module returns the preferred default CA certificate bundle.
If you are packaging Requests, e.g., for a Linux distribution or a managed
environment, you can change the definition of where() to return a separately
packaged CA bundle.
"""
import ... |
KaranToor/MA450 | refs/heads/master | google-cloud-sdk/lib/surface/app/regions/list.py | 3 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
TieWei/nova | refs/heads/enhanced/havana | nova/cert/rpcapi.py | 8 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... |
mmazanec22/too-windy | refs/heads/master | env/lib/python3.5/site-packages/setuptools/command/py36compat.py | 286 | import os
from glob import glob
from distutils.util import convert_path
from distutils.command import sdist
from setuptools.extern.six.moves import filter
class sdist_add_defaults:
"""
Mix-in providing forward-compatibility for functionality as found in
distutils on Python 3.7.
Do not edit the code ... |
swiftype/swiftype-enterprise-python | refs/heads/master | elastic_workplace_search/client.py | 1 | from .request_session import RequestSession
from .apis.documents import Documents
from .apis.permissions import Permissions
"""API client for Elastic Workplace Search"""
class Client:
ELASTIC_WORKPLACE_SEARCH_BASE_URL = "http://localhost:3002/api/ws/v1"
def __init__(self, authorization_token, base_url=ELAS... |
izonder/intellij-community | refs/heads/master | python/testData/inspections/PyPep8NamingInspection/importConstant.py | 74 | from x import TEST as <weak_warning descr="Constant variable imported as non constant">test</weak_warning>
|
Petr-Kovalev/nupic-win32 | refs/heads/master | tests/unit/py2/nupic/math/array_algorithms_test.py | 1 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditio... |
trenton42/txbalanced | refs/heads/master | scenarios/reversal_update/executable.py | 1 | import balanced
balanced.configure('ak-test-1o9QKwUCrwstHWO5sGxICtIJdQXFTjnrV')
reversal = balanced.Reversal.fetch('/reversals/RV7DQpcc6sowPOMi29WTjlOU')
reversal.description = 'update this description'
reversal.meta = {
'user.refund.count': '3',
'refund.reason': 'user not happy with product',
'user.notes': 've... |
arsfeld/conduit | refs/heads/master | conduit/modules/GoogleModule/gdata/spreadsheet/text_db.py | 6 | #!/usr/bin/python
#
# Copyright Google 2007-2008, 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 ... |
philipn/sycamore | refs/heads/master | Sycamore/action/captcha.py | 2 | # -*- coding: utf-8 -*-
"""
Sycamore - captcha action
This action sends and generates CAPTCHAS to test if someone is human
@copyright: 2006 Philip Neustrom <philipn@gmail.com>
@license: GNU GPL, see COPYING for details.
"""
# Imports
import random
import time
import mimetypes
import cStringIO
import ... |
mattvonrocketstein/smash | refs/heads/master | smashlib/ipy3x/utils/daemonize.py | 1 | """daemonize function from twisted.scripts._twistd_unix."""
#-----------------------------------------------------------------------------
# Copyright (c) Twisted Matrix Laboratories.
# See Twisted's LICENSE for details.
# http://twistedmatrix.com/
#---------------------------------------------------------------------... |
snowballdaemons/MMXIV | refs/heads/master | share/qt/make_spinner.py | 4415 | #!/usr/bin/env python
# W.J. van der Laan, 2011
# Make spinning .mng animation from a .png
# Requires imagemagick 6.7+
from __future__ import division
from os import path
from PIL import Image
from subprocess import Popen
SRC='img/reload_scaled.png'
DST='../../src/qt/res/movies/update_spinner.mng'
TMPDIR='/tmp'
TMPNAM... |
frankyrumple/smc | refs/heads/master | modules/ecdsa/numbertheory.py | 29 | #! /usr/bin/env python
#
# Provide some simple capabilities from number theory.
#
# Version of 2008.11.14.
#
# Written in 2005 and 2006 by Peter Pearson and placed in the public domain.
# Revision history:
# 2008.11.14: Use pow( base, exponent, modulus ) for modular_exp.
# Make gcd and lcm accept arbitr... |
NCI-Cloud/horizon | refs/heads/nci/kilo | openstack_dashboard/dashboards/admin/metadata_defs/tests.py | 29 | # (c) Copyright 2014 Hewlett-Packard Development Company, L.P.
# Copyright 2014 Intel 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.... |
litnimax/astconfman | refs/heads/master | astconfman/config.py | 1 | # *-* encoding: utf-8 *-*
import os
from flask_babelex import lazy_gettext as _
# Default Language. Currenly only 'ru' and 'en' are supported.
LANGUAGE = 'en'
# Put here some random string
SECRET_KEY = 'change_me_here_to_random_key'
# BRAND_NAV - this defines the string on the right top navigation bar
BRAND_NAV = u'... |
alviano/wasp | refs/heads/master | tests/asp/cautious/bug1.asp.cautious.asp.test.py | 1 | input = """
1 2 2 1 3 4
1 3 2 1 2 4
1 4 0 0
1 2 2 1 5 6
1 5 2 1 2 6
1 6 0 0
1 2 2 1 7 8
1 7 2 1 2 8
1 8 0 0
1 2 2 1 9 10
1 9 2 1 2 10
1 10 0 0
1 2 2 1 11 12
1 11 2 1 2 12
1 12 0 0
1 2 2 1 13 14
1 13 2 1 2 14
1 14 0 0
1 2 2 1 15 16
1 15 2 1 2 16
1 16 0 0
1 2 2 1 17 18
1 17 2 1 2 18
1 18 0 0
1 2 2 1 19 20
1 19 2 1 2 20
1... |
ashwyn/eden-message_parser | refs/heads/master | static/scripts/tools/import_gadm.py | 37 | # Script to import all countries in Asia Pacific (except Timor Leste, for which we use the UN dataset)
#
# run as python web2py.py -S eden -M -R applications/eden/static/scripts/tools/import_gadm.py
#
import time
secs = time.mktime(time.localtime())
# Asia Pacific less TL
countries = [ "AF", "AU", "BD", "BN", "CK", ... |
robcarver17/pysystemtrade | refs/heads/master | sysbrokers/IB/ib_instruments_data.py | 1 | import pandas as pd
from sysbrokers.IB.ib_instruments import NOT_REQUIRED_FOR_IB, ibInstrumentConfigData, futuresInstrumentWithIBConfigData
from sysbrokers.IB.ib_connection import connectionIB
from sysbrokers.broker_instrument_data import brokerFuturesInstrumentData
from syscore.fileutils import get_filename_for_pack... |
xbianonpi/Sick-Beard-TPB | refs/heads/ThePirateBay | lib/unidecode/x01e.py | 246 | data = (
'A', # 0x00
'a', # 0x01
'B', # 0x02
'b', # 0x03
'B', # 0x04
'b', # 0x05
'B', # 0x06
'b', # 0x07
'C', # 0x08
'c', # 0x09
'D', # 0x0a
'd', # 0x0b
'D', # 0x0c
'd', # 0x0d
'D', # 0x0e
'd', # 0x0f
'D', # 0x10
'd', # 0x11
'D', # 0x12
'd', # 0x13
'E', # 0... |
dipapaspyros/bdo_platform | refs/heads/master | bdo_platform/settings_management/keys_example.py | 2 | # AWS id/access key for s3
AWS_ACCESS_KEY_ID = ''
AWS_SECRET_ACCESS_KEY = ''
|
acshi/osf.io | refs/heads/develop | addons/mendeley/routes.py | 10 | # -*- coding: utf-8 -*-
from framework.routing import Rule, json_renderer
from addons.mendeley.views import mendeley_views
api_routes = {
'rules': [
Rule(
[
'/settings/mendeley/accounts/',
],
'get',
mendeley_views.account_list(),
... |
ff94315/hiwifi-openwrt-HC5661-HC5761 | refs/heads/master | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/distutils/command/build_clib.py | 176 | """distutils.command.build_clib
Implements the Distutils 'build_clib' command, to build a C/C++ library
that is included in the module distribution and needed by an extension
module."""
__revision__ = "$Id$"
# XXX this module has *lots* of code ripped-off quite transparently from
# build_ext.py -- not surprisingly ... |
Y-oHr-N/kenchi | refs/heads/master | kenchi/outlier_detection/ensemble.py | 1 | from sklearn.ensemble import IsolationForest
from sklearn.utils.validation import check_is_fitted
from .base import BaseOutlierDetector
__all__ = ['IForest']
class IForest(BaseOutlierDetector):
"""Isolation forest (iForest).
Parameters
----------
bootstrap : bool, False
If True, individual ... |
turbokongen/home-assistant | refs/heads/dev | homeassistant/components/nest/camera_sdm.py | 2 | """Support for Google Nest SDM Cameras."""
import datetime
import logging
from typing import Optional
from google_nest_sdm.camera_traits import (
CameraEventImageTrait,
CameraImageTrait,
CameraLiveStreamTrait,
)
from google_nest_sdm.device import Device
from google_nest_sdm.exceptions import GoogleNestExc... |
TedaLIEz/sentry | refs/heads/master | src/sentry/plugins/base/structs.py | 30 | """
sentry.plugins.base.structs
~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
__all__ = ('Annotation', 'Notification')
import warnings
class Annotation(... |
CyanogenMod/android_external_chromium-trace | refs/heads/cm-10.2 | trace-viewer/third_party/closure_linter/closure_linter/closurizednamespacesinfo_test.py | 135 | #!/usr/bin/env python
#
# Copyright 2010 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
#... |
dalou/django-templatetags-bundle | refs/heads/master | setup.py | 1 | import ast
import os
import sys
import codecs
import subprocess
from fnmatch import fnmatchcase
from distutils.util import convert_path
from setuptools import setup, find_packages
def find_version(*parts):
try:
version_py = os.path.join(os.path.dirname(__file__), 'templatetags_bundle/version.py')
... |
geminy/aidear | refs/heads/master | oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/tools/python/google/platform_utils_win.py | 193 | # Copyright (c) 2011 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.
"""Platform-specific utility methods shared by several scripts."""
import os
import re
import subprocess
import sys
import google.path_utils
# Cache a ... |
andrewleech/SickRage | refs/heads/master | lib/unidecode/x04f.py | 252 | data = (
'Zhong ', # 0x00
'Qi ', # 0x01
'Pei ', # 0x02
'Yu ', # 0x03
'Diao ', # 0x04
'Dun ', # 0x05
'Wen ', # 0x06
'Yi ', # 0x07
'Xin ', # 0x08
'Kang ', # 0x09
'Yi ', # 0x0a
'Ji ', # 0x0b
'Ai ', # 0x0c
'Wu ', # 0x0d
'Ji ', # 0x0e
'Fu ', # 0x0f
'Fa ', # 0x10
'Xiu ', ... |
abelkhan/websearch | refs/heads/master | websearch/chardet/mbcharsetprober.py | 2923 | ######################## 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... |
rohlandm/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/manifest/log.py | 317 | import logging
logging.basicConfig()
logger = logging.getLogger("manifest")
logger.setLevel(logging.DEBUG)
def get_logger():
return logger
|
yangzilong1986/python | refs/heads/master | JiYouMCC/0011/0011.py | 24 | # -*- coding: utf-8 -*-
def word_check(input_word, filtered_words):
for word in filtered_words:
if word in input_word:
return 'Freedom'
return 'Human Rights'
file = open('filtered_words.txt')
filtered_words=[line.replace('\n','') for line in file]
print word_check('程序员在上班。', filtered_words)... |
ffu/DSA-3.2.2 | refs/heads/master | gnuradio-core/src/python/gnuradio/gr/qa_kludged_imports.py | 6 | #!/usr/bin/env python
#
# Copyright 2005,2008 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 opt... |
rjeczalik/koding | refs/heads/master | scripts/assassin.py | 13 | #!/usr/bin/env python
import os
import sys
import time
import json
import socket
import commands
try:
import psutil
import pycurl
except ImportError:
print "Install required packages first: pip install psutil pycurl"
sys.exit(1)
THRESHOLD = 1.0 # percentage
KILL_THRESHOLD = 3.0 # average perce... |
percona/debian-percona-xtradb-cluster-5.6 | refs/heads/master | plugin/percona-pam-for-mysql/doc/source/conf.py | 33 | # -*- coding: utf-8 -*-
#
# Percona PAM authentication plugin documentation build configuration file, created by
# sphinx-quickstart on Mon Jun 27 22:27:15 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
# a... |
jpiccino/isonline | refs/heads/master | ping_enUS.py | 1 | #!/usr/bin/python
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
ledtest = 2 # Turns on while pinging
ledNOK = 3 # Turns on if the ping response is an error
ledOK = 4 # Turns on if there is a ping response
GPIO.setup(ledtest, GPIO.OUT)
GPIO.setup(ledNOK, GPIO.OUT)
GPIO.setup(ledO... |
buqing2009/MissionPlanner | refs/heads/master | Lib/lib2to3/fixes/fix_paren.py | 61 | """Fixer that addes parentheses where they are required
This converts ``[x for x in 1, 2]`` to ``[x for x in (1, 2)]``."""
# By Taek Joo Kim and Benjamin Peterson
# Local imports
from .. import fixer_base
from ..fixer_util import LParen, RParen
# XXX This doesn't support nested for loops like [x for x in ... |
ArcherCraftStore/ArcherVMPeridot | refs/heads/master | Python/Lib/idlelib/AutoCompleteWindow.py | 88 | """
An auto-completion window for IDLE, used by the AutoComplete extension
"""
from tkinter import *
from idlelib.MultiCall import MC_SHIFT
from idlelib.AutoComplete import COMPLETE_FILES, COMPLETE_ATTRIBUTES
HIDE_VIRTUAL_EVENT_NAME = "<<autocompletewindow-hide>>"
HIDE_SEQUENCES = ("<FocusOut>", "<ButtonPress>")
KEYPR... |
ESOedX/edx-platform | refs/heads/master | cms/djangoapps/contentstore/tests/test_core_caching.py | 1 | """
Tests core caching facilities.
"""
from __future__ import absolute_import
from django.test import TestCase
from opaque_keys.edx.locator import AssetLocator, CourseLocator
from openedx.core.djangoapps.contentserver.caching import del_cached_content, get_cached_content, set_cached_content
class Content(object):
... |
Tetpay/cjdns | refs/heads/master | node_build/dependencies/libuv/build/gyp/test/mac/gyptest-xcode-gcc-clang.py | 254 | #!/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.
"""
Verifies that xcode-style GCC_... settings that require clang are handled
properly.
"""
import TestGyp
import os
import sys
if sys.pl... |
jeffbean/kubernetes | refs/heads/master | examples/celery-rabbitmq/celery-app-add/run_tasks.py | 471 | #!/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... |
kuipertan/vitess | refs/heads/master | test/environment.py | 10 | #!/usr/bin/env python
import json
import logging
import os
import socket
import subprocess
import sys
# Import the topo implementations that you want registered as options for the
# --topo-server-flavor flag.
import topo_flavor.zookeeper
import topo_flavor.etcd
from topo_flavor.server import topo_server
# import th... |
whitehorse-io/encarnia | refs/heads/master | pyenv/lib/python2.7/site-packages/django/contrib/gis/gdal/raster/band.py | 308 | from ctypes import byref, c_int
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.prototypes import raster as capi
from django.contrib.gis.shortcuts import numpy
from django.utils import six
from django.utils.encoding import force_tex... |
alxgu/ansible | refs/heads/devel | test/units/modules/network/f5/test_bigip_file_copy.py | 16 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# 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
import os
import json
import pytest
import sys
if sys.version_info < (2... |
willusher/ansible-modules-core | refs/heads/devel | files/xattr.py | 39 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... |
k3nnyfr/s2a_fr-nsis | refs/heads/master | s2a/Python/Lib/test/test_format.py | 9 | import sys
from test.test_support import verbose, have_unicode, TestFailed
import test.test_support as test_support
import unittest
maxsize = test_support.MAX_Py_ssize_t
# test string formatting operator (I am not sure if this is being tested
# elsewhere but, surely, some of the given cases are *not* tested because
#... |
Yrthgze/prueba-sourcetree2 | refs/heads/master | illuz/0001/key_generator.py | 40 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Author: illuz <iilluzen[at]gmail.com>
# File: key_generator.py
# Create Date: 2015-02-09 10:43:36
# Descripton: Use uuid module to generate 200 register keys.
# Usage: key_generator.py
"""
第 0001 题:
做为 Apple Store App 独立开发者,你要搞限时促销,为你的应用生成激活码(或者优惠券),使用 Pyt... |
mglukhikh/intellij-community | refs/heads/master | python/testData/refactoring/extractsuperclass/importNotBroken.before.py | 80 | from shared import SharedClass
class Source(SharedClass):
pass |
becm/meson | refs/heads/master | test cases/common/130 generated llvm ir/copyfile.py | 100 | #!/usr/bin/env python3
import sys
import shutil
shutil.copyfile(sys.argv[1], sys.argv[2])
|
hiteshwadekar/ns-3-dev-ndnSIM | refs/heads/ndnSIM | src/topology-read/bindings/callbacks_list.py | 664 | callback_classes = [
['void', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
]
|
ubiar/odoo | refs/heads/8.0 | addons/l10n_fr_hr_payroll/l10n_fr_hr_payroll.py | 340 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... |
Gab0/gekkoJaponicus | refs/heads/master | evaluation/gekko/API.py | 1 | #!/bin/python
import os
import requests
import json
from subprocess import Popen, PIPE
def initializeGekko(): # not used yet.
CMD = ['node', gekkoDIR + '/gekko', '--ui']
D = Popen(CMD, stdin=PIPE, stdout=PIPE, stderr=PIPE)
def checkInstance(instanceUrl):
try:
Request = requests.get(instance... |
yawnosnorous/python-for-android | refs/heads/master | python-modules/twisted/twisted/persisted/journal/picklelog.py | 64 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
#
# -*- test-case-name: twisted.test.test_journal -*-
"""Logging that uses pickles.
TODO: add log that logs to a file.
"""
# twisted imports
from twisted.persisted import dirdbm
from twisted.internet import defer
from zope.interface ... |
tashoecraft/node-workshop | refs/heads/master | challenge6/start/node_modules/browserify/node_modules/insert-module-globals/node_modules/lexical-scope/node_modules/astw/node_modules/esprima-six/tools/generate-unicode-regex.py | 341 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# By Yusuke Suzuki <utatane.tea@gmail.com>
# Modified by Mathias Bynens <http://mathiasbynens.be/>
# http://code.google.com/p/esprima/issues/detail?id=110
import sys
import string
import re
class RegExpGenerator(object):
def __init__(self, detector):
self.de... |
InakiZabala/odoomrp-wip | refs/heads/8.0 | product_pricelist_rules/models/__init__.py | 25 | # -*- encoding: utf-8 -*-
##############################################################################
#
# 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... |
Infinity-MaNGOS-Project-FallenAngelX/infinity_mangos | refs/heads/master | contrib/mmap/mmap_extract.py | 1 | #!/usr/bin/python
import os, sys, threading, time, subprocess
from multiprocessing import cpu_count
from collections import deque
mapList = deque([0,1,530,571,13,25,30,33,34,35,36,37,42,43,44,47,48,70,90,109,129,169,189,209,229,230,249,269,289,309,329,349,369,
389,409,429,449,450,451,469,489,509,529,531,532,533,5... |
nashve/mythbox | refs/heads/master | resources/lib/twisted/twisted/spread/__init__.py | 61 |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Twisted Spread: Spreadable (Distributed) Computing.
Future Plans: PB, Jelly and Banana need to be optimized.
@author: Glyph Lefkowitz
"""
|
teltek/edx-platform | refs/heads/master | lms/djangoapps/courseware/tests/test_user_state_client.py | 11 | """
Black-box tests of the DjangoUserStateClient against the semantics
defined in edx_user_state_client.
"""
from collections import defaultdict
from unittest import skip
from django.test import TestCase
from edx_user_state_client.tests import UserStateClientTestBase
from courseware.tests.factories import UserFactor... |
yanchen036/tensorflow | refs/heads/master | tensorflow/python/debug/lib/debug_service_pb2_grpc.py | 78 | # 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... |
Nu3001/external_chromium_org | refs/heads/master | chrome/common/extensions/docs/server2/chained_compiled_file_system_test.py | 24 | #!/usr/bin/env python
# Copyright 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 unittest
from chained_compiled_file_system import ChainedCompiledFileSystem
from compiled_file_system import CompiledFileSystem... |
foreni-packages/golismero | refs/heads/master | thirdparty_libs/django/core/servers/fastcgi.py | 241 | """
FastCGI (or SCGI, or AJP1.3 ...) server that implements the WSGI protocol.
Uses the flup python package: http://www.saddi.com/software/flup/
This is a adaptation of the flup package to add FastCGI server support
to run Django apps from Web servers that support the FastCGI protocol.
This module can be run standalo... |
kristi/Lyx | refs/heads/master | lib/scripts/TeXFiles.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# file TeXFiles.py
# This file is part of LyX, the document processor.
# Licence details can be found in the file COPYING.
# \author Herbert Voß
# \author Jean-Marc Lasgouttes
# \author Jürgen Spitzmüller
# \author Bo Peng
# Full author contact details are available in f... |
guoxiao/hostsupdater | refs/heads/master | hostsupdater.py | 1 | #!/usr/bin/env python
import argparse
import dns.resolver
from multiprocessing.dummy import Pool as ThreadPool
class HostsUpdater():
"""
HostsUpdater: Read a hosts file and query to make a new one
"""
names = []
name_ip = []
nameservers = ['8.8.8.8']
THREADS = 10
def __init__(self, infi... |
h4ck3rm1k3/BeautifulSoup4 | refs/heads/master | bs4/tests/test_tree.py | 38 | # -*- coding: utf-8 -*-
"""Tests for Beautiful Soup's tree traversal methods.
The tree traversal methods are the main advantage of using Beautiful
Soup over just using a parser.
Different parsers will build different Beautiful Soup trees given the
same markup, but all Beautiful Soup trees can be traversed with the
me... |
jordivilaseca/ardupi-weather | refs/heads/master | RaspberryPi/ardupi_weather/database/mongodb.py | 1 | import pymongo
import json
import os
import logging
from logging.handlers import TimedRotatingFileHandler
logger = logging.getLogger('mongodb')
def jsonAdd(jsonFile, collection, func, newEntry, params=None):
"""
It appends a data entry to a json file.
Args:
jsonFile: Aboslut path to the json file.
collection... |
TathagataChakraborti/resource-conflicts | refs/heads/master | PLANROB-2015/seq-sat-lama/Python-2.5.2/Demo/tkinter/matt/canvas-mult-item-sel.py | 47 | from Tkinter import *
# allows moving dots with multiple selection.
SELECTED_COLOR = "red"
UNSELECTED_COLOR = "blue"
class Test(Frame):
###################################################################
###### Event callbacks for THE CANVAS (not the stuff drawn on it)
###################################... |
capooti/geonode | refs/heads/2.0-wfp | geonode/proxy/tests.py | 3 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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 versio... |
partofthething/home-assistant | refs/heads/dev | tests/components/awair/test_sensor.py | 3 | """Tests for the Awair sensor platform."""
from unittest.mock import patch
from homeassistant.components.awair.const import (
API_CO2,
API_HUMID,
API_LUX,
API_PM10,
API_PM25,
API_SCORE,
API_SPL_A,
API_TEMP,
API_VOC,
ATTR_UNIQUE_ID,
DOMAIN,
SENSOR_TYPES,
)
from homeassis... |
aptivate/econsensus | refs/heads/master | django/econsensus/publicweb/tests/resending_message_test.py | 3 | from django.test.testcases import SimpleTestCase
from mock import patch, Mock
from publicweb.extra_models import FEEDBACK_ADDED_NOTIFICATIONS,\
NotificationSettings, FEEDBACK_MAJOR_CHANGES
from django_dynamic_fixture import N
from django.contrib.auth.models import User
from publicweb.models import Decision, additio... |
farhaanbukhsh/networkx | refs/heads/master | networkx/linalg/tests/test_graphmatrix.py | 40 | from nose import SkipTest
import networkx as nx
from networkx.generators.degree_seq import havel_hakimi_graph
class TestGraphMatrix(object):
numpy=1 # nosetests attribute, use nosetests -a 'not numpy' to skip test
@classmethod
def setupClass(cls):
global numpy
global assert_equal
g... |
koobonil/Boss2D | refs/heads/master | Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/contrib/rnn/python/kernel_tests/core_rnn_test.py | 3 | # 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.