repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
BruceDai/crosswalk-test-suite
refs/heads/master
stability/stability-iterative-android-tests/iterative/Switch_Between_NativeAndWebApp.py
18
#!/usr/bin/env python # coding=utf-8 # # Copyright (c) 2015 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of c...
chrismeyersfsu/ansible
refs/heads/devel
lib/ansible/modules/network/nxos/nxos_mtu.py
12
#!/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 distribut...
ftrader-bitcoinunlimited/hardfork_prototype_1_mvf-bu
refs/heads/master
qa/rpc-tests/invalidateblock.py
3
#!/usr/bin/env python3 # Copyright (c) 2014-2015 The Bitcoin Core developers # Copyright (c) 2015-2017 The Bitcoin Unlimited developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test InvalidateBlock code # import time ...
shsingh/ansible
refs/heads/devel
test/units/modules/network/fortios/test_fortios_vpn_ssl_web_user_bookmark.py
21
# Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the...
leafclick/intellij-community
refs/heads/master
python/testData/refactoring/extractmethod/File.after.py
79
def __init__(self): for base in self__class__.__bases__: bar(base, self) def bar(base_new, self_new): try: base_new.__init__(self_new) except AttributeError: pass
witalikkowal/Store
refs/heads/master
vendor/doctrine/orm/docs/en/conf.py
2448
# -*- coding: utf-8 -*- # # Doctrine 2 ORM documentation build configuration file, created by # sphinx-quickstart on Fri Dec 3 18:10:24 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. ...
fredsod/NIPAP
refs/heads/master
nipap/nipap/nipapconfig.py
7
import ConfigParser class NipapConfig(ConfigParser.SafeConfigParser): """ Makes configuration data available. Implemented as a class with a shared state; once an instance has been created, new instances with the same state can be obtained by calling the custructor again. """ __sh...
abhitopia/tensorflow
refs/heads/master
tensorflow/contrib/learn/python/learn/trainable.py
68
# 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...
glennhickey/teHmm
refs/heads/master
scripts/multibench.py
1
#!/usr/bin/env python #Copyright (C) 2014 by Glenn Hickey # #Released under the MIT license, see LICENSE.txt import unittest import sys import os import argparse import logging import random import numpy as np from teHmm.common import runShellCommand, setLogLevel, addLoggingFileHandler setLogLevel("INFO") addLogging...
avinassh/rtiman
refs/heads/master
sample_settings.py
1
# all the settings, auth etc. import os MONGO_URL = "mongodb://avinassh:avinassh@localhost:10031/rti" application_handler_setttings = dict( template_path=os.path.join(os.path.dirname(__file__), "templates"), static_path=os.path.join(os.path.dirname(__file__), "static"), cookie_sec...
donnydevito/py-academicstoday
refs/heads/master
academicstoday_project/teacher/views/overview.py
3
from django.shortcuts import render from django.core import serializers from django.http import HttpResponse from django.contrib.auth.models import User from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required from django.conf import settings import json impo...
jiangzhuo/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/site-packages/pip/basecommand.py
392
"""Base Command class, and related routines""" import os import sys import tempfile import traceback import time import optparse from pip import cmdoptions from pip.locations import running_under_virtualenv from pip.log import logger from pip.download import PipSession from pip.exceptions import (BadCommand, Installa...
Bartzi/LabShare
refs/heads/master
labshare/wsgi.py
1
import os from django.core.wsgi import get_wsgi_application os.environ['DJANGO_SETTINGS_MODULE'] = 'labshare.settings' # This application object is used by any WSGI server configured to use this # file. This includes Django's development server, if the WSGI_APPLICATION # setting points here. # Apply WSGI middleware ...
miguelalba89/hfooad-python
refs/heads/master
ch4/sam_dogdoor.py
1
""" Sam's dogdoor Author: m1ge7 Date: 2014/04/12 """ import time from threading import Timer class Bark: def __init__(self, sound): self._sound = sound def get_sound(self): return self._sound def __eq__(self, bark): return self._sound.lower() == bark.get_sound().lower() cla...
4eek/configuration
refs/heads/master
tests/jinja_check.py
49
#!/usr/bin/env python import os import sys from jinja2 import FileSystemLoader from jinja2 import Environment as j from jinja2.exceptions import UndefinedError from ansible.utils.template import _get_filters, _get_extensions from yaml.representer import RepresenterError input_file = sys.argv[1] if not os.path.exists(...
microdee/IronHydra
refs/heads/master
src/IronHydra/Lib/distutils/command/register.py
75
"""distutils.command.register Implements the Distutils 'register' command (register with the repository). """ # created 2002/10/21, Richard Jones __revision__ = "$Id$" import urllib2 import getpass import urlparse import StringIO from warnings import warn from distutils.core import PyPIRCCommand from distutils imp...
CyanogenMod/android_kernel_asus_fugu
refs/heads/cm-12.0
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
4653
# EventClass.py # # This is a library defining some events types classes, which could # be used by other scripts to analyzing the perf samples. # # Currently there are just a few classes defined for examples, # PerfEvent is the base class for all perf event sample, PebsEvent # is a HW base Intel x86 PEBS event, and use...
MemeticParadigm/TensorFlow
refs/heads/master
tensorflow/python/training/training_ops.py
5
"""Python wrappers for training ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import ops from tensorflow.python.framework import tensor_shape from tensorflow.python.training import gen_training_ops # pylint: disabl...
sunlianqiang/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/test/test_pep247.py
84
""" Test suite to check compilance with PEP 247, the standard API for hashing algorithms """ import hmac import unittest from hashlib import md5, sha1, sha224, sha256, sha384, sha512 from test import support class Pep247Test(unittest.TestCase): def check_module(self, module, key=None): self.assertTrue(ha...
sharma1nitish/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/QueueStatusServer/model/workitems.py
140
# 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 ...
opena11y/fae2
refs/heads/master
fae2/rules/tests.py
1
""" Copyright 2014-2016 University of Illinois 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 writ...
manipopopo/tensorflow
refs/heads/master
tensorflow/contrib/data/python/ops/threadpool.py
4
# 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...
ramezquitao/pyoptools
refs/heads/master
pyoptools/misc/cmisc/__init__.py
2
from .cmisc import (dot_test, test_1, test_2, unwrap) __all__ = ["dot_test", "test_1", "test_2", "unwrap"]
zstyblik/infernal-twin
refs/heads/master
build/pip/pip/_vendor/html5lib/treewalkers/genshistream.py
1730
from __future__ import absolute_import, division, unicode_literals from genshi.core import QName from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT from . import _base from ..constants import voidElements, namespaces class ...
KJin99/zulip
refs/heads/master
docs/conf.py
121
# -*- coding: utf-8 -*- # # zulip-contributor-docs documentation build configuration file, created by # sphinx-quickstart on Mon Aug 17 16:24:04 2015. # # 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 # autogenera...
z1gm4/desarrollo_web_udp
refs/heads/dev
env/lib/python2.7/site-packages/faker/utils/__init__.py
20
# coding=utf-8 def is_string(var): try: return isinstance(var, basestring) except NameError: return isinstance(var, str) def quote(var): return ('"{0}"' if '"' not in var else "'{0}'").format(var)
imitrichev/cantera
refs/heads/master
interfaces/cython/cantera/examples/transport/dusty_gas.py
4
""" Dusty Gas transport model. The Dusty Gas model is a multicomponent transport model for gas transport through the pores of a stationary porous medium. This example shows how to create a transport manager that implements the Dusty Gas model and use it to compute the multicomponent diffusion coefficients. """ import...
Justin-Yuan/Image2Music-Generator
refs/heads/master
library/jython2.5.3/Lib/test/test_joverload.py
22
# test overloaded java methods dispatch logic in PyReflectedFunction # needs to grow more tests. Uses javatests.JOverload as a bag of overloaded methods. # (can be adapted to test alternative re-implemations even while they are developed # write a *Envl class and change/add to to_test for that) import sys import unitt...
jk1/intellij-community
refs/heads/master
python/testData/refactoring/move/referenceToClassWithNewInMovedSymbol/after/src/classFile.py
62
from collections import namedtuple class Pipeline(namedtuple('_Pipeline', 'name')): def __new__(cls, name): return super(Pipeline, cls).__new__(cls, name) def __init__(self, name): pass
jeanlinux/calibre
refs/heads/master
src/regex/_regex_core.py
13
# # Secret Labs' Regular Expression Engine core module # # Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. # # This version of the SRE library can be redistributed under CNRI's # Python 1.6 license. For any other use, please contact Secret Labs # AB (info@pythonware.com). # # Portions of this engine h...
jlegendary/Dato-Core
refs/heads/master
src/unity/python/graphlab_util/metric_tracker.py
13
''' Copyright (C) 2015 Dato, Inc. All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the DATO-PYTHON-LICENSE file for details. ''' from config import DEFAULT_CONFIG as CONFIG from metric_mock import MetricMock # metrics libraries import mixpanel import librato ...
KnoxMakers/KM-Laser
refs/heads/master
extensions/km_deps/axidrawinternal/axidraw_svg_reorder.py
2
# coding=utf-8 # # SVG Path Ordering Extension # This extension uses a simple TSP algorithm to order the paths so as # to reduce plotting time by plotting nearby paths consecutively. # # # While written from scratch, this is a derivative in spirit of the work by # Matthew Beckler and Daniel C. Newman for the EggBot p...
bev-a-tron/pledge_service
refs/heads/master
build/stripe/api_requestor.py
10
import calendar import datetime import platform import time import urllib import urlparse import warnings import stripe from stripe import error, http_client, version, util def _encode_datetime(dttime): if dttime.tzinfo and dttime.tzinfo.utcoffset(dttime) is not None: utc_timestamp = calendar.timegm(dtti...
etalab/weckan
refs/heads/master
weckan/controllers/dataset.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json import logging import math import requests from biryani1 import strings from datetime import datetime from urllib import urlencode from pkg_resources import resource_stream from sqlalchemy.sql import func, or_ from ckanext.etalab.plugins im...
fungos/gemuo
refs/heads/master
src/lumber.py
1
#!/usr/bin/python # # GemUO # # (c) 2005-2012 Max Kellermann <max@duempel.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; version 2 of the License. # # This program is distribut...
zooba/PTVS
refs/heads/master
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/cryptography/hazmat/primitives/kdf/scrypt.py
13
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import sys from cryptography import utils from cryptography.exceptions i...
pdellaert/ansible
refs/heads/devel
lib/ansible/modules/database/mongodb/mongodb_parameter.py
45
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Loic Blot <loic.blot@unix-experience.fr> # Sponsored by Infopro Digital. http://www.infopro-digital.com/ # Sponsored by E.T.A.I. http://www.etai.fr/ # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ impo...
mjg59/python-broadlink
refs/heads/master
broadlink/protocol.py
1
import datetime as dt import time class Datetime: """Helps to pack and unpack datetime objects for the Broadlink protocol.""" @staticmethod def pack(datetime: dt.datetime) -> bytes: """Pack the timestamp to be sent over the Broadlink protocol.""" data = bytearray(12) utcoffset = i...
gmacon/mongoengine
refs/heads/master
benchmark.py
28
#!/usr/bin/env python import timeit def cprofile_main(): from pymongo import Connection connection = Connection() connection.drop_database('timeit_test') connection.disconnect() from mongoengine import Document, DictField, connect connect("timeit_test") class Noddy(Document): fi...
dlopes-samba/dlopes-maps-sambatech
refs/heads/master
django/test/__init__.py
247
""" Django Unit Test and Doctest framework. """ from django.test.client import Client, RequestFactory from django.test.testcases import TestCase, TransactionTestCase, skipIfDBFeature, skipUnlessDBFeature from django.test.utils import Approximate
bonitadecker77/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/quopri.py
57
#! /usr/bin/env python3 """Conversions to/from quoted-printable transport encoding as per RFC 1521.""" # (Dec 1991 version). __all__ = ["encode", "decode", "encodestring", "decodestring"] ESCAPE = b'=' MAXLINESIZE = 76 HEX = b'0123456789ABCDEF' EMPTYSTRING = b'' try: from binascii import a2b_qp, b2a_qp except ...
joequery/django
refs/heads/master
tests/admin_changelist/urls.py
810
from django.conf.urls import url from . import admin urlpatterns = [ url(r'^admin/', admin.site.urls), ]
molejar/pyIMX
refs/heads/master
imx/img/images.py
1
# Copyright (c) 2017-2018 Martin Olejar # # SPDX-License-Identifier: BSD-3-Clause # The BSD-3-Clause license for this file can be found in the LICENSE file included with this distribution # or at https://spdx.org/licenses/BSD-3-Clause.html#licenseText from io import BytesIO, BufferedReader, SEEK_END, SEEK_CUR from .mi...
mammadori/pyglet
refs/heads/master
tests/window/CONTEXT_SHARE.py
27
#!/usr/bin/env python '''Test that multiple windows share objects by default. This test is non-interactive. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest from ctypes import * from pyglet import window from pyglet.gl import * __noninteractive = True class CONTEXT_SHARE(unittest.Tes...
geordanr/pylint
refs/heads/master
test/input/func_r0903.py
10
"""test min methods""" __revision__ = None class Aaaa: """yo""" def __init__(self): pass def meth1(self): """hehehe""" print self def _dontcount(self): """not public""" print self
Dumbaz/ProjectEuler
refs/heads/master
Problem2/Problem_2.py
1
fib_numbers = [1,2] def fib(first, second): if(first) not in fib_numbers: fib_numbers.append(first) if(second) not in fib_numbers: fib_numbers.append(second) fib_numbers.append(first+second) return (first + second) while (fib_numbers[-1] < 4000000): fib(fib_numbers[-1], fib_numbers[-2]) print(fib_number...
kimrutherford/intermine
refs/heads/master
testmodel/webapp/selenium/test/account-login-openid-test.py
18
from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import Select from selenium.common.exceptions import NoSuchElementException from test.testmodeltestcase import TestModelTestCase as Super import unittest, time, re, os class AccountLoginOpenID...
rcocetta/kano-profile
refs/heads/master
kano_world/config.py
1
#!/usr/bin/env python # config.py # # Copyright (C) 2014, 2015 Kano Computing Ltd. # License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2 # import os import yaml CONF_FILE = '/etc/kano-world.conf' def load_conf(): conf = None if os.path.exists(CONF_FILE): with open(CONF_FI...
allenlavoie/tensorflow
refs/heads/master
tensorflow/contrib/seq2seq/python/ops/beam_search_decoder.py
9
# 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...
andrewsmedina/django
refs/heads/master
tests/get_earliest_or_latest/tests.py
8
from __future__ import absolute_import from datetime import datetime from django.test import TestCase from .models import Article, Person class EarliestOrLatestTests(TestCase): """Tests for the earliest() and latest() objects methods""" def tearDown(self): """Makes sure Article has a get_latest_by...
jaruba/chromium.src
refs/heads/nw12
build/toolchain/win/setup_toolchain.py
9
# 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 errno import os import re import subprocess import sys """ Copies the given "win tool" (which the toolchain uses to wrap compiler invocations) an...
happy5214/pywikibot-core
refs/heads/master
scripts/welcome.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- u""" Script to welcome new users. This script works out of the box for Wikis that have been defined in the script. It is currently used on the Dutch, Norwegian, Albanian, Italian Wikipedia, Wikimedia Commons and English Wikiquote. Ensure you have community support before runn...
tommyip/zulip
refs/heads/master
analytics/urls.py
4
from django.conf.urls import include, url import analytics.views from zerver.lib.rest import rest_dispatch i18n_urlpatterns = [ # Server admin (user_profile.is_staff) visible stats pages url(r'^activity$', analytics.views.get_activity, name='analytics.views.get_activity'), url(r'^activity/support$...
BuildingLink/sentry
refs/heads/master
tests/sentry/interfaces/test_contexts.py
3
# -*- coding: utf-8 -*- from __future__ import absolute_import from sentry.interfaces.contexts import Contexts from sentry.testutils import TestCase class ContextsTest(TestCase): def test_os(self): ctx = Contexts.to_python({ 'os': { 'name': 'Windows', 'versi...
ezpuzz/supysonic
refs/heads/master
api/browse.py
1
# coding: utf-8 # This file is part of Supysonic. # # Supysonic is a Python implementation of the Subsonic server API. # Copyright (C) 2013 Alban 'spl0k' Féron # # 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 F...
mxOBS/deb-pkg_trusty_chromium-browser
refs/heads/master
third_party/scons-2.0.1/engine/SCons/Variables/BoolVariable.py
61
"""engine.SCons.Variables.BoolVariable This file defines the option type for SCons implementing true/false values. Usage example: opts = Variables() opts.Add(BoolVariable('embedded', 'build for an embedded system', 0)) ... if env['embedded'] == 1: ... """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, ...
vatsalparekh/tweet-csv
refs/heads/master
twitter_profile_csv.py
1
import tweepy import csv import webbrowser import time def get_all_tweets(tweepy_user): alltweets = [] screen_name = input( 'Enter the screenname of the profile : @') new_tweets = tweepy_user.user_timeline(screen_name=screen_name, count=200) alltweets.extend(new_tweets) oldest = alltweet...
BehavioralInsightsTeam/edx-platform
refs/heads/release-bit
lms/djangoapps/course_api/blocks/transformers/milestones.py
14
""" Milestones Transformer """ import logging from django.conf import settings from edx_proctoring.api import get_attempt_status_summary from edx_proctoring.exceptions import ProctoredExamNotFoundException from openedx.core.djangoapps.content.block_structure.transformer import ( BlockStructureTransformer, ) from...
sajuptpm/contrail-controller
refs/heads/master
src/config/utils/provision_linklocal.py
10
#!/usr/bin/python # # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # import sys import argparse import ConfigParser from vnc_api.vnc_api import * class MetadataProvisioner(object): def __init__(self, args_str=None): self._args = None if not args_str: args_str = ' '....
alcobar/asuswrt-merlin
refs/heads/master
release/src/router/samba-3.0.25b/source/python/examples/tdbpack/test_tdbpack.py
55
#! /usr/bin/env python2.2 __doc__ = """test case for samba.tdbpack functions tdbpack provides a means of pickling values into binary formats compatible with that used by the samba tdbpack()/tdbunpack() functions. Numbers are always stored in little-endian format; strings are stored in either DOS or Unix codepage as ...
krunal3103/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/html5lib/html5lib/filters/lint.py
979
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 ...
Homeloc/validictory
refs/heads/master
validictory/tests/test_defaults.py
3
from unittest import TestCase import validictory class TestItems(TestCase): def test_property(self): schema = { "type": "object", "properties": { "foo": { "default": "bar" }, "baz": { "type": "...
hmen89/odoo
refs/heads/master
openerp/addons/base/ir/ir_model.py
12
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2014 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
pchrista/AliPhysics
refs/heads/master
PWGJE/EMCALJetTasks/macros/JetQA/plotPWGJEQA.py
27
#! /usr/bin/env python # Macro to plot PWGJE QA histograms, using AliAnalysisTaskPWGJEQA. # # It automatically detects what to plot, based on the content of your analysis output file: # whether to do track/calo/jet/event QA, as well as MC vs. data, PbPb vs. pp, Run1 vs. Run2, Phos vs. no Phos. # # To run: # python...
trungnt13/scikit-learn
refs/heads/master
examples/linear_model/plot_ard.py
248
""" ================================================== Automatic Relevance Determination Regression (ARD) ================================================== Fit regression model with Bayesian Ridge Regression. See :ref:`bayesian_ridge_regression` for more information on the regressor. Compared to the OLS (ordinary l...
marctc/django-blog-zinnia
refs/heads/develop
zinnia/views/mixins/callable_queryset.py
16
"""Callable Queryset mixins for Zinnia views""" from django.core.exceptions import ImproperlyConfigured class CallableQuerysetMixin(object): """ Mixin for handling a callable queryset, which will force the update of the queryset. Related to issue http://code.djangoproject.com/ticket/8378 """ q...
pypot/scikit-learn
refs/heads/master
sklearn/metrics/scorer.py
211
""" The :mod:`sklearn.metrics.scorer` submodule implements a flexible interface for model selection and evaluation using arbitrary score functions. A scorer object is a callable that can be passed to :class:`sklearn.grid_search.GridSearchCV` or :func:`sklearn.cross_validation.cross_val_score` as the ``scoring`` parame...
MotiurRahman/AppTest1
refs/heads/master
modules/android/com.soasta.touchtest/1.0/hooks/add.py
365
#!/usr/bin/env python # # This is the module project add hook that will be # called when your module is added to a project # import os, sys def dequote(s): if s[0:1] == '"': return s[1:-1] return s def main(args,argc): # You will get the following command line arguments # in the following order:...
skipzone/Illumicone
refs/heads/master
simulator/openpixelcontrol/python/miami.py
4
#!/usr/bin/env python """A demo client for Open Pixel Control http://github.com/zestyping/openpixelcontrol Creates moving blobby colors with sparkles on top. To run: First start the gl simulator using, for example, the included "wall" layout make bin/gl_server layouts/wall.json Then run this script in anot...
dushu1203/chromium.src
refs/heads/nw12
third_party/jinja2/nodes.py
623
# -*- coding: utf-8 -*- """ jinja2.nodes ~~~~~~~~~~~~ This module implements additional nodes derived from the ast base node. It also provides some node tree helper functions like `in_lineno` and `get_nodes` used by the parser and translator in order to normalize python and jinja nodes. :...
mrkn/iTerm2
refs/heads/master
tests/esctest/esctypes.py
31
class ChecksumException(Exception): def __init__(self, points, actual, expected): message = "Checksum failed at the following locations:\n%s\nActual:\n%s\n\nExpected:\n%s" % ( "\n".join(map(str, points)), "\n".join(actual), "\n".join(expected)) super(ChecksumException, self).__init__(m...
teichopsia-/take_brake
refs/heads/master
lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.py
1002
# -*- coding: utf-8 -*- # # Copyright (C) 2012 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """Utility functions for copying and archiving files and directory trees. XXX The functions here don't copy the resource fork or other metadata on Mac. """ import os import sys import stat from os...
be-cloud-be/horizon-addons
refs/heads/9.0
server-tools/email_template_template/model/__init__.py
67
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2013 Therp BV (<http://therp.nl>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
proxysh/Safejumper-for-Desktop
refs/heads/master
buildlinux/env64/lib/python2.7/site-packages/twisted/test/test_usage.py
13
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.python.usage}, a command line option parsing library. """ from __future__ import division, absolute_import from twisted.trial import unittest from twisted.python import usage class WellBehaved(usage.Options): optPar...
hgl888/chromium-crosswalk
refs/heads/master
tools/findit/common/http_client.py
74
# Copyright (c) 2014 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. class HttpClient(object): """Represent a http client for sending request to a http[s] server. If cookies need to be sent, they should be in a file p...
jmartinm/invenio-master
refs/heads/master
modules/docextract/lib/refextract_config.py
11
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2005, 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 ## ...
tszym/ansible
refs/heads/devel
lib/ansible/modules/network/panos/panos_nat_policy.py
72
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage PaloAltoNetworks Firewall # (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish...
imuntil/Python
refs/heads/master
L/django-p/mysite/polls/admin.py
1
from django.contrib import admin from .models import Question # Register your models here. admin.site.register(Question)
KrishanBhasin/exercism
refs/heads/master
luhn/luhn.py
1
class Luhn: """ A class to calculate and verify numbers against the Luhn Formula """ def __init__(self, num): self.input = num self.addEndsList = [] def LuhnDouble(self,to_double): """ Handles numbers that exceed 9 during the 'doubling' phase of the Luhn Form...
auready/django
refs/heads/master
django/db/backends/sqlite3/operations.py
2
import datetime import uuid from django.conf import settings from django.core.exceptions import FieldError from django.db import utils from django.db.backends import utils as backend_utils from django.db.backends.base.operations import BaseDatabaseOperations from django.db.models import aggregates, fields from django....
demonchild2112/travis-test
refs/heads/master
grr/server/grr_response_server/flows/__init__.py
240
#!/usr/bin/env python
drxaero/calibre
refs/heads/master
src/calibre/ebooks/lrf/pylrs/elements.py
24
""" elements.py -- replacements and helpers for ElementTree """ class ElementWriter(object): def __init__(self, e, header=False, sourceEncoding="ascii", spaceBeforeClose=True, outputEncodingName="UTF-16"): self.header = header self.e = e self.sourceEncoding=sourceEncoding ...
Fierydemise/ShadowCraft-Engine
refs/heads/legion
shadowcraft/objects/artifact_data.py
1
traits = { ('rogue', 'assassination'): ( 'kingsbane', 'assassins_blades', 'toxic_blades', 'poison_knives', 'urge_to_kill', 'balanced_blades', 'surge_of_toxins', 'shadow_walker', 'master_assassin', 'shadow_swiftness', 'serrated_e...
melund/python-prompt-toolkit
refs/heads/master
examples/get-password.py
3
#!/usr/bin/env python from __future__ import unicode_literals from prompt_toolkit import prompt if __name__ == '__main__': password = prompt('Password: ', is_password=True) print('You said: %s' % password)
chrismeyersfsu/ansible
refs/heads/devel
lib/ansible/modules/cloud/digital_ocean/digital_ocean_sshkey.py
50
#!/usr/bin/python # -*- coding: utf-8 -*- # 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. #...
qwertyjune/BethSaidaBible
refs/heads/master
venv/lib/python2.7/site-packages/django/contrib/gis/admin/options.py
66
from django.contrib.admin import ModelAdmin from django.contrib.gis.admin.widgets import OpenLayersWidget from django.contrib.gis.gdal import OGRGeomType from django.contrib.gis.db import models class GeoModelAdmin(ModelAdmin): """ The administration options class for Geographic models. Map settings may b...
kaday/cylc
refs/heads/master
lib/cylc/task_pool.py
1
#!/usr/bin/env python # THIS FILE IS PART OF THE CYLC SUITE ENGINE. # Copyright (C) 2008-2015 NIWA # # 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 yo...
morenopc/edx-platform
refs/heads/ok-merge-from-master
lms/djangoapps/instructor_task/migrations/0002_add_subtask_field.py
60
# -*- coding: utf-8 -*- import 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 'InstructorTask.subtasks' db.add_column('instructor_task_instructortask', 'subtasks', ...
Statoil/libres
refs/heads/master
test-data/local/snake_oil_structure/snake_oil/jobs/snake_oil_npv.py
9
#!/usr/bin/env python from ecl.summary import EclSum OIL_PRICES = {"2010-01-01": 78.33, "2010-02-01": 76.39, "2010-03-01": 81.20, "2010-04-01": 84.29, "2010-05-01": 73.74, "2010-06-01": 75.34, "2010-07-01": 76.32, "2010-0...
cnoviello/micropython
refs/heads/master
tests/bytecode/mp-tests/import4.py
22
import a as y import a.b as y import a.b.c as y
mvesper/invenio
refs/heads/master
modules/miscutil/lib/upgrades/invenio_2015_03_03_tag_value.py
3
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015 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...
w1ll1am23/home-assistant
refs/heads/dev
homeassistant/util/network.py
5
"""Network utilities.""" from __future__ import annotations from ipaddress import IPv4Address, IPv6Address, ip_address, ip_network import yarl # RFC6890 - IP addresses of loopback interfaces LOOPBACK_NETWORKS = ( ip_network("127.0.0.0/8"), ip_network("::1/128"), ip_network("::ffff:127.0.0.0/104"), ) # R...
atsao72/sympy
refs/heads/master
sympy/physics/quantum/tests/test_grover.py
48
from sympy import sqrt from sympy.physics.quantum.qapply import qapply from sympy.physics.quantum.qubit import IntQubit from sympy.physics.quantum.grover import (apply_grover, superposition_basis, OracleGate, grover_iteration, WGate) def return_one_on_two(qubits): return qubits == IntQubit(2, qubits.nqubi...
ThoughtWorksInc/treadmill
refs/heads/master
treadmill/plugins.ref/api/authz.py
3
"""Authorization plugin.""" # Disable E0611: No 'name' in module from treadmill import authz # pylint: disable=E0611 class _Authorizer(object): """Authorizer.""" def __init__(self, user_clbk): pass def authorize(self, resource, action, args, _kwargs): """Authorize user/resource/action....
qrkourier/ansible
refs/heads/devel
test/units/modules/network/junos/test_junos_config.py
36
# # (c) 2017 Red Hat Inc. # # 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 d...
dcosentino/edx-platform
refs/heads/master
cms/djangoapps/contentstore/views/tests/test_checklists.py
42
""" Unit tests for checklist methods in views.py. """ from contentstore.utils import reverse_course_url from contentstore.views.checklist import expand_checklist_action_url from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.django import modulestore import json from contentstore.tes...
dreamsxin/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/idlelib/configHelpSourceEdit.py
82
"Dialog to specify or edit the parameters for a user configured help source." import os import sys from tkinter import * import tkinter.messagebox as tkMessageBox import tkinter.filedialog as tkFileDialog class GetHelpSourceDialog(Toplevel): def __init__(self, parent, title, menuItem='', filePath='', _htest=Fals...
GreenRecycleBin/servo
refs/heads/master
tests/wpt/css-tests/tools/pywebsocket/src/example/abort_wsh.py
465
# Copyright 2012, 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 f...
PredictiveScienceLab/py-orthpol
refs/heads/master
demos/demo7.py
2
""" Generate the Legendre polynomials using a scipy.stats random variable. This particular demo generates the Legendre polynomials. This demo demonstrates how to: + Construct a set of orthogonal univariate polynomials given a scipy.stats random variable. + Examine certain properties of a univariate polyn...
huihoo/reader
refs/heads/master
apps/rss_feeds/migrations/0043_favicon_color.py
18
# encoding: utf-8 import 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 'Feed.favicon_color' db.add_column('feeds', 'favicon_color', self.gf('django.db.models.fiel...