repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
stackforge/nova-powervm | refs/heads/master | nova_powervm/tests/virt/powervm/disk/test_imagecache.py | 2 | # Copyright 2018 IBM Corp.
#
# 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 a... |
JioCloud/nova | refs/heads/master | nova/tests/functional/v3/test_flavor_access.py | 29 | # Copyright 2013 IBM Corp.
#
# 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 t... |
zhreshold/mxnet | refs/heads/master | python/mxnet/ndarray/__init__.py | 13 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
shaded-enmity/yum-utils | refs/heads/master | plugins/ps/ps.py | 5 | #! /usr/bin/python -tt
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that ... |
raybuhr/grab | refs/heads/master | test/pycurl_cookie.py | 13 | # coding: utf-8
"""
This test case has written to help me
understand how pycurl lib works with cookies
"""
import pycurl
from six import BytesIO
from six.moves.http_cookiejar import CookieJar
from grab.error import GrabMisuseError
from test.util import BaseGrabTestCase
from grab.cookie import create_cookie
# http://x... |
Treefunder/pycoin | refs/heads/master | pycoin/services/providers.py | 20 | import importlib
import random
from .env import main_cache_dir, service_providers_for_env, tx_read_cache_dirs, tx_writable_cache_dir
from .tx_db import TxDb
SERVICE_PROVIDERS = ["BLOCKCHAIN_INFO", "BLOCKEXPLORER", "BLOCKR_IO", "BITEASY"]
class NoServicesSpecifiedError(Exception):
pass
def service_provider_me... |
normanmaurer/autobahntestsuite-maven-plugin | refs/heads/master | src/main/resources/twisted/news/nntp.py | 39 | # -*- test-case-name: twisted.news.test.test_nntp -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
NNTP protocol support.
The following protocol commands are currently understood::
LIST LISTGROUP XOVER XHDR
POST GROUP ARTICLE ... |
IsticGLA/SIT | refs/heads/master | simulation/old/recordImage.py | 1 | #!/usr/bin/env python
import rospy
from geometry_msgs.msg import Pose
from geometry_msgs.msg import Point
import cv2
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
class ImageRegister:
def __init__(self):
print("init")
rospy.init_node("cat_node")
self.subscriber = rospy.Subscrib... |
wathsalav/xos | refs/heads/master | xos/core/models/image.py | 1 | import os
from django.db import models
from core.models import PlCoreBase
from core.models import Deployment, DeploymentPrivilege, Controller,ControllerLinkManager,ControllerLinkDeletionManager
# Create your models here.
class Image(PlCoreBase):
name = models.CharField(max_length=256, unique=True)
disk_format... |
graik/biskit | refs/heads/master | biskit/md/distanceTrajectory.py | 1 | ## Biskit, a toolkit for the manipulation of macromolecular structures
## Copyright (C) 2004-2019 Raik Gruenberg & Johan Leckner
##
## 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 vers... |
dmilith/SublimeText3-dmilith | refs/heads/master | Package Storage/lsp_utils/node-runtime/12.20.2/node/lib/node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_sln.py | 11 | #!/usr/bin/env python
# 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.
"""Prints the information in a sln file in a diffable way.
It first outputs each projects in alphabetical order with their
dependenci... |
oceansystemslab/kvh_gyroscope | refs/heads/master | src/node_kvh.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Software License Agreement (BSD License)
#
# Copyright (c) 2014, Ocean Systems Laboratory, Heriot-Watt University, UK.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follow... |
faust64/ansible | refs/heads/devel | lib/ansible/utils/module_docs_fragments/netapp.py | 52 | #
# (c) 2016, Sumit Kumar <sumit4@netapp.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 versi... |
pyrrho314/recipesystem | refs/heads/master | trunk/devel/pygacq/test/test_mos_box_detection.py | 1 | from testutil import assert_tolerance, get_data_file_name
from nose.tools import assert_equals
import userinterface as ui
from acquisitionimage import AcquisitionImage
from multiobjectspectroscopy import find_optimal_box
#import gacqlogging
#gacqlogging.setup_logging(None, True)
# all centers in this file are from... |
andaviaco/tronido | refs/heads/master | src/syntax/symtable.py | 1 | import pprint as pp
GLOBAL_CONTEXT = 'g'
class SymTableError(Exception):
pass
class SymTable(object):
_table = {GLOBAL_CONTEXT: {}}
current_contex = GLOBAL_CONTEXT
"""docstring for SymTable."""
def __init__(self):
super().__init__()
@staticmethod
def show():
pp.pprint(... |
alexlo03/ansible | refs/heads/devel | lib/ansible/modules/cloud/vmware/vmware_guest_boot_manager.py | 23 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.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__ ... |
leiferikb/bitpop | refs/heads/master | build/third_party/buildbot_8_4p1/buildbot/test/unit/test_master.py | 4 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
jjanssen/django-cms-timetravel | refs/heads/master | cms_timetravel/urls.py | 1 | from django.conf.urls.defaults import url, patterns
from .views import TimetravelView
urlpatterns = patterns('cms_timetravel',
url(r'^$', TimetravelView.as_view(), name='timetravel'),
)
|
912/M-new | refs/heads/master | virtualenvironment/tourism_industry/lib/python2.7/site-packages/setuptools/tests/test_dist_info.py | 452 | """Test .dist-info style distributions.
"""
import os
import shutil
import tempfile
import unittest
import textwrap
try:
import ast
except:
pass
import pkg_resources
from setuptools.tests.py26compat import skipIf
def DALS(s):
"dedent and left-strip"
return textwrap.dedent(s).lstrip()
class TestDist... |
thepiper/standoff | refs/heads/master | venv/lib/python2.7/site-packages/flask/templating.py | 783 | # -*- coding: utf-8 -*-
"""
flask.templating
~~~~~~~~~~~~~~~~
Implements the bridge to Jinja2.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import posixpath
from jinja2 import BaseLoader, Environment as BaseEnvironment, \
TemplateNotFound
from .glo... |
GitHublong/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/gdal/base.py | 224 | from ctypes import c_void_p
from django.contrib.gis.gdal.error import GDALException
from django.utils import six
class GDALBase(object):
"""
Base object for GDAL objects that has a pointer access property
that controls access to the underlying C pointer.
"""
# Initially the pointer is NULL.
_p... |
bearstech/modoboa | refs/heads/master | modoboa/core/urls.py | 1 | """Core urls."""
from __future__ import unicode_literals
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.RootDispatchView.as_view(), name="root"),
url(r'^dashboard/$', views.DashboardView.as_view(), name="dashboard"),
url(r'^accounts/login/$', views.dologin, name="... |
alphafoobar/intellij-community | refs/heads/master | python/testData/inspections/PyMissingConstructorInspection/innerClass.py | 75 |
class Base(object):
def __init__(self, param):
print "Base", param
class Wrapper(object):
class Child(Base):
def __init__(self, param1, param2):
# Here PyCharm claims no super call
super(Wrapper.Child, self).__init__(param2)
print "Child", param1
def __init__(self):
self.child = ... |
mozilla/addons-server | refs/heads/master | src/olympia/api/tests/test_models.py | 7 | from unittest import mock
from django.core import mail
from django.db import IntegrityError
from olympia.amo.tests import TestCase
from olympia.users.models import UserProfile
from ..models import SYMMETRIC_JWT_TYPE, APIKey, APIKeyConfirmation
class TestAPIKey(TestCase):
fixtures = ['base/addon_3615', 'base/us... |
mhbu50/frappe | refs/heads/develop | frappe/patches/v7_0/desktop_icons_hidden_by_admin_as_blocked.py | 22 | import frappe
def execute():
# all icons hidden in standard are "blocked"
# this is for the use case where the admin wants to remove icon for everyone
# in 7.0, icons may be hidden by default, but still can be shown to the user
# e.g. Accounts, Stock etc, so we need a new property for blocked
if frappe.db.table... |
joeedh/cserver | refs/heads/master | cs_parse.py | 1 | import os.path
from ply import yacc
from cs_lex import *
from cs_ast import *
"""
grammar format:
<$include file.ct>
<#
c code
#>
<html code>
<#include "something.ccs">
<a href=<#=str "some_c_func()">>
so it's a templating system.
"""
def p_statementlist(p):
''' statementlist : statement
... |
ajoaoff/django | refs/heads/master | django/contrib/staticfiles/apps.py | 473 | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class StaticFilesConfig(AppConfig):
name = 'django.contrib.staticfiles'
verbose_name = _("Static Files")
|
TangHao1987/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/core/cache/__init__.py | 71 | """
Caching framework.
This package defines set of cache backends that all conform to a simple API.
In a nutshell, a cache is a set of values -- which can be any object that
may be pickled -- identified by string keys. For the complete API, see
the abstract BaseCache class in django.core.cache.backends.base.
Client ... |
dawran6/zulip | refs/heads/master | zerver/views/realm_filters.py | 27 | from __future__ import absolute_import
from typing import Text
from django.core.exceptions import ValidationError
from django.http import HttpRequest, HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.utils.translation import ugettext as _
from zerver.decorator import has_request_variables... |
antmobilogy/RaspberryPi | refs/heads/master | gpio/gpioclean.py | 1 | #!/usr/bin/env python
from time import sleep
import os
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(23, GPIO.IN)
GPIO.setup(24, GPIO.OUT)
# except KeyboardInterrupt:
# GPIO.cleanup() # clean up GPIO on CTRL+C exit
GPIO.cleanup() # clean up GPIO on normal exit |
atris/gpdb | refs/heads/master | gpMgmt/bin/pythonSrc/PyGreSQL-4.0/tutorial/func.py | 59 | # func.py - demonstrate the use of SQL functions
# inspired from the PostgreSQL tutorial
# adapted to Python 1995 by Pascal ANDRE
print """
__________________________________________________________________
MODULE FUNC.PY : SQL FUNCTION DEFINITION TUTORIAL
This module is designed for being imported from python promp... |
ProfessorX/Config | refs/heads/master | .PyCharm30/system/python_stubs/-1247972723/samba/dcerpc/srvsvc/Statistics.py | 1 | # encoding: utf-8
# module samba.dcerpc.srvsvc
# from /usr/lib/python2.7/dist-packages/samba/dcerpc/srvsvc.so
# by generator 1.135
""" srvsvc DCE/RPC """
# imports
import dcerpc as __dcerpc
import talloc as __talloc
class Statistics(__talloc.Object):
# no doc
def __init__(self, *args, **kwargs): # real signa... |
ycaihua/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/multiprocessing/semaphore_tracker.py | 100 | #
# On Unix we run a server process which keeps track of unlinked
# semaphores. The server ignores SIGINT and SIGTERM and reads from a
# pipe. Every other process of the program has a copy of the writable
# end of the pipe, so we get EOF when all other processes have exited.
# Then the server process unlinks any remai... |
arielalmendral/ert | refs/heads/master | python/python/ert_gui/ertwidgets/caseselector.py | 3 | from PyQt4.QtGui import QComboBox
from ert_gui import ERT
from ert_gui.ertwidgets import addHelpToWidget
from ert_gui.ertwidgets.models.ertmodel import getAllCases, selectOrCreateNewCase, getCurrentCaseName, getAllInitializedCases
class CaseSelector(QComboBox):
def __init__(self, update_ert=True, show_only_initi... |
linktlh/Toontown-journey | refs/heads/master | toontown/classicchars/DistributedGoofy.py | 5 | from pandac.PandaModules import *
import DistributedCCharBase
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM, State
from direct.fsm import State
import CharStateDatas
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocalizer
class DistributedGoofy(Dis... |
Javiercerna/MissionPlanner | refs/heads/master | Lib/site-packages/numpy/ma/tests/test_regression.py | 60 | from numpy.testing import *
import numpy as np
rlevel = 1
class TestRegression(TestCase):
def test_masked_array_create(self,level=rlevel):
"""Ticket #17"""
x = np.ma.masked_array([0,1,2,3,0,4,5,6],mask=[0,0,0,1,1,1,0,0])
assert_array_equal(np.ma.nonzero(x),[[1,2,6,7]])
def test_masked... |
a-doumoulakis/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/division_past_test.py | 63 | # 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... |
H-uru/korman | refs/heads/master | korman/exporter/physics.py | 1 | # This file is part of Korman.
#
# Korman 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.
#
# Korman is distributed i... |
abhijeet9920/python_project | refs/heads/master | develop/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/base.py | 355 | from __future__ import absolute_import, division, unicode_literals
from xml.dom import Node
from ..constants import namespaces, voidElements, spaceCharacters
__all__ = ["DOCUMENT", "DOCTYPE", "TEXT", "ELEMENT", "COMMENT", "ENTITY", "UNKNOWN",
"TreeWalker", "NonRecursiveTreeWalker"]
DOCUMENT = Node.DOCUMEN... |
Eric89GXL/numpy | refs/heads/master | numpy/f2py/tests/test_semicolon_split.py | 14 | from __future__ import division, absolute_import, print_function
from . import util
from numpy.testing import assert_equal
class TestMultiline(util.F2PyTest):
suffix = ".pyf"
module_name = "multiline"
code = """
python module {module}
usercode '''
void foo(int* x) {{
char dummy = ';';
*x = 42;... |
BogusCurry/tundra | refs/heads/tundra2 | tools/tests/launchtundra.py | 6 | #!/usr/local/bin/python
#import
import os
import os.path
import subprocess
from optparse import OptionParser
import config
import autoreport
# folder config
scriptDir = config.scriptDir
rexbinDir = config.rexbinDir
testDir = config.testDir
logsDir = config.tundraLogsDir
# output files
serverOutput = logsDir + "/s.ou... |
cdubz/takeout-inspector | refs/heads/master | takeout_inspector/talk.py | 1 | """takeout_inspector/talk.py
Defines classes and methods used to generate graphs for Google Talk data (based on a Google Mail takeout file).
Copyright (c) 2016 Christopher Charbonneau Wells
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation file... |
apparena/docs | refs/heads/master | readthedocs/core/management/commands/reindex_elasticsearch.py | 7 | import logging
from optparse import make_option
from django.core.management.base import BaseCommand
from django.conf import settings
from builds.models import Version
from search import parse_json
from restapi.utils import index_search_request
log = logging.getLogger(__name__)
class Command(BaseCommand):
opti... |
lovexiaov/SandwichApp | refs/heads/master | venv/lib/python2.7/site-packages/py2app/bootstrap/import_encodings.py | 10 | def _import_encodings():
import os
import imp
import encodings
import pkgutil
import sys
del sys.path[:2]
import encodings.aliases
encodings.__path__ = pkgutil.extend_path(
encodings.__path__,
encodings.__name__)
#imp.reload(encodings)
import encodings.m... |
postrational/django | refs/heads/master | tests/model_package/tests.py | 150 | from __future__ import absolute_import
from django.contrib.sites.models import Site
from django.db import models
from django.test import TestCase
from .models.publication import Publication
from .models.article import Article
class Advertisment(models.Model):
customer = models.CharField(max_length=100)
publ... |
katiecheng/Bombolone | refs/heads/master | env/lib/python2.7/site-packages/simplejson/tests/test_default.py | 261 | from unittest import TestCase
import simplejson as json
class TestDefault(TestCase):
def test_default(self):
self.assertEquals(
json.dumps(type, default=repr),
json.dumps(repr(type)))
|
tmikov/jscomp | refs/heads/develop | runtime/deps/gyp/test/mac/gyptest-infoplist-process.py | 34 | #!/usr/bin/env python
# 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.
"""
Verifies the Info.plist preprocessor functionality.
"""
import TestGyp
import sys
if sys.platform == 'darwin':
print "This test is ... |
ovnicraft/openerp-restaurant | refs/heads/master | base_report_designer/wizard/__init__.py | 421 | # -*- 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... |
sundayliu/npm-www | refs/heads/master | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py | 1049 | # Copyright (c) 2011 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.
import re
import os
def XmlToString(content, encoding='utf-8', pretty=False):
""" Writes the XML content to disk, touching the file only if it has changed.
... |
henryfjordan/django | refs/heads/master | tests/template_tests/filter_tests/test_yesno.py | 430 | from django.template.defaultfilters import yesno
from django.test import SimpleTestCase
class FunctionTests(SimpleTestCase):
def test_true(self):
self.assertEqual(yesno(True), 'yes')
def test_false(self):
self.assertEqual(yesno(False), 'no')
def test_none(self):
self.assertEqual... |
pankeshang/django-allauth | refs/heads/master | allauth/socialaccount/providers/facebook/tests.py | 48 | try:
from mock import patch
except ImportError:
from unittest.mock import patch
import json
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from django.test.client import RequestFactory
from allauth.socialaccount.tests import create_oauth2_tests
from allauth.tests ... |
edevil/django | refs/heads/master | django/contrib/postgres/operations.py | 111 | from django.contrib.postgres.signals import register_hstore_handler
from django.db.migrations.operations.base import Operation
class CreateExtension(Operation):
reversible = True
def __init__(self, name):
self.name = name
def state_forwards(self, app_label, state):
pass
def database... |
dasMalle/AScriptADay2016 | refs/heads/master | January/11-Singleton/singleton.py | 1 | # today just a singleton pattern, with help from this book: https://www.packtpub.com/application-development/python-unlocked
# I find singletons super useful in game development, in normal software dev be careful with them though!
from six import with_metaclass
class Singleton(type):
_registry = {}
def __cal... |
fprados/nipype | refs/heads/master | nipype/interfaces/freesurfer/tests/test_auto_SmoothTessellation.py | 5 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.freesurfer.utils import SmoothTessellation
def test_SmoothTessellation_inputs():
input_map = dict(args=dict(argstr='%s',
),
curvature_averaging_iterations=dict(argstr='-a %d',
position=-... |
schlos/eden | refs/heads/master | modules/s3/s3fields.py | 7 | # -*- coding: utf-8 -*-
""" S3 Extensions for gluon.dal.Field, reusable fields
@requires: U{B{I{gluon}} <http://web2py.com>}
@copyright: 2009-2015 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associ... |
jojoriveraa/titulacion-NFCOW | refs/heads/master | NFCow/shopping_carts/migrations/0006_auto_20160109_0457.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-01-09 04:57
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('shopping_carts', '0005_auto_20160109_0454'),
]
operations = [
migrations.RenameField(
... |
jiadaizhao/LeetCode | refs/heads/master | 0901-1000/0964-Least Operators to Express Number/0964-Least Operators to Express Number.py | 1 | class Solution:
def leastOpsExpressTarget(self, x: int, target: int) -> int:
pos = neg = k = 0
while target:
target, curr = divmod(target, x)
if k == 0:
pos, neg = curr * 2, (x - curr) * 2
else:
pos, neg = min(curr *... |
Pedals2Paddles/ardupilot | refs/heads/master | libraries/AP_HAL_ChibiOS/hwdef/scripts/dma_resolver.py | 1 | #!/usr/bin/env python
import sys, fnmatch
import importlib
# peripheral types that can be shared, wildcard patterns
SHARED_MAP = ["I2C*", "USART*_TX", "UART*_TX", "SPI*", "TIM*_UP"]
ignore_list = []
dma_map = None
debug = False
def check_possibility(periph, dma_stream, curr_dict, dma_map, check_list, recurse=False... |
caveman-dick/ansible | refs/heads/devel | lib/ansible/modules/network/aci/aci_epg_to_contract.py | 22 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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',
'status': ['preview'],
... |
xxsergzzxx/python-for-android | refs/heads/master | python3-alpha/extra_modules/gdata/tlslite/TLSRecordLayer.py | 48 | """Helper class for TLSConnection."""
from .utils.compat import *
from .utils.cryptomath import *
from .utils.cipherfactory import createAES, createRC4, createTripleDES
from .utils.codec import *
from .errors import *
from .messages import *
from .mathtls import *
from .constants import *
from .utils.cryptomath impor... |
DavidCain/mitoc-trips | refs/heads/master | ws/tests/utils/test_geardb.py | 1 | import unittest.mock
from collections import OrderedDict
from datetime import date, timedelta
from typing import Any, ClassVar, Dict
from django.contrib.auth.models import AnonymousUser
from django.db import connections
from django.test import SimpleTestCase
from ws.tests import TestCase
from ws.utils import geardb
f... |
quamilek/django | refs/heads/master | tests/gis_tests/geogapp/tests.py | 253 | """
Tests for geography support in PostGIS
"""
from __future__ import unicode_literals
import os
from unittest import skipUnless
from django.contrib.gis.db.models.functions import Area, Distance
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.measure import D
from django.test import TestCase, ign... |
whs/django | refs/heads/master | tests/utils_tests/test_regex_helper.py | 39 | import unittest
import warnings
from django.utils import regex_helper
class NormalizeTests(unittest.TestCase):
def test_empty(self):
pattern = r""
expected = [('', [])]
result = regex_helper.normalize(pattern)
self.assertEqual(result, expected)
def test_escape(self):
... |
antoinecarme/sklearn2sql_heroku | refs/heads/master | tests/classification/BreastCancer/ws_BreastCancer_SVC_sigmoid_oracle_code_gen.py | 1 | from sklearn2sql_heroku.tests.classification import generic as class_gen
class_gen.test_model("SVC_sigmoid" , "BreastCancer" , "oracle")
|
BioInf-Wuerzburg/AliTV | refs/heads/master | docs/_themes/sphinx_rtd_theme/__init__.py | 43 | """Sphinx ReadTheDocs theme.
From https://github.com/ryan-roemer/sphinx-bootstrap-theme.
"""
import os
__version__ = '0.1.10-alpha'
__version_full__ = __version__
def get_html_theme_path():
"""Return list of HTML theme paths."""
cur_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
retu... |
linjeffrey/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/QueueStatusServer/__init__.py | 6014 | # Required for Python to search this directory for module files
|
steedos/odoo | refs/heads/8.0 | addons/web_tests/tests/__init__.py | 385 | # -*- coding: utf-8 -*-
import test_ui
|
rnicoll/bitcoin | refs/heads/master | test/functional/mining_prioritisetransaction.py | 48 | #!/usr/bin/env python3
# Copyright (c) 2015-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the prioritisetransaction mining RPC."""
import time
from test_framework.messages import COIN, M... |
chyeh727/django | refs/heads/master | tests/utils_tests/test_text.py | 243 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from django.test import SimpleTestCase
from django.utils import six, text
from django.utils.encoding import force_text
from django.utils.functional import lazy
from django.utils.translation import override
lazystr = lazy(force_text, six.text... |
SpamapS/ingress-intel-total-conversion | refs/heads/master | build.py | 21 | #!/usr/bin/env python
import glob
import time
import re
import io
import base64
import sys
import os
import shutil
import json
import shelve
import hashlib
try:
import urllib2
except ImportError:
import urllib.request as urllib2
# load settings file
from buildsettings import buildSettings
# load option local se... |
chvrga/outdoor-explorer | refs/heads/master | java/play-1.4.4/python/Lib/os.py | 3 | r"""OS routines for Mac, NT, or Posix depending on what system we're on.
This exports:
- all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc.
- os.path is one of the modules posixpath, or ntpath
- os.name is 'posix', 'nt', 'os2', 'ce' or 'riscos'
- os.curdir is a string representing the curr... |
asolfre/namebench | refs/heads/master | nb_third_party/dns/rdtypes/ANY/RRSIG.py | 248 | # Copyright (C) 2004-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... |
ritchyteam/odoo | refs/heads/master | addons/account_bank_statement_extensions/wizard/confirm_statement_line.py | 381 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under ... |
MSeifert04/astropy | refs/heads/master | astropy/modeling/setup_package.py | 4 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
from os.path import join
from distutils.core import Extension
from distutils import log
from astropy_helpers import setup_helpers, utils
from astropy_helpers.version_helpers import get_pkg_version_module
wcs_setup_package = utils.import_file(... |
pllim/astropy | refs/heads/placeholder | astropy/stats/tests/test_bayesian_blocks.py | 5 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.testing import assert_allclose
from astropy.stats import bayesian_blocks, RegularEvents
def test_single_change_point(rseed=0):
rng = np.random.default_rng(rseed)
x = np.concatenate([rng.random(100),
... |
briancoutinho0905/2dsampling | refs/heads/master | util/minorview/parse.py | 55 | # Copyright (c) 2013 ARM Limited
# All rights reserved
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality o... |
hifly/OpenUpgrade | refs/heads/8.0 | addons/account_asset/account_asset.py | 183 | # -*- encoding: 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 G... |
openpeer/webrtc-gyp | refs/heads/master | test/hello/gyptest-regyp.py | 268 | #!/usr/bin/env python
# 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.
"""
Verifies that Makefiles get rebuilt when a source gyp file changes.
"""
import TestGyp
# Regenerating build files when a gyp file chan... |
psychotechnik/mycv | refs/heads/master | mycv/apps/projects/migrations/0001_initial.py | 1 | # -*- 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 'Project'
db.create_table(u'projects_project', (
... |
nitin-cherian/Webapps | refs/heads/master | SimpleIsBetterThanComplex.com/myproject/.env/lib/python3.5/site-packages/django/contrib/redirects/apps.py | 590 | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class RedirectsConfig(AppConfig):
name = 'django.contrib.redirects'
verbose_name = _("Redirects")
|
calancha/DIRAC | refs/heads/rel-v6r12 | ResourceStatusSystem/Command/TransferCommand.py | 2 | # $HeadURL: $
''' TransferCommand module
'''
from datetime import datetime, timedelta
from DIRAC import gLogger, S_OK, S_ERROR
from DIRAC.AccountingSystem.Client.ReportsClient import ReportsClient
fr... |
ice9js/servo | refs/heads/master | components/script/dom/bindings/codegen/parser/tests/test_callback.py | 126 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
interface TestCallback {
attribute CallbackType? listener;
};
callback CallbackType = boolean (unsigned long arg);
""")
results = parser.finish()
harness.ok(True, "TestCallback interface parsed without ... |
dgarciam/Sick-Beard | refs/heads/ThePirateBay | lib/unidecode/x07e.py | 252 | data = (
'Xia ', # 0x00
'Yuan ', # 0x01
'Zong ', # 0x02
'Xu ', # 0x03
'Nawa ', # 0x04
'Odoshi ', # 0x05
'Geng ', # 0x06
'Sen ', # 0x07
'Ying ', # 0x08
'Jin ', # 0x09
'Yi ', # 0x0a
'Zhui ', # 0x0b
'Ni ', # 0x0c
'Bang ', # 0x0d
'Gu ', # 0x0e
'Pan ', # 0x0f
'Zhou ', # 0x1... |
brownharryb/erpnext | refs/heads/develop | erpnext/healthcare/doctype/medical_code_standard/test_medical_code_standard.py | 30 | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import unittest
class TestMedicalCodeStandard(unittest.TestCase):
pass
|
felixjimenez/django | refs/heads/nonrel-1.6 | tests/admin_filters/tests.py | 49 | from __future__ import absolute_import, unicode_literals
import datetime
from django.contrib.admin import (site, ModelAdmin, SimpleListFilter,
BooleanFieldListFilter)
from django.contrib.admin.views.main import ChangeList
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
... |
tylertian/Openstack | refs/heads/master | openstack F/nova/nova/virt/vmwareapi/fake.py | 11 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 OpenStack LLC.
#
# 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
#
# htt... |
digital-abyss/ansible-modules-extras | refs/heads/devel | monitoring/pagerduty_alert.py | 121 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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.
... |
lmazuel/ansible | refs/heads/devel | test/units/modules/cloud/amazon/test_kinesis_stream.py | 91 | import pytest
import unittest
boto3 = pytest.importorskip("boto3")
botocore = pytest.importorskip("botocore")
import ansible.modules.cloud.amazon.kinesis_stream as kinesis_stream
aws_region = 'us-west-2'
class AnsibleKinesisStreamFunctions(unittest.TestCase):
def test_convert_to_lower(self):
example =... |
rshipp/sundara | refs/heads/development | sundara/__init__.py | 1 | __version__ = "0.2.0"
__all__ = [ "config", "exceptions", "jala", "projects", "resources", "server" ]
|
Mlieou/oj_solutions | refs/heads/master | leetcode/python/ex_508.py | 3 | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def findFrequentTreeSum(self, root):
"""
:type root: TreeNode
:rtype: List[int]
"""
... |
kustodian/ansible-modules-extras | refs/heads/devel | monitoring/newrelic_deployment.py | 55 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2013 Matt Coddington <coddington@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 ... |
wsmith323/django | refs/heads/master | tests/urlpatterns_reverse/included_urls.py | 452 | from django.conf.urls import url
from .views import empty_view
urlpatterns = [
url(r'^$', empty_view, name="inner-nothing"),
url(r'^extra/(?P<extra>\w+)/$', empty_view, name="inner-extra"),
url(r'^(?P<one>[0-9]+)|(?P<two>[0-9]+)/$', empty_view, name="inner-disjunction"),
]
|
dc3-plaso/plaso | refs/heads/master | tests/output/json_line.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the JSON lines output module."""
import json
import os
import sys
import unittest
from plaso.formatters import manager as formatters_manager
from plaso.lib import timelib
from plaso.output import json_line
from tests.cli import test_lib as cli_test_lib
from test... |
vikas-parashar/yagmail | refs/heads/master | yagmail/image.py | 3 | """ Unused so far"""
class InlineIMG():
def __init__(self, path):
self.path = path
self.is_local = False
self.id = abs(hash(self.path))
self.name = self.id
self.mime_object = self.makeMIME()
self.html_node = self.html_node()
def __repr__(self):
""" The... |
chimecms/chime | refs/heads/master | chime/instantiation/functions.py | 3 | from __future__ import print_function
from getpass import getpass
from os.path import join, dirname
from re import match
from urllib import urlencode
from urlparse import urljoin
from datetime import datetime
from time import sleep
import json
from boto.ec2 import EC2Connection
from boto.route53 import Route53Connect... |
iulian787/spack | refs/heads/develop | var/spack/repos/builtin/packages/vcftools/package.py | 5 | # 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 Vcftools(AutotoolsPackage):
"""VCFtools is a program package designed for working with VCF... |
dpressel/baseline | refs/heads/master | tests/test_vectorizers.py | 1 | import os
import string
import pytest
import random
import numpy as np
from typing import Optional, List, Set, Tuple
from itertools import chain
from baseline.utils import Offsets
from baseline.vectorizers import (
Token1DVectorizer,
Char1DVectorizer,
Char2DVectorizer,
TextNGramVectorizer,
DictTextN... |
lucalianas/openmicroscopy | refs/heads/develop | components/tools/OmeroPy/test/integration/clitest/test_delete.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 University of Dundee & Open Microscopy Environment.
# 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 Software Foundation;... |
KitKatXperience/platform_external_chromium_org | refs/heads/kk | tools/json_schema_compiler/json_parse.py | 32 | # 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 json
import logging
import os
import sys
_FILE_PATH = os.path.dirname(os.path.realpath(__file__))
_SYS_PATH = sys.path[:]
try:
_COMMENT_EATER_P... |
larsmans/numpy | refs/heads/master | numpy/distutils/tests/test_fcompiler_intel.py | 70 | from __future__ import division, absolute_import, print_function
from numpy.testing import *
import numpy.distutils.fcompiler
intel_32bit_version_strings = [
("Intel(R) Fortran Intel(R) 32-bit Compiler Professional for applications"\
"running on Intel(R) 32, Version 11.1", '11.1'),
]
intel_64bit_version_st... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.