repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
MichSchli/QuestionAnsweringGCN
refs/heads/master
models/tensorflow_components/loss_functions/__init__.py
12133432
vladmm/intellij-community
refs/heads/master
python/testData/addImport/newFirstImportInProjectGroupWithExistingBlankLineAbove/a.py
12133432
ximion/dak
refs/heads/master
daklib/architecture.py
5
"""architecture matching @copyright: 2014, Ansgar Burchardt <ansgar@debian.org> @license: GPL-2+ """ # 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 y...
shead-custom-design/pipecat
refs/heads/master
features/steps/common.py
1
# Copyright 2016 Timothy M. Shead # # This file is part of Pipecat. # # Pipecat 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. # # Pip...
starlightme/python
refs/heads/master
renzongxian/0024/mysite/todolist/__init__.py
12133432
takesxi-shimada/livehousemap
refs/heads/master
livehousemap/livehouse/models.py
1
from django.db.models import ( Model, ManyToManyField, ) from django.db.models.fields import ( CharField, FloatField, ) # Create your models here. class House(Model): name = CharField(max_length=1024) lat = FloatField() lon = FloatField() def __unicode__(self): retu...
Donkyhotay/MoonPy
refs/heads/master
twisted/names/test/test_srvconnect.py
53
# Copyright (c) 2007-2009 Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for L{twisted.names.srvconnect}. """ from twisted.internet import defer, protocol from twisted.names import client, dns, srvconnect from twisted.names.common import ResolverBase from twisted.names.error import DNSNameErro...
blrm/openshift-tools
refs/heads/stg
openshift_tools/monitoring/hawk_sender.py
13
#!/usr/bin/env python # vim: expandtab:tabstop=4:shiftwidth=4 """ Collect metrics and send metrics to Hawk. The data being sent to Hawk is done using REST API using the HawkClient module Examples: from openshift_tools.monitoring.hawk_common import HawkConnection, HawkHeartbeat from openshift_tools.monitoring...
Gimpneek/exclusive-raid-gym-tracker
refs/heads/master
app/tests/api/personalised/profile_resource/profile_common.py
1
from app.tests.api.api_common import APICommonCase class ProfileCommonCase(APICommonCase): """ Set up the tests for the Profile endpoint """ def setUp(self): """ Set up the tests """ super(ProfileCommonCase, self).setUp() self.url = '/api/v1/me/'
volodymyrss/3ML
refs/heads/master
threeML/io/plotting/data_residual_plot.py
1
import matplotlib.pyplot as plt from matplotlib.ticker import MaxNLocator import numpy as np from threeML.io.plotting.step_plot import step_plot from threeML.config.config import threeML_config from threeML.exceptions.custom_exceptions import custom_warnings class ResidualPlot(object): def __init__(self,**kwarg...
jfpla/odoo
refs/heads/8.0
addons/warning/__openerp__.py
261
# -*- 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...
AlecAivazis/nautilus
refs/heads/master
nautilus/management/util/__init__.py
2
from .render_template import render_template
lucafavatella/intellij-community
refs/heads/cli-wip
python/lib/Lib/site-packages/django/contrib/auth/models.py
71
import datetime import urllib from django.contrib import auth from django.contrib.auth.signals import user_logged_in from django.core.exceptions import ImproperlyConfigured from django.db import models from django.db.models.manager import EmptyManager from django.contrib.contenttypes.models import ContentType from dja...
Xion/taipan
refs/heads/master
tests/test_api/test_properties.py
1
""" Tests for .api.properties module. """ from taipan.testing import TestCase import taipan.api.properties as __unit__ class _Property(TestCase): VALUE = 42 class ObjectProperty(_Property): def test_none(self): with self.assertRaises(TypeError): __unit__.objectproperty(None) def t...
openpathsampling/openpathsampling
refs/heads/master
openpathsampling/tests/test_storage.py
3
""" @author David W.H. Swenson @author Jan-Hendrik Prinz """ from __future__ import absolute_import from builtins import zip from builtins import range from builtins import object import os import pytest from nose.tools import (assert_equal) import openpathsampling as paths import openpathsampling.engines.openmm as...
jaysuk/Printrun
refs/heads/master
printrun/gui/bufferedcanvas.py
4
""" BufferedCanvas -- flicker-free canvas widget Copyright (C) 2005, 2006 Daniel Keep, 2011 Duane Johnson To use this widget, just override or replace the draw method. This will be called whenever the widget size changes, or when the update method is explicitly called. Please submit any improvements/bugfixes/ideas to...
ProgVal/Limnoria-test
refs/heads/debug-pypy-sqlite
plugins/Alias/config.py
6
### # Copyright (c) 2005, Jeremiah Fincher # 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 conditi...
OmgOhnoes/Flexget
refs/heads/develop
flexget/plugins/sites/rlsbb.py
5
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import logging import re from flexget import plugin from flexget.event import event from flexget.plugins.internal.urlrewriting import UrlRewritingError from flexget.utils....
glorion13/TextEngine
refs/heads/master
src/core/components/customisable/effects.py
5
""" Copyright (c) 2013 ICRL See the file license.txt for copying permission. """ class EffectFunctions: """ This class contains all the customisable functions which are used to represent the output of an action e.g. go to another scene or give information to the player. The `effectDict` container is a dict...
zieckey/sdhash
refs/heads/master
external/tools/build/v2/util/utility.py
49
# (C) Copyright David Abrahams 2001. Permission to copy, use, modify, sell and # distribute this software is granted provided this copyright notice appears in # all copies. This software is provided "as is" without express or implied # warranty, and with no claim as to its suitability for any purpose. """ Utility ...
meh/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/webdriver/webdriver/wait.py
263
# Copyright 2011 Software Freedom Conservancy. # # 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 agre...
dancingdan/tensorflow
refs/heads/master
tensorflow/python/autograph/pyct/static_analysis/live_values_test.py
15
# 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...
deveninfotech/deven-frappe
refs/heads/develop
frappe/model/__init__.py
28
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt # model __init__.py from __future__ import unicode_literals import frappe import json no_value_fields = ['Section Break', 'Column Break', 'HTML', 'Table', 'Button', 'Image', 'Fold'] default_fields = ['doctype','nam...
jymannob/CouchPotatoServer
refs/heads/develop
libs/bs4/element.py
438
import collections import re import sys import warnings from bs4.dammit import EntitySubstitution DEFAULT_OUTPUT_ENCODING = "utf-8" PY3K = (sys.version_info[0] > 2) whitespace_re = re.compile("\s+") def _alias(attr): """Alias one attribute name to another for backward compatibility""" @property def alias...
SanchayanMaity/gem5
refs/heads/CS570
src/arch/x86/isa/insts/simd128/floating_point/data_conversion/__init__.py
91
# Copyright (c) 2007 The Hewlett-Packard Development Company # 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 implemen...
amenonsen/ansible
refs/heads/devel
test/units/modules/network/fortimanager/__init__.py
12133432
djtaylor/lense-client
refs/heads/dev
usr/share/lense/python/__init__.py
12133432
peterhinch/micropython-lcd160cr-gui
refs/heads/master
font10.py
3
# Code generated by font-to-py.py. # Font: FreeSans.ttf version = '0.1' def height(): return 17 def max_width(): return 17 def hmap(): return True def reverse(): return False def monospaced(): return False _font =\ b'\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\ b'\x00\x00...
ran5515/DeepDecision
refs/heads/master
tensorflow/python/kernel_tests/weights_broadcast_test.py
130
# 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...
seann1/portfolio5
refs/heads/master
.meteor/dev_bundle/python/Lib/test/test_pkgimport.py
127
import os, sys, string, random, tempfile, unittest from test.test_support import run_unittest class TestImport(unittest.TestCase): def __init__(self, *args, **kw): self.package_name = 'PACKAGE_' while self.package_name in sys.modules: self.package_name += random.choose(string.letters)...
wengzhilai/family
refs/heads/master
iSoft/dal/FamilyDal.py
1
from iSoft.model.AppReturnDTO import AppReturnDTO from iSoft.entity.model import db, FaUserInfo from iSoft.model.FamilyRelative.Relative import Relative from iSoft.model.FamilyRelative.RelativeItem import RelativeItem from iSoft.model.FamilyRelative.RelativeItem import RelativeItem, HorizonVal, AxisXY class FamilyDal...
oasiswork/odoo
refs/heads/8.0
addons/website_sale/controllers/__init__.py
7372
import main
grevutiu-gabriel/sympy
refs/heads/master
sympy/utilities/tests/diagnose_imports.py
99
#!/usr/bin/env python """ Import diagnostics. Run bin/diagnose_imports.py --help for details. """ from __future__ import print_function if __name__ == "__main__": import sys import inspect from sympy.core.compatibility import builtins import optparse from os.path import abspath, dirname, join,...
ronakkhunt/kuma
refs/heads/master
vendor/packages/pygments/lexers/diff.py
75
# -*- coding: utf-8 -*- """ pygments.lexers.diff ~~~~~~~~~~~~~~~~~~~~ Lexers for diff/patch formats. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, include, bygroups from pygments.token import T...
h4ck3rm1k3/ansible
refs/heads/devel
v2/hacking/module_formatter.py
6
#!/usr/bin/env python # (c) 2012, Jan-Piet Mens <jpmens () gmail.com> # (c) 2012-2014, Michael DeHaan <michael@ansible.com> and others # # 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 So...
opyate/gnashboard
refs/heads/master
application/kv_blueprint/__init__.py
33
from . import views
keisuke-umezawa/chainer
refs/heads/master
chainer/functions/loss/softmax_cross_entropy.py
4
import numpy import six import chainer from chainer import backend from chainer.backends import cuda from chainer import function_node from chainer.functions.activation import log_softmax from chainer.utils import type_check from chainer import variable import chainerx def _broadcast_to(array, shape): if hasattr...
tntnatbry/tensorflow
refs/heads/master
tensorflow/compiler/tests/nullary_ops_test.py
122
# 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...
EArmour/pyfibot
refs/heads/master
pyfibot/modules/available/module_dhl.py
1
# -*- encoding: utf-8 -*- """ Get status of a shipment from DHL Track & Trace service. Experimental. """ from __future__ import unicode_literals from datetime import datetime, timedelta from bs4 import BeautifulSoup def command_dhl(bot, user, channel, args): """Get latest status of a shipment by DHL shipment num...
zmeda/web-summit-2015-recap-zalando
refs/heads/master
node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py
2736
# 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. """Visual Studio project reader/writer.""" import gyp.common import gyp.easy_xml as easy_xml class Writer(object): """Visual Studio XML tool file writer.""" ...
niecw/stock-logistics-workflow
refs/heads/8.0
__unported__/product_serial/stock.py
10
# -*- encoding: utf-8 -*- ############################################################################## # # Product serial module for OpenERP # Copyright (C) 2008 Raphaël Valyi # Copyright (C) 2011 Anevia S.A. - Ability to group invoice lines # written by Alexis Demeaulte <alexis.demeaulte@anevia.com> # Copy...
jianglu/mojo
refs/heads/master
third_party/libxml/src/check-xml-test-suite.py
347
#!/usr/bin/python import sys import time import os import string sys.path.insert(0, "python") import libxml2 test_nr = 0 test_succeed = 0 test_failed = 0 test_error = 0 # # the testsuite description # CONF="xml-test-suite/xmlconf/xmlconf.xml" LOG="check-xml-test-suite.log" log = open(LOG, "w") # # Error and warning...
Elder-of-Ozone/i3pystatus
refs/heads/master
i3pystatus/pomodoro.py
6
import os import subprocess import locale from datetime import datetime, timedelta from i3pystatus import IntervalModule class Pomodoro(IntervalModule): """ This plugin shows Pomodoro timer. Left click starts/restarts timer. Right click stops it. """ settings = ( ('sound', ...
SanchayanMaity/gem5
refs/heads/CS570
src/sim/power/PowerModel.py
12
# Copyright (c) 2016 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 ...
mbox/django
refs/heads/master
django/contrib/flatpages/views.py
105
from django.conf import settings from django.contrib.flatpages.models import FlatPage from django.contrib.sites.shortcuts import get_current_site from django.http import Http404, HttpResponse, HttpResponsePermanentRedirect from django.shortcuts import get_object_or_404 from django.template import loader, RequestContext...
gloaec/trifle
refs/heads/master
src/trifle/raft/store.py
1
import os import errno import uuid import msgpack # we're using it anyway... from trifle import config def read_state(port): sfile = os.path.join(config['TMP_DIR'], "raft-state-%d" % port) try: with open(sfile) as r: return msgpack.unpackb(r.read()) except IOError as e: if no...
TangXT/edx-platform
refs/heads/master
common/djangoapps/heartbeat/views.py
199
from xmodule.modulestore.django import modulestore from dogapi import dog_stats_api from util.json_request import JsonResponse from django.db import connection from django.db.utils import DatabaseError from xmodule.exceptions import HeartbeatFailure @dog_stats_api.timed('edxapp.heartbeat') def heartbeat(request): ...
shankari/e-mission-server
refs/heads/master
emission/analysis/modelling/tour_model/prior_unused/exploratory_scripts/explore_smoothing_trajectories.py
2
from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import # Standard imports from future import standard_library standard_library.install_aliases() from builtins import * import json import logging import numpy as np import datet...
paour/weblate
refs/heads/master
weblate/trans/autofixes/whitespace.py
2
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2014 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://weblate.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, eithe...
jlnaudin/x-drone
refs/heads/master
MissionPlanner-master/packages/IronPython.StdLib.2.7.4/content/Lib/zipfile.py
81
""" Read and write ZIP files. """ import struct, os, time, sys, shutil import binascii, cStringIO, stat import io import re try: import zlib # We may need its compression method crc32 = zlib.crc32 except ImportError: zlib = None crc32 = binascii.crc32 __all__ = ["BadZipfile", "error", "ZIP_STORED", "Z...
upsuper/servo
refs/heads/master
tests/wpt/web-platform-tests/webdriver/tests/sessions/new_session/support/create.py
15
# Note that we can only test things here all implementations must support valid_data = [ ("acceptInsecureCerts", [False, None]), ("browserName", [None]), ("browserVersion", [None]), ("platformName", [None]), ("pageLoadStrategy", ["none", "eager", "normal", None]), ("proxy", [None]), ("timeou...
Nicop06/ansible
refs/heads/devel
lib/ansible/modules/network/nxos/nxos_vrf_af.py
23
#!/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...
tunneln/CarnotKE
refs/heads/master
jyhton/lib-python/2.7/encodings/cp857.py
593
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP857.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
jt6562/XX-Net
refs/heads/master
python27/1.0/lib/noarch/pyasn1/codec/cer/decoder.py
8
# CER decoder from pyasn1.type import univ from pyasn1.codec.ber import decoder from pyasn1.compat.octets import oct2int from pyasn1 import error class BooleanDecoder(decoder.AbstractSimpleDecoder): protoComponent = univ.Boolean(0) def valueDecoder(self, fullSubstrate, substrate, asn1Spec, tagSet, length, ...
drufat/sympy
refs/heads/master
sympy/strategies/util.py
124
from __future__ import print_function, division from sympy import Basic new = Basic.__new__ def assoc(d, k, v): d = d.copy() d[k] = v return d basic_fns = {'op': type, 'new': Basic.__new__, 'leaf': lambda x: not isinstance(x, Basic) or x.is_Atom, 'children': lambda...
fugitifduck/exabgp
refs/heads/master
lib/exabgp/bgp/message/open/capability/addpath.py
1
# encoding: utf-8 """ addpath.py Created by Thomas Mangin on 2012-07-17. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """ from struct import pack from exabgp.protocol.family import AFI from exabgp.protocol.family import SAFI from exabgp.bgp.message.open.capability.capability import Capability # =======...
Dfelker/ansible
refs/heads/devel
lib/ansible/utils/path.py
81
# (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...
bestwpw/ChromeWebLab
refs/heads/master
Sketchbots/sw/labqueue/config.py
7
# Copyright 2013 Google Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
gchp/django
refs/heads/master
tests/forms_tests/widget_tests/base.py
192
from django.test import SimpleTestCase class WidgetTest(SimpleTestCase): beatles = (('J', 'John'), ('P', 'Paul'), ('G', 'George'), ('R', 'Ringo')) def check_html(self, widget, name, value, html='', attrs=None, **kwargs): output = widget.render(name, value, attrs=attrs, **kwargs) self.assertHT...
2014c2g14/w16b_test
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/_functools.py
727
def partial(func, *args, **keywords): def newfunc(*fargs, **fkeywords): newkeywords = keywords.copy() newkeywords.update(fkeywords) return func(*(args + fargs), **newkeywords) newfunc.func = func newfunc.args = args newfunc.keywords = keywords return newfunc def reduce(func,...
linuxsoftware/python-holidays
refs/heads/master
holidays.py
1
# -*- coding: utf-8 -*- # python-holidays # --------------- # A fast, efficient Python library for generating country, province and state # specific sets of holidays on the fly. It aims to make determining whether a # specific date is a holiday as fast and flexible as possible. # # Author: ryanss <ryanssdev@icl...
ayepezv/GAD_ERP
refs/heads/master
openerp/addons/base/ir/ir_exports.py
42
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import fields, models class IrExports(models.Model): _name = "ir.exports" _order = 'name' name = fields.Char(string='Export Name') resource = fields.Char(index=True) export_fields = field...
obi-two/Rebelion
refs/heads/master
data/scripts/templates/object/intangible/pet/shared_gnort_hue.py
2
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/intangible/pet/shared_gnort_hue.iff" result.attribute_template_id = -1 re...
arnaudsj/titanium_mobile
refs/heads/master
drillbit/sdk_tests/unittest2/test/test_setups.py
111
import sys from cStringIO import StringIO import unittest2 from unittest2.test.support import resultFactory class TestSetups(unittest2.TestCase): def getRunner(self): return unittest2.TextTestRunner(resultclass=resultFactory, stream=StringIO()) def runT...
cellsrg/LOD-table-annotator
refs/heads/master
jython/Lib/site-packages/pip-9.0.1-py2.7.egg/pip/_vendor/distlib/database.py
334
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2016 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """PEP 376 implementation.""" from __future__ import unicode_literals import base64 import codecs import contextlib import hashlib import logging import os import posixpath import sys import z...
ycaihua/kbengine
refs/heads/master
kbe/src/lib/python/Tools/pynche/Switchboard.py
116
"""Switchboard class. This class is used to coordinate updates among all Viewers. Every Viewer must conform to the following interface: - it must include a method called update_yourself() which takes three arguments; the red, green, and blue values of the selected color. - When a Viewer selects a colo...
colinnewell/odoo
refs/heads/8.0
openerp/osv/__init__.py
337
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
valentin-krasontovitsch/ansible
refs/heads/devel
lib/ansible/modules/network/avi/avi_serviceenginegroup.py
29
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses...
bmya/addons-yelizariev
refs/heads/8.0
product_custom/__init__.py
2148
import models
pgiri/asyncoro
refs/heads/master
examples/tut_coros.py
1
#!/usr/bin/env python # program for creating coroutines (asynchronous concurrent # programming); see http://asyncoro.sourceforge.net/tutorial.html for # details. import sys, random, time import asyncoro def coro_proc(n, coro=None): s = random.uniform(0.5, 3) print('%f: coroutine %d sleeping for %f seconds' %...
vbelakov/h2o
refs/heads/master
py/testdir_multi_jvm/test_exec2_sum_cols.py
9
import unittest, random, sys, time sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_util, h2o_exec zeroList = [ 'Result0 = 0', ] # the first column should use this exprList = [ 'Result<n> = sum(<keyX>[,<col1>])', ] class Basic(unittest.TestCa...
kenshay/ImageScripter
refs/heads/master
ProgramData/Android/ADB/platform-tools/systrace/catapult/telemetry/telemetry/internal/platform/profiler/v8_profiler.py
7
# 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 re import tempfile from telemetry.internal.platform import profiler class V8Profiler(profiler.Profiler): _V8_ARG = '--js-flags=--logfile=%s --pr...
MountainWei/nova
refs/heads/master
nova/tests/unit/virt/xenapi/test_xenapi.py
13
# Copyright (c) 2010 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
florianholzapfel/home-assistant
refs/heads/dev
homeassistant/components/automation/time.py
19
""" Offer time listening automation rules. For more details about this automation rule, please refer to the documentation at https://home-assistant.io/components/automation/#time-trigger """ import logging import voluptuous as vol from homeassistant.core import callback from homeassistant.const import CONF_AFTER, CO...
ChristopherHogan/numpy
refs/heads/master
numpy/polynomial/tests/test_legendre.py
123
"""Tests for legendre module. """ from __future__ import division, absolute_import, print_function import numpy as np import numpy.polynomial.legendre as leg from numpy.polynomial.polynomial import polyval from numpy.testing import ( TestCase, assert_almost_equal, assert_raises, assert_equal, assert_, run_mod...
JTarball/docker-django-polymer-starter-kit
refs/heads/master
docker/app/app/backend/apps/_archive/blog_old__/migrations/0002_blog_fixture.py
8
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." # Note: Don't use "from appname.models import ModelName". # Use orm....
AnimeshSinha1309/Website-Edunet
refs/heads/master
WebsiteEdunet/env/Lib/site-packages/pip/_vendor/requests/packages/chardet/euctwprober.py
2993
######################## 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...
bob123bob/Sick-Beard
refs/heads/development
lib/subliminal/language.py
23
# -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # # This file is part of subliminal. # # subliminal 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 3 of...
titu1994/Neural-Style-Transfer
refs/heads/master
script_helper/Script/neural_doodle.py
2
from __future__ import print_function from __future__ import division from __future__ import absolute_import import time import argparse import numpy as np from scipy.optimize import fmin_l_bfgs_b from scipy.misc import imread, imsave, imresize, fromimage, toimage, imfilter from keras import backend as K from keras.l...
mbalasso/mynumpy
refs/heads/master
numpy/fft/setup.py
48
def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('fft',parent_package,top_path) config.add_data_dir('tests') # Configure fftpack_lite config.add_extension('fftpack_lite', sources=['fftpack_lite...
abalkin/numpy
refs/heads/master
numpy/core/tests/test_indexing.py
6
import sys import warnings import functools import operator import numpy as np from numpy.core._multiarray_tests import array_indexing from itertools import product from numpy.testing import ( assert_, assert_equal, assert_raises, assert_array_equal, assert_warns, HAS_REFCOUNT, ) class TestIndexing: ...
grahame/ealgis
refs/heads/master
django/ealgis/tests/__init__.py
12133432
omniscale/cartodb-wmsproxy
refs/heads/master
wmsproxy/test/__init__.py
12133432
rhndg/openedx
refs/heads/master
cms/djangoapps/contentstore/features/__init__.py
12133432
Sabayon/entropy
refs/heads/master
rigo/rigo/ui/gtk3/models/preferencesliststore.py
6
# -*- coding: utf-8 -*- """ Copyright (C) 2012 Fabio Erculiani Authors: Fabio Erculiani This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 3. This program is distributed in the hope that it ...
citrix-openstack-build/python-openstackclient
refs/heads/master
openstackclient/tests/object/v1/lib/__init__.py
6
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distrib...
moreati/django
refs/heads/master
tests/template_tests/test_logging.py
210
from __future__ import unicode_literals import logging from django.template import Engine, Variable, VariableDoesNotExist from django.test import SimpleTestCase class TestHandler(logging.Handler): def __init__(self): super(TestHandler, self).__init__() self.log_record = None def emit(self, ...
stuartdrew/plugin.video.CHSPORT
refs/heads/master
_DMsearch.py
35
import urllib import urllib2 import xbmcvfs import os,xbmc,xbmcaddon,xbmcgui,re,xbmcplugin,sys import json import datetime addon = xbmcaddon.Addon('plugin.video.SimpleKore') profile = xbmc.translatePath(addon.getAddonInfo('profile').decode('utf-8')) cacheDir = os.path.join(profile, 'cachedir') headers=dict({'User-Agent...
sakshaat/noclick
refs/heads/master
custom_parser.py
1
from sumy.parsers.html import HtmlParser from sumy.utils import _HTTP_HEADERS, fetch_url from contextlib import closing from custom_article import CustomArticle as Article import requests, lxml.html class CustomParser(HtmlParser): ''' Custom Parser that allows to omit certain keywords and tweak the original for...
ldoktor/autotest
refs/heads/master
client/kernel_versions_unittest.py
6
#!/usr/bin/python import unittest try: import autotest.common as common except ImportError: import common from autotest.client import kernel_versions class kernel_versions_test(unittest.TestCase): def increases(self, kernels): for i in xrange(len(kernels)-1): k1 = kernels[i] ...
stevenhwu/googletest
refs/heads/master
test/gtest_uninitialized_test.py
2901
#!/usr/bin/env python # # Copyright 2008, 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...
jayceyxc/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/django/utils/importlib.py
105
# Taken from Python 2.7 with permission from/by the original author. import sys from django.utils import six def _resolve_name(name, package, level): """Return the absolute name of the module to be imported.""" if not hasattr(package, 'rindex'): raise ValueError("'package' not set to a string") do...
Jgarcia-IAS/SAT
refs/heads/master
openerp/addons/web_gantt/__openerp__.py
387
{ 'name': 'Web Gantt', 'category': 'Hidden', 'description': """ OpenERP Web Gantt chart view. ============================= """, 'version': '2.0', 'depends': ['web'], 'data' : [ 'views/web_gantt.xml', ], 'qweb': [ 'static/src/xml/*.xml', ], 'auto_install': True }...
Servir-Mekong/ecodash
refs/heads/master
lib/ee/ee_list.py
9
#!/usr/bin/env python """A wrapper for lists.""" import apifunction import computedobject import ee_exception # Using lowercase function naming to match the JavaScript names. # pylint: disable=g-bad-name class List(computedobject.ComputedObject): """An object to represent lists.""" _initialized = False de...
piotroxp/scibibscan
refs/heads/master
scib/lib/python3.5/site-packages/astropy/io/fits/tests/test_image.py
1
# Licensed under a 3-clause BSD style license - see PYFITS.rst from __future__ import division, with_statement import math import os import time import warnings import numpy as np from ....io import fits from ....utils.exceptions import (AstropyDeprecationWarning, AstropyPendingDep...
sivasankariit/linux-rl
refs/heads/rl
tools/perf/scripts/python/net_dropmonitor.py
4235
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
zouyapeng/horizon
refs/heads/stable/juno
openstack_dashboard/dashboards/project/data_processing/data_sources/__init__.py
12133432
AndrewGrossman/django
refs/heads/master
django/core/management/commands/check.py
316
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps import apps from django.core import checks from django.core.checks.registry import registry from django.core.management.base import BaseCommand, CommandError class Command(BaseCommand): help = "Checks the entire Django project for p...
ribag/ganeti-experiments
refs/heads/topic-cli-quote
qa/qa_logging.py
3
# # # Copyright (C) 2014 Google 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 2 of the License, or # (at your option) any later version. # # This program is distributed ...
CSC301H-Fall2013/JuakStore
refs/heads/master
site-packages/tests/regressiontests/comment_tests/tests/comment_view_tests.py
44
from __future__ import absolute_import, unicode_literals import re from django.conf import settings from django.contrib.auth.models import User from django.contrib.comments import signals from django.contrib.comments.models import Comment from . import CommentTestCase from ..models import Article, Book post_redire...