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
Flamacue/pretix
src/tests/plugins/test_ticketoutputpdf.py
2
1826
from datetime import timedelta from decimal import Decimal from io import BytesIO import pytest from django.utils.timezone import now from PyPDF2 import PdfFileReader from pretix.base.models import ( Event, Item, ItemVariation, Order, OrderPosition, Organizer, ) from pretix.plugins.ticketoutputpdf.ticketoutput im...
apache-2.0
jayceyxc/hue
desktop/core/ext-py/Django-1.6.10/django/core/cache/backends/filebased.py
114
4904
"File-based cache backend" import hashlib import os import shutil import time try: from django.utils.six.moves import cPickle as pickle except ImportError: import pickle from django.core.cache.backends.base import BaseCache, DEFAULT_TIMEOUT from django.utils.encoding import force_bytes class FileBasedCache(...
apache-2.0
ifduyue/django
tests/gis_tests/gis_migrations/test_operations.py
49
9143
from unittest import skipIf from django.contrib.gis.db.models import fields from django.contrib.gis.geos import MultiPolygon, Polygon from django.core.exceptions import ImproperlyConfigured from django.db import connection, migrations, models from django.db.migrations.migration import Migration from django.db.migratio...
bsd-3-clause
17twenty/binwalk
src/binwalk/plugins/tar.py
27
2287
import time import math import binwalk.core.plugin class TarPlugin(binwalk.core.plugin.Plugin): MODULES = ['Signature'] # "borrowed from pythons tarfile module" TAR_BLOCKSIZE = 512 def nts(self, s): """ Convert a null-terminated string field to a python string. """ # ...
mit
uwafsl/MissionPlanner
Lib/mailbox.py
50
80273
#! /usr/bin/env python """Read/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes.""" # Notes for authors of new mailbox subclasses: # # Remember to fsync() changes to disk before closing a modified file # or returning from a flush() method. See functions _sync_flush() and # _sync_close(). imp...
gpl-3.0
arafsheikh/coala
coalib/results/TextRange.py
10
4188
import copy from coalib.misc.Decorators import ( enforce_signature, generate_ordering, generate_repr) from coalib.results.TextPosition import TextPosition @generate_repr("start", "end") @generate_ordering("start", "end") class TextRange: @enforce_signature def __init__(self, start: TextPosition, end: (T...
agpl-3.0
smmribeiro/intellij-community
python/helpers/pydev/pydev_tests_python/tests_single_notification.py
12
10099
from functools import partial import itertools from pydevd import AbstractSingleNotificationBehavior import time import pytest from _pydevd_bundle.pydevd_comm import run_as_pydevd_daemon_thread from pydev_tests_python.debugger_unittest import CMD_THREAD_SUSPEND, CMD_STEP_OVER, CMD_SET_BREAK from _pydev_bundle.pydev_o...
apache-2.0
FocusTheOne/Qomolangma
Qomolangma/Pods/AVOSCloudCrashReporting/Breakpad/src/tools/gyp/test/rules-rebuild/gyptest-all.py
351
1662
#!/usr/bin/env python # Copyright (c) 2009 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that a rule that generates multiple outputs rebuilds correctly when the inputs change. """ import TestGyp test = TestGyp.Test...
mit
abusesa/abusehelper
abusehelper/core/rules/classifier.py
1
1033
class Classifier(object): def __init__(self): self._rules = dict() def inc(self, rule, class_id): classes = self._rules.get(rule, None) if classes is None: classes = dict() self._rules[rule] = classes classes[class_id] = classes.get(class_id, 0) + 1 ...
mit
geobricks/pgeo
pgeo/metadata/metadata.py
1
2602
import os import json from pgeo.utils.json import dict_merge_and_convert_dates from pgeo.metadata.db_metadata import DBMetadata from pgeo.metadata.search import MongoSearch from pgeo.utils import log from pgeo.config.metadata.core import template as core_template from pgeo.config.metadata.raster import template as rast...
gpl-2.0
MichaelMraka/dnf
tests/cli/commands/test_clean.py
3
2566
# Copyright (C) 2014 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 will be u...
gpl-2.0
JuliBakagianni/CEF-ELRC
metashare/repository/tests/test_special_queries.py
6
9506
import logging from metashare.repository.forms import _extract_special_queries, \ _process_special_query, MORE_FROM_SAME_CREATORS, MORE_FROM_SAME_PROJECTS from metashare import test_utils from metashare.recommendations.tests import _import_resource import django.test from django.test.client import Client fro...
bsd-3-clause
Yearcoin-dev/yearcoin
qa/rpc-tests/invalidtxrequest.py
108
2576
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import ComparisonTestFramework from test_framework.comptool import Tes...
mit
CCI-Tools/cate-core
cate/util/im/ds/ne2.py
2
3352
# The MIT License (MIT) # Copyright (c) 2016, 2017 by the ESA CCI Toolbox development team and contributors # # 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 wi...
mit
cfriedt/gnuradio
gnuradio-runtime/examples/network/dial_tone_sink.py
58
2479
#!/usr/bin/env python # # Copyright 2006,2007,2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your ...
gpl-3.0
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/psycopg2-2.6.1/tests/testutils.py
25
10393
# testutils.py - utility module for psycopg2 testing. # # Copyright (C) 2010-2011 Daniele Varrazzo <daniele.varrazzo@gmail.com> # # psycopg2 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 vers...
mit
fnordahl/nova
nova/tests/functional/api_sample_tests/test_user_data.py
16
1802
# Copyright 2012 Nebula, Inc. # Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
apache-2.0
TeamTwisted/external_chromium_org
remoting/tools/build/remoting_copy_locales.py
142
5150
#!/usr/bin/env python # 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. """Helper script to repack paks for a list of locales. Gyp doesn't have any built-in looping capability, so this just provides a way t...
bsd-3-clause
agualis/test-django-nonrel
django/core/context_processors.py
151
3868
""" A set of request processors that return dictionaries to be merged into a template context. Each function takes the request object as its only parameter and returns a dictionary to add to the context. These are referenced from the setting TEMPLATE_CONTEXT_PROCESSORS and used by RequestContext. """ from django.conf...
bsd-3-clause
krishna-pandey-git/django
tests/admin_changelist/admin.py
247
3931
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User from django.core.paginator import Paginator from .models import Child, Event, Parent, Swallow site = admin.AdminSite(name="admin") site.register(User, UserAdmin) class CustomPaginator(Pagina...
bsd-3-clause
trueblue2704/AskMeAnything
lib/python2.7/site-packages/pip/vcs/mercurial.py
87
5181
from __future__ import absolute_import import logging import os import tempfile import re from pip.utils import call_subprocess from pip.utils import display_path, rmtree from pip.vcs import vcs, VersionControl from pip.download import path_to_url from pip._vendor.six.moves import configparser logger = logging.getL...
mit
ryfeus/lambda-packs
Tensorflow_Pandas_Numpy/source3.6/tensorflow/python/training/session_manager.py
72
20606
# 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
jjoaonunes/namebench
nb_third_party/dns/rdtypes/ANY/NSEC3PARAM.py
248
3161
# Copyright (C) 2004-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
saucelabs/Diamond
src/collectors/openstackswift/openstackswift.py
6
3879
# coding=utf-8 """ Openstack swift collector. #### Dependencies * swift-dispersion-report commandline tool (for dispersion report) if using this, make sure swift.conf and dispersion.conf are reable by diamond also get an idea of the runtime of a swift-dispersion-report call and make sure the collect interv...
mit
leoc/home-assistant
homeassistant/components/sensor/google_travel_time.py
6
10207
""" Support for Google travel time sensors. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.google_travel_time/ """ from datetime import datetime from datetime import timedelta import logging import voluptuous as vol from homeassistant.components...
mit
lumig242/Hue-Integration-with-CDAP
desktop/core/ext-py/Django-1.6.10/django/views/static.py
44
5284
""" Views and functions for serving static files. These are only to be used during development, and SHOULD NOT be used in a production setting. """ from __future__ import unicode_literals import mimetypes import os import stat import posixpath import re from django.http import (CompatibleStreamingHttpResponse, Http40...
apache-2.0
matternet/ardupilot
mk/PX4/Tools/genmsg/test/test_genmsg_names.py
216
4540
# Software License Agreement (BSD License) # # Copyright (c) 2009, Willow Garage, 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...
gpl-3.0
mroth23/django-storages
tests/test_dropbox.py
6
6012
import re from datetime import datetime try: from unittest import mock except ImportError: # Python 3.2 and below import mock from django.test import TestCase from django.core.files.base import File, ContentFile from django.core.exceptions import ImproperlyConfigured, \ Susp...
bsd-3-clause
nnethercote/servo
tests/wpt/web-platform-tests/mathml/tools/use-typo-lineheight.py
101
1404
#!/usr/bin/python from __future__ import print_function from utils.misc import MathMLAssociationCopyright import fontforge font = fontforge.font() font.em = 1000 typoLineHeight = 2300 winHeight = 5000 name = "font-lineheight%d-typolineheight%d" % (winHeight, typoLineHeight) font.fontname = name font.familyname = name...
mpl-2.0
eavatar/ava
src/eavatar.ava/tests/unit/test_util.py
1
2173
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import import unittest import re from ava.util import resource_path, time_uuid from ava.util import webutils class UtilTest(unittest.TestCase): def test_resource_path(self): rv = resource_path("path1") print(rv) ...
bsd-3-clause
thinkopensolutions/l10n-brazil
finan/tests/test_financial_receivable.py
4
11409
# -*- coding: utf-8 -*- # Copyright 2017 KMEE # Luis Felipe Mileo <mileo@kmee.com.br> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import fields from odoo.addons.financial.tests.financial_test_classes import \ FinancialTestCase class ManualFinancialProcess(FinancialTestCase): "...
agpl-3.0
malmiron/incubator-airflow
airflow/contrib/sensors/sagemaker_base_sensor.py
7
2804
# -*- 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 #...
apache-2.0
rahul67/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/auth/admin.py
73
7942
from django.db import transaction from django.conf import settings from django.contrib import admin from django.contrib.admin.options import IS_POPUP_VAR from django.contrib.auth.forms import (UserCreationForm, UserChangeForm, AdminPasswordChangeForm) from django.contrib.auth.models import User, Group from django.c...
apache-2.0
AMOboxTV/AMOBox.LegoBuild
script.module.youtube.dl/lib/youtube_dl/extractor/karaoketv.py
105
1241
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_urllib_parse_unquote_plus from ..utils import ( js_to_json, ) class KaraoketvIE(InfoExtractor): _VALID_URL = r'http://karaoketv\.co\.il/\?container=songs&id=(?P<id>[0-9]+)' _TEST = { ...
gpl-2.0
topic2k/EventGhost
lib27/site-packages/tornado/platform/common.py
285
3403
"""Lowest-common-denominator implementations of platform functionality.""" from __future__ import absolute_import, division, print_function, with_statement import errno import socket from tornado.platform import interface class Waker(interface.Waker): """Create an OS independent asynchronous pipe. For use ...
gpl-2.0
habalux/pglog2grok
pglog2grok.py
1
4033
#!/usr/bin/env python # # Small script for generating a logstash grok filter and patterns for postgresql # using a non-default log_line_prefix setting. # # Output of this script has NOT been tested in any production environment as of yet. # # Copyright (c) 2014, Teemu Haapoja <teemu.haapoja@gmail.com> # All rights rese...
bsd-2-clause
smalls257/VRvisu
Library/External.LCA_RESTRICTED/Languages/CPython/27/Lib/test/test_pkg.py
127
9473
# Test packages (dotted-name import) import sys import os import tempfile import textwrap import unittest from test import test_support # Helpers to create and destroy hierarchies. def cleanout(root): names = os.listdir(root) for name in names: fullname = os.path.join(root, name) if os.path....
gpl-3.0
javachengwc/hue
desktop/core/ext-py/Django-1.6.10/django/utils/unittest/main.py
219
9392
"""Unittest main program""" import sys import os import types from django.utils.unittest import loader, runner try: from django.utils.unittest.signals import installHandler except ImportError: installHandler = None __unittest = True FAILFAST = " -f, --failfast Stop on first failure\n" CATCHBREAK = ...
apache-2.0
yamila-moreno/django
tests/builtin_server/tests.py
368
5230
from __future__ import unicode_literals import sys import traceback from io import BytesIO from unittest import TestCase from wsgiref import simple_server # If data is too large, socket will choke, so write chunks no larger than 32MB # at a time. The rationale behind the 32MB can be found on Django's Trac: # https://...
bsd-3-clause
CLOUGH/info3180-project-2
server/lib/flask/wrappers.py
773
6709
# -*- coding: utf-8 -*- """ flask.wrappers ~~~~~~~~~~~~~~ Implements the WSGI wrappers (request and response). :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from werkzeug.wrappers import Request as RequestBase, Response as ResponseBase from werkzeug.exce...
apache-2.0
TeMPO-Consulting/mediadrop
mediacore/controllers/login.py
1
4471
# This file is a part of MediaDrop (http://www.mediadrop.net), # Copyright 2009-2013 MediaCore Inc., Felix Schwarz and other contributors. # For the exact contribution history, see the git revision log. # The source code contained in this file is licensed under the GPLv3 or # (at your option) any later version. # See L...
gpl-3.0
Connexions/openstax-cms
pages/management/commands/create_impact_page.py
2
6439
import json from django.core.management.base import BaseCommand from pages.models import HomePage, Impact class Command(BaseCommand): help = "create initial impact page after a deployment" def handle(self, *args, **options): homepage = HomePage.objects.first() # there's only one home page, so this sho...
agpl-3.0
cryptica/slapnet
benchmarks/scalable/PhilosophersCM84/make_net.py
1
2045
#!/usr/bin/python3 import sys print(""" petri net "The drinking philosophers for n=2" { places { p1h p1e p2h p2e req1p1 req1p2 req2p1 req2p2 fork1p1 fork1p2 fork2p1 fork2p2 fork1clean fork1dirty fork2clean fork2dirty } transitions { ...
gpl-3.0
CoderHam/WebScraper
node_modules/node-phantom/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py
1788
1435
#!/usr/bin/env python import re import json # https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae # http://stackoverflow.com/a/13436167/96656 def unisymbol(codePoint): if codePoint >= 0x0000 and codePoint <= 0xFFFF: return unichr(codePoint) elif codePoint >= 0x010000 and codePoint <= 0x10FFFF: ...
apache-2.0
uwosh/uwosh.intranet.policy
uwosh/intranet/policy/importexport.py
1
5459
from Products.CMFCore.utils import getToolByName from Products.LDAPMultiPlugins import manage_addLDAPMultiPlugin def install(context): if not context.readDataFile('uwosh.intranet.policy.txt'): return setupLDAPPlugin(context) def setupLDAPPlugin(context): ldap_plugin_id = 'ldap_authentication' ...
gpl-2.0
realopenit/bubble
bubble/commands/cmd_examples.py
1
1437
# -*- coding: utf-8 -*- # Part of bubble. See LICENSE file for full copyright and licensing details. import click from ..cli import pass_bubble from ..util.examples import all_examples_functions @click.command('examples', short_help='Show example for doing some task in bubble(experimental)') @click.op...
gpl-3.0
jeffery-do/Vizdoombot
doom/lib/python3.5/site-packages/numpy/ma/mrecords.py
90
27383
""":mod:`numpy.ma..mrecords` Defines the equivalent of :class:`numpy.recarrays` for masked arrays, where fields can be accessed as attributes. Note that :class:`numpy.ma.MaskedArray` already supports structured datatypes and the masking of individual fields. .. moduleauthor:: Pierre Gerard-Marchant """ from __future...
mit
yw374cornell/e-mission-server
emission/core/wrapper/stop.py
1
1696
import logging import emission.core.wrapper.wrapperbase as ecwb class Stop(ecwb.WrapperBase): props = {"trip_id": ecwb.WrapperBase.Access.WORM, # trip_id of the parent trip "enter_ts": ecwb.WrapperBase.Access.WORM, # the timestamp of entry (in secs) "enter_local_dt": ecwb.WrapperBase.Acc...
bsd-3-clause
RNAcentral/rnacentral-import-pipeline
tests/cli/pdb_test.py
1
1261
# -*- coding: utf-8 -*- """ Copyright [2009-2018] EMBL-European Bioinformatics Institute 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...
apache-2.0
tccworld/qualitybots
src/appengine/handlers/handle_result_details.py
26
8511
#!/usr/bin/python2.4 # # Copyright 2011 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...
apache-2.0
saurabh6790/omnisys-lib
webnotes/profile.py
31
6401
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import webnotes, json class Profile: """ A profile object is created at the beginning of every request with details of the use. The global profile object is `webnotes.use...
mit
mpharrigan/mdtraj
mdtraj/utils/unit/standard_dimensions.py
17
2307
#!/bin/env python """ Module simtk.unit.standard_dimensions Definition of principal dimensions: mass, length, time, etc. This is part of the OpenMM molecular simulation toolkit originating from Simbios, the NIH National Center for Physics-Based Simulation of Biological Structures at Stanford, funded under the NIH Roa...
lgpl-2.1
akrehl/dotfiles
vim/bundle/YouCompleteMe/third_party/requests/requests/packages/urllib3/fields.py
1007
5833
import email.utils import mimetypes from .packages import six def guess_content_type(filename, default='application/octet-stream'): """ Guess the "Content-Type" of a file. :param filename: The filename to guess the "Content-Type" of using :mod:`mimetypes`. :param default: If no "Cont...
mit
ekapujiw2002/kweb
kwebhelper.py
1
34980
#!/usr/bin/env python # -*- coding: utf-8 -*- # helper file for kweb Minimal Kiosk Browser # Copyright 2013-2014 by Guenter Kreidl # free software without any warranty # you can do with it what you like # version 1.4 import os,urllib,sys,subprocess,threading,time import Tkinter as tk # GLOBAL OPTIONS # use external ...
gpl-3.0
bwohlberg/sporco
sporco/dictlrn/cbpdndl.py
1
18601
# -*- coding: utf-8 -*- # Copyright (C) 2015-2020 by Brendt Wohlberg <brendt@ieee.org> # All rights reserved. BSD 3-clause License. # This file is part of the SPORCO package. Details of the copyright # and user license can be found in the 'LICENSE.txt' file distributed # with the package. """Dictionary learning based ...
bsd-3-clause
luanlv/ResizeImage
node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/__init__.py
574
21473
#!/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. import copy import gyp.input import optparse import os.path import re import shlex import sys import traceback from gyp.common import GypErr...
apache-2.0
mattnenterprise/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/treewalkers/_base.py
658
6907
from __future__ import absolute_import, division, unicode_literals from six import text_type, string_types import gettext _ = gettext.gettext from xml.dom import Node DOCUMENT = Node.DOCUMENT_NODE DOCTYPE = Node.DOCUMENT_TYPE_NODE TEXT = Node.TEXT_NODE ELEMENT = Node.ELEMENT_NODE COMMENT = Node.COMMENT_NODE ENTITY =...
mpl-2.0
doged/electrum-doged-i2p
lib/mnemonic.py
16
5736
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2014 Thomas Voegtlin # # 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 y...
gpl-3.0
Changaco/oh-mainline
vendor/packages/requests/requests/packages/chardet/chardetect.py
1786
2504
#!/usr/bin/env python """ Script which takes one or more file paths and reports on their detected encodings Example:: % chardetect somefile someotherfile somefile: windows-1252 with confidence 0.5 someotherfile: ascii with confidence 1.0 If no paths are provided, it takes its input from stdin. """ from...
agpl-3.0
kism/RViProgramLauncher
viinputdaemon.py
1
18123
# Input Daemon for the Visually Impared # For use with a device that outputs serial import uinput #interface between python and the uinput kernel module import time #for time.sleep() import serial #the keyboard this program interfaces with uses serial import os import sys # Easier debugging :^) class termcolour: ...
mit
mrb/letsencrypt
letsencrypt/le_util.py
4
8446
"""Utilities for all Let's Encrypt.""" import argparse import collections import errno import logging import os import platform import re import stat import subprocess import sys from letsencrypt import errors logger = logging.getLogger(__name__) Key = collections.namedtuple("Key", "file pem") # Note: form is the ...
apache-2.0
bsmr-misc-forks/letsencrypt
certbot/plugins/selection_test.py
6
5196
"""Tests for letsenecrypt.plugins.selection""" import sys import unittest import mock import zope.component from certbot.display import util as display_util from certbot import interfaces class ConveniencePickPluginTest(unittest.TestCase): """Tests for certbot.plugins.selection.pick_*.""" def _test(self, f...
apache-2.0
softak/webfaction_demo
vendor-local/lib/python/django/contrib/gis/tests/geoapp/tests.py
155
35125
import re from django.db import connection from django.contrib.gis import gdal from django.contrib.gis.geos import fromstr, GEOSGeometry, \ Point, LineString, LinearRing, Polygon, GeometryCollection from django.contrib.gis.measure import Distance from django.contrib.gis.tests.utils import \ no_mysql, no_oracle,...
bsd-3-clause
tsufiev/horizon
openstack_dashboard/dashboards/project/data_processing/cluster_templates/views.py
2
4708
# 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...
apache-2.0
alistairlow/tensorflow
tensorflow/python/kernel_tests/embedding_ops_test.py
48
34477
# 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
alistairlow/tensorflow
tensorflow/python/keras/_impl/keras/constraints.py
28
6476
# 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
hujiajie/chromium-crosswalk
tools/grit/grit/node/message.py
43
10243
#!/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. '''Handling of the <message> element. ''' import re import types from grit.node import base import grit.format.rc_header import ...
bsd-3-clause
zsiciarz/django
django/contrib/gis/db/backends/oracle/operations.py
11
8452
""" This module contains the spatial lookup types, and the `get_geo_where_clause` routine for Oracle Spatial. Please note that WKT support is broken on the XE version, and thus this backend will not work on such platforms. Specifically, XE lacks support for an internal JVM, and Java libraries are required to use...
bsd-3-clause
waytai/odoo
addons/hr_payroll/report/__init__.py
427
1161
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it...
agpl-3.0
lecaoquochung/ddnb.django
tests/admin_views/admin.py
5
28419
# -*- coding: utf-8 -*- from __future__ import unicode_literals import tempfile import os from django import forms from django.contrib import admin from django.contrib.admin.views.main import ChangeList from django.core.exceptions import ValidationError from django.core.files.storage import FileSystemStorage from dja...
bsd-3-clause
dmillington/ansible-modules-core
cloud/rackspace/rax_files.py
10
12123
#!/usr/bin/python # (c) 2013, Paul Durivage <paul.durivage@rackspace.com> # # This file is part of Ansible. # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (a...
gpl-3.0
hubsaysnuaa/odoo
addons/report/models/report_paperformat.py
311
7814
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
guoxiaolongzte/spark
examples/src/main/python/ml/als_example.py
63
3026
# # 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
aaptel/mumusic
lib/requests/packages/chardet/constants.py
3008
1335
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-3.0
JNeiger/robocup-software
soccer/gameplay/plays/no_opponents/offensive_pivot_kick.py
1
1448
import play import behavior import robocup import skills.line_kick import tactics.defense import main import constants import enum import role_assignment class OffensivePivotKick(play.Play): def __init__(self): super().__init__(continuous=False) self.add_transition(behavior.Behavior.State.start, ...
apache-2.0
odubno/microblog
venv/lib/python2.7/site-packages/migrate/tests/versioning/test_schema.py
78
6750
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import shutil import six from migrate import exceptions from migrate.versioning.schema import * from migrate.versioning import script, schemadiff from sqlalchemy import * from migrate.tests import fixture class TestControlledSchema(fixture.Pathed, fixture.D...
bsd-3-clause
zbraniecki/translate
translate/storage/versioncontrol/svn.py
26
4863
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2004-2008,2012 Zuza Software Foundation # # This file is part of translate. # # translate is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either vers...
gpl-2.0
alexkogon/ansible
v1/ansible/module_utils/splitter.py
372
8425
# (c) 2014 James Cammarata, <jcammarata@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any late...
gpl-3.0
NickelMedia/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/runtests.py
121
5196
# 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 ...
bsd-3-clause
ihsanudin/odoo
openerp/report/custom.py
338
25091
# -*- 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...
agpl-3.0
tumbl3w33d/ansible
lib/ansible/executor/task_queue_manager.py
5
13277
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
swarna-k/MyDiary
flask/lib/python2.7/site-packages/jinja2/__init__.py
303
2326
# -*- coding: utf-8 -*- """ jinja2 ~~~~~~ Jinja2 is a template engine written in pure Python. It provides a Django inspired non-XML syntax but supports inline expressions and an optional sandboxed environment. Nutshell -------- Here a small example of a Jinja2 template:: {% ...
bsd-3-clause
remitamine/youtube-dl
youtube_dl/extractor/gaia.py
16
4700
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_str, compat_urllib_parse_unquote, ) from ..utils import ( ExtractorError, int_or_none, str_or_none, strip_or_none, try_get, urlencode_postdata, ) class Ga...
unlicense
FederatedAI/FATE
examples/benchmark_quality/hetero_nn/fate-hetero_nn.py
1
6666
# # Copyright 2019 The FATE 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 appli...
apache-2.0
jazztpt/edx-platform
common/lib/xmodule/xmodule/progress.py
110
5066
''' Progress class for modules. Represents where a student is in a module. Useful things to know: - Use Progress.to_js_status_str() to convert a progress into a simple status string to pass to js. - Use Progress.to_js_detail_str() to convert a progress into a more detailed string to pass to js. In particular...
agpl-3.0
SoftwareKing/zstack-woodpecker
zstackwoodpecker/zstackwoodpecker/operations/config_operations.py
1
1270
''' All zstack config operations @author: Youyk ''' import apibinding.api_actions as api_actions import apibinding.inventory as inventory import account_operations import os def get_global_config_value(category, name, session_uuid = None, \ default_value = None): value = None action...
apache-2.0
evancich/apm_min_arm_tone
Tools/LogAnalyzer/LogAnalyzer.py
55
12485
#!/usr/bin/env python # # A module to analyze and identify any common problems which can be determined from log files # # Initial code by Andrew Chapman (amchapman@gmail.com), 16th Jan 2014 # # some logging oddities noticed while doing this, to be followed up on: # - tradheli MOT labels Mot1,Mot2,Mot3,Mot4,GGain # ...
gpl-3.0
wswplay/shadowsocks
shadowsocks/tcprelay.py
922
28870
#!/usr/bin/python # -*- coding: utf-8 -*- # # 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 b...
apache-2.0
Ervii/garage-time
garage/src/python/pants/backend/jvm/tasks/bootstrap_jvm_tools.py
2
4858
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals) import threading fr...
apache-2.0
markslwong/tensorflow
tensorflow/contrib/factorization/python/kernel_tests/masked_matmul_benchmark.py
136
5711
# 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...
apache-2.0
tgroh/beam
sdks/python/apache_beam/runners/job/manager.py
9
1785
# # 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
wevote/WebAppPublic
position/urls.py
1
3102
# position/urls.py # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*- from django.conf.urls import url from . import views, views_admin urlpatterns = [ # admin_views.py url(r'^$', views_admin.position_list_view, name='position_list',), url(r'^delete/$', views_admin.position_delete_process_view,...
bsd-3-clause
JustinWingChungHui/okKindred
suggested_image_tagging/migrations/0001_initial.py
2
1851
# Generated by Django 2.2.6 on 2019-10-04 20:21 from django.db import migrations, models import django.db.models.deletion def create_image_face_detect(apps, schema_editor): Queue = apps.get_model("message_queue", "Queue") image_face_detect_queue = Queue(name = "image_face_detect", descript...
gpl-2.0
rooshilp/CMPUT410Lab4
env-lab4/lib/python2.7/site-packages/werkzeug/routing.py
27
63285
# -*- coding: utf-8 -*- """ werkzeug.routing ~~~~~~~~~~~~~~~~ When it comes to combining multiple controller or view functions (however you want to call them) you need a dispatcher. A simple way would be applying regular expression tests on the ``PATH_INFO`` and calling registered callback fun...
apache-2.0
emonty/deb-vhd-util
tools/python/xen/xend/XendAPIConstants.py
39
2593
#============================================================================ # 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
TintypeMolly/Yuzuki
model/article.py
2
1586
# -*- coding: utf-8 -*- from datetime import datetime from sqlalchemy import Boolean, Column, Integer, String, Text, ForeignKey,\ DateTime from sqlalchemy.orm import relationship from helper.content import markdown_and_linkify from model.base import Base from model.subscription import subscription_table class ...
mit
bigswitch/nova
nova/tests/unit/virt/vmwareapi/test_volumeops.py
14
33041
# Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
inovtec-solutions/OpenERP
openerp/addons/analytic_contract_hr_expense/__openerp__.py
57
1655
# -*- 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
herow/planning_qgis
python/plugins/GdalTools/tools/doInfo.py
10
4894
# -*- coding: utf-8 -*- """ *************************************************************************** doInfo.py --------------------- Date : June 2010 Copyright : (C) 2010 by Giuseppe Sucameli Email : brush dot tyler at gmail dot com *********************...
gpl-2.0
lavvy/osmc
package/mediacenter-skin-osmc/files/usr/share/kodi/addons/script.module.unidecode/lib/unidecode/x091.py
252
4655
data = ( 'Ruo ', # 0x00 'Bei ', # 0x01 'E ', # 0x02 'Yu ', # 0x03 'Juan ', # 0x04 'Yu ', # 0x05 'Yun ', # 0x06 'Hou ', # 0x07 'Kui ', # 0x08 'Xiang ', # 0x09 'Xiang ', # 0x0a 'Sou ', # 0x0b 'Tang ', # 0x0c 'Ming ', # 0x0d 'Xi ', # 0x0e 'Ru ', # 0x0f 'Chu ', # 0x10 'Zi ...
gpl-2.0