repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
zubie7a/Algorithms
refs/heads/master
CodeSignal/Arcade/Intro/Level_06/03_Variable_Name.py
3
# https://codefights.com/arcade/intro/level-6/6Wv4WsrsMJ8Y2Fwno import re def variableName(name): # Return if its a valid variable name. It should start with # an alphabetic character or with underscore, and then can be # followed by any alphanumeric characters and underscores. return bool(re.match("^[a...
alviano/wasp
refs/heads/master
tests/wasp1/AllAnswerSets/rule_with_60_variables.test.py
3
input = """ bar(a). foo(X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12,X13,X14,X15,X16,X17,X18,X19,X20,X21,X22,X23,X24,X25,X26,X27,X28,X29,X30,X31,X32,X33,X34,X35,X36,X37,X38,X39,X40,X41,X42,X43,X44,X45,X46,X47,X48,X49,X50,X51,X52,X53,X54,X55,X56,X57,X58,X59,X60) :- bar(X1),bar(X2),bar(X3),bar(X4),bar(X5),bar(X6),bar(X7),bar(X...
krieger-od/nwjs_chromium.src
refs/heads/master
tools/site_compare/command_line.py
179
#!/usr/bin/env python # Copyright (c) 2011 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. """Parse a command line, retrieving a command and its arguments. Supports the concept of command line commands, each with its own ...
mbayon/TFG-MachineLearning
refs/heads/master
vbig/lib/python2.7/site-packages/scipy/signal/tests/test_max_len_seq.py
20
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import assert_allclose, assert_array_equal from pytest import raises as assert_raises from numpy.fft import fft, ifft from scipy.signal import max_len_seq class TestMLS(object): def test_mls_inputs(self): ...
genouest/biomaj-download
refs/heads/master
biomaj_download/message/downmessage_pb2.py
1
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: downmessage.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _r...
nibanks/openthread
refs/heads/master
tests/scripts/thread-cert/Cert_5_6_05_NetworkDataRegisterAfterAttachRouter.py
5
#!/usr/bin/python # # Copyright (c) 2016, The OpenThread Authors. # 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 # not...
fperez/sympy
refs/heads/master
sympy/core/tests/test_var.py
3
# Tests for var are in their own file, because var pollutes global namespace. from sympy import Symbol, var, raises # make z1 with call-depth = 1 def make_z1(): var("z1") # make z2 with call-depth = 2 def __make_z2(): var("z2") def make_z2(): __make_z2() def test_var(): var("a") assert a == S...
cyrus-/typy
refs/heads/typy
tests/test_gpce16.py
1
"""Testing the examples from the GPCE 2016 paper. To run: $ py.test test_gpce16.py """ import pytest import ast import typy from typy.std import component, unit, record, string, py, fn, finsum, tpl class TestGPCEExamples: @pytest.fixture def Listing1(self): # simplified to use string rather than st...
quinot/ansible
refs/heads/devel
lib/ansible/modules/storage/infinidat/infini_pool.py
27
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Gregory Shulov (gregory.shulov@gmail.com) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '...
IITBinterns13/edx-platform-dev
refs/heads/master
cms/djangoapps/contentstore/tests/test_item.py
2
from contentstore.tests.test_course_settings import CourseTestCase from xmodule.modulestore.tests.factories import CourseFactory from django.core.urlresolvers import reverse class DeleteItem(CourseTestCase): def setUp(self): """ Creates the test course with a static page in it. """ super(DeleteIte...
duqiao/django
refs/heads/master
tests/validators/tests.py
163
# -*- coding: utf-8 -*- from __future__ import unicode_literals import io import os import re import types from datetime import datetime, timedelta from unittest import TestCase from django.core.exceptions import ValidationError from django.core.validators import ( BaseValidator, EmailValidator, MaxLengthValidato...
dtrip/weevely3
refs/heads/master
tests/test_file_upload2web.py
2
from testfixtures import log_capture from tests.base_test import BaseTest from tests import config from core.sessions import SessionURL from core import modules import utils from core import messages import subprocess import tempfile import os def setUpModule(): subprocess.check_output(""" BASE_FOLDER="{config.bas...
w1ll1am23/home-assistant
refs/heads/dev
tests/components/apple_tv/__init__.py
9
"""Tests for Apple TV.""" import pytest # Make asserts in the common module display differences pytest.register_assert_rewrite("tests.components.apple_tv.common")
Cerberus98/tortilla
refs/heads/master
setup.py
1
#!/usr/bin/env python import distutils.core import pip.download from pip.req import parse_requirements try: import setuptools except ImportError: pass version = "0.01" def requires(path): return [r.name for r in parse_requirements(path, session=pip.download.PipSession()) if r] distutils....
scrollback/kuma
refs/heads/master
vendor/packages/pylint/test/input/__init__.py
36
"""test"""
mitdrc/director
refs/heads/master
src/python/director/robotposegui.py
4
import director from PythonQt import QtCore, QtGui, QtUiTools import lcm import sys import json import time import os import bot_core as lcmbotcore import functools from collections import OrderedDict class LCMWrapper(object): ''' A basic class provided some convenience methods around LCM. ''' def _...
lkorigin/laniakea
refs/heads/master
src/lighthouse/lighthouse/jobs_server.py
1
# -*- coding: utf-8 -*- # # Copyright (C) 2018-2019 Matthias Klumpp <matthias@tenstral.net> # # Licensed under the GNU Lesser General Public License Version 3 # # This program 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...
annegabrielle/secure_adhoc_network_ns-3
refs/heads/master
doc/testing/source/conf.py
5
# -*- coding: utf-8 -*- # # ns-3 documentation build configuration file, created by # sphinx-quickstart on Tue Dec 14 09:00:39 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All co...
ibjohansen/acando-react-boilerplate-extended
refs/heads/master
node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py
1558
# 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. ...
josegonzalez/python-smooshy
refs/heads/master
setup.py
1
from distutils.core import setup setup( name='smooshy', version='1', author='Jose Gonzalez', author_email='support@savant.be', packages=['smooshy'], scripts=['bin/smooshy'], url='https://github.com/josegonzalez/smooshy', license='LICENSE.txt', description='Automatic lossless image c...
vadimtk/chrome4sdp
refs/heads/master
tools/telemetry/third_party/gsutilz/third_party/boto/tests/integration/kms/test_kms.py
99
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
shujingke/opencog
refs/heads/master
opencog/python/blending/src/chooser/chooser_finder.py
22
from blending.src.chooser.choose_null import ChooseNull from blending.src.chooser.choose_all import ChooseAll from blending.src.chooser.choose_in_sti_range import ChooseInSTIRange from blending.util.blending_config import BlendConfig from blending.util.blending_error import blending_status __author__ = 'DongMin Kim' ...
MountainWei/nova
refs/heads/master
nova/tests/unit/api/openstack/compute/test_rescue.py
29
# Copyright 2011 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
microcom/odoo
refs/heads/9.0
addons/l10n_hr/__init__.py
110
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. # Author: Goran Kliska # mail: goran.kliska(AT)slobodni-programi.hr # Copyright (C) 2011- Slobodni programi d.o.o., Zagreb
colinnewell/odoo
refs/heads/8.0
addons/hr_contract/__init__.py
381
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-Today OpenERP SA (<http://www.openerp.com) # # This program is free software: you can redistribute it and/or modify # it under the term...
yaniv14/OpenCommunity
refs/heads/master
src/communities/forms.py
1
from datetime import datetime, date, time from communities.models import Committee, CommunityGroup, CommunityGroupRole from django.utils.translation import ugettext_lazy as _, gettext from ocd.formfields import HTMLArea, OCCheckboxSelectMultiple, OCSplitDateTimeField import floppyforms.__future__ as forms from haystac...
eurosata1/e2
refs/heads/master
lib/python/Components/About.py
2
# -*- coding: utf-8 -*- from boxbranding import getBoxType import struct, socket, fcntl, sys, os, time from sys import modules import os import time def getVersionString(): return getImageVersionString() def getImageVersionString(): try: if os.path.isfile('/var/lib/opkg/status'): st = os.stat('/var/lib/opkg/st...
martint/airlift
refs/heads/master
launcher/src/main/scripts/bin/launcher.py
12
#!/usr/bin/env python import errno import os import platform import sys import traceback from fcntl import flock, LOCK_EX, LOCK_NB from optparse import OptionParser from os import O_RDWR, O_CREAT, O_WRONLY, O_APPEND from os.path import basename, dirname, exists, realpath from os.path import join as pathjoin from sign...
willingc/oh-mainline
refs/heads/master
mysite/search/management/__init__.py
90
# This file is part of OpenHatch. # Copyright (C) 2010 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 Foundation, either version 3 of the License, or # (at your option) any later v...
agrista/odoo-saas
refs/heads/master
addons/l10n_be/wizard/__init__.py
438
# -*- 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...
proxysh/Safejumper-for-Desktop
refs/heads/master
buildmac/Resources/env/lib/python2.7/site-packages/twisted/cred/test/test_simpleauth.py
24
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for basic constructs of L{twisted.cred.credentials}. """ from __future__ import division, absolute_import from twisted.trial.unittest import TestCase from twisted.cred.credentials import UsernamePassword, IUsernamePassword from twisted...
bryanph/OIPA
refs/heads/develop
OIPA/geodata/geojson_to_wkt.py
4
import StringIO import tokenize INVALID_WKT_FMT = 'Invalid WKT: `%s`' def dump(obj, dest_file): """ Dump GeoJSON-like `dict` to WKT and write it to the `dest_file`. :param dict obj: A GeoJSON-like dictionary. It must at least the keys 'type' and 'coordinates'. :param dest_file: ...
ycaihua/kbengine
refs/heads/master
kbe/src/lib/python/Tools/demo/markov.py
107
#!/usr/bin/env python3 """ Markov chain simulation of words or characters. """ class Markov: def __init__(self, histsize, choice): self.histsize = histsize self.choice = choice self.trans = {} def add(self, state, next): self.trans.setdefault(state, []).append(next) def p...
MTG/essentia
refs/heads/master
src/python/essentia/pytools/extractors/melspectrogram.py
1
# Copyright (C) 2006-2021 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Essentia # # Essentia 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 (FSF), either version 3 of the ...
raajitr/django_hangman
refs/heads/master
env/lib/python2.7/site-packages/django/contrib/gis/utils/__init__.py
8
""" This module contains useful utilities for GeoDjango. """ from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.utils.wkt import precision_wkt # NOQA from django.core.exceptions import ImproperlyConfigured if HAS_GDAL: from django.contrib.gis.utils.ogrinfo import ogrinfo # NOQA from django...
pignacio/var-log-recetas
refs/heads/master
var_log_recetas/recipe/models.py
1
from django.db import models from django.utils.translation import ugettext as _ # Create your models here. class MeasuredIngredient(models.Model): ingredient = models.ForeignKey('ingredient.Ingredient') unit = models.ForeignKey('ingredient.MeasureUnit') amount = models.FloatField(_('Amount')) subreci...
amunk/metagoofil
refs/heads/master
hachoir_parser/archive/ace.py
95
""" ACE parser From wotsit.org and the SDK header (bitflags) Partial study of a new block type (5) I've called "new_recovery", as its syntax is very close to the former one (of type 2). Status: can only read totally file and header blocks. Author: Christophe Gisquet <christophe.gisquet@free.fr> Creation date: 19 jan...
singe/sslstrip2
refs/heads/master
sslstrip/SSLServerConnection.py
32
# Copyright (c) 2004-2009 Moxie Marlinspike # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distri...
DansGit/qnatool
refs/heads/master
analyze/parsedatetime/tests/TestRanges.py
3
""" Test parsing of simple date and times """ import unittest, time, datetime import parsedatetime as pdt # a special compare function is used to allow us to ignore the seconds as # the running of the test could cross a minute boundary def _compareResults(result, check): targetStart, targetEnd, t_flag = res...
turdusmerula/kipartman
refs/heads/master
kipartman/frames/project_frame.py
1
from dialogs.dialog_project import DialogProject from frames.buy_frame import BuyFrame from frames.bom_frame import BomFrame from frames.schematic_frame import SchematicFrame from frames.configuration_frame import ConfigurationFrame from helper.exception import print_stack import helper.tree import os import wx from ki...
abdullah2891/remo
refs/heads/master
vendor-local/lib/python/rest_framework/templatetags/rest_framework.py
13
from __future__ import unicode_literals, absolute_import from django import template from django.core.urlresolvers import reverse, NoReverseMatch from django.utils import six from django.utils.encoding import iri_to_uri, force_text from django.utils.html import escape from django.utils.safestring import SafeData, mark_...
inovtec-solutions/OpenERP
refs/heads/branch_openerp
openerp/addons/base/module/wizard/base_module_scan.py
24
# -*- 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...
roadhead/satchmo
refs/heads/master
satchmo/contact/forms.py
2
from django import forms from django.contrib.auth.models import User from django.db.models import Q from django.utils.translation import ugettext_lazy as _, ugettext from satchmo.configuration import config_value, config_get_group, SettingNotSet, SHOP_GROUP from satchmo.contact.models import Contact, AddressBook, Phone...
vany-egorov/node-gyp
refs/heads/master
gyp/tools/graphviz.py
2679
#!/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. """Using the JSON dumped by the dump-dependency-json generator, generate input suitable for graphviz to render a dependency graph of targets...
ftomassetti/intellij-community
refs/heads/master
python/testData/resolve/multiFile/relativeSimple/sys.py
83
token = "local"
diagramsoftware/odoo
refs/heads/8.0
addons/crm/crm_segmentation.py
333
# -*- 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...
slipperyhank/pyphi
refs/heads/develop
pyphi/cache.py
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # cache.py """ A memory-limited cache decorator. """ import os import pickle from functools import namedtuple, update_wrapper, wraps import psutil import redis from . import config, constants _CacheInfo = namedtuple("CacheInfo", ["hits", "misses", "currsize"]) def m...
Galaxy-J5/android_kernel_samsung_j5nlte
refs/heads/cm-12.1
tools/perf/tests/attr.py
3174
#! /usr/bin/python import os import sys import glob import optparse import tempfile import logging import shutil import ConfigParser class Fail(Exception): def __init__(self, test, msg): self.msg = msg self.test = test def getMsg(self): return '\'%s\' - %s' % (self.test.path, self.msg)...
sunqm/pyscf
refs/heads/master
pyscf/data/gyro.py
2
#!/usr/bin/env python # Copyright 2014-2018 The PySCF Developers. 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 # # U...
MungoRae/home-assistant
refs/heads/dev
homeassistant/components/cover/mqtt.py
4
""" Support for MQTT cover devices. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/cover.mqtt/ """ import asyncio import logging import voluptuous as vol from homeassistant.core import callback import homeassistant.components.mqtt as mqtt from homeassi...
robert-impey/tree-sorter
refs/heads/master
test_arelinessortedtree.py
1
#!/usr/bin/env python3 from treesorting import * import unittest class TestEmpty(unittest.TestCase): def setUp(self): self.lines = [] def test_empty_set_is_sorted(self): lines_are_sorted_tree = are_lines_sorted_tree(self.lines) self.assertTrue(lines_are_sorted_tree) class TestSingl...
exelearning/iteexe
refs/heads/master
nevow/testutil.py
14
# Copyright (c) 2004 Divmod. # See LICENSE for details. from nevow import compy, inevow class FakeChannel: def __init__(self, site): self.site = site class FakeSite: pass class FakeSession(compy.Componentized): def __init__(self, avatar): compy.Componentized.__init__(self) se...
Seagate/swift
refs/heads/master
swift/common/middleware/ratelimit.py
42
# Copyright (c) 2010-2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
tgsd96/gargnotes
refs/heads/master
venv/lib/python2.7/site-packages/django/contrib/syndication/__init__.py
808
default_app_config = 'django.contrib.syndication.apps.SyndicationConfig'
bratatidas9/Impala-1
refs/heads/cdh5-trunk
thirdparty/thrift-0.9.0/contrib/zeromq/TZmqServer.py
108
# # 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...
GoogleCloudPlatform/dataflow-speech-redaction
refs/heads/master
srf-longrun-job-dataflow/srflongrunjobdataflow.py
1
# Copyright 2021 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
peterjoel/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/third_party/h2/examples/fragments/server_upgrade_fragment.py
25
# -*- coding: utf-8 -*- """ Server Plaintext Upgrade ~~~~~~~~~~~~~~~~~~~~~~~~ This example code fragment demonstrates how to set up a HTTP/2 server that uses the plaintext HTTP Upgrade mechanism to negotiate HTTP/2 connectivity. For maximum explanatory value it uses the synchronous socket API that comes with the Pytho...
Andrew-McNab-UK/DIRAC
refs/heads/integration
tests/Integration/WorkloadManagementSystem/exe-script.py
22
#!/usr/bin/env python '''Script to run Executable application''' import sys from os import system # Main if __name__ == '__main__': sys.exit(system('''echo Hello World''')/256)
botswana-harvard/getresults-receive
refs/heads/develop
getresults_receive/tests/factories/receive_factory.py
1
import factory from getresults_receive.models import Receive from django.utils import timezone class ReceiveFactory(factory.DjangoModelFactory): class Meta: model = Receive receive_identifier = factory.Sequence(lambda n: 'APA{0}K-{0}'.format(n)) receive_datetime = timezone.now() collection_d...
madflow/weblate
refs/heads/master
weblate/trans/models/changes.py
7
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://weblate.org/> # # 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, eithe...
40223114/w16b_test
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/fractions.py
722
# Originally contributed by Sjoerd Mullender. # Significantly modified by Jeffrey Yasskin <jyasskin at gmail.com>. """Fraction, infinite-precision, real numbers.""" from decimal import Decimal import math import numbers import operator import re import sys __all__ = ['Fraction', 'gcd'] def gcd(a, b): """Calcu...
ykaneko/quantum
refs/heads/master
quantum/tests/unit/test_linux_ip_lib.py
3
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack Foundation # 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.apach...
waddedMeat/ember-proxy-example
refs/heads/master
test-app/node_modules/ember-cli/node_modules/npm/node_modules/node-gyp/gyp/tools/graphviz.py
2679
#!/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. """Using the JSON dumped by the dump-dependency-json generator, generate input suitable for graphviz to render a dependency graph of targets...
avanov/Rhetoric
refs/heads/develop
tests/testapp/manage.py
57
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "testapp.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
waynesun09/tp-libvirt
refs/heads/master
libvirt/tests/src/virsh_cmd/domain/virsh_metadata.py
4
import logging import xml.dom.minidom import aexpect from autotest.client.shared import error from virttest import remote from virttest import virsh from virttest.utils_test import libvirt as utlv from virttest.utils_libvirtd import Libvirtd from virttest.libvirt_xml import vm_xml def run(test, params, env): "...
mikalstill/nova
refs/heads/master
nova/tests/unit/api/openstack/compute/test_cloudpipe.py
3
# Copyright 2011 OpenStack Foundation # 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 requ...
ikargis/horizon_fod
refs/heads/master
openstack_dashboard/dashboards/project/databases/urls.py
9
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 Rackspace Hosting # # 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....
rockyzhang/zhangyanhit-python-for-android-mips
refs/heads/master
python-modules/twisted/twisted/conch/checkers.py
59
# -*- test-case-name: twisted.conch.test.test_checkers -*- # Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Provide L{ICredentialsChecker} implementations to be used in Conch protocols. """ import os, base64, binascii, errno try: import pwd except ImportError: pwd = None e...
dpryan79/tools-iuc
refs/heads/master
data_managers/data_manager_bwameth_index_builder/data_manager/bwameth_index_builder.py
8
#!/usr/bin/env python # Based heavily on the HISAT2 data manager wrapper import argparse import os import subprocess import sys from json import dumps, loads DEFAULT_DATA_TABLE_NAME = "bwameth_indexes" def build_bwameth_index(data_manager_dict, params, args): data_table_name = args.data_table_name target_di...
ChanduERP/odoo
refs/heads/8.0
openerp/osv/__init__.py
337
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
enen92/script.matchcenter
refs/heads/master
resources/lib/__init__.py
6
# -*- coding: utf-8 -*- ''' script.matchcenter - Football information for Kodi A program addon that can be mapped to a key on your remote to display football information. Livescores, Event details, Line-ups, League tables, next and previous matches by team. Follow what others are saying about the match ...
faridani/pyDoc
refs/heads/master
Unidecode/unidecode/x00c.py
252
data = ( '[?]', # 0x00 'N', # 0x01 'N', # 0x02 'H', # 0x03 '[?]', # 0x04 'a', # 0x05 'aa', # 0x06 'i', # 0x07 'ii', # 0x08 'u', # 0x09 'uu', # 0x0a 'R', # 0x0b 'L', # 0x0c '[?]', # 0x0d 'e', # 0x0e 'ee', # 0x0f 'ai', # 0x10 '[?]', # 0x11 'o', # 0x12 'oo', # 0x...
denyszamiatin/to_do
refs/heads/master
tests/test_tasks.py
1
from unittest import TestCase from main import add_task, tasks class TestTasks(TestCase): def test_add_tasks(self): add_task('01.01.2015', 'Make coffee') self.assertEqual(tasks, [['01.01.2015', 'Make coffee']])
Tejal011089/trufil-erpnext
refs/heads/master
erpnext/accounts/doctype/payment_tool/payment_tool.py
30
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import flt from frappe.model.document import Document import json class PaymentTool(Docum...
chrismbarnes/ndnSIM
refs/heads/ndnSIM-v1
src/network/test/examples-to-run.py
129
#! /usr/bin/env python ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- # A list of C++ examples to run in order to ensure that they remain # buildable and runnable over time. Each tuple in the list contains # # (example_name, do_run, do_valgrind_run). # # See test.py for more i...
perkinslr/pypyjs
refs/heads/master
addedLibraries/twisted/conch/mixin.py
69
# -*- test-case-name: twisted.conch.test.test_mixin -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Experimental optimization This module provides a single mixin class which allows protocols to collapse numerous small writes into a single larger one. @author: Jp Calderone """ from tw...
zhounanshu/Flask-AppBuilder
refs/heads/master
examples/issue_188/app/__init__.py
9
import logging from flask import Flask from flask.ext.appbuilder import SQLA, AppBuilder """ Logging configuration """ logging.basicConfig(format='%(asctime)s:%(levelname)s:%(name)s:%(message)s') logging.getLogger().setLevel(logging.DEBUG) app = Flask(__name__) app.config.from_object('config') db = SQLA(app) appbui...
JanNash/sms-tools
refs/heads/master
lectures/05-Sinusoidal-model/plots-code/spectral-peaks-interpolation.py
22
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, triang, blackmanharris from scipy.fftpack import fft, ifft import math import sys, os, functools, time sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import dftModel as DFT impo...
gangadhar-kadam/church-erpnext
refs/heads/master
patches/april_2013/p03_fixes_for_lead_in_quotation.py
6
import webnotes def execute(): webnotes.conn.sql("""update `tabQuotation` set customer_name = organization where quotation_to = 'Lead' and ifnull(lead, '') != '' and ifnull(organization, '') != ''""") webnotes.conn.sql("""update `tabQuotation` set customer_name = lead_name where quotation_to = 'Lead' and i...
nextgis/quickmapservices_server
refs/heads/master
qms_server/qms_site/tests.py
24123
from django.test import TestCase # Create your tests here.
aikonbrasil/ns3-20
refs/heads/master
doc/tutorial-pt-br/source/conf.py
90
# -*- coding: utf-8 -*- # # ns-3 documentation build configuration file, created by # sphinx-quickstart on Tue Dec 14 09:00:39 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All co...
CCI-MOC/moc-openstack-tools
refs/heads/master
setpass.py
1
# Copyright 2016 Massachusetts Open Cloud # # 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...
kerneltask/micropython
refs/heads/master
tests/float/complex_special_mehods.py
2
# test complex interacting with special methods class A: def __add__(self, x): print("__add__") return 1 def __radd__(self, x): print("__radd__") return 2 print(A() + 1j) print(1j + A())
mcanthony/libvips
refs/heads/master
python/Vips.py
1
# -*- Mode: Python; py-indent-offset: 4 -*- # vim: tabstop=4 shiftwidth=4 expandtab from __future__ import division # overrides for pygobject gobject-introspection binding for libvips, tested # with python2.7 and python3.4 # copy this file to dist-packages/gi/overrides, eg. # # sudo cp Vips.py /usr/lib/python2.7...
Zhongqilong/mykbengineer
refs/heads/master
kbe/src/lib/python/Lib/test/test_poplib.py
72
"""Test script for poplib module.""" # Modified by Giampaolo Rodola' to give poplib.POP3 and poplib.POP3_SSL # a real test suite import poplib import asyncore import asynchat import socket import os import time import errno from unittest import TestCase, skipUnless from test import support as test_support threading ...
PriviPK/privipk-sync-engine
refs/heads/privipk
inbox/events/remote_sync.py
1
from datetime import datetime from inbox.log import get_logger logger = get_logger() from inbox.basicauth import AccessNotEnabledError from inbox.sync.base_sync import BaseSyncMonitor from inbox.models import Event, Account, Calendar from inbox.models.event import RecurringEvent, RecurringEventOverride from inbox.uti...
memento7/KINCluster
refs/heads/master
tests/test_extractor.py
1
# -*- coding: utf-8 -*- """ tests.cluster --------------- Test cluster of KINCluster :author: MaybeS(maytryark@gmail.com) """ import pytest from KINCluster.core.extractor import Extractor, extractable from KINCluster.core.cluster import Cluster from KINCluster.core.pipeline import Pipeline from KINC...
Yen-Chung-En/2015cdb_g1
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/site.py
805
import sys
Communities-Communications/cc-odoo
refs/heads/master
openerp/modules/graph.py
260
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
shaistaansari/django
refs/heads/master
tests/gis_tests/gis_migrations/migrations/0001_initial.py
46
from django.db import connection, migrations, models from ...models import models as gis_models ops = [ migrations.CreateModel( name='Neighborhood', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('name', models.C...
GdZ/scriptfile
refs/heads/master
software/googleAppEngine/lib/django_1_2/django/contrib/auth/tests/views.py
43
import os import re import urllib from django.conf import settings from django.contrib.auth import SESSION_KEY, REDIRECT_FIELD_NAME from django.contrib.auth.forms import AuthenticationForm from django.contrib.sites.models import Site, RequestSite from django.contrib.auth.models import User from django.test import Test...
mx3L/enigma2
refs/heads/master
tests/test_timer.py
56
import enigma import sys import time import tests #enigma.reset() def test_timer(repeat = 0, timer_start = 3600, timer_length = 1000, sim_length = 86400 * 7): import NavigationInstance at = time.time() t = NavigationInstance.instance.RecordTimer print t print "old mwt:", t.MaxWaitTime t.MaxWaitTime = 86400 *...
jlcjunk/pynet_pac
refs/heads/master
class7/exer01.py
1
#!/usr/bin/env python ''' Use Arista's eAPI to obtain 'show interfaces' from the switch. ''' # imports try: import ssl import jsonrpclib except ImportError: print "Could not import a required module.\n Exiting" raise SystemExit # Variables DEV_NAME = 'pynet-sw4' DEV_USERID = 'eapi' DEV_PASSWORD = '1...
RecursiveGreen/spradio-django
refs/heads/master
savepointradio/core/utils.py
1
import json import random import string from django.core.exceptions import ImproperlyConfigured from django.db import connection def generate_password(length=32): possible_characters = string.ascii_letters + string.digits + string.punctuation rng = random.SystemRandom() return ''.join([rng.choice(possibl...
asampat3090/keras
refs/heads/master
keras/utils/test_utils.py
85
import numpy as np def get_test_data(nb_train=1000, nb_test=500, input_shape=(10,), output_shape=(2,), classification=True, nb_class=2): ''' classification=True overrides output_shape (i.e. output_shape is set to (1,)) and the output consists in integers in [0, nb_class-1...
c0hen/django-venv
refs/heads/master
lib/python3.4/site-packages/django/template/loaders/locmem.py
464
""" Wrapper for loading templates from a plain Python dict. """ import warnings from django.template import Origin, TemplateDoesNotExist from django.utils.deprecation import RemovedInDjango20Warning from .base import Loader as BaseLoader class Loader(BaseLoader): def __init__(self, engine, templates_dict): ...
jalavik/invenio-records
refs/heads/master
invenio_records/recordext/functions/get_record_collections.py
4
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015 CERN. # # Invenio 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...
brian-rose/climlab
refs/heads/main
climlab/dynamics/budyko_transport.py
1
from __future__ import division from climlab.process.energy_budget import EnergyBudget from climlab.domain.field import global_mean class BudykoTransport(EnergyBudget): r"""calculates the 1 dimensional heat transport as the difference between the local temperature and the global mean temperature. :param ...
gorlemik/selenium
refs/heads/master
py/selenium/webdriver/common/html5/__init__.py
2454
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
dannyperry571/theapprentice
refs/heads/master
script.module.youtube.dl/lib/youtube_dl/extractor/tv3.py
69
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class TV3IE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?tv3\.co\.nz/(?P<id>[^/]+)/tabid/\d+/articleID/\d+/MCat/\d+/Default\.aspx' _TEST = { 'url': 'http://www.tv3.co.nz/MOTORSPORT-SRS-SsangYong-Hampton-Dow...