repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
MostafaGazar/tensorflow | refs/heads/master | tensorflow/python/summary/event_file_inspector.py | 62 | # 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... |
be-cloud-be/horizon-addons | refs/heads/9.0 | web/web_translate_dialog/__init__.py | 14224 | # -*- coding: utf-8 -*-
|
DBrianKimmel/PyHouse | refs/heads/develop | Project/src/Modules/_test/test_Drivers.py | 1 | """
@name: C:/Users/briank/workspace/PyHouse/src/Modules/_test/test_Drivers.py
@author: D. Brian Kimmel
@contact: [email protected]
@copyright: (c) 2015-2018 by D. Brian Kimmel
@license: MIT License
@note: Created on Jul 30, 2015
@Summary:
Passed all tests - DBK - 2018-02-13
"""
__updated__ = ... |
Chandra-MARX/marxs | refs/heads/hamogu-patch-1 | marxs/base/__init__.py | 2 | # Licensed under GPL version 3 - see LICENSE.rst
from .base import (GeometryError,
DocMeta,
MarxsElement, SimulationSequenceElement,
_parse_position_keywords
)
|
uwcirg/true_nth_usa_portal | refs/heads/develop | portal/views/crossdomain.py | 1 | """Cross Domain Decorators"""
from datetime import timedelta
from functools import update_wrapper
from flask import current_app, make_response, request
from ..models.client import validate_origin
def crossdomain(
origin=None,
methods=None,
headers=(
'Authorization',
'... |
epitron/youtube-dl | refs/heads/master | youtube_dl/extractor/apa.py | 1 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
determine_ext,
js_to_json,
)
class APAIE(InfoExtractor):
_VALID_URL = r'https?://[^/]+\.apa\.at/embed/(?P<id>[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{... |
chStaiger/ELIXIR-gridftp-PID | refs/heads/master | gridftp.py | 1 | #System import subprocess
import subprocess
import getopt
import sys
# PID imports
from b2handle.clientcredentials import PIDClientCredentials
from b2handle.handleclient import EUDATHandleClient
import uuid
import hashlib
import os, shutil
RED = "\033[31m"
GREEN = "\033[92m"
BLUE = "\033[34m"
DEFAULT = "\03... |
skyddv/neutron | refs/heads/master | neutron/db/migration/alembic_migrations/versions/liberty/expand/52c5312f6baf_address_scopes.py | 40 | # Copyright (c) 2015 Red Hat, 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 ... |
FrankBian/kuma | refs/heads/master | vendor/packages/html5lib/src/html5lib/treebuilders/_base.py | 26 | from html5lib.constants import scopingElements, tableInsertModeElements, namespaces
try:
frozenset
except NameError:
# Import from the sets module for python 2.3
from sets import Set as set
from sets import ImmutableSet as frozenset
# The scope markers are inserted when entering buttons, object element... |
isshe/Language | refs/heads/master | Python/20161126/2_test_object.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
class Student(object):
def __init__(self, name, score):
self.name = name
self.score = score
def print_score(self):
print('%s: %s' % (self.name, self.score))
if __name__=='__main__':
isshe = Student('isshe', 99)
isshe.print_sco... |
persandstrom/home-assistant | refs/heads/master | homeassistant/components/sensor/ios.py | 5 | """
Support for Home Assistant iOS app sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/ecosystem/ios/
"""
from homeassistant.components import ios
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.icon import icon_for_battery_level
... |
demvher/pythondotorg | refs/heads/master | docs/source/conf.py | 2 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Python.org Website documentation build configuration file, created by
# sphinx-quickstart on Fri Feb 21 10:03:44 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present i... |
muraliselva10/cloudkitty | refs/heads/master | cloudkitty/api/v1/types.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2014 Objectif Libre
#
# 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 ... |
knittledan/netflixXBMC | refs/heads/master | resources/mechanize/_headersutil.py | 133 | """Utility functions for HTTP header value parsing and construction.
Copyright 1997-1998, Gisle Aas
Copyright 2002-2006, John J. Lee
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD or ZPL 2.1 licenses (see the file
COPYING.txt included with the distribution).
"""
impo... |
geminy/aidear | refs/heads/master | oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/third_party/bintrees/bintrees/__init__.py | 156 | #!/usr/bin/env python
#coding:utf-8
# Author: mozman
# Purpose: binary trees package
# Created: 03.05.2010
# Copyright (c) 2010-2013 by Manfred Moitzi
# License: MIT License
from __future__ import absolute_import
__doc__ = """
Binary Tree Package
===================
Python Trees
------------
Balanced and unbalance... |
cysp/gyp | refs/heads/master | test/rules-rebuild/src/make-sources.py | 337 | #!/usr/bin/env python
# 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 sys
assert len(sys.argv) == 4, sys.argv
(in_file, c_file, h_file) = sys.argv[1:]
def write_file(filename, contents):
open(filenam... |
nelsonvarela/mollie-api-python | refs/heads/master | examples/app.py | 2 | import os
import flask
app = flask.Flask(__name__)
examples = [
'1-new-payment',
'2-webhook-verification',
'3-return-page',
'4-ideal-payment',
'5-payments-history',
'6-list-activated-methods'
]
@app.route('/')
def show_list():
body = ''
for example in examples:
body += '<a hre... |
anryko/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/aws_config_rule.py | 10 | #!/usr/bin/python
# Copyright: (c) 2018, Aaron Smith <[email protected]>
# 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',
... |
rpsingh21/resultanalysis | refs/heads/master | resultAnalysis/result/api/serializer.py | 1 | from rest_framework.serializers import ModelSerializer,ValidationError
from result.models import (
ContactUs,
ReportBug,
ReportError,
)
class ContactUsSerializer(ModelSerializer):
class Meta:
model = ContactUs
fields = [
'name',
'mobNo',
'email',
'comment',
]
def validate_email(self, email):
... |
surajssd/kuma | refs/heads/master | vendor/packages/logilab/common/date.py | 89 | # copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:[email protected]
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as publ... |
bhcopeland/ansible-modules-extras | refs/heads/devel | network/illumos/dladm_etherstub.py | 29 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Adam Števko <[email protected]>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the L... |
birdonwheels5/p2pool-myrScrypt | refs/heads/master | p2pool/test/util/test_datachunker.py | 287 | import random
import unittest
from p2pool.util import datachunker
def random_bytes(length):
return ''.join(chr(random.randrange(2**8)) for i in xrange(length))
class Test(unittest.TestCase):
def test_stringbuffer(self):
for i in xrange(100):
sb = datachunker.StringBuffer()
... |
bitcrystal/bitcrystal_v20 | refs/heads/master | contrib/testgen/base58.py | 2139 | '''
Bitcoin base58 encoding and decoding.
Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain)
'''
import hashlib
# for compatibility with following code...
class SHA256:
new = hashlib.sha256
if str != bytes:
# Python 3.x
def ord(c):
return c
def chr(n):
return byte... |
sballesteros/node-gyp | refs/heads/master | gyp/test/hello/gyptest-target.py | 351 | #!/usr/bin/env python
# Copyright (c) 2009 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 simplest-possible build of a "Hello, world!" program
using an explicit build target of 'hello'.
"""
import TestGyp
test = Tes... |
BeATz-UnKNoWN/python-for-android | refs/heads/master | python3-alpha/python3-src/Tools/pynche/DetailsViewer.py | 48 | """DetailsViewer class.
This class implements a pure input window which allows you to meticulously
edit the current color. You have both mouse control of the color (via the
buttons along the bottom row), and there are keyboard bindings for each of the
increment/decrement buttons.
The top three check buttons allow yo... |
sounak98/coala-bears | refs/heads/master | bears/c_languages/CSecurityBear.py | 2 | from coalib.bearlib.abstractions.Linter import linter
from coalib.bears.requirements.DistributionRequirement import (
DistributionRequirement)
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
@linter(executable='flawfinder',
output_format='regex',
output_regex=r'.+:(?P<line>\d+):(?P<colu... |
liangjiaxing/sympy | refs/heads/master | sympy/combinatorics/tests/test_prufer.py | 102 | from sympy.combinatorics.prufer import Prufer
from sympy.utilities.pytest import raises
def test_prufer():
# number of nodes is optional
assert Prufer([[0, 1], [0, 2], [0, 3], [0, 4]], 5).nodes == 5
assert Prufer([[0, 1], [0, 2], [0, 3], [0, 4]]).nodes == 5
a = Prufer([[0, 1], [0, 2], [0, 3], [0, 4]]... |
stshine/servo | refs/heads/master | tests/wpt/web-platform-tests/old-tests/webdriver/timeouts/implicit_waits_tests.py | 142 | import os
import sys
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
from selenium.common import exceptions
class ImplicitWaitsTests(base_test.WebDriverBaseTest):
def setUp(self):
self.driver.get(self.webserver.where_is('timeouts/res/implicit_waits_te... |
enthought/etsproxy | refs/heads/master | enthought/chaco/svg_graphics_context.py | 1 | # proxy module
from __future__ import absolute_import
from chaco.svg_graphics_context import *
|
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_12_01/operations/_virtual_networks_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 ... |
teamotrinidad/plugin.video.chicovara | refs/heads/master | servers/shareflare.py | 41 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para shareflare
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core im... |
speccy88/Mote | refs/heads/master | MoteServer/client.py | 1 | import zmq
class MoteClient:
def __init__(self, serverAddress):
self.context = zmq.Context()
self.socket = self.context.socket(zmq.REQ)
self.socket.connect("tcp://"+serverAddress+":5006")
def Close(self):
self.socket.close()
self.context.term()
def Fetch(self, addr... |
PhonologicalCorpusTools/CorpusTools | refs/heads/master | corpustools/corpus/io/text_ilg.py | 1 |
import os
import re
from collections import Counter, defaultdict
from corpustools.corpus.classes import SpontaneousSpeechCorpus
from corpustools.corpus.classes import Corpus, Word, Discourse, WordToken, Attribute
from corpustools.corpus.io.binary import load_binary
from corpustools.exceptions import (DelimiterError... |
MikeLing/treeherder | refs/heads/master | tests/webapp/api/test_failureline.py | 3 | from django.core.urlresolvers import reverse
from rest_framework.test import APIClient
from tests.autoclassify.utils import (create_failure_lines,
create_text_log_errors,
test_line)
from treeherder.autoclassify.detectors import ManualDetector
... |
Stanford-Online/edx-platform | refs/heads/master | common/test/acceptance/pages/lms/completion.py | 19 | # -*- coding: utf-8 -*-
"""
Mixins for completion.
"""
class CompletionOnViewMixin(object):
"""
Methods for testing completion on view.
"""
def xblock_components_mark_completed_on_view_value(self):
"""
Return the xblock components data-mark-completed-on-view-after-delay value.
... |
jerli/sympy | refs/heads/master | sympy/unify/rewrite.py | 93 | """ Functions to support rewriting of SymPy expressions """
from __future__ import print_function, division
from sympy.unify.usympy import unify
from sympy.unify.usympy import rebuild
from sympy.strategies.tools import subs
from sympy import Expr
from sympy.assumptions import ask
def rewriterule(source, target, vari... |
hkawasaki/kawasaki-aio8-2 | refs/heads/gacco2/0701_kim_again | lms/djangoapps/courseware/features/word_cloud.py | 46 | # pylint: disable=C0111
from time import sleep
from lettuce import world, step
from lettuce.django import django_url
from common import i_am_registered_for_the_course, section_location, visit_scenario_item
@step('I view the word cloud and it has rendered')
def word_cloud_is_rendered(_step):
assert world.is_css_... |
ymap/aioredis | refs/heads/master | examples/iscan.py | 1 | import asyncio
import aioredis
async def main():
redis = await aioredis.create_redis(
'redis://localhost')
await redis.delete('something:hash',
'something:set',
'something:zset')
await redis.mset('something', 'value',
'something:... |
dneg/cortex | refs/heads/master | test/IECoreHoudini/procedurals/sphereProcedural/sphereProcedural-2.py | 12 | ##########################################################################
#
# Copyright 2010 Dr D Studios Pty Limited (ACN 127 184 954) (Dr. D Studios),
# its affiliates and/or its licensors.
#
# Copyright (c) 2011, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms... |
Microsoft/hummingbird | refs/heads/master | hummingbird/ml/_utils.py | 1 | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""
Colle... |
flh/odoo | refs/heads/master | addons/point_of_sale/report/pos_payment_report.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... |
zahanm/foodpedia | refs/heads/master | django/contrib/gis/admin/__init__.py | 637 | # Getting the normal admin routines, classes, and `site` instance.
from django.contrib.admin import autodiscover, site, AdminSite, ModelAdmin, StackedInline, TabularInline, HORIZONTAL, VERTICAL
# Geographic admin options classes and widgets.
from django.contrib.gis.admin.options import GeoModelAdmin
from django.contri... |
nacc/autotest | refs/heads/master | client/tests/fsstress/fsstress.py | 2 | import os
from autotest.client import test, utils
class fsstress(test.test):
version = 1
def initialize(self):
self.job.require_gcc()
# http://www.zip.com.au/~akpm/linux/patches/stuff/ext3-tools.tar.gz
def setup(self, tarball = 'ext3-tools.tar.gz'):
self.tarball = utils.unmap_url(se... |
dbrattli/RxPY | refs/heads/master | rx/testing/reactivetest.py | 1 | import math
import types
from rx.notification import OnNext, OnError, OnCompleted
from .recorded import Recorded
from .subscription import Subscription
def is_prime(i):
"""Tests if number is prime or not"""
if i <= 1:
return False
_max = int(math.floor(math.sqrt(i)))
for j in range(2, _max+... |
ntuecon/server | refs/heads/master | pyenv/Lib/site-packages/twisted/persisted/test/test_styles.py | 13 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.persisted.styles}.
"""
import pickle
from twisted.trial import unittest
from twisted.persisted.styles import unpickleMethod, _UniversalPicklingError
class Foo:
"""
Helper class.
"""
def method(self):
... |
baylee-d/osf.io | refs/heads/develop | osf/migrations/0080_add_abstractprovider.py | 6 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-02-15 19:48
from __future__ import unicode_literals
import dirtyfields.dirtyfields
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion
import django_extensions.db.fields
import osf.models.base
impor... |
godfather1103/WeiboRobot | refs/heads/master | python27/1.0/lib/test/test_linuxaudiodev.py | 134 | from test import test_support
test_support.requires('audio')
from test.test_support import findfile, run_unittest
import errno
import sys
import audioop
import unittest
linuxaudiodev = test_support.import_module('linuxaudiodev', deprecated=True)
sunaudio = test_support.import_module('sunaudio', deprecated=True)
SND... |
kjagoo/wger_stark | refs/heads/master | wger/weight/__init__.py | 15 | # -*- coding: utf-8 -*-
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... |
garthylou/Libreosteo | refs/heads/master | libreosteoweb/api/renderers.py | 1 | # This file is part of LibreOsteo.
#
# LibreOsteo 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.
#
# LibreOsteo is distributed ... |
sasukeh/cinder | refs/heads/master | cinder/tests/unit/api/contrib/test_volume_encryption_metadata.py | 23 | # Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
# 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/... |
EvanK/ansible | refs/heads/devel | lib/ansible/modules/cloud/cloudstack/cs_network_offering.py | 14 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017, David Passante (@dpassante)
# Copyright (c) 2017, René Moser <[email protected]>
# 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': [... |
AntouanK/rethinkdb | refs/heads/next | test/rql_test/connections/http_support/werkzeug/testsuite/wsgi.py | 146 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.wsgi
~~~~~~~~~~~~~~~~~~~~~~~
Tests the WSGI utilities.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
from os import path
from contextlib import closing
from werkzeug.testsuite import Werkzeug... |
mamchecker/mamchecker | refs/heads/master | mamchecker/r/bl/__init__.py | 1 | # -*- coding: utf-8 -*-
from random import randrange, sample
from mamchecker.hlp import Struct
def given():
i1 = randrange(15, 90) / 10.0
di = (randrange(1, 10) - 5) / 50.0
if di == 0:
di = 0.05
i2 = i1 + di
i_c = [4, 12, 1]
i = [ii for ii in sample(i_c, 2)]
i_n = ['i_' + str(ii) f... |
vladmm/intellij-community | refs/heads/master | python/testData/quickFixes/PyAddSpecifierToFormatQuickFixTest/int.py | 80 | a = <warning descr="Format specifier character missing">"test<caret> %"</warning> % 1 |
rchacon/sms-service | refs/heads/master | scraper.py | 1 | import os
import sys
import re
import BeautifulSoup
from googlevoice import Voice
from pymongo import MongoClient
def extractsms(htmlsms) :
"""
extractsms -- extract SMS messages from BeautifulSoup tree of Google Voice SMS HTML.
Output is a list of dictionaries, one per message.
"""
msgitems =... |
ahmedaljazzar/edx-platform | refs/heads/master | common/djangoapps/enrollment/tests/test_views.py | 1 | """
Tests for user enrollment.
"""
import datetime
import itertools
import json
import unittest
import ddt
import httpretty
import pytz
from django.conf import settings
from django.core.cache import cache
from django.core.exceptions import ImproperlyConfigured
from django.core.handlers.wsgi import WSGIRequest
from dja... |
google/pigweed | refs/heads/main | pw_rpc/py/tests/client_test.py | 1 | #!/usr/bin/env python3
# Copyright 2020 The Pigweed Authors
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
feer56/Kitsune2 | refs/heads/master | kitsune/gallery/__init__.py | 24 | # The number of items per page
ITEMS_PER_PAGE = 24
|
pwoodworth/intellij-community | refs/heads/master | python/testData/resolve/ClassPrivateOutsideClass.py | 83 | class A(object):
__X = 1
A._<ref>_X
|
lmazuel/azure-sdk-for-python | refs/heads/master | azure-mgmt-subscription/azure/mgmt/subscription/models/subscription_definition_paged.py | 2 | # 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 ... |
sinotradition/meridian | refs/heads/master | meridian/tst/acupoints/test_shaohai43.py | 1 | #!/usr/bin/python
#coding=utf-8
'''
@author: sheng
@license:
'''
import unittest
from meridian.acupoints import shaohai43
class TestShaohai43Functions(unittest.TestCase):
def setUp(self):
pass
def test_xxx(self):
pass
if __name__ == '__main__':
unittest.main()
|
patilsangram/erpnext | refs/heads/develop | erpnext/hr/doctype/employee/test_employee.py | 3 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import erpnext
import unittest
import frappe.utils
test_records = frappe.get_test_records('Employee')
class TestEmployee(unittest.TestC... |
connoranderson/Speechables | refs/heads/master | mechanize-0.2.5/mechanize/_firefox3cookiejar.py | 134 | """Firefox 3 "cookies.sqlite" cookie persistence.
Copyright 2008 John J Lee <[email protected]>
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD or ZPL 2.1 licenses (see the file
COPYING.txt included with the distribution).
"""
import logging
import time
from _clientcooki... |
rosenvladimirov/addons | refs/heads/8.0 | hw_datecs_bg/icl/icl.py | 1 | # -*- coding: utf-8 -*-
#
# Copyright 2013 Rosen Vladimirov <[email protected]>
#
# 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 o... |
t3dev/odoo | refs/heads/master | addons/purchase_stock/tests/test_onchange_product.py | 14 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime
from odoo import fields
from odoo.tests.common import TransactionCase
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT
class TestOnchangeProductId(TransactionCase):
"""Test that w... |
cntnboys/410Lab6 | refs/heads/master | v1/lib/python2.7/site-packages/django/db/backends/oracle/creation.py | 34 | import sys
import time
from django.conf import settings
from django.db.backends.creation import BaseDatabaseCreation
from django.db.utils import DatabaseError
from django.utils.six.moves import input
TEST_DATABASE_PREFIX = 'test_'
PASSWORD = 'Im_a_lumberjack'
class DatabaseCreation(BaseDatabaseCreation):
# Thi... |
auferack08/edx-platform | refs/heads/master | docs/en_us/developers/source/conf.py | 30 | # -*- coding: utf-8 -*-
# pylint: disable=C0103
# pylint: disable=W0622
# pylint: disable=W0212
# pylint: disable=W0613
import sys, os
from path import path
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
sys.path.append('../../../../')
from docs.shared.conf import *
# Add any paths that contain template... |
hevel/goflow | refs/heads/master | sampleproject/manage.py | 79 | #!/usr/bin/env python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll ha... |
nadley/Sick-Beard | refs/heads/development | lib/hachoir_core/log.py | 90 | import os, sys, time
import lib.hachoir_core.config as config
from lib.hachoir_core.i18n import _
class Log:
LOG_INFO = 0
LOG_WARN = 1
LOG_ERROR = 2
level_name = {
LOG_WARN: "[warn]",
LOG_ERROR: "[err!]",
LOG_INFO: "[info]"
}
def __init__(self):
self.__buf... |
Venturi/cms | refs/heads/master | env/lib/python2.7/site-packages/django/contrib/flatpages/views.py | 475 | from django.conf import settings
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.shortcuts import get_current_site
from django.http import Http404, HttpResponse, HttpResponsePermanentRedirect
from django.shortcuts import get_object_or_404
from django.template import loader
from django.uti... |
40223119/2015cda | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/site-packages/pygame/color.py | 603 | ## pygame - Python Game Library
## Copyright (C) 2000-2003 Pete Shinners
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (... |
cjh1/AutobahnPython | refs/heads/master | autobahn/autobahn/resource.py | 9 | ###############################################################################
##
## Copyright 2012 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
##
## http://www... |
grilo/ansible-1 | refs/heads/devel | lib/ansible/modules/network/f5/bigip_gtm_facts.py | 16 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016 F5 Networks Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... |
open-synergy/account-payment | refs/heads/8.0 | account_payment_return_import/wizard/__init__.py | 4 | # -*- coding: utf-8 -*-
from . import payment_return_import
|
wxgeo/geophar | refs/heads/master | wxgeometrie/sympy/core/symbol.py | 4 | from __future__ import print_function, division
from sympy.core.assumptions import StdFactKB
from sympy.core.compatibility import (string_types, range, is_sequence,
ordered)
from .basic import Basic
from .sympify import sympify
from .singleton import S
from .expr import Expr, AtomicExpr
from .cache import cacheit
... |
Hons/troposphere | refs/heads/master | troposphere/redshift.py | 3 | # Copyright (c) 2014, Guillem Anguera <[email protected]>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
from .validators import boolean, integer
class Cluster(AWSObject):
type = "AWS::Redshift::Cluster"
props = {
'AllowVersionUpgrade': (boolean, ... |
kerr-huang/SL4A | refs/heads/master | python/src/Lib/test/sample_doctest.py | 229 | """This is a sample module that doesn't really test anything all that
interesting.
It simply has a few tests, some of which succeed and some of which fail.
It's important that the numbers remain constant as another test is
testing the running of these tests.
>>> 2+2
4
"""
def foo():
"""
>>> 2+2
5
... |
chrisjaquet/FreeCAD | refs/heads/master | src/Mod/Assembly/FCDocTool.py | 38 | #! python
# -*- coding: utf-8 -*-
#***************************************************************************
#* *
#* Copyright (c) 2012 *
#* Juergen Riegel <[email protected]> ... |
EvilGRAHAM/school-projects | refs/heads/master | Random Python3/domtempcode.py | 1 | import random
import sys
row=9
col=12
mine=10
def createBoard(row,col,mine):
board=[]
for r in range (row):
board.append([])
for c in range (col):
board[r].append("C ")
while mine > 0:
rowTemp= random.randrange(0,row-1)
colTemp= random.randrange(0,col-1)
if board[rowTemp][colTemp]=="C ":
board[rowT... |
rubenvb/skia | refs/heads/m75 | infra/bots/assets/android_sdk_linux/create.py | 11 | #!/usr/bin/env python
#
# Copyright 2017 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Create the asset."""
import argparse
import os
import shutil
def create_asset(target_dir, android_sdk_root):
"""Create the asset."""
if not android_sd... |
doismellburning/django | refs/heads/master | tests/template_backends/test_django.py | 4 | from django.template import RequestContext
from django.template.backends.django import DjangoTemplates
from django.test import ignore_warnings, RequestFactory
from django.utils.deprecation import RemovedInDjango20Warning
from template_tests.test_response import test_processor_name
from .test_dummy import TemplateStri... |
opendesk/winnow | refs/heads/master | src/winnow/options.py | 1 | import collections
from winnow.utils import deep_copy_dict as deepcopy
# from copy import deepcopy
from winnow import utils
from winnow.values.option_values import OptionWinnowValue
from winnow.values import value_factory, value_path_factory
from winnow.values.option_values import OptionResourceWinnowValue, OptionStr... |
ETCBC/shebanq | refs/heads/master | routes.example.py | 22 | # -*- coding: utf-8 -*-
# This is an app-specific example router
#
# This simple router is used for setting languages from app/languages directory
# as a part of the application path: app/<lang>/controller/function
# Language from default.py or 'en' (if the file is not found) is used as
# a default_language
#
# ... |
shitolepriya/test-erp | refs/heads/develop | erpnext/accounts/report/purchase_register/purchase_register.py | 45 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt
from frappe import msgprint, _
def execute(filters=None):
if not filters: filters = {}
invoice_list = get... |
qskycolor/viewfinder | refs/heads/master | backend/www/test/service_counters_test.py | 13 | # Copyright 2012 Viewfinder Inc. All Rights Reserved.
"""Test case for performance counters related to the service frontend.
"""
__author__ = '[email protected] (Matt Tracy)'
import time
from viewfinder.backend.base import util, counters
from viewfinder.backend.base.testing import async_test
from viewfinder.ba... |
bva24/smart | refs/heads/master | cartridge/shop/__init__.py | 17 | from __future__ import unicode_literals
from cartridge import __version__
|
2014c2g5/2014c2 | refs/heads/master | exts/wsgi/static/Brython2.1.0-20140419-113919/Lib/_socket.py | 742 | """Implementation module for socket operations.
See the socket module for documentation."""
AF_APPLETALK = 16
AF_DECnet = 12
AF_INET = 2
AF_INET6 = 23
AF_IPX = 6
AF_IRDA = 26
AF_SNA = 11
AF_UNSPEC = 0
AI_ADDRCONFIG = 1024
AI_ALL = 256
AI_CANONNAME = 2
AI_NUMERICHOST = 4
AI_NUMERICSERV = 8
AI_PASSIVE = 1... |
schalkneethling/bedrock | refs/heads/master | lib/l10n_utils/extract.py | 11 | # mostly borrowed from tower
from babel.messages.extract import extract_python as babel_extract_py
from jinja2 import ext
from lib.l10n_utils.utils import strip_whitespace
def add_context(context, message):
# \x04 is a magic gettext number.
return u"%s\x04%s" % (context, message)
def tweak_message(message... |
mtanski/samba | refs/heads/master | lib/testtools/testtools/tests/test_helpers.py | 12 | # Copyright (c) 2010-2012 testtools developers. See LICENSE for details.
from testtools import TestCase
from testtools.helpers import (
try_import,
try_imports,
)
from testtools.matchers import (
Equals,
Is,
Not,
)
from testtools.tests.helpers import (
FullStackRunTest,
hide_testtoo... |
chatcannon/numpy | refs/heads/master | tools/allocation_tracking/track_allocations.py | 102 | from __future__ import division, absolute_import, print_function
import numpy as np
import gc
import inspect
from alloc_hook import NumpyAllocHook
class AllocationTracker(object):
def __init__(self, threshold=0):
'''track numpy allocations of size threshold bytes or more.'''
self.threshold = thre... |
myhdl/myhdl | refs/heads/master | example/manual/test_mux.py | 6 | import random
from myhdl import block, instance, Signal, intbv, delay
from mux import mux
random.seed(5)
randrange = random.randrange
@block
def test_mux():
z, a, b, sel = [Signal(intbv(0)) for i in range(4)]
mux_1 = mux(z, a, b, sel)
@instance
def stimulus():
print("z a b sel")
for... |
nju520/django | refs/heads/master | tests/sitemaps_tests/urls/http.py | 311 | from datetime import date, datetime
from django.conf.urls import url
from django.conf.urls.i18n import i18n_patterns
from django.contrib.sitemaps import GenericSitemap, Sitemap, views
from django.http import HttpResponse
from django.utils import timezone
from django.views.decorators.cache import cache_page
from ..mod... |
resmo/cloudstack | refs/heads/master | plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmHostModule.py | 9 | # 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... |
bspink/django | refs/heads/master | tests/backends/tests.py | 77 | # -*- coding: utf-8 -*-
# Unit and doctests for specific database backends.
from __future__ import unicode_literals
import copy
import datetime
import re
import threading
import unittest
import warnings
from decimal import Decimal, Rounded
from django.conf import settings
from django.core.exceptions import Improperly... |
adedayo/intellij-community | refs/heads/master | python/helpers/pydev/tests_python/_debugger_case7.py | 98 | def Call():
variable_for_test_1 = 10
variable_for_test_2 = 20
variable_for_test_3 = 30
if __name__ == '__main__':
Call()
print('TEST SUCEEDED!')
|
mgr0dzicki/python-neo | refs/heads/master | neo/test/iotest/test_elanio.py | 13 | # -*- coding: utf-8 -*-
"""
Tests of neo.io.elanio
"""
# needed for python 3 compatibility
from __future__ import absolute_import, division
import sys
try:
import unittest2 as unittest
except ImportError:
import unittest
from neo.io import ElanIO
from neo.test.iotest.common_io_test import BaseTestIO
@unit... |
jacky-young/crosswalk-test-suite | refs/heads/master | misc/sampleapp-android-tests/sampleapp/hangonman_install.py | 2 | #!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... |
johnmulder/pycon-tutorial-student | refs/heads/master | setup.py | 1 | from setuptools import setup
setup(name='pycon-tutorial-student-jmulder',
version='0.1',
description='test stuff for pycon tutorial',
py_modules=['wordcount_lib'],
scripts=['wordcount'],
setup_requires=[
'pytest-runner',
],
tests_require=[
'pytest',
]... |
kdwink/intellij-community | refs/heads/master | python/testData/codeInsight/controlflow/assertfalseargument.py | 83 | assert False, 'foo'
print('unreachable 1')
assert False, f()
print('unreachable 2')
|
sxhao/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py | 118 | # 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.