repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
modulexcite/catapult
refs/heads/master
perf_insights/perf_insights/corpus_driver.py
5
# Copyright (c) 2015 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 sys class CorpusDriver(object): def GetTraceHandlesMatchingQuery(self, query): raise NotImplementedError()
tashaxe/Red-DiscordBot
refs/heads/develop
lib/requests/packages/urllib3/util/response.py
316
from __future__ import absolute_import from ..packages.six.moves import http_client as httplib from ..exceptions import HeaderParsingError def is_fp_closed(obj): """ Checks whether a given file-like object is closed. :param obj: The file-like object to check. """ try: # Check `i...
Team-Hydra/sultan-kernel-pyramid-pure-3.4
refs/heads/cm-11.0
scripts/gcc-wrapper.py
501
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, Code Aurora Forum. 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 a...
jyotikamboj/container
refs/heads/master
dj-tests/utils_tests/test_simplelazyobject.py
434
from __future__ import unicode_literals import pickle from django.contrib.auth.models import User from django.test import TestCase from django.utils import six from django.utils.functional import SimpleLazyObject class TestUtilsSimpleLazyObjectDjangoTestCase(TestCase): def test_pickle_py2_regression(self): ...
DavidMcDonald1993/ghsom
refs/heads/master
spearmint/spearmint/kernels/sum_kernel.py
2
# -*- coding: utf-8 -*- # Spearmint # # Academic and Non-Commercial Research Use Software License and Terms # of Use # # Spearmint is a software package to perform Bayesian optimization # according to specific algorithms (the “Software”). The Software is # designed to automatically run experiments (thus the code name ...
SamHames/scikit-image
refs/heads/master
viewer_examples/plugins/canny_simple.py
1
from skimage import data from skimage.filter import canny from skimage.viewer import ImageViewer from skimage.viewer.widgets import Slider from skimage.viewer.widgets.history import SaveButtons from skimage.viewer.plugins.overlayplugin import OverlayPlugin image = data.camera() # You can create a UI for a filter ju...
reinout/ansible
refs/heads/devel
test/units/mock/loader.py
72
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
goodwinos/sos
refs/heads/master
sos/plugins/hts.py
5
# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but...
KMK-ONLINE/ansible
refs/heads/devel
lib/ansible/plugins/lookup/ini.py
9
# (c) 2015, Yannig Perre <yannig.perre(at)gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any late...
ProjectSWGCore/NGECore2
refs/heads/master
scripts/skillMods/expertise_area_size_line_trap.py
1156
import sys def add(core, actor, skillMod, value): return def deduct(core, actor, skillMod, value): return
svisser/ipuz
refs/heads/master
ipuz/structures/stylespec.py
1
import string from ipuz.exceptions import IPUZException from ipuz.validators import validate_string def validate_stylespec_shapebg(field_data): return field_data in ["circle"] def validate_stylespec_highlight(field_data): return isinstance(field_data, bool) def validate_stylespec_named(field_data): r...
Balannen/LSMASOMM
refs/heads/master
atom3/Formalisms/LSMASOMM/hasObjective.py
1
""" __hasObjective.py_____________________________________________________ Automatically generated AToM3 syntactic object (DO NOT MODIFY DIRECTLY) Author: bogdan Modified: Sat Apr 14 23:09:41 2018 ______________________________________________________________________ """ from ASGNode import * from ATOM3Type import * ...
proxysh/Safejumper-for-Desktop
refs/heads/master
buildmac/Resources/env/lib/python2.7/site-packages/Crypto/SelfTest/Signature/__init__.py
116
# -*- coding: utf-8 -*- # # SelfTest/Signature/__init__.py: Self-test for signature modules # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is grant...
roboime/pyroboime
refs/heads/master
roboime/core/skills/fishingrod.py
1
# # Copyright (C) 2013-2015 RoboIME # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distrib...
fumen/gae-fumen
refs/heads/master
lib/requests/packages/chardet/escsm.py
2929
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
crackhopper/TFS-toolbox
refs/heads/master
tfs/dataset/data_tool.py
1
import numpy as np import tensorflow as tf def isclose(a, b, rel_tol=1e-09, abs_tol=0.0): return abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol) def check_exist_raise(filenames): for f in filenames: if not tf.gfile.Exists(f): raise ValueError('Failed to find file: ' + f) def check_exist(filen...
wbwseeker/spaCy
refs/heads/master
spacy/tests/vectors/test_vectors.py
5
import pytest @pytest.mark.models def test_token_vector(EN): token = EN(u'Apples and oranges')[0] token.vector token.vector_norm @pytest.mark.models def test_lexeme_vector(EN): lexeme = EN.vocab[u'apples'] lexeme.vector lexeme.vector_norm @pytest.mark.models def test_doc_vector(EN): doc ...
crosswalk-project/chromium-crosswalk-efl
refs/heads/efl/crosswalk-10/39.0.2171.19
tools/telemetry/telemetry/core/wpr_modes.py
32
# Copyright 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. WPR_OFF = 'wpr-off' WPR_RECORD = 'wpr-record' WPR_REPLAY = 'wpr-replay'
IBMPredictiveAnalytics/Gradient_Boosted_Trees_with_MLlib
refs/heads/master
src/gb_tree_score.py
1
script_details = ("gb_tree_score.py",0.5) # COMMON SECTION VERSION 0.7 from pyspark.context import SparkContext from pyspark.sql.context import SQLContext from pyspark import AccumulatorParam from pyspark.mllib.regression import LabeledPoint from pyspark.mllib.linalg import DenseVector import time import sys import os...
google/tensorstore
refs/heads/master
python/tensorstore/tests/bfloat16_test.py
1
# Copyright 2021 The TensorStore Authors # # 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...
10clouds/edx-platform
refs/heads/dev
cms/djangoapps/contentstore/management/commands/prompt.py
204
import sys def query_yes_no(question, default="yes"): """Ask a yes/no question via raw_input() and return their answer. "question" is a string that is presented to the user. "default" is the presumed answer if the user just hits <Enter>. It must be "yes" (the default), "no" or None (meaning ...
ektor5/Arduino
refs/heads/udoo3.14
arduino-core/src/processing/app/i18n/python/requests/packages/charade/sbcsgroupprober.py
2935
######################## 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...
bitmazk/django-rapid-prototyping
refs/heads/master
rapid_prototyping/views.py
1
"""Views for the rapid_prototyping app.""" from django.views.generic import TemplateView from .context.utils import get_sprints class SprintListView(TemplateView): template_name = 'rapid_prototyping/sprints.html' def dispatch(self, request, *args, **kwargs): self.request = request return sup...
mehdy/flactory
refs/heads/master
setup.py
1
""" This module :copyright: (c) 2016 by Mehdy Khoshnoody. :license: GPLv3, see LICENSE for more details. """ import os from distutils.core import setup setup( name='flactory', version='0.2.0', packages=['flactory'], install_requires=[ 'click', 'jinja2' ], classi...
moble/sympy
refs/heads/master
sympy/interactive/tests/test_interactive.py
124
import sys from sympy.interactive.session import int_to_Integer def test_int_to_Integer(): assert int_to_Integer("1 + 2.2 + 0x3 + 40") == \ 'Integer (1 )+2.2 +Integer (0x3 )+Integer (40 )' if sys.version_info[0] == 2: assert int_to_Integer("1l") == 'Integer (1l )' assert int_to_Integer("0...
Lilywei123/tempest
refs/heads/master
tempest/api/compute/admin/test_instance_usage_audit_log.py
5
# Copyright 2013 IBM Corporation # 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 ...
andrewleech/pydio-sync
refs/heads/master
src/pydio/job/change_processor.py
1
# # Copyright 2007-2014 Charles du Jeu - Abstrium SAS <team (at) pyd.io> # This file is part of Pydio. # # Pydio 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...
michelts/lettuce
refs/heads/master
tests/integration/lib/Django-1.2.5/tests/regressiontests/context_processors/tests.py
50
""" Tests for Django's bundled context processors. """ from django.conf import settings from django.contrib.auth import authenticate from django.db.models import Q from django.test import TestCase from django.template import Template class RequestContextProcessorTests(TestCase): """ Tests for the ``django.cor...
samthor/intellij-community
refs/heads/master
python/testData/codeInsight/smartEnter/py3209.py
83
@classmethod def func(arg<caret>
henryfjordan/django
refs/heads/master
django/db/migrations/operations/fields.py
362
from __future__ import unicode_literals from django.db.models.fields import NOT_PROVIDED from django.utils import six from django.utils.functional import cached_property from .base import Operation class AddField(Operation): """ Adds a field to a model. """ def __init__(self, model_name, name, fiel...
Jusedawg/SickRage
refs/heads/develop
lib/hachoir_parser/parser.py
95
import hachoir_core.config as config from hachoir_core.field import Parser as GenericParser from hachoir_core.error import HACHOIR_ERRORS, HachoirError, error from hachoir_core.tools import makeUnicode from hachoir_core.i18n import _ from inspect import getmro class ValidateError(HachoirError): pass class Hachoi...
evildmp/django-cms
refs/heads/master
cms/publisher/errors.py
61
# -*- coding: utf-8 -*- class PublisherCantPublish(Exception): """Publisher can not publish instance, because there is something wrong"""
ttalviste/aima
refs/heads/master
aima/rl.py
2
"""Reinforcement Learning (Chapter 21) """ from utils import * import agents class PassiveADPAgent(agents.Agent): """Passive (non-learning) agent that uses adaptive dynamic programming on a given MDP and policy. [Fig. 21.2]""" NotImplemented class PassiveTDAgent(agents.Agent): """Passive (non-learnin...
jorik041/scikit-learn
refs/heads/master
sklearn/svm/base.py
28
from __future__ import print_function import numpy as np import scipy.sparse as sp import warnings from abc import ABCMeta, abstractmethod from . import libsvm, liblinear from . import libsvm_sparse from ..base import BaseEstimator, ClassifierMixin, ChangedBehaviorWarning from ..preprocessing import LabelEncoder from...
lishensan/xbmc
refs/heads/master
lib/libUPnP/Neptune/Build/Targets/x86-microsoft-win32-vs2010/Build.py
198
#! /usr/bin/env python """ Visual Studio 2010 Build Script $Id: Build.py 309 2011-09-21 05:44:28Z soothe $ """ import os import sys import getopt import subprocess # Setup some path stuff try: if environ['VISUALSTUDIO_BIN']: VSBINDIR = environ['VISUALSTUDIO_BIN'] except NameError: # Use default val...
ssdxiao/kimchi
refs/heads/master
src/kimchi/control/utils.py
1
# # Project Kimchi # # Copyright IBM, Corp. 2013 # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This lib...
numba/numba
refs/heads/master
numba/tests/test_pycc.py
3
import contextlib import imp import os import shutil import subprocess import sys import tempfile from unittest import skip from ctypes import * import numpy as np import llvmlite.binding as ll from numba.core import utils from numba.pycc import main from numba.pycc.decorators import clear_export_registry from numba...
farodin91/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/py/py/_io/saferepr.py
273
import py import sys builtin_repr = repr reprlib = py.builtin._tryimport('repr', 'reprlib') class SafeRepr(reprlib.Repr): """ subclass of repr.Repr that limits the resulting size of repr() and includes information on exceptions raised during the call. """ def repr(self, x): return self._c...
rackerlabs/kazoo
refs/heads/master
kazoo/handlers/gevent.py
36
"""A gevent based handler.""" from __future__ import absolute_import import atexit import logging import gevent import gevent.event import gevent.queue import gevent.select import gevent.thread from gevent.queue import Empty from gevent.queue import Queue from gevent import socket try: from gevent.lock import Se...
syci/OCB
refs/heads/9.0
addons/project/tests/test_project_base.py
44
# -*- coding: utf-8 -*- from openerp.addons.mail.tests.common import TestMail class TestProjectBase(TestMail): @classmethod def setUpClass(cls): super(TestProjectBase, cls).setUpClass() user_group_employee = cls.env.ref('base.group_user') user_group_project_user = cls.env.ref('proje...
stuporglue/solar_scripts
refs/heads/master
dbconn_quick.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # Version of dbconn that only quickly connects to run a query then disconnects # Psycopg2 Windows Binaries: http://www.stickpeople.com/projects/python/win-psycopg/ # You probably want the version for Python 2.7 32 bit which is what's distributed with Arc 10.2 from config...
dcbdmb/example-code
refs/heads/master
attic/operator/vector.py
7
""" The `+` operator produces a `Vector` result. >>> v1 = Vector(2, 4) >>> v2 = Vector(2, 1) >>> v1 + v2 Vector(4, 5) We can also implemement the `*` operator to perform scalar multiplication or elementwise multiplication. >>> v = Vector(3, 4) >>> abs(v) 5.0 >>> v * 3 Vector(9, 1...
mila-labs/django-pipeline-compass-rubygem
refs/heads/master
pipeline_compass/compass.py
1
from os.path import dirname from django.conf import settings from pipeline.compilers import SubProcessCompiler class CompassCompiler(SubProcessCompiler): output_extension = 'css' def match_file(self, filename): return filename.endswith(('.scss', '.sass')) def compile_file(self, infile, outfile, ...
aimas/TuniErp-8.0
refs/heads/master
addons/report_webkit/company.py
431
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com) # All Right Reserved # # Author : Nicolas Bessi (Camptocamp) # # WARNING: This program as such is intended to be used by professional # programmers who...
kennedyshead/home-assistant
refs/heads/dev
tests/components/zodiac/test_sensor.py
8
"""The test for the zodiac sensor platform.""" from datetime import datetime from unittest.mock import patch import pytest from homeassistant.components.zodiac.const import ( ATTR_ELEMENT, ATTR_MODALITY, DOMAIN, ELEMENT_EARTH, ELEMENT_FIRE, ELEMENT_WATER, MODALITY_CARDINAL, MODALITY_FI...
jxta/cc
refs/heads/master
vendor/Twisted-10.0.0/twisted/spread/banana.py
59
# -*- test-case-name: twisted.test.test_banana -*- # Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Banana -- s-exp based protocol. Future Plans: This module is almost entirely stable. The same caveat applies to it as applies to L{twisted.spread.jelly}, however. Read its future ...
bob123bob/Sick-Beard
refs/heads/development
lib/hachoir_parser/audio/mpeg_audio.py
90
""" MPEG audio file parser. Creation: 12 decembre 2005 Author: Victor Stinner """ from lib.hachoir_parser import Parser from lib.hachoir_core.field import (FieldSet, MissingField, ParserError, createOrphanField, Bit, Bits, Enum, PaddingBits, PaddingBytes, RawBytes) from lib.hachoir_parser.audio.id3 im...
numpy/datetime
refs/heads/main
numpy/numarray/setup.py
41
from os.path import join def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('numarray',parent_package,top_path) config.add_data_files('include/numpy/*') config.add_extension('_capi', sources=['_capi.c...
hbrunn/OpenUpgrade
refs/heads/master
addons/website_hr/controllers/main.py
28
# -*- coding: utf-8 -*- from openerp.addons.web import http from openerp.addons.web.http import request class website_hr(http.Controller): @http.route(['/page/website.aboutus', '/page/aboutus'], type='http', auth="public", website=True) def blog(self, **post): hr_obj = request.registry['hr.employee']...
julen/babel
refs/heads/master
babel/localtime/_win32.py
114
try: import _winreg as winreg except ImportError: try: import winreg except ImportError: winreg = None from babel.core import get_global import pytz # When building the cldr data on windows this module gets imported. # Because at that point there is no global.dat yet this call will # fail...
edwardgeorge/eventlet_x
refs/heads/master
eventlet/twistedutil/join_reactor.py
14
"""Integrate eventlet with twisted's reactor mainloop. You generally don't have to use it unless you need to call reactor.run() yourself. """ from eventlet.hubs.twistedr import BaseTwistedHub from eventlet.support import greenlets as greenlet from eventlet.hubs import _threadlocal, use_hub use_hub(BaseTwistedHub) ass...
optima-ict/odoo
refs/heads/9.0
addons/website_sale_digital/__init__.py
54
# -*- encoding: utf-8 -*- import controllers import product import account_invoice
camptocamp/mapproxy
refs/heads/master
mapproxy/cache/legend.py
8
# This file is part of the MapProxy project. # Copyright (C) 2010 Omniscale <http://omniscale.de> # # 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...
tshawebdev/vkfeed
refs/heads/master
vkfeed/pages/not_found.py
16
# -*- coding: utf-8 -*- '''Generates "404 - Page Not Found" page.''' from __future__ import unicode_literals import httplib import webapp2 import vkfeed.utils class NotFoundPage(webapp2.RequestHandler): '''Generates "404 - Page Not Found" page.''' def get(self): '''Processes the request.''' ...
ryannathans/micropython
refs/heads/master
tests/basics/string_format_modulo_int.py
28
# test string modulo formatting with int values # basic cases print("%d" % 10) print("%+d" % 10) print("% d" % 10) print("%d" % -10) print("%d" % True) print("%i" % -10) print("%i" % True) print("%u" % -10) print("%u" % True) print("%x" % 18) print("%o" % 18) print("%X" % 18) print("%#x" % 18) print("%#X" % 18) print(...
mistercrunch/airflow
refs/heads/master
docs/exts/providers_packages_ref.py
7
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
Zouyiran/ryu
refs/heads/master
ryu/lib/packet/vrrp.py
23
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2013 Isaku Yamahata <yamahata at private email ne jp> # # 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 # # h...
zerobatu/edx-platform
refs/heads/master
openedx/core/djangoapps/credit/tests/test_services.py
7
""" Tests for the Credit xBlock service """ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory from openedx.core.djangoapps.credit.services import CreditService from openedx.core.djangoapps.credit.models import CreditCourse from openedx...
cogeorg/black_rhino
refs/heads/master
tools/br-generate_banks.py
2
#!/usr/bin/env python # [SublimeLinter pep8-max-line-length:300] """ black_rhino is a multi-agent simulator for financial network analysis Copyright (C) 2012 Co-Pierre Georg (co-pierre.georg@keble.ox.ac.uk) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Publi...
Learningtribes/edx-platform
refs/heads/master
lms/djangoapps/mobile_api/migrations/0002_auto_20160406_0904.py
53
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('mobile_api', '0001_initial'), ] operations = [ migrations.CreateModel( name='AppVersionConfig', fiel...
timabbott/zulip
refs/heads/master
zerver/webhooks/zapier/tests.py
4
from zerver.lib.test_classes import WebhookTestCase class ZapierHookTests(WebhookTestCase): STREAM_NAME = 'zapier' URL_TEMPLATE = "/api/v1/external/zapier?stream={stream}&api_key={api_key}" FIXTURE_DIR_NAME = 'zapier' def test_zapier_when_subject_and_body_are_correct(self) -> None: expected_t...
Splawik/pytigon
refs/heads/master
pytigon/prj/_schtools/schlog/urls.py
1
## -- coding: utf-8 -- from django.urls import path, re_path, include from django.utils.translation import ugettext_lazy as _ from pytigon_lib.schviews import generic_table_start, gen_tab_action, gen_row_action from django.views.generic import TemplateView from . import views urlpatterns = [ ] gen = ...
dreilly369/ggp_arena
refs/heads/master
ggp-base/src_py/external/JythonConsole/history.py
9
""" history.py - Handles the History of the jython console Copyright (C) 2001 Carlos Quiroz This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version...
Batterfii/django
refs/heads/master
django/conf/locale/pt/formats.py
504
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'j \d\e F \d\e Y' TIME_FORMAT = '...
Adai0808/scikit-learn
refs/heads/master
examples/classification/plot_lda_qda.py
164
""" ==================================================================== Linear and Quadratic Discriminant Analysis with confidence ellipsoid ==================================================================== Plot the confidence ellipsoids of each class and decision boundary """ print(__doc__) from scipy import lin...
plotly/python-api
refs/heads/master
packages/python/plotly/plotly/validators/ohlc/decreasing/line/_dash.py
1
import _plotly_utils.basevalidators class DashValidator(_plotly_utils.basevalidators.DashValidator): def __init__( self, plotly_name="dash", parent_name="ohlc.decreasing.line", **kwargs ): super(DashValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_...
GheRivero/ansible
refs/heads/devel
test/units/modules/network/f5/test_bigip_device_ntp.py
23
# -*- coding: utf-8 -*- # # Copyright (c) 2017 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 sys from nose.plugins.skip import SkipTest i...
agreen/scrapy
refs/heads/master
tests/test_spiderstate.py
113
import os from datetime import datetime from twisted.trial import unittest from scrapy.extensions.spiderstate import SpiderState from scrapy.spiders import Spider class SpiderStateTest(unittest.TestCase): def test_store_load(self): jobdir = self.mktemp() os.mkdir(jobdir) spider = Spider(...
getweber/weber-cli
refs/heads/master
cob/pytest_plugin.py
2
import pytest from cob.app import build_app from cob.project import is_cob_project from cob.utils.unittests import Webapp @pytest.yield_fixture def webapp(request): # pylint: disable=unused-argument with Webapp() as _webapp, _webapp.app.app_context(): yield _webapp def pytest_configure(config): # pyli...
extremenetworks/xkit
refs/heads/master
SLXOS/SLX_ifIndex_gen/build/lib/Slx9150_IfIndex.py
2
#!/usr/bin/python3 import re from SLX_BitMap import BitMap from SLX_IntfTypeMap import IntfTypeMap from SLX_TunnelTypeMap import TunnelTypeMap from SLXRSpeedMap import SLXRSpeedMap from SLXSSpeedMap import SLXSSpeedMap from SLX_PortData import PortData from SLX_PortMapping import PortMapping from IfIndex import IfIndex...
azureplus/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/django/db/backends/sqlite3/client.py
635
import os import sys from django.db.backends import BaseDatabaseClient class DatabaseClient(BaseDatabaseClient): executable_name = 'sqlite3' def runshell(self): args = [self.executable_name, self.connection.settings_dict['NAME']] if os.name == 'nt': sys.exit(os.sys...
rafaelvasco/SpriteMator
refs/heads/master
src/model/inks.py
1
# ------------------------------------------------------------------------------------------------- # Name: Inks # Purpose: Inks module used by Canvas. An Ink is a visual representation of a tool acting # on the Canvas # Author: Rafael Vasco # # Created: 28/04/13 # Copyright: (c) Rafa...
mohamedhagag/community-addons
refs/heads/8.0
openeducat_erp/op_division/op_division.py
1
# -*- coding: utf-8 -*- ############################################################################### # # Tech-Receptives Solutions Pvt. Ltd. # Copyright (C) 2009-TODAY Tech-Receptives(<http://www.techreceptives.com>). # # This program is free software: you can redistribute it and/or modify # it under the...
porcobosso/spark-ec2
refs/heads/master
lib/boto-2.34.0/boto/sdb/__init__.py
131
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # 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, modi...
gsmartway/odoo
refs/heads/8.0
addons/website_event_sale/controllers/__init__.py
2262
import main
digideskio/ajenti
refs/heads/master
ajenti/plugins/dashboard/main.py
17
import platform from ajenti.com import Interface from ajenti.ui import UI from ajenti.utils import detect_distro, detect_platform from ajenti.api import * from ajenti import apis class Dashboard(CategoryPlugin): text = 'Dashboard' icon = '/dl/dashboard/icon.png' folder = 'top' def on_session_start(s...
ctgiant/litedoge---DO-NOT-USE
refs/heads/master
contrib/wallettools/walletchangepass.py
2299
from jsonrpc import ServiceProxy access = ServiceProxy("http://127.0.0.1:8332") pwd = raw_input("Enter old wallet passphrase: ") pwd2 = raw_input("Enter new wallet passphrase: ") access.walletpassphrasechange(pwd, pwd2)
Harry-R/skylines
refs/heads/master
skylines/commands/server.py
5
from flask_script import Server as BaseServer from skylines.app import create_combined_app, create_api_app class Server(BaseServer): def handle(self, app, *args, **kw): app = create_combined_app() super(Server, self).handle(app, *args, **kw) class APIServer(BaseServer): def handle(self, app,...
GageGaskins/osf.io
refs/heads/develop
api/applications/urls.py
36
from django.conf.urls import url from api.applications import views urlpatterns = [ url(r'^$', views.ApplicationList.as_view(), name=views.ApplicationList.view_name), url(r'^(?P<client_id>\w+)/$', views.ApplicationDetail.as_view(), name=views.ApplicationDetail.view_name), url(r'^(?P<client_id>\w+)/reset/$...
shfengcj/pyminer
refs/heads/master
pyminer_cos_model.py
1
# -*- coding: utf-8 -*- """ Created on Fri Jun 19 15:28:10 2015 @author: chaojun """ #=============================================================================== """ cosmological model data struct """ #=============================================================================== ""...
nwjs/chromium.src
refs/heads/nw45-log
third_party/tlslite/tlslite/integration/xmlrpctransport.py
113
# Authors: # Trevor Perrin # Kees Bos - Fixes for compatibility with different Python versions # Martin von Loewis - python 3 port # # See the LICENSE file for legal information regarding use of this file. """TLS Lite + xmlrpclib.""" try: import xmlrpclib import httplib except ImportError: # Pytho...
xiangel/hue
refs/heads/master
desktop/core/src/desktop/lib/thrift_sasl.py
37
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use...
saurabh6790/med_new_app
refs/heads/develop
hr/doctype/appraisal_template/appraisal_template.py
30
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import webnotes from webnotes import _ class DocType: def __init__(self, d, dl): self.doc, self.doclist = d, dl def validate(self): self.do...
liorvh/infernal-twin
refs/heads/master
build/pillow/build/lib.linux-i686-2.7/PIL/ImageCms.py
31
# The Python Imaging Library. # $Id$ # Optional color managment support, based on Kevin Cazabon's PyCMS # library. # History: # 2009-03-08 fl Added to PIL. # Copyright (C) 2002-2003 Kevin Cazabon # Copyright (c) 2009 by Fredrik Lundh # Copyright (c) 2013 by Eric Soroos # See the README file for information on us...
domob1812/huntercore
refs/heads/master
test/functional/name_reorg.py
2
#!/usr/bin/env python3 # Copyright (c) 2014-2017 Daniel Kraft # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Test that reorgs (undoing) work for names. This also checks that # cleaning the mempool with respect to conflicti...
tonyqtian/quora-simi
refs/heads/master
test/kg_xgb_mgf.py
1
import argparse import functools from collections import defaultdict import time # from util.utils import mkdir import numpy as np import pandas as pd import xgboost as xgb from nltk.corpus import stopwords from collections import Counter from sklearn.metrics import log_loss # from sklearn.cross_validati...
zhangzhonglai/heron
refs/heads/master
heron/common/tests/python/pex_loader/testdata/src/sample.py
10
# Copyright 2016 Twitter. 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 agree...
facilecoin/facilecoin-core
refs/heads/master
qa/rpc-tests/receivedby.py
1
#!/usr/bin/env python2 # Copyright (c) 2014 The FacileCoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Exercise the listreceivedbyaddress API from test_framework import FacileCoinTestFramework from facilecoi...
nickdex/cosmos
refs/heads/master
code/online_challenges/src/project_euler/problem_003/problem_003.py
3
def main(): n = 600851475143 h = 0 c = 2 while n != 1: if n % c == 0 and c > h: h = c n /= c c += 1 print(h) if __name__ == "__main__": main()
freedomtan/tensorflow
refs/heads/master
tensorflow/python/framework/proto_test.py
177
# 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...
mpe/powerpc
refs/heads/master
tools/testing/kunit/kunit_kernel.py
16
# SPDX-License-Identifier: GPL-2.0 # # Runs UML kernel, collects output, and handles errors. # # Copyright (C) 2019, Google LLC. # Author: Felix Guo <felixguoxiuping@gmail.com> # Author: Brendan Higgins <brendanhiggins@google.com> import logging import subprocess import os import kunit_config KCONFIG_PATH = '.confi...
mlperf/training_results_v0.7
refs/heads/master
Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/python/mxnet/tvmop.py
12
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
xhair/TopOdoo_Addons
refs/heads/master
ToproERP_WeChat_GLD/__init__.py
1
# -*- coding: utf-8 -*- # © <2016> <ToproERP liujing> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). import controllers
jobli/24
refs/heads/master
hour13-a.py
1
from random import random tested = 0 while True: number = random() test_number = raw_input("Test random number? [y/n] ") if test_number == "y": print number tested = tested + 1 print tested if test_number == "n": print "Total times of testing = " "{}".format(tested) ...
vmihailenco/fabdeploy
refs/heads/master
fabdeploy/supervisor.py
1
import re import posixpath from fabric.api import cd, run, sudo, settings from fabric.contrib import files from . import pip from .containers import conf from .task import Task as BaseTask from .utils import upload_config_template, upload_init_template __all__ = [ 'install', 'push_init_config', 'start',...
cjaniake/ionicweb
refs/heads/master
webapp/ionic/lib/python2.7/site-packages/setuptools/lib2to3_ex.py
907
""" Customized Mixin2to3 support: - adds support for converting doctests This module raises an ImportError on Python 2. """ from distutils.util import Mixin2to3 as _Mixin2to3 from distutils import log from lib2to3.refactor import RefactoringTool, get_fixers_from_package import setuptools class DistutilsRefactorin...
jeremiah-c-leary/vhdl-style-guide
refs/heads/master
vsg/vhdlFile/classify/package_instantiation_declaration.py
1
from vsg.token import package_instantiation_declaration as token from vsg.vhdlFile import utils from vsg.vhdlFile.classify import generic_map_aspect from vsg.vhdlFile.classify import identifier def detect(iToken, lObjects): ''' package_instantiation_declaration ::= package identifier is new *uninst...
jaytlennon/Emergence
refs/heads/master
tools/DiversityTools/macroeco_distributions/macroeco_distributions.py
11
"""Probability and Likelihood Functions for Distribution Testing Probability distributions Poisson lognormal distribution Upper truncated logseries distribution Lower truncated exponential distribution Lower truncated Pareto (power) distribution Lower truncated Weibull distribution Upper trunca...
navotsil/Open-Knesset
refs/heads/master
video/migrations/0004_add_sticky_hide_fields.py
14
# 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 'Video.sticky' db.add_column('video_video', 'sticky', self.gf('django.db.models.fields.Bool...
titansgroup/python-phonenumbers
refs/heads/dev
python/phonenumbers/data/region_YT.py
8
"""Auto-generated file, do not edit by hand. YT metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_YT = PhoneMetadata(id='YT', country_code=262, international_prefix='00', general_desc=PhoneNumberDesc(national_number_pattern='[268]\\d{8}', possible_number_pattern='\...