repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
dongyoungy/dbseer_middleware
refs/heads/master
rs-sysmon2/plugins/dstat_top_childwait.py
5
### Dstat most expensive process plugin ### Displays the name of the most expensive process ### ### Authority: dag@wieers.com global cpunr class dstat_plugin(dstat): def __init__(self): self.name = 'most waiting for' self.vars = ('child process',) self.type = 's' self.width = 16 ...
iver333/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/style/error_handlers_unittest.py
122
# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and...
antoinecarme/pyaf
refs/heads/master
tests/model_control/detailed/transf_None/model_control_one_enabled_None_MovingMedian_Seasonal_DayOfMonth_LSTM.py
1
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['None'] , ['MovingMedian'] , ['Seasonal_DayOfMonth'] , ['LSTM'] );
aasoliz/Bitcoin-Statistics
refs/heads/master
venv/lib/python2.7/site-packages/sqlalchemy/event/__init__.py
55
# event/__init__.py # Copyright (C) 2005-2016 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from .api import CANCEL, NO_RETVAL, listen, listens_for, remove, contains from .ba...
MalloyPower/parsing-python
refs/heads/master
front-end/testsuite-python-lib/Python-2.7/Lib/test/test_struct.py
3
import os import array import unittest import struct import inspect from test.test_support import run_unittest, check_warnings, check_py3k_warnings import sys ISBIGENDIAN = sys.byteorder == "big" IS32BIT = sys.maxsize == 0x7fffffff integer_codes = 'b', 'B', 'h', 'H', 'i', 'I', 'l', 'L', 'q', 'Q' testmod_filename = o...
temasek/android_external_chromium_org_third_party_WebKit
refs/heads/cm-12.1
Tools/Scripts/webkitpy/common/net/sheriff_calendar_unittest.py
59
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # This is based on code from: # https://chromium.googlesource.com/chromium/tools/build/+/master/scripts/tools/blink_roller/auto_roll_test.py # Ideally we sho...
sirikata/sirikata
refs/heads/master
tools/cdn/meshtool_regression.py
1
import list import pprint import sys import os import os.path import urllib2 import shutil from meshtool.filters import factory from meshtool.filters.print_filters.print_render_info import getRenderInfo import collada import unicodedata import math import traceback import itertools from multiprocessing import Process, ...
ArvinDevel/incubator-pulsar
refs/heads/master
pulsar-functions/instance/src/main/python/contextimpl.py
1
#!/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 # "...
newerthcom/savagerebirth
refs/heads/master
libs/python-2.72/Demo/scripts/lpwatch.py
10
#! /usr/bin/env python # Watch line printer queue(s). # Intended for BSD 4.3 lpq. import os import sys import time DEF_PRINTER = 'psc' DEF_DELAY = 10 def main(): delay = DEF_DELAY # XXX Use getopt() later try: thisuser = os.environ['LOGNAME'] except: thisuser = os.environ['USER'] pri...
toanalien/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/patchanalysistask.py
122
# Copyright (c) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
Tchanders/socorro
refs/heads/master
webapp-django/crashstats/base/helpers.py
11
import cgi import urllib import jinja2 from jingo import register @register.function @jinja2.contextfunction def change_query_string(context, **kwargs): """ Template function for modifying the current URL by parameters. You use it like this in a template: <a href={{ change_query_string(foo='bar'...
tamland/trakt-sync
refs/heads/master
models.py
1
# -*- coding: utf-8 -*- # # Copyright (C) 2015 Thomas Amland # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This ...
ebar0n/django
refs/heads/master
django/contrib/gis/sitemaps/kml.py
101
from django.apps import apps from django.contrib.gis.db.models.fields import GeometryField from django.contrib.sitemaps import Sitemap from django.db import models from django.urls import reverse class KMLSitemap(Sitemap): """ A minimal hook to produce KML sitemaps. """ geo_format = 'kml' def __i...
savoirfairelinux/odoo
refs/heads/master
setup/setup.py
21
# -*- 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...
wilvk/ansible
refs/heads/devel
lib/ansible/plugins/lookup/hiera.py
34
# (c) 2017, Juan Manuel Parrilla <jparrill@redhat.com> # (c) 2012-17 Ansible Project # 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 DOCUMENTATION = ''' author: - Juan Manuel P...
juhans/ardupilot
refs/heads/master
Tools/LogAnalyzer/tests/TestEmpty.py
346
from LogAnalyzer import Test,TestResult import DataflashLog class TestEmpty(Test): '''test for empty or near-empty logs''' def __init__(self): Test.__init__(self) self.name = "Empty" def run(self, logdata, verbose): self.result = TestResult() self.result.status = TestResult.StatusType.GOOD # all the...
sanitz/django-census-example
refs/heads/master
census_site/settings.py
1
""" Django settings for census_site project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ......
haridsv/pip
refs/heads/develop
pip/_vendor/requests/packages/urllib3/packages/ordered_dict.py
2039
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. # Copyright 2009 Raymond Hettinger, released under the MIT License. # http://code.activestate.com/recipes/576693/ try: from thread import get_ident as _get_iden...
oblique-labs/pyVM
refs/heads/master
rpython/translator/c/gc.py
1
import sys from rpython.flowspace.model import Constant from rpython.rtyper.lltypesystem.lltype import (RttiStruct, RuntimeTypeInfo) from rpython.translator.c.node import ContainerNode from rpython.translator.c.support import cdecl from rpython.translator.tool.cbuild import ExternalCompilationInfo class BasicGcPo...
munhanha/mtg-random
refs/heads/master
django/contrib/comments/views/moderation.py
307
from django import template from django.conf import settings from django.shortcuts import get_object_or_404, render_to_response from django.contrib.auth.decorators import login_required, permission_required from utils import next_redirect, confirmation_view from django.contrib import comments from django.contrib.commen...
felipedau/unmessage
refs/heads/develop
unmessage/persistence.py
2
import errno import sqlite3 import attr from pyaxo import Keypair, a2b, b2a from .contact import Contact @attr.s class PeerInfo(object): name = attr.ib( validator=attr.validators.optional(attr.validators.instance_of(str)), default=None) port_local_server = attr.ib( validator=attr.val...
marc-sensenich/ansible
refs/heads/devel
test/units/modules/network/f5/test_bigip_device_sshd.py
21
# -*- 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 pytest import sys if sys.version_info < (2, ...
brunoabud/ic
refs/heads/master
plugins/ICBGRBlurFilter/plugin_object.py
1
# coding: utf-8 # Copyright (C) 2016 Bruno Abude Cardoso # # Imagem Cinemática 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. # # Imag...
zacoxicompton/ExocortexCrate
refs/heads/master
Python/samples/cmpABCs.py
4
import _ExocortexAlembicPython as alembic import sys import argparse def compareValues(a1, a2, id): if a1.getNbStoredSamples() != a2.getNbStoredSamples(): print("--> VAL: " + str(id) + " doesn't have the same number of sample") return for i in xrange(0, a1.getNbStoredSamples()): if a1.getValue...
ByteMail/ByteMail
refs/heads/master
flask/testsuite/test_apps/config_module_app.py
1257
import os import flask here = os.path.abspath(os.path.dirname(__file__)) app = flask.Flask(__name__)
zaxliu/deepnap
refs/heads/master
experiments/kdd-exps/experiment_QNN_Feb2_0944.py
1
# System built-in modules import time from datetime import datetime import sys import os from multiprocessing import Pool # Project dependency modules import pandas as pd pd.set_option('mode.chained_assignment', None) # block warnings due to DataFrame value assignment import lasagne # Project modules sys.path.append('...
arek125/remote-GPIO-control-server
refs/heads/master
rgc-server1_0.py
1
import socket import sys import hashlib from datetime import datetime import os import signal import glob import sqlite3 import threading import time import RPi.GPIO as GPIO HOST = '' PORT = 8888 PASSWORD = '' ENC_KEY = '' exitapp = False break_ = -1 db_path = 'rgc-server.db3' def stringToint(...
eldarion/edge
refs/heads/master
setup.py
1
from setuptools import setup setup( name = "edge", version = "0.4.0", url = "http://pypi.python.org/pypi/edge", license = "BSD", description = "Python bindings for Directed Edge's API", author = "Directed Edge", py_modules = ["directed_edge"], install_requires = ["httplib2"] )
WillisXChen/django-oscar
refs/heads/master
oscar/lib/python2.7/site-packages/sphinx/pycode/nodes.py
12
# -*- coding: utf-8 -*- """ sphinx.pycode.nodes ~~~~~~~~~~~~~~~~~~~ Parse tree node implementations. :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ class BaseNode(object): """ Node superclass for both terminal and nonterminal ...
dfalt974/SickRage
refs/heads/master
lib/oauthlib/oauth2/rfc6749/utils.py
19
# -*- coding: utf-8 -*- """ oauthlib.utils ~~~~~~~~~~~~~~ This module contains utility methods used by various parts of the OAuth 2 spec. """ from __future__ import absolute_import, unicode_literals import datetime import os from oauthlib.common import unicode_type, urldecode try: from urllib import quote excep...
alangwansui/mtl_ordercenter
refs/heads/master
openerp/tools/yaml_import.py
35
# -*- coding: utf-8 -*- import threading import types import time # used to eval time.strftime expressions from datetime import datetime, timedelta import logging import openerp.pooler as pooler import openerp.sql_db as sql_db import misc from config import config import yaml_tag import yaml import re from lxml import...
twitterdev/twitter-for-bigquery
refs/heads/master
libs/requests/packages/charade/euctwfreq.py
3132
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
mscherer/ansible
refs/heads/devel
lib/ansible/plugins/shell/__init__.py
7690
# (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...
bzero/statsmodels
refs/heads/master
statsmodels/examples/ex_regressionplots.py
34
# -*- coding: utf-8 -*- """Examples for Regression Plots Author: Josef Perktold """ from __future__ import print_function import numpy as np import statsmodels.api as sm import matplotlib.pyplot as plt from statsmodels.sandbox.regression.predstd import wls_prediction_std import statsmodels.graphics.regressionplots ...
danhuss/faker
refs/heads/master
faker/providers/automotive/en_NZ/__init__.py
1
from .. import Provider as AutomotiveProvider class Provider(AutomotiveProvider): # See https://en.wikipedia.org/wiki/Vehicle_registration_plates_of_New_Zealand license_formats = ( # Old plates '??%##', '??%###', '??%###', # Three letters since 2002 'A??%##', ...
hynnet/openwrt-mt7620
refs/heads/master
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/test/test_fileio.py
32
# Adapted from test_file.py by Daniel Stutzbach from __future__ import unicode_literals import sys import os import errno import unittest from array import array from weakref import proxy from functools import wraps from test.test_support import TESTFN, check_warnings, run_unittest, make_bad_fd from test.test_suppor...
stsquad/heating-pi
refs/heads/master
heatingpi/sensor/serial_temp_sensor.py
1
#!/usr/bin/env python # # A simple temperature sensor that is plugged into the serial port of # the Pi and reports a temperature every now and again. # from temp_sensor import TempSensor from serial import Serial class SerialTempSensor(TempSensor): """ A SerialTempSensor expects to read a temperture from a se...
lcplj123/video-dl
refs/heads/master
extractors/tudou.py
2
#!/usr/bin/env python3 import re import sys import json sys.path.append('..') from define import * from utils import * from extractor import BasicExtractor from xml.dom.minidom import parseString class TuDouExtractor(BasicExtractor): ''' 土豆视频下载器 ''' def __init__(self,c): super(TuDouExtractor,self).__init__(c,TUD...
suneeth51/neutron
refs/heads/master
neutron/api/rpc/handlers/metadata_rpc.py
58
# Copyright (c) 2014 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...
MattsFleaMarket/python-for-android
refs/heads/master
python-modules/twisted/twisted/trial/test/test_doctest.py
61
# Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Test twisted's doctest support. """ from twisted.trial import itrial, runner, unittest, reporter from twisted.trial.test import mockdoctest class TestRunners(unittest.TestCase): """ Tests for Twisted's doctest support. ...
nikolaik/IndicoIo-python
refs/heads/master
tests/test_imagerecognition.py
2
#!/usr/bin/python # -*- coding: utf-8 -*- import unittest, os from indicoio import config from indicoio import image_recognition DIR = os.path.dirname(os.path.realpath(__file__)) class ImageRecognitionTest(unittest.TestCase): def setUp(self): self.api_key = config.api_key def test_single_image_recogn...
tedye/leetcode
refs/heads/master
tools/leetcode.226.Invert Binary Tree/leetcode.226.Invert Binary Tree.submission2.py
2
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: # @param {TreeNode} root # @return {TreeNode} def invertTree(self, root): # iterative way if not root: ...
connectordb/connectordb-python
refs/heads/master
setup.py
2
#!/usr/bin/env python # python setup.py sdist # python setup.py bdist_wheel --universal # twine upload dist/* from __future__ import absolute_import from setuptools import setup, find_packages setup(name='ConnectorDB', version='0.3.5', # The a.b of a.b.c follows connectordb version. c is the version of pytho...
miconof/headphones
refs/heads/master
lib/pygazelle/category.py
28
class InvalidCategoryException(Exception): pass class Category(object): def __init__(self, id, parent_api): self.id = id self.parent_api = parent_api self.name = None self.parent_api.cached_categories[self.id] = self # add self to cache of known Category objects def __repr...
roadmapper/ansible
refs/heads/devel
test/units/modules/network/onyx/test_onyx_mlag_vip.py
52
# # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.onyx impor...
neumerance/cloudloon2
refs/heads/master
.venv/lib/python2.7/site-packages/neutronclient/tests/unit/vpn/test_utils.py
7
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # (c) Copyright 2013 Hewlett-Packard Development Company, L.P. # 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...
etherkit/OpenBeacon2
refs/heads/master
client/win/venv/Lib/site-packages/PyInstaller/hooks/hook-xml.py
2
#----------------------------------------------------------------------------- # Copyright (c) 2013-2019, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this s...
mavit/ansible
refs/heads/devel
lib/ansible/module_utils/parsing/convert_bool.py
118
# Copyright: 2017, Ansible Project # Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause ) from ansible.module_utils.six import binary_type, text_type from ansible.module_utils._text import to_text BOOLEANS_TRUE = frozenset(('y', 'yes', 'on', '1', 'true', 't', 1, 1...
Nitaco/ansible
refs/heads/devel
lib/ansible/modules/cloud/amazon/ec2_placement_group_facts.py
70
#!/usr/bin/python # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module...
azatoth/scons
refs/heads/master
test/option-unknown.py
2
#!/usr/bin/env python # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, ...
toslunar/chainerrl
refs/heads/master
tests/wrappers_tests/test_atari_wrappers.py
1
"""Currently this script tests `chainerrl.wrappers.atari_wrappers.FrameStack` only.""" from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library...
jkgneu12/python3-saml
refs/heads/master
src/onelogin/saml2/xml_utils.py
1
# -*- coding: utf-8 -*- """ OneLogin_Saml2_XML class Copyright (c) 2015, OneLogin, Inc. All rights reserved. Auxiliary class of OneLogin's Python Toolkit. """ from os.path import join, dirname from lxml import etree from onelogin.saml2 import compat from onelogin.saml2.constants import OneLogin_Saml2_Constants f...
Geoion/urllib3
refs/heads/master
test/with_dummyserver/test_https.py
7
import datetime import logging import ssl import sys import unittest import warnings import mock from nose.plugins.skip import SkipTest from dummyserver.testcase import HTTPSDummyServerTestCase from dummyserver.server import (DEFAULT_CA, DEFAULT_CA_BAD, DEFAULT_CERTS, NO_SAN_CERTS, NO_...
mick-d/nipype
refs/heads/master
nipype/interfaces/semtools/diffusion/gtract.py
9
# -*- coding: utf-8 -*- # -*- coding: utf8 -*- """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" import os from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, is...
40023154/Finalexam_0627
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/_weakrefset.py
766
# Access WeakSet through the weakref module. # This code is separated-out because it is needed # by abc.py to load everything else at startup. from _weakref import ref __all__ = ['WeakSet'] class _IterationGuard: # This context manager registers itself in the current iterators of the # weak container, such ...
daevaorn/sentry
refs/heads/master
src/sentry/replays.py
10
from __future__ import absolute_import from requests import RequestException from sentry.http import safe_urlopen class Replayer(object): def __init__(self, url, method, data=None, headers=None): self.url = url self.method = method self.data = data self.headers = headers def r...
BillBillBillBill/Take-out
refs/heads/master
backend/takeout/bussiness/urls.py
1
from django.conf.urls import url from rest_framework import routers import views router = routers.DefaultRouter() #router.register(r'seller', views.SellerViewSet) # router.register(r'store', views.StoreViewSet) urlpatterns = [ # url(r'^', include(router.urls)), url(r'seller/(\d*)', views.SellerDetail.as_view(...
archf/ansible
refs/heads/devel
lib/ansible/modules/monitoring/newrelic_deployment.py
29
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2013 Matt Coddington <coddington@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':...
mancoast/CPythonPyc_test
refs/heads/master
fail/324_test_index.py
60
import unittest from test import support import operator maxsize = support.MAX_Py_ssize_t class newstyle: def __index__(self): return self.ind class TrapInt(int): def __index__(self): return self class BaseTestCase(unittest.TestCase): def setUp(self): self.o = newstyle() s...
yangming85/lettuce
refs/heads/master
tests/integration/lib/Django-1.3/tests/regressiontests/dispatch/__init__.py
277
"""Unit-tests for the dispatch project """
mdanielwork/intellij-community
refs/heads/master
python/testData/quickFixes/PyAddSpecifierToFormatQuickFixTest/float.py
80
a = <warning descr="Format specifier character missing">"t<caret>est %"</warning> % 1.
ibinti/intellij-community
refs/heads/master
python/helpers/pydev/_pydevd_frame_eval/pydevd_frame_tracing.py
8
import sys from _pydev_bundle import pydev_log from _pydev_imps._pydev_saved_modules import threading from _pydevd_bundle.pydevd_comm import get_global_debugger, CMD_SET_BREAK from pydevd_file_utils import get_abs_path_real_path_and_base_from_frame, NORM_PATHS_AND_BASE_CONTAINER from _pydevd_bundle.pydevd_frame import...
gcobos/rft
refs/heads/master
app/controllers/functions.py
1
import config # Author: drone import web from app.models import functions from app.models import rss from app.helpers import render from app.helpers import misc from app.helpers import utils from config import view, listLimit, projectName def functionMustExist (meth): def new(self, functionName): ...
sinergatis/pathagar
refs/heads/master
books/tests/sample_epubs.py
2
"""Helper for dealing with the sample epubs stored on resources. """ import os from collections import namedtuple from django.conf import settings RSRC_DIR = os.path.abspath(os.path.join(settings.BASE_DIR, 'resources/epubsamples')) SampleEpub = namedtuple('SampleEpub', ('key', ...
jasonwee/asus-rt-n14uhp-mrtg
refs/heads/master
src/lesson_file_system/ospath_commonprefix.py
1
import os.path paths = ['/one/two/three/four', '/one/two/threefold', '/one/two/three/', ] for path in paths: print('PATH:', path) print() print('PREFIX:', os.path.commonprefix(paths))
sodexis/odoo
refs/heads/8.0
addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/functions.py
292
########################################################################## # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gener...
jjz/mezzanine
refs/heads/master
mezzanine/forms/signals.py
71
from __future__ import unicode_literals from django.dispatch import Signal form_invalid = Signal(providing_args=["form"]) form_valid = Signal(providing_args=["form", "entry"])
mk-fg/feedjack
refs/heads/master
feedjack/admin.py
1
# -*- coding: utf-8 -*- from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from feedjack import models class SiteAdmin(admin.ModelAdmin): list_display = 'url', 'name' filter_vertical = 'links', admin.site.register(models.Site, SiteAdmin) class PostProcessorTagInline(admin.T...
renegelinas/mi-instrument
refs/heads/master
mi/platform/responses.py
10
#!/usr/bin/env python """ @package ion.agents.platform.responses @file ion/agents/platform/responses.py @author Carlos Rueda @brief Some constants for responses from platform agents/drivers. """ from mi.core.common import BaseEnum __author__ = 'Carlos Rueda' __license__ = 'Apache 2.0' class NormalResponse(Ba...
LLNL/spack
refs/heads/develop
var/spack/repos/builtin/packages/superlu-dist/package.py
3
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class SuperluDist(CMakePackage): """A general purpose library for the direct solution of large, ...
mattn/ultisnips
refs/heads/master
test/test_ListSnippets.py
29
from test.vim_test_case import VimTestCase as _VimTest from test.constant import * # List Snippets {{{# class _ListAllSnippets(_VimTest): snippets = (('testblah', 'BLAAH', 'Say BLAH'), ('test', 'TEST ONE', 'Say tst one'), ('aloha', 'OHEEEE', 'Say OHEE'), ) class...
bratsche/Neutron-Drive
refs/heads/master
google_appengine/google/appengine/_internal/graphy/formatters.py
254
#!/usr/bin/python2.4 # # Copyright 2008 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 o...
pibouv/ingeniciel
refs/heads/master
external/gtest/scripts/pump.py
2471
#!/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...
joopert/home-assistant
refs/heads/dev
homeassistant/components/cover/reproduce_state.py
5
"""Reproduce an Cover state.""" import asyncio import logging from typing import Iterable, Optional from homeassistant.components.cover import ( ATTR_CURRENT_POSITION, ATTR_CURRENT_TILT_POSITION, ATTR_POSITION, ATTR_TILT_POSITION, ) from homeassistant.const import ( ATTR_ENTITY_ID, SERVICE_CLOS...
Edraak/edraak-platform
refs/heads/master
common/lib/xmodule/xmodule/modulestore/mongo/base.py
1
""" Modulestore backed by Mongodb. Stores individual XModules as single documents with the following structure: { '_id': <location.as_dict>, 'metadata': <dict containing all Scope.settings fields> 'definition': <dict containing all Scope.content fields> 'definition.children': <list of all child text_t...
petkan/linux
refs/heads/master
tools/perf/scripts/python/export-to-postgresql.py
293
# export-to-postgresql.py: export perf data to a postgresql database # Copyright (c) 2014, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # Thi...
Polarcraft/KbveBot
refs/heads/master
commands/score.py
1
# Copyright (C) 2013-2015 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Fox Wilson # # 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 ve...
p0cisk/Quantum-GIS
refs/heads/master
python/plugins/db_manager/db_plugins/spatialite/info_model.py
6
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : DB Manager Description : Database manager plugin for QGIS Date : May 23, 2011 copyright : (C) 2011 by Giuseppe Sucameli email : brush.tyler@...
jasondunsmore/heat
refs/heads/master
heat/db/sqlalchemy/migrate_repo/versions/045_stack_backup.py
13
# # 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 # ...
opencb/cellbase
refs/heads/develop
cellbase-client/src/main/python/pycellbase/commons.py
1
import sys import time import warnings import requests import threading import itertools try: from Queue import Queue except ImportError: from queue import Queue _CALL_BATCH_SIZE = 200 _NUM_THREADS_DEFAULT = 4 def _create_rest_url(host, version, species, category, subcategory, resource, ...
sebgoa/client-python
refs/heads/master
kubernetes/client/models/v1_limit_range_list.py
2
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.7.4 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
LukeCarrier/py3k-pexpect
refs/heads/master
notes/my_forkpty.py
1
import os, fcntl, termios import time def my_forkpty(): (master_fd, slave_fd) = os.openpty() if (master_fd < 0 or slave_fd < 0): raise ExceptionPexpect("Forkpty failed") # slave_name = ptsname(master_fd); pid = os.fork(); if pid == -1: raise ExceptionPexpect("Forkpty failed") ...
firerszd/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/test/test___all__.py
72
import unittest from test import support import os import sys class NoAll(RuntimeError): pass class FailedImport(RuntimeError): pass class AllTest(unittest.TestCase): def check_all(self, modname): names = {} with support.check_warnings( (".* (module|package)", DeprecationWa...
pabigot/pyxb
refs/heads/next
tests/utils/test-fac.py
2
import unittest import sys from pyxb.utils.fac import * from pyxb.utils import six from pyxb.utils.six.moves import xrange class TestFAC (unittest.TestCase): a = Symbol('a') b = Symbol('b') c = Symbol('c') aOb = Choice(a, b) aTb = Sequence(a, b) a2 = NumericalConstraint(a, 2, 2) bTc = Seque...
Jgarcia-IAS/Fidelizacion_odoo
refs/heads/master
openerp/addons/base/tests/test_translate.py
460
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010 OpenERP S.A. http://www.openerp.com # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
BT-fgarbely/account-financial-reporting
refs/heads/8.0
account_financial_report_webkit/report/common_reports.py
2
# -*- encoding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi, Guewen Baconnier # Copyright Camptocamp SA 2011 # SQL inspired from OpenERP original code # # This program is free software: you can redistribute it and/or modify # it under...
nvbn/coviolations_web
refs/heads/develop
violations/tests/test_pep8.py
1
import sure from django.test import TestCase from tasks.const import STATUS_SUCCESS, STATUS_FAILED from ..pep8 import pep8_violation from .base import get_content class PEP8ViolationCase(TestCase): """PEP8 violation case""" def test_success(self): """Test success result""" data = {'raw': ''} ...
Azure/qpid-proton
refs/heads/master
examples/python/messenger/server.py
8
#!/usr/bin/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 # "Lice...
kevinkle/semantic
refs/heads/master
superphy/src/upload/tests/test_gene_location_upload.py
1
#!/usr/bin/env python # -*- coding: UTF-8 -*- import unittest import mock from collections import defaultdict import sys import traceback import subprocess import json import re import os from rdflib import Graph, Namespace, Literal, XSD from Bio.Blast import NCBIXML, Record from superphy.upload._sparql import chec...
bzbarsky/servo
refs/heads/master
tests/wpt/web-platform-tests/fetch/api/resources/method.py
161
def main(request, response): headers = [] if "cors" in request.GET: headers.append(("Access-Control-Allow-Origin", "*")) headers.append(("Access-Control-Allow-Credentials", "true")) headers.append(("Access-Control-Allow-Methods", "GET, POST, PUT, FOO")) headers.append(("Access-Co...
codeforamerica/pdfhook
refs/heads/master
src/pdfhook/__init__.py
3
# -*- coding: utf-8 -*- from flask import Blueprint blueprint = Blueprint( 'pdfhook', __name__, ) from . import views
delinhabit/django-rest-framework
refs/heads/master
tests/test_pagination.py
59
# coding: utf-8 from __future__ import unicode_literals import pytest from rest_framework import ( exceptions, filters, generics, pagination, serializers, status ) from rest_framework.pagination import PAGE_BREAK, PageLink from rest_framework.request import Request from rest_framework.test import APIRequestFactor...
Cyrillic327/p2pool
refs/heads/master
p2pool/test/util/test_pack.py
283
import unittest from p2pool.util import pack class Test(unittest.TestCase): def test_VarInt(self): t = pack.VarIntType() for i in xrange(2**20): assert t.unpack(t.pack(i)) == i for i in xrange(2**36, 2**36+25): assert t.unpack(t.pack(i)) == i
kawasaki2013/python-for-android-x86
refs/heads/master
python3-alpha/python3-src/Lib/lib2to3/pygram.py
170
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Export the Python grammar and symbols.""" # Python imports import os # Local imports from .pgen2 import token from .pgen2 import driver from . import pytree # The grammar file _GRAMMAR_FILE = os.path.join(os.path....
weimingtom/python-for-android
refs/heads/master
python-modules/twisted/twisted/conch/test/test_cftp.py
56
# -*- test-case-name: twisted.conch.test.test_cftp -*- # Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE file for details. """ Tests for L{twisted.conch.scripts.cftp}. """ import time, sys, os, operator, getpass, struct from StringIO import StringIO from twisted.conch.test.test_ssh import Crypto, ...
cr/fxos-certsuite
refs/heads/master
webapi_tests/semiauto/environment.py
7
#!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import time import threading from mozlog.structured import structuredlog from tornado.ioloop imp...
eriksf/atmosphere-cli
refs/heads/develop
tests/test_projects.py
1
import json from .mock_server import get_free_port, start_mock_server from atmosphere.api import AtmosphereAPI from atmosphere.main import AtmosphereApp from atmosphere.project import ProjectList class TestProjects(object): @classmethod def setup_class(cls): cls.mock_server_port = get_free_port() ...
fatcloud/PyCV-time
refs/heads/master
opencv-official-samples/3.0.0/logpolar.py
8
#!/usr/bin/env python import cv2 if __name__ == '__main__': import sys try: fn = sys.argv[1] except: fn = '../data/fruits.jpg' img = cv2.imread(fn) if img is None: print 'Failed to load image file:', fn sys.exit(1) img2 = cv2.logPolar(img, (img.shape[0]/2, img....
fmierlo/django-default-settings
refs/heads/master
release/1.3/app/models.py
10644
from django.db import models # Create your models here.
sio2project/oioioi
refs/heads/master
oioioi/plagiarism/urls.py
1
from django.conf.urls import url from oioioi.plagiarism import views app_name = 'plagiarism' contest_patterns = [ url( r'^moss_submit/$', views.moss_submit, name='moss_submit', ), ]