repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
fabtrompet/bomberman | refs/heads/master | testando.py | 1 | from Tkinter import *
root = Tk()
def find_in_grid(frame, row, column):
for children in frame.children.values():
info = children.grid_info()
#note that rows and column numbers are stored as string
if info['row'] == st... |
t794104/ansible | refs/heads/devel | lib/ansible/modules/notification/irc.py | 32 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Jan-Piet Mens <jpmens () 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',
... |
wzyuliyang/scrapy | refs/heads/master | extras/qps-bench-server.py | 178 | #!/usr/bin/env python
from __future__ import print_function
from time import time
from collections import deque
from twisted.web.server import Site, NOT_DONE_YET
from twisted.web.resource import Resource
from twisted.internet import reactor
class Root(Resource):
def __init__(self):
Resource.__init__(self... |
vwc/agita | refs/heads/master | src/agita.sitetheme/setup.py | 1 | from setuptools import setup, find_packages
import os
version = '1.0'
setup(name='agita.sitetheme',
version=version,
description="agita Diazo Plone Theme",
long_description=open("README.txt").read() + "\n" +
open(os.path.join("docs", "HISTORY.txt")).read(),
# Get more st... |
sdarji/lpthw | refs/heads/master | Lib/site-packages/pip/index.py | 343 | """Routines related to PyPI, indexes"""
import sys
import os
import re
import mimetypes
import posixpath
from pip.log import logger
from pip.util import Inf, normalize_name, splitext, is_prerelease
from pip.exceptions import (DistributionNotFound, BestVersionAlreadyInstalled,
InstallationE... |
Architektor/PySnip | refs/heads/master | venv/lib/python2.7/site-packages/twisted/internet/test/test_epollreactor.py | 39 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.internet.epollreactor}.
"""
from __future__ import division, absolute_import
from twisted.trial.unittest import TestCase
try:
from twisted.internet.epollreactor import _ContinuousPolling
except ImportError:
_Conti... |
Zord13appdesa/python-for-android | refs/heads/master | python-modules/twisted/twisted/web/test/test_soap.py | 55 | #
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
#
"""Test SOAP support."""
try:
import SOAPpy
except ImportError:
SOAPpy = None
class SOAPPublisher: pass
else:
from twisted.web import soap
SOAPPublisher = soap.SOAPPublisher
from twisted.trial import unittest
fr... |
KitKatXperience/platform_external_chromium_org | refs/heads/kk | chrome/test/functional/chromeos_ephemeral.py | 42 | # 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.
import logging
import os
import sys
import pyauto_functional # Must come before pyauto (and thus, policy_base).
import policy_base
sys.path.append('/u... |
alxgu/ansible | refs/heads/devel | lib/ansible/modules/cloud/ovirt/ovirt_instance_type.py | 12 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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'}
DOCU... |
mindbender-studio/setup | refs/heads/master | bin/windows/python36/Lib/site-packages/pip/_vendor/packaging/utils.py | 1126 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import re
_canonicalize_regex = re.compile(r"[-_.]+")
def canonicalize... |
azevakin/django-push-notifications | refs/heads/master | setup.py | 2 | #!/usr/bin/env python
import os.path
from distutils.core import setup
README = open(os.path.join(os.path.dirname(__file__), "README.rst")).read()
CLASSIFIERS = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"License ::... |
unaizalakain/django | refs/heads/master | tests/admin_checks/tests.py | 118 | from __future__ import unicode_literals
from django import forms
from django.contrib import admin
from django.contrib.admin import AdminSite
from django.contrib.contenttypes.admin import GenericStackedInline
from django.core import checks
from django.test import SimpleTestCase, override_settings
from .models import A... |
jiajiax/crosswalk-test-suite | refs/heads/master | webapi/tct-csp-w3c-tests/csp-py/csp_default-src_self_img_blocked-manual.py | 30 | def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
response.headers.set("Content-Security-Policy", "default-src 'self'")
response.headers.set("X... |
lesina/Hack70 | refs/heads/master | env/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/mbcharsetprober.py | 2923 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
sadmansk/servo | refs/heads/master | components/net/tests/cookie_http_state_utils.py | 111 | # 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 os
import subprocess
import tempfile
REPO = "https://github.com/abarth/http-state.git"
TEST_FILE = "cookie_http_... |
petercb/aggravator | refs/heads/master | aggravator/__init__.py | 1 | '''
Custom dynamic inventory script for Ansible, in Python.
This script will read in a configuration file either locally or fetched via HTTP and will
output a JSON data structure describing the inventory by merging the files as listed in
the config file.
Files can be in either YAML or JSON format
'''
# pylint: disab... |
fedora-infra/mote | refs/heads/master | mote/__init__.py | 1 | # -*- coding: utf-8 -*-
#
# Copyright © 2015-2016 Chaoyi Zha <cydrobolt@fedoraproject.org>
#
# 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 option) any later
# version. T... |
sruffell/asterisk-working | refs/heads/for-trunk | contrib/ast-db-manage/config/versions/21e526ad3040_add_pjsip_debug_option.py | 13 | """add pjsip debug option
Revision ID: 21e526ad3040
Revises: 2fc7930b41b3
Create Date: 2014-01-30 10:44:02.297455
"""
# revision identifiers, used by Alembic.
revision = '21e526ad3040'
down_revision = '2fc7930b41b3'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('ps_globals', sa.C... |
StackPointCloud/ansible-modules-extras | refs/heads/devel | packaging/language/pear.py | 157 | #!/usr/bin/python -tt
# -*- coding: utf-8 -*-
# (c) 2012, Afterburn <http://github.com/afterburn>
# (c) 2013, Aaron Bull Schaefer <aaron@elasticdog.com>
# (c) 2015, Jonathan Lestrelin <jonathan.lestrelin@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# i... |
leafclick/intellij-community | refs/heads/master | python/testData/completion/uninitialized/fun.py | 13 | f<caret>
def foo():
pass |
usersource/tasks | refs/heads/master | tasks_phonegap/Tasks/cordova/plugins/io.usersource.anno/tools/copytool2/oauth2client/locked_file.py | 144 | # Copyright 2011 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 to in writing,... |
divegeek/keyczar | refs/heads/master | cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/Tool/masm.py | 19 | """SCons.Tool.masm
Tool-specific initialization for the Microsoft Assembler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons F... |
ryano144/intellij-community | refs/heads/master | python/testData/paramInfo/SimpleMethod.py | 83 | class A:
def foo(self, a):
pass
a = A()
a.foo(<arg1>1)
|
hydroshare/hydroshare | refs/heads/develop | hs_access_control/tests/test_public_groups.py | 1 |
from django.test import TestCase
from django.contrib.auth.models import Group
from hs_access_control.models import PrivilegeCodes, GroupAccess
from hs_core import hydroshare
from hs_core.testing import MockIRODSTestCaseMixin
from hs_access_control.tests.utilities import global_reset, is_equal_to_as_set
class T01P... |
marcore/edx-platform | refs/heads/master | common/lib/capa/capa/xqueue_interface.py | 179 | #
# LMS Interface to external queueing system (xqueue)
#
import hashlib
import json
import logging
import requests
import dogstats_wrapper as dog_stats_api
log = logging.getLogger(__name__)
dateformat = '%Y%m%d%H%M%S'
XQUEUE_METRIC_NAME = 'edxapp.xqueue'
# Wait time for response from Xqueue.
XQUEUE_TIMEOUT = 35 #... |
xiaonanln/myleetcode-python | refs/heads/master | src/Symmetric Tree.py | 1 | # Definition for a binary tree node
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
# @param root, a tree node
# @return a boolean
def isSymmetric(self, root):
if root is None: return True
... |
raphaelmerx/django | refs/heads/master | django/test/__init__.py | 341 | """
Django Unit Test and Doctest framework.
"""
from django.test.client import Client, RequestFactory
from django.test.testcases import (
LiveServerTestCase, SimpleTestCase, TestCase, TransactionTestCase,
skipIfDBFeature, skipUnlessAnyDBFeature, skipUnlessDBFeature,
)
from django.test.utils import (
ignore... |
pombredanne/regex2dfa | refs/heads/master | tests.py | 3 | import unittest
import glob
import sys
sys.path.append(".")
import regex2dfa
class AllTests(unittest.TestCase):
def test_all_regexes(self):
regexes = glob.glob("tests/*.regex")
for filepath in regexes:
self._test_regex_file(filepath)
def _test_regex_file(self, filepath):
... |
zenoss/ZenPacks.community.AIX | refs/heads/master | ZenPacks/community/AIX/AIXFileSystem.py | 3 | __doc__="""AIXFileSystem
AIXFileSystem is a file system on an aix server
$Id: FileSystem.py,v 1.12 2004/04/06 22:33:23 edahl Exp $"""
import logging
log = logging.getLogger("zen.AIXFileSystem")
from Globals import DTMLFile
from Globals import InitializeClass
from Products.ZenUtils.Utils import prepId
from Products.... |
shaftoe/home-assistant | refs/heads/dev | script/inspect_schemas.py | 31 | #!/usr/bin/env python3
"""Inspect all component SCHEMAS."""
import os
import importlib
import pkgutil
from homeassistant.config import _identify_config_schema
from homeassistant.scripts.check_config import color
def explore_module(package):
"""Explore the modules."""
module = importlib.import_module(package)... |
fafaman/django | refs/heads/master | django/views/decorators/cache.py | 586 | from functools import wraps
from django.middleware.cache import CacheMiddleware
from django.utils.cache import add_never_cache_headers, patch_cache_control
from django.utils.decorators import (
available_attrs, decorator_from_middleware_with_args,
)
def cache_page(*args, **kwargs):
"""
Decorator for view... |
jhayworth/config | refs/heads/master | .emacs.d/elpy/rpc-venv/local/lib/python2.7/site-packages/pip/_vendor/requests/api.py | 37 | # -*- coding: utf-8 -*-
"""
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: Apache2, see LICENSE for more details.
"""
from . import sessions
def request(method, url, **kwargs):
"""Constructs and sends a :class:`Request <Request>`.
:para... |
mozilla/stoneridge | refs/heads/master | python/src/Lib/test/test_pkgutil.py | 113 | from test.test_support import run_unittest
import unittest
import sys
import imp
import pkgutil
import os
import os.path
import tempfile
import shutil
import zipfile
class PkgutilTests(unittest.TestCase):
def setUp(self):
self.dirname = tempfile.mkdtemp()
self.addCleanup(shutil.rmtree, self.dirn... |
teltek/edx-platform | refs/heads/master | openedx/core/djangoapps/auth_exchange/tests/mixins.py | 1 | """
Mixins to facilitate testing OAuth connections to Django-OAuth-Toolkit or
Django-OAuth2-Provider.
"""
from unittest import skip, expectedFailure
from django.test.client import RequestFactory
from openedx.core.djangoapps.oauth_dispatch import adapters
from openedx.core.djangoapps.oauth_dispatch.tests.constants imp... |
deiga/robotframework-selenium2library | refs/heads/master | test/lib/mockito/__init__.py | 69 | #!/usr/bin/env python
# coding: utf-8
'''Mockito is a Test Spy framework.'''
__copyright__ = "Copyright 2008-2010, Mockito Contributors"
__license__ = "MIT"
__maintainer__ = "Mockito Maintainers"
__email__ = "mockito-python@googlegroups.com"
from mockito import mock, verify, verifyNoMoreInteractions, verifyZeroInter... |
Filechaser/nzbToMedia | refs/heads/master | libs/beetsplug/metasync/amarok.py | 16 | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Heinz Wiesinger.
#
# 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 ... |
Intel-Corporation/tensorflow | refs/heads/master | tensorflow/python/data/util/sparse_test.py | 13 | # 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... |
vipul-sharma20/oh-mainline | refs/heads/master | vendor/packages/scrapy/scrapy/utils/trackref.py | 19 | """This module provides some functions and classes to record and report
references to live object instances.
If you want live objects for a particular class to be tracked, you only have to
subclass form object_ref (instead of object). Also, remember to turn on
tracking by enabling the TRACK_REFS setting.
About perfor... |
jriegel/FreeCAD | refs/heads/dev-assembly-next | src/Mod/Path/PathScripts/PathKurve.py | 16 | # -*- coding: utf-8 -*-
#***************************************************************************
#* *
#* Copyright (c) 2015 Dan Falck <ddfalck@gmail.com> *
#* ... |
fyffyt/scikit-learn | refs/heads/master | examples/linear_model/plot_lasso_and_elasticnet.py | 249 | """
========================================
Lasso and Elastic Net for Sparse Signals
========================================
Estimates Lasso and Elastic-Net regression models on a manually generated
sparse signal corrupted with an additive noise. Estimated coefficients are
compared with the ground-truth.
"""
print(... |
miccrun/smartcontrol | refs/heads/master | apps/control/models.py | 1 |
import json
import re
import urllib
import urllib2
from django.conf import settings
from django.db import models
import apps.control as control_constants
class Room(models.Model):
name = models.CharField(
max_length=30,
default='',
blank=False,
)
created = models.DateTimeField(a... |
vlegoff/tsunami | refs/heads/master | src/primaires/scripting/actions/blesser.py | 1 | # -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# 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
# ... |
Scalr/libcloud | refs/heads/trunk | libcloud/storage/drivers/ktucloud.py | 60 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... |
mesemus/fedoralink | refs/heads/master | fedoralink/models.py | 1 | import inspect
import logging
import django.dispatch
import rdflib
from io import BytesIO
from django.apps import apps
from rdflib import Literal
from rdflib.namespace import DC, RDF, XSD
from rdflib.term import URIRef
from fedoralink.fedorans import ACL
from .fedorans import FEDORA, EBUCORE
from .manager import Fed... |
rec/echomesh | refs/heads/master | code/python/external/pi3d/shape/MergeShape.py | 1 | import ctypes
import math
import random
from pi3d.constants import *
from pi3d import Texture
from pi3d.Buffer import Buffer
from pi3d.Shape import Shape
from pi3d.util.RotateVec import rotate_vec_x, rotate_vec_y, rotate_vec_z
class MergeShape(Shape):
""" 3d model inherits from Shape. As there is quite a time pena... |
vgrachev8/youtube-dl | refs/heads/master | youtube_dl/extractor/tf1.py | 3 | # coding: utf-8
import json
import re
from .common import InfoExtractor
class TF1IE(InfoExtractor):
"""TF1 uses the wat.tv player."""
_VALID_URL = r'http://videos\.tf1\.fr/.*-(.*?)\.html'
_TEST = {
u'url': u'http://videos.tf1.fr/auto-moto/citroen-grand-c4-picasso-2013-presentation-officielle-8062... |
smmribeiro/intellij-community | refs/heads/master | python/testData/completion/mockPatchObject1/lib/unittest/mock.py | 181 | def patch():
pass
patch.object = None |
Peddle/hue | refs/heads/master | desktop/core/ext-py/django-openid-auth-0.5/django_openid_auth/management/__init__.py | 100 | # django-openid-auth - OpenID integration for django.contrib.auth
#
# Copyright (C) 2009-2013 Canonical Ltd.
#
# 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 ... |
gnieboer/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/ops/seq2seq_ops.py | 61 | # 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... |
FrancoisRheaultUS/dipy | refs/heads/master | dipy/io/tests/test_streamline.py | 8 | import json
import os
from dipy.data import fetch_gold_standard_io
from dipy.io.streamline import (load_tractogram, save_tractogram,
load_trk, save_trk)
from dipy.io.stateful_tractogram import Space, StatefulTractogram
from dipy.io.utils import create_nifti_header
from dipy.io.vtk impor... |
pranavtendolkr/horizon | refs/heads/master | openstack_dashboard/test/integration_tests/pages/admin/system/flavorspage.py | 36 | # 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
# d... |
saullocastro/pyNastran | refs/heads/master | pyNastran/gui/vtk_examples/mesh_label_image.py | 1 | import vtk
meta_image_filename = 'labels.mhd'
# Prepare to read the file
reader_volume = vtk.vtkMetaImageReader()
reader_volume.SetFileName(meta_image_filename)
reader_volume.Update()
# Extract the region of interest
voi = vtk.vtkExtractVOI()
if vtk.VTK_MAJOR_VERSION <= 5:
voi.SetInput(reader_volume.GetOutput(... |
ezigman/pjsip-upstream | refs/heads/master | tests/pjsua/scripts-call/301_ice_public_b.py | 59 | # $Id: 301_ice_public_b.py 2392 2008-12-22 18:54:58Z bennylp $
#
from inc_cfg import *
# This test:
# to make call with ICE but without STUN.
# Note:
# - need --dis-codec to make INVITE packet less than typical MTU
uas_args = "--null-audio --id=\"<sip:test1@pjsip.org>\" --registrar=sip:sip.pjsip.org --username=test... |
x111ong/django | refs/heads/master | django/conf/locale/cy/formats.py | 504 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y' # '25 Hy... |
fernandog/Medusa | refs/heads/optimized | ext/dogpile/cache/backends/__init__.py | 70 | from dogpile.cache.region import register_backend
register_backend(
"dogpile.cache.null", "dogpile.cache.backends.null", "NullBackend")
register_backend(
"dogpile.cache.dbm", "dogpile.cache.backends.file", "DBMBackend")
register_backend(
"dogpile.cache.pylibmc", "dogpile.cache.backends.memcached",
"Pyl... |
rbrito/pkg-youtube-dl | refs/heads/master | youtube_dl/extractor/mediasite.py | 11 | # coding: utf-8
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urlparse,
)
from ..utils import (
ExtractorError,
float_or_none,
mimetype2ext,
str_or_none,
try_get,
unescapeHTML,
unsmuggle_url... |
arkarkark/snippy | refs/heads/master | app/lookup.py | 1 | # Copyright 2009 Alex K (wtwf.com) All rights reserved.
__author__ = "wtwf.com (Alex K)"
import urllib
import logging
import os
import socket
from google.appengine.api import urlfetch
from google.appengine.api import users
import jinja2
from wtwf import wtwfhandler
import model
import snippy_config
__pychecker__ ... |
SauloAislan/ironic | refs/heads/SauloAislan-WIP | ironic/api/controllers/link.py | 13 | # Copyright 2013 Red Hat, Inc.
# 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... |
liamgh/liamgreenhughes-sl4a-tf101 | refs/heads/master | python/src/Lib/plat-linux2/CDROM.py | 330 | # Generated by h2py from /usr/include/linux/cdrom.h
CDROMPAUSE = 0x5301
CDROMRESUME = 0x5302
CDROMPLAYMSF = 0x5303
CDROMPLAYTRKIND = 0x5304
CDROMREADTOCHDR = 0x5305
CDROMREADTOCENTRY = 0x5306
CDROMSTOP = 0x5307
CDROMSTART = 0x5308
CDROMEJECT = 0x5309
CDROMVOLCTRL = 0x530a
CDROMSUBCHNL = 0x530b
CDROMREADMODE2 = 0x530c
... |
mrroach/CentralServer | refs/heads/master | csrv/model/cards/runner/card01045_test.py | 1 | import unittest
from csrv.model import deck
from csrv.model import game
from csrv.model import premade_decks
from csrv.model import test_base
from csrv.model import timing_phases
from csrv.model.cards import card_info
from csrv.model.cards.runner import card01045
class TestCard01045(test_base.TestBase):
RUNNER_DECK... |
MER-GROUP/intellij-community | refs/heads/master | python/testData/paramInfo/SimpleClassFunction.py | 83 | class A:
def foo(self, a):
pass
a = A()
A.foo(<arg1>a, <arg2>1)
|
aspidites/beets | refs/heads/master | beets/util/__init__.py | 1 | # This file is part of beets.
# Copyright 2012, Adrian Sampson.
#
# 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, ... |
agaffney/ansible | refs/heads/devel | test/units/utils/test_vars.py | 50 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2015, Toshio Kuraotmi <tkuratomi@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, eithe... |
sureleo/leetcode | refs/heads/master | archive/python/dynamic_programming/PalindromePartitioningII.py | 2 | class Solution:
# @param s, a string
# @return an integer
def minCut(self, s):
matrix = [[False for i in xrange(len(s))] for i in xrange(len(s))]
for i in xrange(len(s)):
matrix[i][i] = True
for i in xrange(len(s)-1):
if s[i+1] == s[i]:
... |
quantenschaum/piripherals | refs/heads/master | tests/test_util.py | 1 | import pytest
from unittest.mock import Mock, patch
from piripherals.util import *
from time import sleep
def test_fork():
func = Mock()
fork(func)
sleep(0.3)
func.assert_called_once_with()
def test_not_raising(capsys):
func = Mock()
func.side_effect = Exception('Boom!')
func2 = not_rais... |
jriegel/FreeCAD | refs/heads/dev-assembly-next | src/Mod/Path/PathScripts/linuxcnc_post.py | 20 | #***************************************************************************
#* (c) sliptonic (shopinthewoods@gmail.com) 2014 *
#* *
#* This file is part of the FreeCAD CAx development system. *
#* ... |
iancze/Pysplotter | refs/heads/master | conf.py | 1 | # -*- coding: utf-8 -*-
#
# Pysplotter documentation build configuration file, created by
# sphinx-quickstart on Sat Sep 10 15:19:07 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... |
delhivery/django | refs/heads/master | tests/utils_tests/test_module_loading.py | 281 | import imp
import os
import sys
import unittest
from importlib import import_module
from zipimport import zipimporter
from django.test import SimpleTestCase, modify_settings
from django.test.utils import extend_sys_path
from django.utils import six
from django.utils._os import upath
from django.utils.module_loading im... |
factorlibre/OCB | refs/heads/8.0 | addons/portal_sale/__openerp__.py | 380 | # -*- 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... |
alexlo03/ansible | refs/heads/devel | lib/ansible/modules/windows/win_audit_policy_system.py | 28 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Noah Sparks <nsparks@outlook.com>
# 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'... |
abusalimov/pytest | refs/heads/master | testing/cx_freeze/tox_run.py | 200 | """
Called by tox.ini: uses the generated executable to run the tests in ./tests/
directory.
.. note:: somehow calling "build/runtests_script" directly from tox doesn't
seem to work (at least on Windows).
"""
if __name__ == '__main__':
import os
import sys
executable = os.path.join(os... |
otadmor/Open-Knesset | refs/heads/master | mks/migrations/0028_knesset_18.py | 10 | # -*- 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: Remember to use orm['appname.ModelName'] rather than "from appname.m... |
nemesisdesign/django | refs/heads/master | django/contrib/sessions/backends/db.py | 118 | import logging
from django.contrib.sessions.backends.base import (
CreateError, SessionBase, UpdateError,
)
from django.core.exceptions import SuspiciousOperation
from django.db import DatabaseError, IntegrityError, router, transaction
from django.utils import timezone
from django.utils.encoding import force_text
... |
Weil0ng/gem5 | refs/heads/master | configs/common/SysPaths.py | 32 | # Copyright (c) 2006 The Regents of The University of Michigan
# 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 ... |
Samuel789/MediPi | refs/heads/master | MedManagementWeb/env/lib/python3.5/site-packages/pytz/tzinfo.py | 380 | '''Base classes and helpers for building zone specific tzinfo classes'''
from datetime import datetime, timedelta, tzinfo
from bisect import bisect_right
try:
set
except NameError:
from sets import Set as set
import pytz
from pytz.exceptions import AmbiguousTimeError, NonExistentTimeError
__all__ = []
_time... |
appsembler/edx-platform | refs/heads/appsembler/tahoe/master | scripts/xsslint/tests/test_utils.py | 15 | from unittest import TestCase
from ddt import data, ddt
from xsslint.utils import StringLines
@ddt
class TestStringLines(TestCase):
"""
Test StringLines class.
"""
@data(
{'string': 'test', 'index': 0, 'line_start_index': 0, 'line_end_index': 4},
{'string': 'test', 'index': 2, 'line_... |
gojira/tensorflow | refs/heads/master | tensorflow/contrib/timeseries/python/timeseries/ar_model.py | 14 | # 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... |
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2019_08_01/aio/operations/_domain_registration_provider_operations.py | 1 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
nicolargo/intellij-community | refs/heads/master | plugins/hg4idea/testData/bin/hgext/largefiles/proto.py | 92 | # Copyright 2011 Fog Creek Software
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import os
import urllib2
from mercurial import error, httppeer, util, wireproto
from mercurial.wireproto import batchable, future
from mercurial.... |
QuantCrimAtLeeds/PredictCode | refs/heads/master | tests/gui/predictors/stscan_test.py | 1 | from .helper import *
import open_cp.gui.predictors.stscan as stscan
import datetime
def test_STScan(model, project_task, analysis_model, grid_task):
provider = stscan.STScan(model)
assert provider.settings_string == "geo(50%/3000m) time(50%/60days)"
standard_calls(provider, project_task, analysis_model, ... |
valexandersaulys/prudential_insurance_kaggle | refs/heads/master | venv/lib/python2.7/site-packages/numpy/core/machar.py | 141 | """
Machine arithmetics - determine the parameters of the
floating-point arithmetic system
Author: Pearu Peterson, September 2003
"""
from __future__ import division, absolute_import, print_function
__all__ = ['MachAr']
from numpy.core.fromnumeric import any
from numpy.core.numeric import errstate
# Need to speed ... |
ypu/tp-qemu | refs/heads/master | qemu/tests/timerdevice_change_guest_clksource.py | 3 | import logging
import re
from autotest.client.shared import error
from virttest import data_dir, storage, utils_disk, env_process
@error.context_aware
def run(test, params, env):
"""
Timer device check guest after update kernel line without kvmclock:
1) Boot a guest with kvm-clock
2) Check the curren... |
iamutkarshtiwari/sympy | refs/heads/master | sympy/integrals/__init__.py | 59 | """Integration functions that integrates a sympy expression.
Examples
========
>>> from sympy import integrate, sin
>>> from sympy.abc import x
>>> integrate(1/x,x)
log(x)
>>> integrate(sin(x),x)
-cos(x)
"""
from .integrals import integrate, Integral, line_integrate
from .transforms im... |
eeshangarg/oh-mainline | refs/heads/master | vendor/packages/celery/celery/tests/test_events/test_events_state.py | 18 | from __future__ import absolute_import
from time import time
from itertools import count
from celery import states
from celery.events import Event
from celery.events.state import State, Worker, Task, HEARTBEAT_EXPIRE
from celery.utils import uuid
from celery.tests.utils import unittest
class replay(object):
d... |
faulkner/prospector | refs/heads/master | prospector/suppression.py | 2 | r"""
Each tool has its own method of ignoring errors and warnings.
For example, pylint requires a comment of the form
# pylint disable=<error codes>
PEP8 will not warn on lines with
# noqa
Additionally, flake8 follows that convention for pyflakes errors,
but pyflakes itself does not.
Finally, an entire fil... |
endlessm/chromium-browser | refs/heads/master | content/test/gpu/gold_inexact_matching/parameter_set.py | 1 | # Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
class ParameterSet(object):
"""Struct-like object for holding parameters for an iteration."""
def __init__(self, max_diff, delta_threshold, edge_thresh... |
ccn-2m/django | refs/heads/master | django/conf/locale/de/formats.py | 107 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = 'j. F Y H:i:s'
YEAR_MONTH... |
shaialon/vim-awesome | refs/heads/master | db/categories.py | 5 | import collections
import os
import rethinkdb as r
import yaml
import db.util
r_conn = db.util.r_conn
def get_all():
filename = os.path.join(os.path.dirname(__file__), 'categories.yaml')
with open(filename) as f:
categories = yaml.safe_load(f)
_aggregate_category_tags(categories)
return c... |
wshallum/ansible | refs/heads/devel | lib/ansible/utils/module_docs_fragments/auth_basic.py | 39 | # 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 distributed in the hope that ... |
kartikluke/chammakbot | refs/heads/master | vendored/urllib3/util/ssl_.py | 87 | from __future__ import absolute_import
import errno
import warnings
import hmac
from binascii import hexlify, unhexlify
from hashlib import md5, sha1, sha256
from ..exceptions import SSLError, InsecurePlatformWarning, SNIMissingWarning
SSLContext = None
HAS_SNI = False
IS_PYOPENSSL = False
IS_SECURETRANSPORT = Fals... |
poddus/gtrnkvrkf | refs/heads/master | alchemy/initialize_db.py | 1 | from config import *
from sqlalchemy import Table, Column, Integer, Float, String, DateTime, MetaData, join, ForeignKey
from sqlalchemy.orm import relationship
class Product(Base):
"""
Common base class for all products.
A 'unit' is the smallest deliverable unit.
"""
__tablename__ = "tblProducts"
artNum = Col... |
mrquim/mrquimrepo | refs/heads/master | repo/script.module.youtube.dl/lib/youtube_dl/extractor/rds.py | 57 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
parse_duration,
parse_iso8601,
js_to_json,
)
from ..compat import compat_str
class RDSIE(InfoExtractor):
IE_DESC = 'RDS.ca'
_VALID_URL = r'https?://(?:www\.)?rds\.ca/vid(?:[eé]|%C3%A9)o... |
PokemonGoF/PokemonGo-Bot-Desktop | refs/heads/development | build/pywin/Lib/encodings/mac_croatian.py | 593 | """ Python Character Mapping Codec mac_croatian generated from 'MAPPINGS/VENDORS/APPLE/CROATIAN.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_table)
def decode(self,inp... |
Petrole/MaturePyRobots | refs/heads/master | WebPyRobot/backend/migrations/0008_notification.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-11-15 09:47
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_depende... |
bashrc/zeronet-debian | refs/heads/master | src/update.py | 1 | #!/usr/bin/python
import urllib
import zipfile
import os
import ssl
import httplib
import socket
import re
import cStringIO as StringIO
from gevent import monkey
monkey.patch_all()
def update():
# Gevent https bug workaround (https://github.com/gevent/gevent/issues/477)
reload(socket)
reload(httplib)
... |
ahamilton55/ansible | refs/heads/devel | lib/ansible/modules/cloud/ovirt/ovirt_datacenters_facts.py | 45 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... |
alisaifee/AutobahnPython | refs/heads/master | examples/asyncio/websocket/echo/server.py | 13 | ###############################################################################
##
## Copyright (C) 2013-2014 Tavendo GmbH
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## h... |
RachitKansal/scikit-learn | refs/heads/master | sklearn/random_projection.py | 207 | # -*- coding: utf8
"""Random Projection transformers
Random Projections are a simple and computationally efficient way to
reduce the dimensionality of the data by trading a controlled amount
of accuracy (as additional variance) for faster processing times and
smaller model sizes.
The dimensions and distribution of Ra... |
deberon/ansible-modules-extras | refs/heads/devel | packaging/os/pkgin.py | 43 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Shaun Zinck
# Written by Shaun Zinck <shaun.zinck at gmail.com>
# Based on pacman module written by Afterburn <http://github.com/afterburn>
# that was based on apt module written by Matthew Williams <matthew@flowroute.com>
#
# This module is free software: you can... |
enclose-io/compiler | refs/heads/master | current/tools/specialize_node_d.py | 6 | #!/usr/bin/env python
#
# specialize_node_d.py output_file src/node.d flavor arch
#
# Specialize node.d for given flavor (`freebsd`) and arch (`x64` or `ia32`)
#
from __future__ import print_function
import re
import sys
if len(sys.argv) != 5:
print("usage: specialize_node_d.py outfile src/node.d flavor arch")
s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.