repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
cube2matrix/Krypton | refs/heads/master | test/networkx/generators/tests/test_directed.py | 77 | #!/usr/bin/env python
"""Generators - Directed Graphs
----------------------------
"""
from nose.tools import *
from networkx import *
from networkx.generators.directed import *
class TestGeneratorsDirected():
def test_smoke_test_random_graphs(self):
G=gn_graph(100)
G=gnr_graph(100,0.5)
G... |
Instagram/django | refs/heads/master | django/contrib/gis/tests/relatedapp/tests.py | 127 | from django.test import TestCase
from django.contrib.gis.geos import GEOSGeometry, Point, MultiPoint
from django.contrib.gis.db.models import Collect, Count, Extent, F, Union
from django.contrib.gis.geometry.backend import Geometry
from django.contrib.gis.tests.utils import mysql, oracle, no_mysql, no_oracle, no_spati... |
ryannathans/micropython | refs/heads/master | tests/cpydiff/modules_array_subscrstep.py | 30 | """
categories: Modules,array
description: Subscript with step != 1 is not yet implemented
cause: Unknown
workaround: Unknown
"""
import array
a = array.array('b', (1, 2, 3))
print(a[3:2:2])
|
vidoardes/XS-ICS | refs/heads/master | tools/perf/scripts/python/check-perf-trace.py | 11214 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... |
toastedcornflakes/scikit-learn | refs/heads/master | sklearn/ensemble/tests/test_gradient_boosting.py | 43 | """
Testing for the gradient boosting module (sklearn.ensemble.gradient_boosting).
"""
import warnings
import numpy as np
from itertools import product
from scipy.sparse import csr_matrix
from scipy.sparse import csc_matrix
from scipy.sparse import coo_matrix
from sklearn import datasets
from sklearn.base import clo... |
sgammon/libcloud | refs/heads/trunk | libcloud/test/dns/test_gandi.py | 37 | # 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 ... |
charlesvdv/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/html5lib/utils/entities.py | 438 | import json
import html5lib
def parse(path="html5ents.xml"):
return html5lib.parse(open(path), treebuilder="lxml")
def entity_table(tree):
return dict((entity_name("".join(tr[0].xpath(".//text()"))),
entity_characters(tr[1].text))
for tr in tree.xpath("//h:tbody/h:tr",
... |
40023256/2015cdag1man | refs/heads/master | static/Brython3.1.3-20150514-095342/Lib/difflib.py | 737 | #! /usr/bin/env python3
"""
Module difflib -- helpers for computing deltas between objects.
Function get_close_matches(word, possibilities, n=3, cutoff=0.6):
Use SequenceMatcher to return list of the best "good enough" matches.
Function context_diff(a, b):
For two lists of strings, return a delta in context ... |
interlegis/saap | refs/heads/master | config/rest_framework/documentation.py | 5 | from django.conf.urls import include, url
from rest_framework.renderers import (
CoreJSONRenderer, DocumentationRenderer, SchemaJSRenderer
)
from rest_framework.schemas import SchemaGenerator, get_schema_view
from rest_framework.settings import api_settings
def get_docs_view(
title=None, description=None... |
mrry/tensorflow | refs/heads/windows | tensorflow/examples/tutorials/mnist/__init__.py | 211 | # 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... |
sorenk/ansible | refs/heads/devel | contrib/inventory/collins.py | 46 | #!/usr/bin/env python
"""
Collins external inventory script
=================================
Ansible has a feature where instead of reading from /etc/ansible/hosts
as a text file, it can query external programs to obtain the list
of hosts, groups the hosts are in, and even variables to assign to each host.
Collins ... |
trezor/micropython | refs/heads/trezor-v1.12 | tests/cpydiff/modules/foo.py | 30 | print('foo')
xxx
|
oberlin/panoptes | refs/heads/master | panoptes/tracking/widgets.py | 2 |
from django.contrib.admin.widgets import AdminTextInputWidget
class AccountListWidget(AdminTextInputWidget):
"""A widget that handles the tuple of names that the AccountListField uses."""
def render(self, name, value, attrs=None):
"""Show the tuple as strings joined with the default separator."""
from panoptes... |
patochectp/navitia | refs/heads/dev | source/jormungandr/jormungandr/scenarios/distributed.py | 1 | # Copyright (c) 2001-2015, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public tr... |
kpcyrd/cjdns | refs/heads/master | node_build/dependencies/libuv/build/gyp/test/actions/src/subdir3/generate_main.py | 377 | #!/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.
import sys
contents = """
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("Hello from generate_main.py\\n");
return 0;
}
... |
flavour/iscram | refs/heads/master | modules/s3/pyvttbl/pystaggrelite3.py | 11 | from __future__ import print_function
# Copyright (c) 2011, Roger Lew [see LICENSE.txt]
# This software is funded in part by NIH Grant P20 RR016454.
"""
This module contains custom aggregators for sqlite3
sqlite has the following aggregate functions built-in:
avg(X)
count(X)
count(*)
grou... |
asimshankar/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/kernel_tests/bijectors/softsign_test.py | 23 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
AutorestCI/azure-sdk-for-python | refs/heads/master | azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/sub_resource.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 ... |
chovanecm/sacredboard | refs/heads/develop | sacredboard/tests/webapi/test_metrics.py | 1 | import pytest
import simplejson
from flask import Flask
from sacredboard import bootstrap
from sacredboard.app.data import MetricsDAO, NotFoundError, DataStorage
from sacredboard.app.webapi import metrics
from sacredboard.tests.fixtures.metrics import m1, m2
app = None
test_client = None
class FakeMetricsDAO(Metric... |
sursum/buckanjaren | refs/heads/master | buckanjaren/lib/python3.5/site-packages/django/conf/urls/i18n.py | 96 | from django.conf import settings
from django.conf.urls import url
from django.urls import LocaleRegexURLResolver, get_resolver
from django.utils import lru_cache
from django.views.i18n import set_language
def i18n_patterns(*urls, **kwargs):
"""
Adds the language code prefix to every URL pattern within this
... |
citrix-openstack-build/ceilometer | refs/heads/master | tests/network/test_floatingip.py | 3 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# Copyright © 2012 eNovance <licensing@enovance.com>
#
# Copyright 2013 IBM Corp
# All Rights Reserved.
#
# Author: Julien Danjou <julien@danjou.info>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... |
ignacionf/cui | refs/heads/master | home/urls.py | 1 | from django.conf.urls import url, include
urlpatterns = [
url('^', include('django.contrib.auth.urls')),
]
|
arkem/pyflag | refs/heads/main | utilities/Tester.py | 2 | # ******************************************************
# Michael Cohen <scudette@users.sourceforge.net>
#
# ******************************************************
# Version: FLAG $Version: 0.87-pre1 Date: Thu Jun 12 00:48:38 EST 2008$
# ******************************************************
#
# * This program is fre... |
dagwieers/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/_ec2_vpc.py | 63 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['removed'],
... |
axaxs/pyparted | refs/heads/master | tests/test__ped_device.py | 3 | #
# Copyright (C) 2009-2011 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it wi... |
thecableguy11492/pynet_practice | refs/heads/master | class1/exercise6JSON.py | 1 | import json
mylist = range(8)
mydict=({})
mydict['ipaddress'] = '10.10.10.1'
mydict['ipaddress2'] = '11.11.11.1'
mydict['ipaddressrange'] = '/24, /25, /26'
mylist.append(mydict)
with open('jsonex6.json', 'w') as f:
json.dump(mylist, f)
|
rpalovics/Alpenglow | refs/heads/master | python/test_alpenglow/evaluation/test_RrScore.py | 2 | import alpenglow as prs
import alpenglow.Getter as rs
import alpenglow.evaluation
import pandas as pd
import math
import unittest
class TestRrScore(unittest.TestCase):
def test_rrScore(self):
ranks = [102, 102, 102, 102, 3, 4, 102, 9, 102, 102, 102, 9, 102, 102, 102, 6, 102, 102, 102, 102, 102, 102, 102, ... |
pelson/conda-build | refs/heads/master | tests/test-recipes/metadata/_python_xx/run_test.py | 4 | import os
import json
import glob
import sys
def main():
prefix = os.environ['PREFIX']
info_files = glob.glob(os.path.join(prefix, 'conda-meta',
'conda-build-test-python-xx-1.0-py35_0.json'))
assert len(info_files) == 1, "did not find appropriate info file - check build strin... |
pepetreshere/odoo | refs/heads/patch-2 | addons/account/tests/test_account_payment.py | 2 | # -*- coding: utf-8 -*-
from odoo.addons.account.tests.common import AccountTestInvoicingCommon
from odoo.tests import tagged, new_test_user
from odoo.tests.common import Form
@tagged('post_install', '-at_install')
class TestAccountPayment(AccountTestInvoicingCommon):
@classmethod
def setUpClass(cls, chart_t... |
datawire/mdk | refs/heads/master | functionaltests/webservers/djangoserver/settings.py | 1 | """
Django settings for djangoserver project.
Generated by 'django-admin startproject' using Django 1.9.9.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import ... |
PI-Victor/tmux0r | refs/heads/pi-victor/integration_tests | collection/commands.py | 1 | import click
from . import utils, docker, tmux, libvirt, openshift
@click.group()
def vmctx():
pass
@vmctx.command()
def vmlist():
pass
@vmctx.command()
@click.option('--url')
@click.option('--image')
def vmsetup(url, image):
utils.download_image(url, image)
@vmctx.command()
@click.option('--hypervisor... |
bckwltn/SickRage | refs/heads/master | autoProcessTV/lib/requests/packages/chardet/gb2312prober.py | 2993 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
n3storm/caldav | refs/heads/master | caldav/objects.py | 1 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
import copy
import urlparse
import vobject
import StringIO
import uuid
from lxml import etree
from caldav.lib import error, vcal, url
from caldav.lib.namespace import ns
from caldav.elements import dav, cdav
class DAVObject(object):
"""
Base class for all DAV ... |
naparuba/shinken | refs/heads/master | test/test_contactdowntimes.py | 18 | #!/usr/bin/env python
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
#
# This file is part of Shinken.
#
# Shinken 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 F... |
timthelion/FreeCAD | refs/heads/master | src/Mod/Start/StartPage/LoadMRU1.py | 32 | #***************************************************************************
#* *
#* Copyright (c) 2012 *
#* Yorik van Havre <yorik@uncreated.net> *
#* ... |
michaelspeed/EntityMobile_Nexus5_kernel_AOSP | refs/heads/master | tools/perf/scripts/python/check-perf-trace.py | 11214 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... |
csningli/MultiAgent | refs/heads/master | tests/test_memory.py | 1 |
# MultiAgent 2.0
# (c) 2017-2018, NiL, csningli@gmail.com
import sys, os, time
import doctest
sys.path.append("..")
from mas.multiagent import *
def test_mem_basic() :
'''
>>> test_mem_basic()
Initialization.
Memory: <<multiagent.Memory content_size=0>>
'''
print("Initialization.")
mem =... |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/ship/components/weapon_capacitor/cap_kessel_imperial_sds_imperial_finest.py | 85615 | import sys
def setup(core, object):
return |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/mobile/dressed_droidengineer_trainer_rodian_male_01.py | 85615 | import sys
def setup(core, object):
return |
ynop/spych | refs/heads/master | spych/data/dataset/io/__init__.py | 1 | from .base import DatasetLoader
from .kaldi import KaldiDatasetLoader
from .legacy import LegacySpychDatasetLoader
from .spych import SpychDatasetLoader
from .tuda import TudaDatasetLoader
def available_loaders():
""" Return dictionary with the mapping loader-name, loader-class for all available dataset loaders. ... |
amgowano/oppia | refs/heads/develop | core/domain/trigger_registry.py | 34 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... |
garyjyao1/ansible | refs/heads/devel | lib/ansible/modules/extras/windows/win_webpicmd.py | 138 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Peter Mounce <public@neverrunwithscissors.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... |
kenshay/ImageScripter | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/pandas/tseries/offsets.py | 7 | from datetime import date, datetime, timedelta
from pandas.compat import range
from pandas import compat
import numpy as np
from pandas.types.generic import ABCSeries, ABCDatetimeIndex, ABCPeriod
from pandas.tseries.tools import to_datetime, normalize_date
from pandas.core.common import AbstractMethodError
# import a... |
ironbox360/django | refs/heads/master | django/conf/locale/vi/formats.py | 619 | # -*- 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 = r'\N\gà\y d \t\há\n\g n \nă\m Y'
T... |
factorlibre/OCB | refs/heads/8.0 | addons/account/tests/test_fiscal_position.py | 246 | from openerp.tests.common import TransactionCase
class TestFiscalPosition(TransactionCase):
"""Tests for fiscal positions in auto apply (account.fiscal.position).
If a partner has a vat number, the fiscal positions with "vat_required=True"
are prefered.
"""
def setUp(self):
super(TestFisca... |
google/active-qa | refs/heads/master | searchqa/prepro.py | 1 | # Copyright 2018 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
vegitron/pyodbc | refs/heads/master | tests2/freetdstests.py | 22 | #!/usr/bin/python
# -*- coding: latin-1 -*-
usage = """\
usage: %prog [options] connection_string
Unit tests for FreeTDS / SQL Server. To use, pass a connection string as the parameter.
The tests will create and drop tables t1 and t2 as necessary.
These run using the version from the 'build' directory, not the vers... |
eickenberg/scikit-learn | refs/heads/master | sklearn/tests/test_learning_curve.py | 19 | # Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import sys
from sklearn.externals.six.moves import cStringIO as StringIO
import numpy as np
import warnings
from sklearn.base import BaseEstimator
from sklearn.learning_curve import learning_curve, validation_curve
from sklearn.u... |
koyuawsmbrtn/eclock | refs/heads/master | windows/Python27/Lib/site-packages/pywin32-218-py2.7-win32.egg/win32comext/internet/inetcon.py | 29 | INET_E_USE_DEFAULT_PROTOCOLHANDLER = -2146697199 # _HRESULT_TYPEDEF_(0x800C0011L)
INET_E_USE_DEFAULT_SETTING = -2146697198 # _HRESULT_TYPEDEF_(0x800C0012L)
INET_E_DEFAULT_ACTION = INET_E_USE_DEFAULT_PROTOCOLHANDLER
INET_E_QUERYOPTION_UNKNOWN = -2146697197 # _HRESULT_TYPEDEF_(0x800C0013L)
INET_E_REDIRECTING = -214669719... |
SyntaxBlitz/skyward-link-old | refs/heads/master | skyward_link/clicker/views.py | 6445 | from django.shortcuts import render
# Create your views here.
|
idlesign/makeapp | refs/heads/master | makeapp/app_templates/webscaff/__module_name__/settings/base.py | 1 | # Stub. This wil be replaced by actual settings file generated by django-admin.
|
cawka/ns-3-dev-ndnSIM-old | refs/heads/master | src/tap-bridge/examples/tap-csma-virtual-machine.py | 157 | # -*- Mode: Python; -*-
#
# Copyright 2010 University of Washington
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation;
#
# This program is distributed in the hope that it will be usefu... |
uberamd/NGECore2 | refs/heads/master | scripts/object/static/creature/droids_21b_medical.py | 85615 | import sys
def setup(core, object):
return |
liavkoren/djangoDev | refs/heads/master | django/contrib/admin/templatetags/admin_modify.py | 76 | from django import template
register = template.Library()
@register.inclusion_tag('admin/prepopulated_fields_js.html', takes_context=True)
def prepopulated_fields_js(context):
"""
Creates a list of prepopulated_fields that should render Javascript for
the prepopulated fields for both the admin form and i... |
JacerOmri/PokemonGo-Bot-Desktop | refs/heads/development | pywin/Lib/encodings/cp861.py | 593 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP861.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_map)
def decode(self,input,errors='strict'):
... |
fuhongliang/odoo | refs/heads/8.0 | addons/project_timesheet/report/task_report.py | 336 | # -*- 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... |
wpoely86/easybuild-framework | refs/heads/develop | easybuild/tools/parallelbuild.py | 1 | # #
# Copyright 2012-2016 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (... |
SRabbelier/Melange | refs/heads/master | tests/app/soc/modules/seeder/logic/__init__.py | 1 | # Copyright 2009 the Melange 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
grlee77/nipype | refs/heads/master | nipype/interfaces/freesurfer/tests/test_auto_SampleToSurface.py | 9 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.freesurfer.utils import SampleToSurface
def test_SampleToSurface_inputs():
input_map = dict(apply_rot=dict(argstr='--rot %.3f %.3f %.3f',
),
apply_trans=dict(argstr='--trans %.3f %.3f %.3f',... |
AllanNozomu/tecsaladeaula | refs/heads/master | notes/serializers.py | 8 | from notes.models import Note
from rest_framework import serializers
class NoteSerializer(serializers.ModelSerializer):
class Meta:
model = Note
fields = ('id', 'text', 'content_type', 'object_id')
|
djmaze/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/test_expectations.py | 126 | # 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 ... |
DepthDeluxe/ansible | refs/heads/devel | lib/ansible/modules/database/proxysql/proxysql_manage_config.py | 58 | #!/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.
#... |
jarvys/django-1.7-jdb | refs/heads/master | tests/comment_tests/tests/test_models.py | 24 | from django.contrib.comments.models import Comment
from . import CommentTestCase
from ..models import Author, Article
class CommentModelTests(CommentTestCase):
def testSave(self):
for c in self.createSomeComments():
self.assertNotEqual(c.submit_date, None)
def testUserProperties(self):
... |
hynnet/hiwifi-openwrt-HC5661-HC5761 | refs/heads/master | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/cmd.py | 32 | """A generic class to build line-oriented command interpreters.
Interpreters constructed with this class obey the following conventions:
1. End of file on input is processed as the command 'EOF'.
2. A command is parsed out of each line by collecting the prefix composed
of characters in the identchars member.
3. A ... |
wooga/airflow | refs/heads/master | tests/providers/exasol/hooks/__init__.py | 5130 | #
# 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... |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-2.3/Lib/test/test_bsddb3.py | 17 | # Test driver for bsddb package.
"""
Run all test cases.
"""
import sys
import unittest
from test.test_support import requires, verbose, run_suite
# When running as a script instead of within the regrtest framework, skip the
# requires test, since it's obvious we want to run them.
if __name__ <> '__main__':
requir... |
mosbasik/buzhug | refs/heads/master | javasrc/lib/Jython/Lib/test/test__rawffi.py | 23 | import unittest
from test import test_support
# xxx - forces a skip in the case we haven't built ctypes_test module in ant (which is not yet a task as of now)
try:
import _rawffi
_rawffi.CDLL("ctypes_test")
except:
raise ImportError
class RawFFITestCase(unittest.TestCase):
def setUp(self):
s... |
mornsun/javascratch | refs/heads/master | src/topcoder.py/WordLadderII.py | 2 | '''
Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start to end, such that:
Only one letter can be changed at a time
Each intermediate word must exist in the dictionary
For example,
Given:
start = "hit"
end = "cog"
dict = ["hot","dot","dog","lot","log"]
Return
[... |
PetePriority/home-assistant | refs/heads/dev | homeassistant/components/abode/lock.py | 5 | """
This component provides HA lock support for Abode Security System.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/lock.abode/
"""
import logging
from homeassistant.components.abode import AbodeDevice, DOMAIN as ABODE_DOMAIN
from homeassistant.compon... |
subodhchhabra/airflow | refs/heads/master | tests/contrib/sensors/test_bash_sensor.py | 15 | # -*- coding: utf-8 -*-
#
# 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
#... |
svsn2117/coala | refs/heads/master | coalib/parsing/__init__.py | 66 | """
The StringProcessing module contains various functions for extracting
information out of strings.
Most of them support regexes for advanced pattern matching.
"""
|
Simran-B/arangodb | refs/heads/docs_3.0 | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_resource.py | 70 | import unittest
from test import test_support
import resource
import time
# This test is checking a few specific problem spots with the resource module.
class ResourceTest(unittest.TestCase):
def test_args(self):
self.assertRaises(TypeError, resource.getrlimit)
self.assertRaises(TypeError, resou... |
kuipertan/vitess | refs/heads/master | py/vtdb/__init__.py | 10 | # Copyright 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.
# PEP 249 complient db api for Vitess
apilevel = '2.0'
# Threads may not share the module because multi_client is not thread safe.
threadsafety = 0
paramstyle = 'nam... |
fujunwei/chromium-crosswalk | refs/heads/master | tools/telemetry/telemetry/value/list_of_scalar_values.py | 8 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import numbers
from telemetry import value as value_module
from telemetry.value import none_values
def _Mean(values):
return float(sum(values)) / len(va... |
moijes12/oh-mainline | refs/heads/master | mysite/missions/git/forms.py | 15 | # This file is part of OpenHatch.
# Copyright (C) 2010 Jack Grigg
# Copyright (C) 2010 John Stumpo
# Copyright (C) 2010, 2011 OpenHatch, Inc.
#
# This program 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 Foundat... |
Regner/will | refs/heads/master | will/plugins/friendly/love.py | 11 | from will.plugin import WillPlugin
from will.decorators import respond_to, periodic, hear, randomly, route, rendered_template, require_settings
class ItsLovePlugin(WillPlugin):
@hear("i love(?: you,?)? will")
def hear_love(self, message):
self.say("I love you, too.", message=message)
@respond_to... |
Tatsh/youtube-dl | refs/heads/master | youtube_dl/extractor/twitch.py | 2 | # coding: utf-8
from __future__ import unicode_literals
import collections
import itertools
import json
import random
import re
from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
compat_str,
compat_urlparse,
compat_urllib_parse_urlencode,
compat_urllib_parse_urlparse,
)
from... |
Learning-from-our-past/Kaira | refs/heads/master | interface/csvbuilderinterface.py | 2 | # -*- coding: utf-8 -*-
import ntpath
import csv
from abc import abstractmethod
class ResultCsvBuilderInterface:
#TODO: POISTA SISÄISEN TOTETUKSEN FUNKTIOT SILLÄ NE VOIVAT VAPAASTI VAIHDELLA
def __init__(self):
pass
@abstractmethod
def openCsv(self, filepath):
self.filepath = filepath... |
jesramirez/odoo | refs/heads/8.0 | addons/l10n_es/__init__.py | 307 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# This program 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 Fre... |
bgris/ODL_bgris | refs/heads/master | lib/python3.5/site-packages/pexpect/exceptions.py | 58 | """Exception classes used by Pexpect"""
import traceback
import sys
class ExceptionPexpect(Exception):
'''Base class for all exceptions raised by this module.
'''
def __init__(self, value):
super(ExceptionPexpect, self).__init__(value)
self.value = value
def __str__(self):
re... |
yongshengwang/hue | refs/heads/master | build/env/lib/python2.7/site-packages/boto-2.38.0-py2.7.egg/boto/ec2/keypair.py | 150 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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, modi... |
jim-cooley/abletonremotescripts | refs/heads/master | remote-scripts/samples/FCB1010_Custom/FCB1010MainController.py | 1 | import Live
from FCB1010Component import FCB1010Component
from consts import *
class FCB1010MainController(FCB1010Component):
__module__ = __name__
__doc__ = "Main controller for FCB1010 remote control surface"
__filter_funcs__ = ["update_display", "log"]
def __init__(self, parent):
FCB1010Component... |
mdakin/engine | refs/heads/master | build/android/pylib/gtest/gtest_config.py | 56 | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Configuration file for android gtest suites."""
# Add new suites here before upgrading them to the stable list below.
EXPERIMENTAL_TEST_SUITES = [
... |
yarikoptic/scrapy | refs/heads/master | tests/test_utils_conf.py | 22 | import unittest
from scrapy.settings import BaseSettings
from scrapy.utils.conf import build_component_list, arglist_to_dict
class BuildComponentListTest(unittest.TestCase):
def test_build_dict(self):
d = {'one': 1, 'two': None, 'three': 8, 'four': 4}
self.assertEqual(build_component_list(d, con... |
minghuascode/pyj | refs/heads/master | library/pyjamas/ui/Grid.py | 9 | # Copyright 2006 James Tauber and contributors
# Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
#
# 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/... |
steventimberman/masterDebater | refs/heads/master | venv/lib/python2.7/site-packages/whoosh/qparser/plugins.py | 52 | # Copyright 2011 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... |
miguelpalacio/python-for-android | refs/heads/master | python-build/python-libs/gdata/src/gdata/tlslite/Session.py | 359 | """Class representing a TLS session."""
from utils.compat import *
from mathtls import *
from constants import *
class Session:
"""
This class represents a TLS session.
TLS distinguishes between connections and sessions. A new
handshake creates both a connection and a session. Data is
transmitt... |
a-parhom/edx-platform | refs/heads/master | common/djangoapps/course_modes/tests/test_views.py | 4 | """
Tests for course_modes views.
"""
import decimal
import unittest
from datetime import datetime, timedelta
import ddt
import freezegun
import httpretty
import pytz
from django.conf import settings
from django.urls import reverse
from mock import patch
from course_modes.models import CourseMode, Mode
from course_m... |
drukhil/frappe | refs/heads/master | frappe/utils/data.py | 1 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
# IMPORTANT: only import safe functions as this module will be included in jinja environment
import frappe
import operator
import re, urllib, datetime, math
import babel.dates
fr... |
AlphaX2/FotoShareN9 | refs/heads/master | 1.6.1/fotoshare/opt/FotoShareN9/plugins/sftp/libs/paramiko/auth_handler.py | 26 | # Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (a... |
n0trax/ansible | refs/heads/devel | lib/ansible/modules/network/vyos/vyos_command.py | 15 | #!/usr/bin/python
#
# 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 distribut... |
thurt/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/third_party/python_26/Lib/compiler/pycodegen.py | 56 | import imp
import os
import marshal
import struct
import sys
from cStringIO import StringIO
from compiler import ast, parse, walk, syntax
from compiler import pyassem, misc, future, symbols
from compiler.consts import SC_LOCAL, SC_GLOBAL, SC_FREE, SC_CELL
from compiler.consts import (CO_VARARGS, CO_VARKEYWORDS, CO_NEW... |
adaur/SickRage | refs/heads/master | lib/hachoir_parser/image/psd.py | 95 | """
Photoshop parser (.psd file).
Creation date: 8 january 2006
Author: Victor Stinner
"""
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet,
UInt16, UInt32, String, NullBytes, Enum, RawBytes)
from hachoir_core.endian import BIG_ENDIAN
from hachoir_parser.image.photoshop_metadata import P... |
XiaosongWei/chromium-crosswalk | refs/heads/master | ppapi/generators/idl_thunk.py | 30 | #!/usr/bin/env python
# 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.
""" Generator for C++ style thunks """
import glob
import os
import re
import sys
from idl_log import ErrOut, InfoOut, WarnOut
fr... |
KousikaGanesh/purchaseandInventory | refs/heads/master | openerp/addons/mrp/report/mrp_production_order.py | 69 | # -*- 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... |
tinkhaven-organization/odoo | refs/heads/8.0 | addons/base_vat/base_vat.py | 238 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 OpenERP SA (<http://openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
AnishShah/tensorflow | refs/heads/master | tensorflow/contrib/data/python/kernel_tests/bucketing_test.py | 1 | # 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... |
wbrambley/Grace-kernel | refs/heads/master | arch/ia64/scripts/unwcheck.py | 13143 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... |
fangxingli/hue | refs/heads/master | desktop/core/ext-py/South-1.0.2/south/tests/fakeapp/migrations/0003_alter_spam.py | 151 | from south.db import db
from django.db import models
class Migration:
def forwards(self):
db.alter_column("southtest_spam", 'weight', models.FloatField(null=True))
def backwards(self):
db.alter_column("southtest_spam", 'weight', models.FloatField())
models = {
... |
hrashk/sympy | refs/heads/master | sympy/core/tests/test_numbers.py | 4 | import decimal
from sympy import (Rational, Symbol, Float, I, sqrt, oo, nan, pi, E, Integer,
S, factorial, Catalan, EulerGamma, GoldenRatio, cos, exp,
Number, zoo, log, Mul, Pow, Tuple, latex)
from sympy.core.basic import _aresame
from sympy.core.compatibility import long, u
from s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.