repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
robobrobro/ballin-octo-shame
lib/Python-3.4.3/Tools/pybench/Numbers.py
92
16198
from pybench import Test class CompareIntegers(Test): version = 2.0 operations = 30 * 5 rounds = 120000 def test(self): for i in range(self.rounds): 2 < 3 2 > 3 2 == 3 2 > 3 2 < 3 2 < 3 2 > 3 2 ...
mit
mmnelemane/nova
nova/scheduler/manager.py
24
6510
# Copyright (c) 2010 OpenStack Foundation # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in complianc...
apache-2.0
ganeshnalawade/ansible-modules-core
cloud/docker/docker_network.py
19
13023
#!/usr/bin/python # # Copyright 2016 Red Hat | Ansible # # 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 la...
gpl-3.0
defionscode/ansible
test/units/modules/network/f5/test_bigiq_application_fastl4_tcp.py
4
5467
# -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # 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 import os import json import pytest import sys from nose.plugins.skip i...
gpl-3.0
bradh/samba
source3/stf/example.py
82
1087
#! /usr/bin/env python # Copyright (C) 2003 by Martin Pool <mbp@samba.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; either version 3 of the # License, or (at your option) any later ve...
gpl-3.0
Alwnikrotikz/kegbot
pykeg/src/pykeg/core/migrations/0046_session_stats.py
1
26297
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'SessionStats' db.create_table('core_sessionstats', ( ('stats', self.gf('py...
gpl-2.0
mikewiebe-ansible/ansible
lib/ansible/module_utils/network/junos/config/lag_interfaces/lag_interfaces.py
19
10123
# # -*- coding: utf-8 -*- # Copyright 2019 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """ The junos_lag_interfaces class It is in this file where the current configuration (as dict) is compared to the provided configuration (as dict) and the command set necess...
gpl-3.0
fgesora/odoo
addons/website_twitter/models/twitter_config.py
377
2095
import logging from openerp.osv import fields, osv from openerp.tools.translate import _ _logger = logging.getLogger(__name__) class twitter_config_settings(osv.osv_memory): _inherit = 'website.config.settings' _columns = { 'twitter_api_key': fields.related( 'website_id', 'twitter_a...
agpl-3.0
youprofit/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/test_treeadapters.py
451
1852
from __future__ import absolute_import, division, unicode_literals from . import support # flake8: noqa import html5lib from html5lib.treeadapters import sax from html5lib.treewalkers import getTreeWalker def test_to_sax(): handler = support.TracingSaxHandler() tree = html5lib.parse("""<html xml:lang="en">...
mpl-2.0
apache/airflow
airflow/providers/google/cloud/operators/pubsub.py
2
40994
# # 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...
apache-2.0
pombredanne/invenio-old
modules/miscutil/lib/pluginutils_tests.py
4
3879
# -*- coding: utf-8 -*- ## ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN. ## ## CDS 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 versio...
gpl-2.0
maropu/spark
examples/src/main/python/ml/train_validation_split.py
23
2841
# # 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 us...
apache-2.0
gregdek/ansible
lib/ansible/modules/network/meraki/meraki_vlan.py
14
13623
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Kevin Breit (@kbreit) <kevin.breit@kevinbreit.net> # 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 = { ...
gpl-3.0
ubc/compair
compair/tests/learning_records/test_assignment_events.py
1
11445
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json import pytz from data.fixtures.test_data import SimpleAssignmentTestData, LTITestData from compair.tests.test_compair import ComPAIRLearningRecordTestCase from compair.core import db from flask_login import current_app from compair.learning_...
gpl-3.0
usc-isi-i2/WEDC
spark_dependencies/python_lib/nose2/suite.py
1
3721
import sys import inspect import logging from nose2 import util from nose2.compat import unittest log = logging.getLogger(__name__) __unittest = True # # Layer suite class # class LayerSuite(unittest.BaseTestSuite): def __init__(self, tests=(), layer=None): super(LayerSuite, self).__init__(tests) ...
apache-2.0
alphagov/notifications-admin
app/main/views/new_password.py
1
2001
import json from flask import ( current_app, flash, redirect, render_template, request, session, url_for, ) from itsdangerous import SignatureExpired from notifications_utils.url_safe_token import check_token from app.main import main from app.main.forms import NewPasswordForm from app.mod...
mit
yochow/autotest
client/bin/harness_unittest.py
1
1129
#!/usr/bin/python import unittest import common import harness, harness_standalone, harness_ABAT from autotest_lib.client.common_lib.test_utils import mock class harness_unittest(unittest.TestCase): def setUp(self): self.god = mock.mock_god() def tearDown(self): self.god.unstub_all() d...
gpl-2.0
jrief/django-cms
cms/utils/page.py
17
2960
# -*- coding: utf-8 -*- from django.conf import settings from django.db.models import Q import re APPEND_TO_SLUG = "-copy" COPY_SLUG_REGEX = re.compile(r'^.*-copy(?:-(\d+)*)?$') def is_valid_page_slug(page, parent, lang, slug, site, path=None): """Validates given slug depending on settings. """ from cms....
bsd-3-clause
carrillo/scikit-learn
sklearn/datasets/twenty_newsgroups.py
126
13591
"""Caching loader for the 20 newsgroups text classification dataset The description of the dataset is available on the official website at: http://people.csail.mit.edu/jrennie/20Newsgroups/ Quoting the introduction: The 20 Newsgroups data set is a collection of approximately 20,000 newsgroup documents,...
bsd-3-clause
Elbagoury/odoo
addons/report_webkit/__init__.py
382
1593
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com) # All Right Reserved # # Author : Nicolas Bessi (Camptocamp) # # WARNING: This program as such is intended to be used by professional # programmers who...
agpl-3.0
vintasoftware/django-oscar-paypal
sandbox/apps/checkout/views.py
8
3688
from django.contrib import messages from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from oscar.apps.checkout import views from oscar.apps.payment import forms, models from paypal.payflow import facade class PaymentDetailsView(views.PaymentDetailsView): def get_context_d...
bsd-3-clause
Pluto-tv/chromium-crosswalk
tools/perf/profile_creators/fast_navigation_profile_extender_unittest.py
8
2857
# Copyright 2015 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 unittest from profile_creators.fast_navigation_profile_extender import ( FastNavigationProfileExtender) from telemetry.core import util from telem...
bsd-3-clause
piyushroshan/xen-4.3
tools/python/xen/util/auxbin.py
42
1573
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
gpl-2.0
debugger06/MiroX
lib/debugutil.py
3
2783
# Miro - an RSS based video player application # Copyright (C) 2010, 2011 # Participatory Culture Foundation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or...
gpl-2.0
wldcordeiro/servo
tests/wpt/web-platform-tests/tools/wptserve/tests/functional/test_server.py
86
1285
import unittest import urllib2 import wptserve from .base import TestUsingServer class TestFileHandler(TestUsingServer): def test_not_handled(self): with self.assertRaises(urllib2.HTTPError) as cm: resp = self.request("/not_existing") self.assertEqual(cm.exception.code, 404) class Te...
mpl-2.0
Denisolt/Tensorflow_Chat_Bot
local/lib/python2.7/site-packages/external/protobuf/python/google/protobuf/service.py
243
9144
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
gpl-3.0
greenfire27/Torque2D
engine/source/testing/googleTest/scripts/gen_gtest_pred_impl.py
412
21984
#!/usr/bin/env python # # Copyright 2006, 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...
mit
Soya93/Extract-Refactoring
python/helpers/profiler/thrift/transport/TZlibTransport.py
210
8090
# # 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...
apache-2.0
pbrazdil/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/views/printing_unittest.py
121
8467
# Copyright (C) 2010, 2012 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 an...
bsd-3-clause
GenericStudent/home-assistant
tests/components/adguard/test_config_flow.py
6
8304
"""Tests for the AdGuard Home config flow.""" import aiohttp from homeassistant import config_entries, data_entry_flow from homeassistant.components.adguard import config_flow from homeassistant.components.adguard.const import DOMAIN from homeassistant.const import ( CONF_HOST, CONF_PASSWORD, CONF_PORT, ...
apache-2.0
Danfocus/Flexget
flexget/tests/test_qualities.py
4
11829
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import pytest from jinja2 import Template from flexget.components.parsing.parsers.parser_guessit import ParserGuessit from flexget.components.parsing.parsers.parser_intern...
mit
fxfitz/ansible
lib/ansible/modules/cloud/ovirt/ovirt_storage_connections.py
43
9748
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 Red Hat, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or #...
gpl-3.0
dangemstar/mezzaninesource
build/lib/mezzanine/generic/managers.py
44
2281
from __future__ import unicode_literals from django_comments.managers import CommentManager as DjangoCM from mezzanine.conf import settings from mezzanine.core.managers import CurrentSiteManager class CommentManager(CurrentSiteManager, DjangoCM): """ Provides filter for restricting comments that are not app...
bsd-2-clause
lyarwood/sosreport
sos/plugins/numa.py
11
1526
# Copyright (C) 2014 Red Hat, Inc. Bryn M. Reeves <bmr@redhat.com> # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # Th...
gpl-2.0
qsnake/numpy
numpy/distutils/conv_template.py
43
9621
#!/usr/bin/python """ takes templated file .xxx.src and produces .xxx file where .xxx is .i or .c or .h, using the following template rules /**begin repeat -- on a line by itself marks the start of a repeated code segment /**end repeat**/ -- on a line by itself marks it's end After the /**begin ...
bsd-3-clause
JasonGross/mozjs
python/mozbuild/mozbuild/backend/common.py
2
9814
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from __future__ import unicode_literals import json import os import re import mozpack.path as mozpath from .base imp...
mpl-2.0
liorvh/infernal-twin
build/pillow/Tests/test_file_jpeg2k.py
11
5225
from helper import unittest, PillowTestCase from PIL import Image from io import BytesIO codecs = dir(Image.core) test_card = Image.open('Tests/images/test-card.png') test_card.load() # OpenJPEG 2.0.0 outputs this debugging message sometimes; we should # ignore it---it doesn't represent a test failure. # 'Not enoug...
gpl-3.0
anderspitman/scikit-bio
skbio/stats/tests/test_subsample.py
2
8920
# ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # --------------------------------------------...
bsd-3-clause
harrisonfeng/pip
pip/_vendor/requests/packages/chardet/euckrfreq.py
3121
45978
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
mit
carsongee/edx-platform
lms/djangoapps/courseware/migrations/0006_create_student_module_history.py
80
8157
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'StudentModuleHistory' db.create_table('courseware_studentmodulehistory', ( ('id'...
agpl-3.0
olexiim/edx-platform
common/djangoapps/microsite_configuration/middleware.py
46
3252
""" This file implements the Middleware support for the Open edX platform. A microsite enables the following features: 1) Mapping of sub-domain name to a 'brand', e.g. foo-university.edx.org 2) Present a landing page with a listing of courses that are specific to the 'brand' 3) Ability to swap out some branding elemen...
agpl-3.0
yiakwy/numpy
numpy/core/tests/test_function_base.py
16
4762
from __future__ import division, absolute_import, print_function from numpy.testing import * from numpy import (logspace, linspace, dtype, array, finfo, typecodes, arange, isnan) class TestLogspace(TestCase): def test_basic(self): y = logspace(0, 6) assert_(len(y) == 50) ...
bsd-3-clause
dementrock/cgt
thirdparty/validate.py
37
46666
# validate.py # A Validator object # Copyright (C) 2005-2010 Michael Foord, Mark Andrews, Nicola Larosa # E-mail: fuzzyman AT voidspace DOT org DOT uk # mark AT la-la DOT com # nico AT tekNico DOT net # This software is licensed under the terms of the BSD license. # http://www.voidspace.org.uk/python/l...
mit
majora2007/plexpy
lib/unidecode/x0fd.py
252
3764
data = ( '', # 0x00 '', # 0x01 '', # 0x02 '', # 0x03 '', # 0x04 '', # 0x05 '', # 0x06 '', # 0x07 '', # 0x08 '', # 0x09 '', # 0x0a '', # 0x0b '', # 0x0c '', # 0x0d '', # 0x0e '', # 0x0f '', # 0x10 '', # 0x11 '', # 0x12 '', # 0x13 '', # 0x14 '', # 0x15 '',...
gpl-3.0
hjz15k6/shadowsocks
shadowsocks/crypto/openssl.py
1038
5414
#!/usr/bin/env python # # Copyright 2015 clowwindy # # 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 ...
apache-2.0
laborautonomo/youtube-dl
youtube_dl/extractor/nhl.py
16
4253
import re import json from .common import InfoExtractor from ..utils import ( compat_urlparse, compat_urllib_parse, determine_ext, unified_strdate, ) class NHLBaseInfoExtractor(InfoExtractor): @staticmethod def _fix_json(json_string): return json_string.replace('\\\'', '\'') def ...
unlicense
michath/ConMonkey
media/webrtc/trunk/tools/gyp/test/ninja/normalize-paths-win/gyptest-normalize-paths.py
180
1272
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Make sure paths are normalized with VS macros properly expanded on Windows. """ import TestGyp import sys if sys.platform == 'win32':...
mpl-2.0
bzero/statsmodels
statsmodels/sandbox/tsa/varma.py
33
5032
'''VAR and VARMA process this doesn't actually do much, trying out a version for a time loop alternative representation: * textbook, different blocks in matrices * Kalman filter * VAR, VARX and ARX could be calculated with signal.lfilter only tried some examples, not implemented TODO: try minimizing sum of squares...
bsd-3-clause
harigov/newsalyzer
shared/summarizer.py
1
1055
from sumy.parsers.plaintext import PlaintextParser from sumy.nlp.tokenizers import Tokenizer from sumy.summarizers.lsa import LsaSummarizer as Summarizer from sumy.nlp.stemmers import Stemmer from sumy.utils import get_stop_words # summarizer requires this to work import nltk nltk.download('punkt') class ArticleSumma...
mit
yograterol/django
tests/gis_tests/test_geoforms.py
292
14830
from unittest import skipUnless from django.contrib.gis import forms from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.geos import GEOSGeometry from django.forms import ValidationError from django.test import SimpleTestCase, skipUnlessDBFeature from django.utils import six from django.utils.html imp...
bsd-3-clause
crflynn/fbm
setup.py
1
1318
"""Setup.""" import io from os import path from setuptools import setup here = path.abspath(path.dirname(__file__)) # io.open for py27 with io.open(path.join(here, "README.rst"), encoding="utf-8") as f: long_description = f.read() # import __version__ attributes about = {} with open(path.join(here, "fbm", "__...
mit
ChinaMassClouds/copenstack-server
openstack/src/horizon-2014.2/openstack_dashboard/dashboards/project/data_processing/job_binaries/urls.py
39
1485
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
gpl-2.0
BonexGu/Blik2D-SDK
Blik2D/addon/tensorflow-1.2.1_for_blik/tensorflow/tools/docs/build_docs_test.py
24
1725
# 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...
mit
sayederfanarefin/cse470
phpMyAdmin/doc/_ext/configext.py
121
6622
from sphinx.domains import Domain, ObjType from sphinx.roles import XRefRole from sphinx.domains.std import GenericObject, StandardDomain from sphinx.directives import ObjectDescription from sphinx.util.nodes import clean_astext, make_refnode from sphinx.util import ws_re from sphinx import addnodes from sphinx.util.do...
apache-2.0
assamite/TwatBot
tweets/migrations/0008_auto__add_urltweetimage.py
1
10052
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'URLTweetImage' db.create_table(u'tweets_urltweetimage', (...
mit
ccnmtl/lettuce
tests/integration/lib/Django-1.3/tests/regressiontests/select_related_onetoone/tests.py
54
4044
from django import db from django.conf import settings from django.test import TestCase from models import (User, UserProfile, UserStat, UserStatResult, StatDetails, AdvancedUserStat, Image, Product) class ReverseSelectRelatedTestCase(TestCase): def setUp(self): user = User.objects.create(username="te...
gpl-3.0
brototyp/CouchPotato
library/sqlalchemy/engine/strategies.py
18
7577
"""Strategies for creating new instances of Engine types. These are semi-private implementation classes which provide the underlying behavior for the "strategy" keyword argument available on :func:`~sqlalchemy.engine.create_engine`. Current available options are ``plain``, ``threadlocal``, and ``mock``. New strategi...
gpl-3.0
holmes/intellij-community
python/lib/Lib/site-packages/django/utils/unittest/runner.py
571
6761
"""Running tests""" import sys import time import unittest from django.utils.unittest import result try: from django.utils.unittest.signals import registerResult except ImportError: def registerResult(_): pass __unittest = True class _WritelnDecorator(object): """Used to decorate file-like obj...
apache-2.0
EvenStrangest/tensorflow
tensorflow/contrib/layers/python/layers/__init__.py
3
1496
# 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...
apache-2.0
yufengg/tensorflow
tensorflow/contrib/training/__init__.py
21
3631
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
luogangyi/bcec-nova
nova/api/openstack/compute/views/servers.py
11
10285
# Copyright 2010-2011 OpenStack Foundation # Copyright 2011 Piston Cloud Computing, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www...
apache-2.0
salspaugh/splparser
splparser/rules/strcatrules.py
1
1210
#!/usr/bin/env python from splparser.parsetree import * from splparser.exceptions import SPLSyntaxError from splparser.rules.common.fieldrules import * from splparser.rules.common.fieldlistrules import * from splparser.rules.common.valuerules import * from splparser.lexers.strcatlexer import precedence, tokens star...
bsd-3-clause
atsuyim/OpenBazaar
node/trust.py
13
1841
import logging import bitcoin import obelisk from twisted.internet import reactor from dnschain import server as DNSChainServer from node import constants _LOG = logging.getLogger('trust') TESTNET = False def burnaddr_from_guid(guid_hex): _LOG.debug("burnaddr_from_guid: %s", guid_hex) prefix = '6f' if TES...
mit
gauthierm/bedrock
bedrock/newsletter/utils.py
26
2669
from hashlib import md5 from django.conf import settings from django.core.cache import cache import basket import commonware.log log = commonware.log.getLogger('b.newsletter') NEWSLETTERS_CACHE_KEY = "newsletter-data" NEWSLETTERS_CACHE_TIMEOUT = 3600 # 1 hour def get_newsletters(): """Return a dictionary wit...
mpl-2.0
funkbit/django-payex
djpayex/views.py
1
1610
import logging from django.conf import settings from django.http import HttpResponse, HttpResponseNotAllowed from payex.service import PayEx from djpayex.models import TransactionStatus logger = logging.getLogger(__name__) # Initialize PayEx service service = PayEx( merchant_number=settings.PAYEX_MERCHANT_NUMBE...
bsd-2-clause
amwelch/a10sdk-python
a10sdk/core/interface/interface_trunk_ipv6_rip.py
2
1820
from a10sdk.common.A10BaseClass import A10BaseClass class SplitHorizonCfg(A10BaseClass): """This class does not support CRUD Operations please use parent. :param state: {"default": "poisoned", "enum": ["poisoned", "disable", "enable"], "type": "string", "description": "'poisoned': Perform split horizon ...
apache-2.0
aioue/ansible
lib/ansible/module_utils/facts/system/selinux.py
52
3061
# Collect facts related to selinux # # 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. # # Ans...
gpl-3.0
pjuren/pyokit
src/pyokit/io/repeatmaskerAlignments.py
1
38860
""" Date of Creation: 11th Dec 2014 Description: Classes and functions for IO of repeatmasker pairwise alignments. Copyright (C) 2010-2015 Philip J. Uren, Authors: Philip J. Uren This program is free software: you can redistribute it and/or modify it under the terms of the GNU Gener...
lgpl-2.1
adborden/swagger-py
swaggerpy_test/loader_test.py
2
1213
#!/usr/bin/env python # # Copyright (c) 2013, Digium, Inc. # import unittest import swaggerpy from swaggerpy import swagger_model class TestProcessor(swagger_model.SwaggerProcessor): def process_resource_listing(self, resources, context): resources['processed'] = True class LoaderTest(unittest.TestCa...
bsd-3-clause
infoxchange/lettuce
tests/integration/lib/Django-1.3/django/contrib/gis/tests/test_geoip.py
290
4204
import os, unittest from django.db import settings from django.contrib.gis.geos import GEOSGeometry from django.contrib.gis.utils import GeoIP, GeoIPException # Note: Requires use of both the GeoIP country and city datasets. # The GEOIP_DATA path should be the only setting set (the directory # should contain links or ...
gpl-3.0
garvenshen/zeda-swift
swift/account/auditor.py
1
5227
# Copyright (c) 2010-2012 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
apache-2.0
gomiero/PTVS
Python/Product/Django/Templates/Projects/StarterDjangoProject/app-tests.py
17
1082
""" This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". """ import django from django.test import TestCase # TODO: Configure your database in settings.py and sync before running tests. class ViewTest(TestCase): """Tests for the application vie...
apache-2.0
apixandru/intellij-community
python/lib/Lib/site-packages/django/contrib/webdesign/templatetags/webdesign.py
350
2196
from django.contrib.webdesign.lorem_ipsum import words, paragraphs from django import template register = template.Library() class LoremNode(template.Node): def __init__(self, count, method, common): self.count, self.method, self.common = count, method, common def render(self, context): try: ...
apache-2.0
madscientist159/heimdal
lib/wind/rfc3454.py
88
2296
#!/usr/local/bin/python # -*- coding: iso-8859-1 -*- # $Id$ # Copyright (c) 2004 Kungliga Tekniska Högskolan # (Royal Institute of Technology, Stockholm, Sweden). # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following...
bsd-3-clause
havard024/prego
venv/lib/python2.7/site-packages/PIL/IcnsImagePlugin.py
2
9154
# # The Python Imaging Library. # $Id$ # # Mac OS X icns file decoder, based on icns.py by Bob Ippolito. # # history: # 2004-10-09 fl Turned into a PIL plugin; removed 2.3 dependencies. # # Copyright (c) 2004 by Bob Ippolito. # Copyright (c) 2004 by Secret Labs. # Copyright (c) 2004 by Fredrik Lundh. # Copyright (c) ...
mit
loongson-community/EFI-MIPS
ToolKit/cmds/python/Lib/test/skipped/test_ioctl.py
19
1292
import unittest from test.test_support import TestSkipped, run_unittest import os, struct try: import fcntl, termios except ImportError: raise TestSkipped("No fcntl or termios module") if not hasattr(termios,'TIOCGPGRP'): raise TestSkipped("termios module doesn't have TIOCGPGRP") try: tty = open("/dev/...
bsd-3-clause
massot/odoo
addons/account_followup/account_followup.py
93
28777
# -*- 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...
agpl-3.0
chaserhkj/PyComicCast
ComicCast.py
1
3515
#!/usr/bin/env python2 # Copyright (c) 2014 Chaserhkj # This software is licensed under the MIT license. # See LICENSE for more details. import tornado.web as web import tornado.template as template import tornado.ioloop as ioloop import os,sys,mimetypes import rarfile,zipfile supported_archive = [".zip", ".rar"] su...
mit
mgadi/naemonbox
sources/psdash/pyzmq-13.1.0/zmq/sugar/context.py
4
4473
"""Python bindings for 0MQ.""" #----------------------------------------------------------------------------- # Copyright (C) 2013 Brian Granger, Min Ragan-Kelley # # This file is part of pyzmq # # Distributed under the terms of the New BSD License. The full license is in # the file COPYING.BSD, distributed as pa...
gpl-2.0
vpistis/soapfish
soapfish/py2xsd.py
1
11116
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import argparse import imp import inspect import itertools import logging import six import textwrap from lxml import etree from . import namespaces as ns from . import xsd, xsdspec from .compat import basestring from .utils import ...
bsd-3-clause
GoogleCloudPlatform/PerfKitExplorer
server/perfkit/explorer/handlers/data.py
1
10892
"""Copyright 2014 Google Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in ...
apache-2.0
jmartinezchaine/OpenERP
openerp/tests/common.py
13
1720
# -*- coding: utf-8 -*- import os import time import xmlrpclib import openerp # The openerp library is supposed already configured. ADDONS_PATH = openerp.tools.config['addons_path'] PORT = openerp.tools.config['xmlrpc_port'] DB = openerp.tools.config['db_name'] HOST = '127.0.0.1' ADMIN_USER = 'admin' ADMIN_USER_ID ...
agpl-3.0
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/lib/PyAMF-0.6.1/pyamf/tests/test_remoting.py
26
13006
# -*- coding: utf-8 -*- # # Copyright (c) The PyAMF Project. # See LICENSE.txt for details. """ Tests for AMF Remoting. @since: 0.1.0 """ import unittest import pyamf from pyamf import remoting, util class DecoderTestCase(unittest.TestCase): """ Tests the decoders. """ def test_client_version(sel...
bsd-3-clause
jessicalucci/NovaOrc
nova/api/openstack/compute/views/limits.py
9
3501
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010-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-2.0
sidartaoliveira/ansible
lib/ansible/modules/cloud/amazon/iam_cert_facts.py
44
5106
#!/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 distributed...
gpl-3.0
40023154/40023154_test2
static/Brython3.1.1-20150328-091302/Lib/contextlib.py
737
8788
"""Utilities for with-statement contexts. See PEP 343.""" import sys from collections import deque from functools import wraps __all__ = ["contextmanager", "closing", "ContextDecorator", "ExitStack"] class ContextDecorator(object): "A base class or mixin that enables context managers to work as decorators." ...
gpl-3.0
KohlsTechnology/ansible
test/units/modules/network/aruba/test_aruba_config.py
54
8125
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
gpl-3.0
GenericMappingTools/gmt-python
examples/tutorials/vectors.py
1
13414
""" Plotting vectors ================ Plotting vectors is handled by :meth:`pygmt.Figure.plot`. """ # sphinx_gallery_thumbnail_number = 6 import numpy as np import pygmt ######################################################################################## # Plot Cartesian Vectors # ---------------------- # # Crea...
bsd-3-clause
Frodox/buildbot
master/buildbot/test/integration/test_integration_locks.py
2
3027
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
JamesMura/sentry
tests/sentry/api/endpoints/test_organization_repositories.py
4
1459
from __future__ import absolute_import import six from django.core.urlresolvers import reverse from sentry.models import Repository from sentry.testutils import APITestCase class OrganizationRepositoriesListTest(APITestCase): def test_simple(self): self.login_as(user=self.user) org = self.crea...
bsd-3-clause
fredmorcos/attic
projects/plantmaker/archive/20100707/src/extra/schedule.py
1
2899
from printer import pretty, GREEN, YELLOW, CYAN class Schedule(object): def __init__(self): self.schedule = [] self.startTimes = [] self.finishTimes = [] self.report = {} self.fitness = None self.startTime = (2,0,0) def maxTime(self): if len(self.schedule) > 0: maxTime = self.schedule[0][2] for ...
isc
nkgilley/home-assistant
homeassistant/components/ted5000/sensor.py
16
3201
"""Support gathering ted5000 information.""" from datetime import timedelta import logging import requests import voluptuous as vol import xmltodict from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PORT, POWER_WATT, VOLT from homeassistant.helpers ...
apache-2.0
defzzd/UserDataBase-Heroku
venv/Lib/site-packages/pip/_vendor/requests/sessions.py
294
22290
# -*- coding: utf-8 -*- """ requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ import os from collections import Mapping from datetime import datetime from .auth import _basic_auth_str from .compat import cookielib, Or...
mit
projectcalico/calico-neutron
neutron/wsgi.py
3
35683
# 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 req...
apache-2.0
balloob/home-assistant
homeassistant/util/async_.py
6
3782
"""Asyncio backports for Python 3.6 compatibility.""" from asyncio import coroutines, ensure_future, get_running_loop from asyncio.events import AbstractEventLoop import concurrent.futures import functools import logging import threading from traceback import extract_stack from typing import Any, Callable, Coroutine, T...
apache-2.0
all-of-us/raw-data-repository
rdr_service/alembic/versions/5a1b1f7b4761_add_columns_to_genomic_member_.py
1
2128
"""add columns to genomic_set_member Revision ID: 5a1b1f7b4761 Revises: f3fdb9d05ab3 Create Date: 2019-09-17 16:06:00.824574 """ from alembic import op import sqlalchemy as sa import rdr_service.model.utils from sqlalchemy.dialects import mysql from rdr_service.participant_enums import PhysicalMeasurementsStatus, Qu...
bsd-3-clause
Anonymous-X6/django
django/contrib/staticfiles/finders.py
478
9854
import os from collections import OrderedDict from django.apps import apps from django.conf import settings from django.contrib.staticfiles import utils from django.core.exceptions import ImproperlyConfigured from django.core.files.storage import ( FileSystemStorage, Storage, default_storage, ) from django.utils i...
bsd-3-clause
HailStorm32/Q.bo_stacks
qbo_webi/src/teleoperation/sip2rtmp/p2p-sip/src/external/util.py
4
6928
# -*- encoding: utf8 -*- # # Copyright (c) 2007 The RTMPy Project. All rights reserved. # # Arnar Birgisson # Thijs Triemstra # # 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 restr...
lgpl-2.1
xavierm02/lyx-mathpartir
lib/scripts/clean_dvi.py
7
3211
''' file clean_dvi.py This file is part of LyX, the document processor. Licence details can be found in the file COPYING or at http://www.lyx.org/about/licence.php author Angus Leeming Full author contact details are available in the file CREDITS or at http://www.lyx.org/about/credits.php Usage: python clean_dvi....
gpl-2.0
jjanssen/django-cms-patches
cms/plugins/googlemap/migrations/0005_delete-street.py
11
10766
from south.db import db from django.db import models from cms.plugins.googlemap.models import * class Migration: def forwards(self, orm): # Deleting field 'GoogleMapPublic.streetnr' db.delete_column('cmsplugin_googlemappublic', 'streetnr') # Deleting field 'GoogleMapPublic.s...
bsd-3-clause