repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
dmazzella/micropython
refs/heads/master
tests/float/string_format_modulo2.py
30
# test formatting floats with large precision, that it doesn't overflow the buffer def test(num, num_str): if num == float('inf') or num == 0.0 and num_str != '0.0': # skip numbers that overflow or underflow the FP precision return for kind in ('e', 'f', 'g'): # check precision either s...
codrut3/tensorflow
refs/heads/master
tensorflow/tools/docs/doc_generator_visitor.py
68
# 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...
davidrenne/django-allauth
refs/heads/master
allauth/socialaccount/south_migrations/0011_auto__chg_field_socialtoken_token.py
77
# -*- 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): # Changing field 'SocialToken.token' db.alter_column('socialaccount_socialtoken', 'token', self.gf('django....
nerzhul/ansible
refs/heads/devel
test/runner/lib/core_ci.py
14
"""Access Ansible Core CI remote services.""" from __future__ import absolute_import, print_function import json import os import traceback import uuid import errno import time from lib.http import ( HttpClient, HttpResponse, HttpError, ) from lib.util import ( ApplicationError, run_command, ...
HyperBaton/ansible
refs/heads/devel
lib/ansible/modules/network/fortios/fortios_switch_controller_managed_switch.py
7
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # 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 Lic...
JioCloud/horizon
refs/heads/master
openstack_dashboard/dashboards/admin/routers/extensions/__init__.py
12133432
KennethPierce/pylearnk
refs/heads/fixNogil/master
pylearn2/devtools/tests/docscrape.py
5
"""Extract reference documentation from the NumPy source tree. """ import inspect from nose.plugins.skip import SkipTest import re import sys import types class Reader(object): """A line-based string reader. """ def __init__(self, data): """ Parameters ---------- data : s...
2014c2g2/2014c2
refs/heads/master
wsgi/static/Brython2.1.0-20140419-113919/Lib/contextlib.py
737
"""Utilities for with-statement contexts. See PEP 343.""" import sys from collections import deque from functools import wraps __all__ = ["contextmanager", "closing", "ContextDecorator", "ExitStack"] class ContextDecorator(object): "A base class or mixin that enables context managers to work as decorators." ...
salopensource/sal
refs/heads/main
inventory/apps.py
2
from django.apps import AppConfig class InventoryAppConfig(AppConfig): name = "inventory"
jpshort/odoo
refs/heads/8.0
addons/website_event/tests/test_ui.py
339
import openerp.tests @openerp.tests.common.at_install(False) @openerp.tests.common.post_install(True) class TestUi(openerp.tests.HttpCase): def test_admin(self): self.phantom_js("/", "openerp.Tour.run('event', 'test')", "openerp.Tour.tours.event", login='admin')
visualputty/Landing-Lights
refs/heads/master
django/core/management/commands/runfcgi.py
674
from django.core.management.base import BaseCommand class Command(BaseCommand): help = "Runs this project as a FastCGI application. Requires flup." args = '[various KEY=val options, use `runfcgi help` for help]' def handle(self, *args, **options): from django.conf import settings from djan...
rjschof/gem5
refs/heads/master
src/arch/x86/isa/insts/simd128/floating_point/arithmetic/reciprocal_square_root.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...
xmission/d-note
refs/heads/master
venv/lib/python2.7/site-packages/Crypto/SelfTest/Cipher/test_ARC4.py
117
# -*- coding: utf-8 -*- # # SelfTest/Cipher/ARC4.py: Self-test for the Alleged-RC4 cipher # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedicat...
kybriainfotech/iSocioCRM
refs/heads/8.0
doc/cla/stats.py
319
#!/usr/bin/python # # Runme From the repo toplevel directory # import subprocess import glob import re import pprint cla_glob = "doc/cla/*/*.md" cla = ''.join(open(f).read() for f in glob.glob(cla_glob)) cla = cla.lower() def cla_signed(email): if re.match('.*(odoo|openerp|tinyerp).com$',email): return T...
msincenselee/vnpy
refs/heads/vnpy2
examples/client_server/client/run_client.py
3
from vnpy.event import EventEngine from vnpy.trader.engine import MainEngine from vnpy.trader.ui import MainWindow, create_qapp from vnpy.gateway.rpc import RpcGateway from vnpy.app.cta_strategy import CtaStrategyApp def main(): """""" qapp = create_qapp() event_engine = EventEngine() main_engine = ...
szopu/django
refs/heads/master
tests/utils_tests/test_module/__init__.py
439
class SiteMock(object): _registry = {} site = SiteMock()
hgrif/incubator-airflow
refs/heads/master
tests/contrib/operators/test_file_to_wasb.py
38
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
xq262144/hue
refs/heads/master
desktop/core/ext-py/guppy-0.1.10/guppy/etc/Unpack.py
37
#._cv_part guppy.etc.Unpack from opcode import * import sys CALL_FUNCTION = opmap['CALL_FUNCTION'] UNPACK_SEQUENCE = opmap['UNPACK_SEQUENCE'] STORE_FAST = opmap['STORE_FAST'] STORE_NAME = opmap['STORE_NAME'] STORE_GLOBAL = opmap['STORE_GLOBAL'] STORE_ATTR = opmap['STORE_ATTR'] STORE_SUBSCR = opmap['STORE_SUBSCR'] STO...
chandranaik/Aligning-of-PIE-with-rfc8033-in-ns3
refs/heads/master
src/visualizer/visualizer/plugins/show_last_packets.py
12
import gobject import gtk import ns.core import ns.network import ns.visualizer from visualizer.base import InformationWindow from visualizer.higcontainer import HIGContainer from kiwi.ui.objectlist import ObjectList, Column ## ShowLastPackets class class ShowLastPackets(InformationWindow): ## @var win # wi...
heiden-deng/anaconda
refs/heads/master
pyanaconda/simpleconfig.py
8
# # simpleconifg.py - representation of a simple configuration file (sh-like) # # Copyright (C) 1999-2014 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your op...
sangjin3/webida-server
refs/heads/master
src/ext/cordova-weinre/weinre.build/scripts/build-client-html.py
7
#!/usr/bin/env python # --- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (th...
kriswuollett/grpc
refs/heads/master
src/python/grpcio_tests/tests/qps/client_runner.py
23
# Copyright 2016, 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...
jorsea/odoo-addons
refs/heads/8.0
purchase_uom_prices_uoms/__init__.py
8
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from . import purchase # vim:expandtab:smartinden...
vitiral/micropython
refs/heads/master
tests/pyb/switch.py
117
from pyb import Switch sw = Switch() print(sw()) sw.callback(print) sw.callback(None)
arpitbbhayani/penny
refs/heads/master
app/service/webcomicsService.py
1
import time import app from app.utils import readable from app.dao.items.webcomicDao import WebcomicDao from app.crawlers.xkcd_crawler import XkcdComic def create_comic(comic_id, initial_data): dao = WebcomicDao() webcomicObj = dao.create_comic(comic_id, initial_data) return webcomicObj def get_comic(...
NTesla/pattern
refs/heads/master
pattern/graph/commonsense.py
21
#### PATTERN | COMMONSENSE ######################################################################### # Copyright (c) 2010 University of Antwerp, Belgium # Author: Tom De Smedt <tom@organisms.be> # License: BSD (see LICENSE.txt for details). # http://www.clips.ua.ac.be/pages/pattern ####################################...
jimhw/trading-with-python
refs/heads/master
cookbook/runConsoleUntilInterrupt.py
77
# -*- coding: utf-8 -*- """ example on how to run a console script until interrupted by keyboard @author: jev """ from time import sleep counter = 0 print 'Press Ctr-C to stop loop' try: while True: print counter counter += 1 sleep(1) exce...
slohse/ansible
refs/heads/devel
test/units/modules/network/exos/test_exos_command.py
14
# # (c) 2018 Extreme Networks 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. # # Ans...
Bachmann1234/letsencrypt
refs/heads/master
acme/acme/fields_test.py
62
"""Tests for acme.fields.""" import datetime import unittest import pytz from acme import jose class FixedTest(unittest.TestCase): """Tests for acme.fields.Fixed.""" def setUp(self): from acme.fields import Fixed self.field = Fixed('name', 'x') def test_decode(self): self.asser...
andrebellafronte/stoq
refs/heads/master
plugins/optical/tests/test_optical_ui.py
2
# -*- Mode: Python; coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 ## ## Copyright (C) 2013 Async Open Source <http://www.async.com.br> ## All rights reserved ## ## 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 Sof...
pozetroninc/micropython
refs/heads/stable
tests/basics/int_divmod_intbig.py
45
# test integer floor division and modulo # this tests bignum modulo a = 987654321987987987987987987987 b = 19 print(a % b) print(a % -b) print(-a % b) print(-a % -b)
jmcarbo/openerp7
refs/heads/master
openerp/addons/base/module/wizard/base_import_language.py
105
# -*- 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...
clarkfitzg/dask
refs/heads/master
dask/dataframe/tests/test_optimize_dataframe.py
3
import pytest from operator import getitem from toolz import valmap, merge from dask.dataframe.optimize import dataframe_from_ctable import dask.dataframe as dd import pandas as pd dsk = {('x', 0): pd.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6]}, index=[0, 1, 3]), ('x', 1): pd.DataFr...
ThomasMiconi/htmresearch
refs/heads/master
projects/sequence_classification/run_encoder_only.py
11
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2016, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
hxddh/youtube-dl
refs/heads/master
youtube_dl/extractor/ehow.py
195
from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_urllib_parse_unquote class EHowIE(InfoExtractor): IE_NAME = 'eHow' _VALID_URL = r'https?://(?:www\.)?ehow\.com/[^/_?]*_(?P<id>[0-9]+)' _TEST = { 'url': 'http://www.ehow.com/video_12245069_hardwoo...
espadrine/opera
refs/heads/master
chromium/src/third_party/pefile/setup.py
3
try: from setuptools import setup except ImportError, excp: from distutils.core import setup import pefile import os os.environ['COPY_EXTENDED_ATTRIBUTES_DISABLE'] = 'true' os.environ['COPYFILE_DISABLE'] = 'true' setup(name = 'pefile', version = pefile.__version__, description = 'Python PE parsin...
gabrielfalcao/sure
refs/heads/master
tests/test_custom_assertions.py
2
# -*- coding: utf-8 -*- """ Test custom assertions. """ from sure import expect, assertion, chain, chainproperty from sure.magic import is_cpython def test_custom_assertion(): "test extending sure with a custom assertion." class Response(object): def __init__(self, return_code): self.re...
Eyjafjallajokull/pyga
refs/heads/master
tests/test_selection_strategy/test_rank.py
1
from unittest import TestCase from unittest.mock import MagicMock from pyga import Candidate from pyga import Fitness from pyga import Population from pyga import Random from pyga import RankSelection class RankSelectionStrategyTestCase(TestCase): def setUp(self): self.random = Random() self.obj ...
Intel-tensorflow/tensorflow
refs/heads/master
tensorflow/python/compiler/tensorrt/test/int32_test.py
5
# 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...
betrisey/home-assistant
refs/heads/dev
tests/conftest.py
5
"""Setup some common test helper things.""" import functools import logging import pytest import requests_mock as _requests_mock from homeassistant import util from homeassistant.util import location from .common import async_test_home_assistant from .test_util.aiohttp import mock_aiohttp_client logging.basicConfig...
DLR-SC/RepoGuard
refs/heads/master
test/repoguard_test/checks/test_rejecttabs.py
2
# # Copyright 2008 Adam Byrtek # # 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 i...
aichingm/electron
refs/heads/master
tools/mac/copy-locales.py
46
#!/usr/bin/env python # Copyright (c) 2013 GitHub, Inc. # Use of this source code is governed by the MIT license that can be # found in the LICENSE file. import errno import optparse import os import shutil import sys def main(argv): parser = optparse.OptionParser() usage = 'usage: %s [options ...] src dest local...
skoppisetty/idigbio-appliance
refs/heads/master
dataingestion/services/ingestion_manager.py
1
#!/usr/bin/env python # # Copyright (c) 2013 Suresh Koppisetty <suresh.koppisetty@gmail.com>, University of # Florida # # Extra layer of abstraction to ingestion manager - Currently using Celery Manager # # This software may be used and distributed according to the terms of the # MIT license: http://www.opensource.org/...
NikolaYolov/invenio_backup
refs/heads/master
modules/miscutil/lib/logicutils_tests.py
16
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 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 ## License, or (at your opt...
apple/swift-lldb
refs/heads/stable
packages/Python/lldbsuite/test/commands/expression/completion-in-lambda-and-unnnamed-class/TestCompletionInLambdaAndUnnamedClass.py
13
from lldbsuite.test import lldbinline from lldbsuite.test import decorators lldbinline.MakeInlineTest(__file__, globals(),)
CeltonMcGrath/TACTIC
refs/heads/master
src/tactic/ui/panel/static_table_layout_wdg.py
6
########################################################### # # Copyright (c) 2009, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
mrfalcone/pyext2
refs/heads/master
ext2/__init__.py
1
#!/usr/bin/env python """ Module for interfacing with an Ext2 filesystem image. """ __license__ = "BSD" __copyright__ = "Copyright 2013, Michael R. Falcone" from .error import * from .fs import Ext2Filesystem from .file import Ext2File __all__ = ["Ext2File", "Ext2Filesystem", "FilesystemError", "InvalidFileTypeError",...
theblacklion/pyglet
refs/heads/pyglet-1.2-maintenance
pyglet/text/document.py
34
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
rbarlow/pulp_puppet
refs/heads/master
pulp_puppet_tools/setup.py
1
from setuptools import setup, find_packages setup( name='pulp_puppet_tools', version='2.8.0b4', license='GPLv2+', packages=find_packages(exclude=['test', 'test.*']), author='Pulp Team', author_email='pulp-list@redhat.com', entry_points={ 'console_scripts': [ 'pulp-puppet...
binwiederhier/plugin.video.vox-now.de
refs/heads/master
resources/lib/kodion/impl/mock/mock_context_ui.py
2
__author__ = 'bromix' from ..abstract_context_ui import AbstractContextUI from ...logging import * class MockContextUI(AbstractContextUI): def __init__(self): AbstractContextUI.__init__(self) self._view_mode = None pass def set_view_mode(self, view_mode): self._view_mode = vi...
sdague/home-assistant
refs/heads/dev
tests/components/buienradar/test_sensor.py
19
"""The tests for the Buienradar sensor platform.""" from homeassistant.components import sensor from homeassistant.setup import async_setup_component CONDITIONS = ["stationname", "temperature"] BASE_CONFIG = { "sensor": [ { "platform": "buienradar", "name": "volkel", "la...
ultmaster/eoj3
refs/heads/master
account/migrations/0011_auto_20170928_1327.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-09-28 13:27 from __future__ import unicode_literals import account.models from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('account', '0010_auto_20170914_1920'), ] operations = [ ...
wesparish/heat-templates
refs/heads/master
tests/software_config/config-tool-fake.py
8
#!/usr/bin/env python # # 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 ...
wwj718/edx-platform
refs/heads/master
lms/djangoapps/courseware/tests/test_credit_requirements.py
9
""" Tests for credit requirement display on the progress page. """ import datetime import ddt from mock import patch from pytz import UTC from django.conf import settings from django.core.urlresolvers import reverse from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.test...
coursera/courseraresearchexports
refs/heads/master
courseraresearchexports/constants/__init__.py
1
__all__ = [ "api_constants", "db_constants", "container_constants" ] from . import * # noqa
liangazhou/django-rdp
refs/heads/master
packages/Django-1.8.6/tests/many_to_many/tests.py
2
from __future__ import unicode_literals from django.db import transaction from django.test import TestCase from django.utils import six from .models import Article, InheritedArticleA, InheritedArticleB, Publication class ManyToManyTests(TestCase): def setUp(self): # Create a couple of Publications. ...
tiagofernandez/dailyevents-cloud
refs/heads/master
acceptance/dailyevents/__init__.py
12133432
CSC-ORG/Dynamic-Dashboard-2015
refs/heads/master
engine/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/__init__.py
12133432
yunyu2019/blog
refs/heads/master
python/python_challenge/5.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- # note:序列与反序列化pickle import pickle import pprint import urllib2 urls='http://www.pythonchallenge.com/pc/def/banner.p' fp=urllib2.urlopen(urls) cont=pickle.load(fp) """ #方法一 def makestring(line): s='' for char,num in line: s+=char*num retur...
moijes12/oh-mainline
refs/heads/master
vendor/packages/oauthlib/oauthlib/oauth1/rfc5849/endpoints/authorization.py
87
# -*- coding: utf-8 -*- """ oauthlib.oauth1.rfc5849.endpoints.authorization ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module is an implementation of various logic needed for signing and checking OAuth 1.0 RFC 5849 requests. """ from __future__ import absolute_import, unicode_literals from oauthlib.common i...
yokose-ks/edx-platform
refs/heads/gacco3/master
lms/djangoapps/instructor/tests/test_legacy_anon_csv.py
5
""" Unit tests for instructor dashboard Based on (and depends on) unit tests for courseware. Notes for running by hand: ./manage.py lms --settings test test lms/djangoapps/instructor """ from django.test.utils import override_settings # Need access to internal func to put users in the right group from django.contr...
gold3bear/swift
refs/heads/master
swift/common/container_sync_realms.py
24
# Copyright (c) 2013 OpenStack Foundation # # 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 ...
patrickfournier/woodbox
refs/heads/master
access_control/record.py
1
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals from abc import ABCMeta, abstractmethod from sqlalchemy import and_, or_, true, false, text from ..models.user_model import WBUserModel, WBRoleModel from ..models.record_acl_model import RecordACLModel class RecordAcces...
wagnerand/amo-validator
refs/heads/master
tests/test_contextgenerator.py
2
from validator.contextgenerator import ContextGenerator def test_load_data(): """Test that data is loaded properly into the CG.""" d = """abc def ghi""" c = ContextGenerator(d) print c.data assert len(c.data) == 3 # Through inductive reasoning, we can assert that every other line ...
gskachkov/phantomjs
refs/heads/master
src/qt/qtwebkit/Source/ThirdParty/gtest/test/gtest_xml_output_unittest.py
306
#!/usr/bin/env python # # Copyright 2006, 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...
huguesv/PTVS
refs/heads/master
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/pip/_vendor/urllib3/packages/ssl_match_hostname/__init__.py
374
import sys try: # Our match_hostname function is the same as 3.5's, so we only want to # import the match_hostname function if it's at least that good. if sys.version_info < (3, 5): raise ImportError("Fallback to vendored code") from ssl import CertificateError, match_hostname except ImportErr...
rahushen/ansible
refs/heads/devel
lib/ansible/modules/notification/twilio.py
47
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Matt Makai <matthew.makai@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1',...
amlight/ofp_sniffer
refs/heads/master
libs/tcpiplib/process_data.py
1
""" This module has functions to help processing the data from PacketIn and PacketOut. """ from pyof.foundation.basic_types import BinaryData from libs.tcpiplib.packet import Ethernet, VLAN, IP, TCP, LLDP, ARP, OessFvd def dissect_data(data, start=0): """ This function aims to dissect PacketIn a...
ajdavis/tornado
refs/heads/master
tornado/test/websocket_test.py
5
from __future__ import absolute_import, division, print_function import functools import sys import traceback from tornado.concurrent import Future from tornado import gen from tornado.httpclient import HTTPError, HTTPRequest from tornado.iostream import StreamClosedError from tornado.log import gen_log, app_log from...
VMTrooper/squadtracker
refs/heads/master
destiny/views.py
1
from django.shortcuts import redirect, render from django.http import HttpResponse from django.template.loader import render_to_string from destiny.models import Item, List # Create your views here. def home_page(request): return render(request, 'home.html') def view_squad(request, list_id): list_ = List.objects.ge...
kuiwei/kuiwei
refs/heads/master
lms/djangoapps/licenses/tests.py
30
"""Tests for License package""" import logging import json from uuid import uuid4 from random import shuffle from tempfile import NamedTemporaryFile import factory from factory.django import DjangoModelFactory from django.test import TestCase from django.test.client import Client from django.test.utils import overrid...
jsteemann/arangodb
refs/heads/devel
3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/pythonwin/pywin/debugger/configui.py
17
from dbgcon import * from pywin.mfc import dialog class DebuggerOptionsPropPage(dialog.PropertyPage): def __init__(self): dialog.PropertyPage.__init__(self, win32ui.IDD_PP_DEBUGGER) def OnInitDialog(self): options = self.options = LoadDebuggerOptions() self.AddDDX(win32ui.IDC_CHECK1, OPT_HIDE) self[OPT_STOP...
cervinko/calibre-web
refs/heads/master
cps/web.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- import mimetypes import logging from logging.handlers import RotatingFileHandler import sys import textwrap mimetypes.add_type('application/xhtml+xml','.xhtml') from flask import Flask, render_template, session, request, Response, redirect, url_for, send_from_directory, ma...
alangwansui/mtl_ordercenter
refs/heads/master
openerp/addons/001_report/__init__.py
1
#!usr/bin/python # -*-coding:utf-8 -*- import sale_report
BhallaLab/moose-core
refs/heads/master
tests/core/params.py
4
# -*- coding: utf-8 -*- """params.py Parameters used in this model These parameters are from paper Miller et. al. "The stability of CaMKII switch" """ __author__ = "Dilawar Singh" __copyright__ = "Copyright 2015, Dilawar Singh and NCBS Bangalore" __credits__ = ["NCBS Bangalore"] __license_...
auready/django
refs/heads/master
tests/reverse_lookup/tests.py
31
from django.core.exceptions import FieldError from django.test import TestCase from .models import Choice, Poll, User class ReverseLookupTests(TestCase): def setUp(self): john = User.objects.create(name="John Doe") jim = User.objects.create(name="Jim Bo") first_poll = Poll.objects.create...
PGHS-CP1A-2015/python_koans_kjhansen
refs/heads/master
python3/koans/about_list_assignments.py
14
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Based on AboutArrayAssignments in the Ruby Koans # from runner.koan import * class AboutListAssignments(Koan): def test_non_parallel_assignment(self): names = ["John", "Smith"] self.assertEqual(__, names) def test_parallel_assignments...
tnemis/staging-server
refs/heads/master
students/migrations/0002_initial.py
5
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Child_detail' db.create_table(u'students_child_detail', (...
laszlocsomor/tensorflow
refs/heads/master
tensorflow/contrib/kfac/python/ops/estimator.py
2
# 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...
pymedusa/SickRage
refs/heads/master
ext2/libfuturize/fixes/fix_metaclass.py
61
# coding: utf-8 """Fixer for __metaclass__ = X -> (future.utils.with_metaclass(X)) methods. The various forms of classef (inherits nothing, inherits once, inherints many) don't parse the same in the CST so we look at ALL classes for a __metaclass__ and if we find one normalize the inherits to all be an arg...
faust64/ansible
refs/heads/devel
lib/ansible/plugins/action/net_config.py
137
# # Copyright 2015 Peter Sprygada <psprygada@ansible.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...
github4ry/pathomx
refs/heads/master
pathomx/plugins/merge/loader.py
2
import os import copy import numpy as np import pathomx.ui as ui import pathomx.db as db import pathomx.utils as utils from pathomx.data import DataDefinition from pathomx.utils import UnicodeReader, UnicodeWriter from pathomx.plugins import FilterPlugin class MergeApp(ui.IPythonApp): notebook = 'merge.ipynb' ...
gauribhoite/personfinder
refs/heads/master
env/google_appengine/lib/django-1.5/django/views/generic/dates.py
107
from __future__ import unicode_literals import datetime from django.conf import settings from django.db import models from django.core.exceptions import ImproperlyConfigured from django.http import Http404 from django.utils.encoding import force_text from django.utils.functional import cached_property from django.util...
longde123/MultiversePlatform
refs/heads/master
lib/IPCE/Lib/BeautifulSoup.py
307
"""Beautiful Soup Elixir and Tonic "The Screen-Scraper's Friend" http://www.crummy.com/software/BeautifulSoup/ Beautiful Soup parses a (possibly invalid) XML or HTML document into a tree representation. It provides methods and Pythonic idioms that make it easy to navigate, search, and modify the tree. A well-formed X...
ar7z1/ansible
refs/heads/devel
test/units/cli/test_cli.py
16
# (c) 2017, Adrian Likins <alikins@redhat.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 later vers...
jmattbeal/avro
refs/heads/trunk
lang/py/test/av_bench.py
22
#!/usr/bin/env python # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "L...
M4sse/chromium.src
refs/heads/nw12
ppapi/generators/idl_gen_wrapper.py
113
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Base class for generating wrapper functions for PPAPI methods. """ from datetime import datetime import os import sys from idl_c_proto import CGen f...
yashtrivedi96/coala
refs/heads/master
tests/results/ResultTest.py
5
import unittest import json from os.path import abspath from coalib.results.Diff import Diff from coalib.results.Result import RESULT_SEVERITY, Result from coalib.results.SourceRange import SourceRange from coalib.output.JSONEncoder import create_json_encoder class ResultTest(unittest.TestCase): def test_origin...
feinsteinben/normalizr
refs/heads/master
normalizr/regex.py
1
#-*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import re """ Regular expression to match URLs as seen on http://daringfireball.net/2010/07/improved_regex_for_matching_urls """ URL_REGEX = re.compile( r'(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([...
crisis-economics/housingModel
refs/heads/master
src/main/resources/calibration/code/bak/RentalPrice.py
2
# -*- coding: utf-8 -*- """ Created on Tue Apr 14 15:44:04 2015 @author: daniel """ #import sys import pandas as pd import matplotlib.pyplot as plt import matplotlib.cm as cm import numpy as np #from pandas import Series, DataFrame import Datasets as ds ###### RENTAL BID PRICE DECISION class RentalPriceDecision: ...
CamelBackNotation/CarnotKE
refs/heads/master
jyhton/lib-python/2.7/test/test_dummy_thread.py
127
"""Generic thread tests. Meant to be used by dummy_thread and thread. To allow for different modules to be used, test_main() can be called with the module to use as the thread implementation as its sole argument. """ import dummy_thread as _thread import time import Queue import random import unittest from test impo...
blackzw/openwrt_sdk_dev1
refs/heads/master
staging_dir/host/lib/python2.7/test/string_tests.py
29
""" Common tests shared by test_str, test_unicode, test_userstring and test_string. """ import unittest, string, sys, struct from test import test_support from UserList import UserList class Sequence: def __init__(self, seq='wxyz'): self.seq = seq def __len__(self): return len(self.seq) def __getitem__(se...
alsrgv/tensorflow
refs/heads/master
tensorflow/python/ops/unconnected_gradients.py
39
# 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...
marcuskelly/recover
refs/heads/master
Lib/site-packages/_pytest/deprecated.py
19
""" This module contains deprecation messages and bits of code used elsewhere in the codebase that is planned to be removed in the next pytest release. Keeping it in a central location makes it easy to track what is deprecated and should be removed when the time comes. """ MAIN_STR_ARGS = 'passing a string to pytest...
darkleons/BE
refs/heads/master
addons/account/wizard/account_reconcile.py
226
# -*- 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...
hhkaos/awesome-arcgis
refs/heads/master
node_modules/gitbook/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py
1835
# 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. """New implementation of Visual Studio project generation.""" import os import random import gyp.common # hashlib is supplied as of Python 2.5 as the replacemen...
Sidney84/pa-chromium
refs/heads/master
build/android/pylib/utils/reraiser_thread.py
36
# 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. """Thread and ThreadGroup that reraise exceptions on the main thread.""" import logging import sys import threading import time import traceback import wat...
chrber/dcache-docker
refs/heads/master
dcache/deps/.vim/bundle/jedi-vim/jedi/test/test_evaluate/test_pyc.py
26
""" Test completions from *.pyc files: - generate a dummy python module - compile the dummy module to generate a *.pyc - delete the pure python dummy module - try jedi on the generated *.pyc """ import os import shutil import sys import pytest import jedi from ..helpers import cwd_at SRC = """class Foo: pa...
HybridF5/tempest
refs/heads/master
tempest/api/network/test_extra_dhcp_options.py
8
# Copyright 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
aidan-/ansible-modules-extras
refs/heads/devel
network/illumos/ipadm_if.py
2
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Adam Števko <adam.stevko@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 L...