repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
AgileInstitute/GtestSpike
GtestSpike/gtest-1.7.0/test/gtest_xml_output_unittest.py
1815
14580
#!/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
sudovijay/youtube-dl
youtube_dl/extractor/tutv.py
94
1111
from __future__ import unicode_literals import base64 from .common import InfoExtractor from ..compat import compat_parse_qs class TutvIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?tu\.tv/videos/(?P<id>[^/?]+)' _TEST = { 'url': 'http://tu.tv/videos/robots-futbolistas', 'md5': '627c7c1...
unlicense
Southpaw-TACTIC/TACTIC
src/pyasm/command/dataflow_test.py
1
24666
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
epl-1.0
cloudbau/nova
nova/cmd/all.py
7
3300
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 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 ...
apache-2.0
ProfessionalIT/maxigenios-website
sdk/google_appengine/lib/django-1.5/django/conf/locale/nb/formats.py
107
1585
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATET...
mit
jkozerski/meteo
meteo_lcd/month_plot.py
1
8156
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- # Author: # Janusz Kozerski (https://github.com/jkozerski) # This draws plots (of temp, humid, dp and pressure) for prevoius month. # Plots are kept in files: # yyyy.mm.dataName.png import dateutil.parser import datetime # datetime and timedelta structures import time...
apache-2.0
syndicate-storage/syndicate-core
python/tests/tree.py
2
2592
#!/usr/bin/env python from syndicate.volume import Volume import os import shutil from settings import settings_kw vol = Volume( **settings_kw ) def touch( vol, path, mode ): fd = vol.create( path, mode ) assert fd != None, "create %s failed" % path vol.close( fd ) return 0 def whitespace(): for i i...
apache-2.0
axinging/sky_engine
sky/engine/build/scripts/name_utilities.py
32
3069
# Copyright (C) 2013 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
AstroTech/atlassian-python-api
examples/bitbucket/bitbucket_cloud_oo.py
2
1452
# coding=utf-8 from textwrap import indent from atlassian.bitbucket import Cloud cloud = Cloud(url="https://api.bitbucket.org/", username="admin", password="admin") index = 0 for w in cloud.workspaces.each(): print("Workspace name " + w.name) p = next(w.projects.each()) print(" First project name " + ...
apache-2.0
rexshihaoren/scikit-learn
sklearn/utils/linear_assignment_.py
214
9413
""" Solve the unique lowest-cost assignment problem using the Hungarian algorithm (also known as Munkres algorithm). """ # Based on original code by Brain Clapper, adapted to NumPy by Gael Varoquaux. # Heavily refactored by Lars Buitinck. # Copyright (c) 2008 Brian M. Clapper <bmc@clapper.org>, Gael Varoquaux # Autho...
bsd-3-clause
erwilan/ansible
lib/ansible/modules/network/avi/avi_gslbapplicationpersistenceprofile.py
44
3659
#!/usr/bin/python # # Created on Aug 25, 2016 # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the te...
gpl-3.0
gdimitris/ChessPuzzlerBackend
Virtual_Environment/lib/python2.7/site-packages/sqlalchemy/engine/base.py
49
79380
# engine/base.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from __future__ import with_statement """Defines :class:`.Connection` and :class:`.En...
mit
csrg-utfsm/acscb
Benchmark/components/src/perftestImpl/SupplierTestComponent.py
4
2766
#******************************************************************************* # ALMA - Atacama Large Millimiter Array # (c) Associated Universities Inc., 2002 # (c) European Southern Observatory, 2002 # Copyright by ESO (in the framework of the ALMA collaboration) # and Cosylab 2002, All rights reserved # # This li...
mit
FreddieShoreditch/image_folder_organiser
venv/lib/python2.7/site-packages/pip/utils/__init__.py
186
26814
from __future__ import absolute_import import contextlib import errno import locale import logging import re import os import posixpath import shutil import stat import subprocess import sys import tarfile import zipfile from pip.exceptions import InstallationError from pip.compat import console_to_str, stdlib_pkgs f...
mit
nortikin/sverchok
nodes/generator/segment.py
1
8721
# This file is part of project Sverchok. It's copyrighted by the contributors # recorded in the version control history of the file, available from # its original location https://github.com/nortikin/sverchok/commit/master # # SPDX-License-Identifier: GPL3 # License-Filename: LICENSE from collections import namedtupl...
gpl-3.0
natanlailari/PennApps2015-Heartmates
venv/lib/python2.7/site-packages/requests/packages/chardet/latin1prober.py
1778
5232
######################## 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...
apache-2.0
DONIKAN/django
tests/admin_widgets/widgetadmin.py
368
1345
from django.contrib import admin from . import models class WidgetAdmin(admin.AdminSite): pass class CarAdmin(admin.ModelAdmin): list_display = ['make', 'model', 'owner'] list_editable = ['owner'] class CarTireAdmin(admin.ModelAdmin): def formfield_for_foreignkey(self, db_field, request, **kwargs...
bsd-3-clause
ww9rivers/splunk-sdk-python
tests/test_modular_input_kinds.py
1
3182
#!/usr/bin/env python # # Copyright 2011-2015 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
apache-2.0
googleapis/python-compute
google/cloud/compute_v1/services/region_target_https_proxies/transports/base.py
1
8295
# -*- coding: utf-8 -*- # Copyright 2020 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...
apache-2.0
jmcarp/django
django/contrib/gis/geoip2/base.py
73
8630
import os import socket import geoip2.database from django.conf import settings from django.core.validators import ipv4_re from django.utils import six from django.utils.ipv6 import is_valid_ipv6_address from .resources import City, Country # Creating the settings dictionary with any settings, if needed. GEOIP_SETT...
bsd-3-clause
JamesTFarrington/flask
setup.py
141
2096
""" Flask ----- Flask is a microframework for Python based on Werkzeug, Jinja 2 and good intentions. And before you ask: It's BSD licensed! Flask is Fun ```````````` Save in a hello.py: .. code:: python from flask import Flask app = Flask(__name__) @app.route("/") def hello(): return "Hell...
bsd-3-clause
tanmaykm/edx-platform
openedx/core/djangoapps/credit/tests/test_partition.py
14
7158
# -*- coding: utf-8 -*- """ Tests for In-Course Reverification Access Control Partition scheme """ import ddt from nose.plugins.attrib import attr import unittest from django.conf import settings from lms.djangoapps.verify_student.models import ( VerificationCheckpoint, VerificationStatus, SkippedReverif...
agpl-3.0
andreparrish/python-for-android
python-build/python-libs/gdata/src/gdata/tlslite/utils/PyCrypto_RSAKey.py
361
1814
"""PyCrypto RSA implementation.""" from cryptomath import * from RSAKey import * from Python_RSAKey import Python_RSAKey if pycryptoLoaded: from Crypto.PublicKey import RSA class PyCrypto_RSAKey(RSAKey): def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0): if not d: ...
apache-2.0
danieldc/cloudtunes
cloudtunes-server/cloudtunes/library/models.py
14
3157
from mongoengine import ( CASCADE, PULL, EmbeddedDocumentField, ListField, StringField, BooleanField, ReferenceField, IntField ) from cloudtunes.base.models import Document from cloudtunes.users.models import User from cloudtunes.services.youtube.models import YoutubeTrack from cloudtunes.services.dropbox.mode...
bsd-3-clause
bdupharm/sqlalchemy
lib/sqlalchemy/sql/naming.py
55
4662
# sqlalchemy/naming.py # Copyright (C) 2005-2016 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Establish constraint and index naming conventions. """ from .schema impor...
mit
isiscoin/Isiscoin
share/qt/extract_strings_qt.py
1294
1784
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by xgettext. Ret...
mit
Root-shady/Flog
node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/easy_xml.py
1049
4803
# 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. ...
mit
shishaochen/TensorFlow-0.8-Win
tensorflow/tools/dist_test/python/mnist_replica.py
9
10307
# Copyright 2016 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 a...
apache-2.0
mobilecoind/mobilecoin
contrib/spendfrom/spendfrom.py
792
10053
#!/usr/bin/env python # # Use the raw transactions API to spend bitcoins received on particular addresses, # and send any change back to that same address. # # Example usage: # spendfrom.py # Lists available funds # spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 # # Assumes it will talk to a bitcoind or Bit...
mit
boyuegame/kbengine
kbe/src/lib/python/Doc/includes/minidom-example.py
101
1582
import xml.dom.minidom document = """\ <slideshow> <title>Demo slideshow</title> <slide><title>Slide title</title> <point>This is a demo</point> <point>Of a program for processing slides</point> </slide> <slide><title>Another demo slide</title> <point>It is important</point> <point>To have more than</point> <point>on...
lgpl-3.0
atandon/Ghost
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/_scilab_builtins.py
364
31261
# -*- coding: utf-8 -*- """ pygments.lexers._scilab_builtins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Builtin list for the ScilabLexer. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ # These lists are generated automatically. # Run the follo...
mit
kaixinjxq/crosswalk-test-suite
apptools/apptools-ios-tests/apptools/create_with_target_platform.py
15
2916
#!/usr/bin/env python # # Copyright (c) 2015 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of conditions and t...
bsd-3-clause
jayceyxc/hue
desktop/core/ext-py/cx_Oracle-5.2.1/test/test3k.py
3
2301
"""Runs all defined unit tests.""" import cx_Oracle import imp import os import sys import unittest inSetup = (os.path.basename(sys.argv[0]).lower() == "setup.py") print("Running tests for cx_Oracle version", cx_Oracle.version, cx_Oracle.buildtime) print("File:", cx_Oracle.__file__) sys.stdout.flush() impor...
apache-2.0
ax003d/openerp
openerp/addons/l10n_be/__openerp__.py
12
3505
# -*- 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
petertodd/stealth-addresses-ref-implementation
lib/python-bitcoinlib/examples/spend-p2sh-txout.py
6
3510
#!/usr/bin/python3 # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Low-level example of how to spend a P2SH/BIP16 txout""" import hashlib from bitcoin import SelectParams from bitcoin.core import b2x, lx, COIN, COutPoint...
mit
jazztpt/edx-platform
lms/djangoapps/instructor_task/tests/test_base.py
107
14772
""" Base test classes for LMS instructor-initiated background tasks """ import os import json from mock import Mock import shutil import unicodecsv from uuid import uuid4 from celery.states import SUCCESS, FAILURE from django.core.urlresolvers import reverse from django.conf import settings from django.test.testcases...
agpl-3.0
gef756/scipy
scipy/optimize/tests/test_cobyla.py
100
3562
from __future__ import division, print_function, absolute_import import math import numpy as np from numpy.testing import assert_allclose, TestCase, run_module_suite, \ assert_ from scipy.optimize import fmin_cobyla, minimize class TestCobyla(TestCase): def setUp(self): self.x0 = [4.95, 0.66] ...
bsd-3-clause
guildai/guild
guild/external/pip/_vendor/lockfile/sqlitelockfile.py
536
5506
from __future__ import absolute_import, division import time import os try: unicode except NameError: unicode = str from . import LockBase, NotLocked, NotMyLock, LockTimeout, AlreadyLocked class SQLiteLockFile(LockBase): "Demonstrate SQL-based locking." testdb = None def __init__(self, path, ...
apache-2.0
dreibh/planetlab-lxc-plcapi
PLC/Methods/DeleteRoleFromPerson.py
1
2189
from PLC.Faults import * from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Persons import Person, Persons from PLC.Auth import Auth from PLC.Roles import Role, Roles class DeleteRoleFromPerson(Method): """ Deletes the specified role from the person. PIs can only revoke the ...
bsd-3-clause
abagh0703/RetailTrail
flask/lib/python2.7/site-packages/whoosh/support/unicode.py
95
26604
import re from bisect import bisect_right from whoosh.compat import text_type, u # http://unicode.org/Public/UNIDATA/Blocks.txt _blockdata = ''' # Blocks-5.1.0.txt # Date: 2008-03-20, 17:41:00 PDT [KW] # # Unicode Character Database # Copyright (c) 1991-2008 Unicode, Inc. # For terms of use, see http://www.unicode.o...
mit
coslova/python-oauth2
oauth2/clients/smtp.py
884
1680
""" The MIT License Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel 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 ...
mit
google/material-design-icons
update/venv/lib/python3.9/site-packages/fontTools/encodings/codecs.py
5
3860
"""Extend the Python codecs module with a few encodings that are used in OpenType (name table) but missing from Python. See https://github.com/fonttools/fonttools/issues/236 for details.""" import codecs import encodings class ExtendCodec(codecs.Codec): def __init__(self, name, base_encoding, mapping): self.name...
apache-2.0
raqsilva/VcfDataExporter
polls/esp_vcf.py
1
15408
import vcf from django.http import HttpResponse from django.core.files import File import xlsxwriter import os from .vcf_functions import getBasePath, save_binary, getFilePath, parse_fasta, getEspPath import subprocess import collections from .dictionaries import esp_col_dic from pytera.settings import BASE_DIR # PYTE...
apache-2.0
ruishihan/R7-with-notes
src/host/python/gsmlib/interleave.py
2
1262
import numpy as np class interleave: def __init__(self,size,block_size,t="CCH"): """ int interleave_init(INTERLEAVE_CTX *ictx, int size, int block_size) { ictx->trans_size = size; ictx->trans = (unsigned short *)malloc(size * sizeof *ictx->trans); // DEBUGF("size: %d\n", size); // DEBUGF("Block s...
apache-2.0
cpacia/OpenBazaar-Server
market/tests/test_smtpnotification.py
5
3548
from twisted.trial import unittest from twisted.python import log from mock import patch, MagicMock import mock from smtplib import SMTPAuthenticationError from market.smtpnotification import SMTPNotification class MarketSMTPTest(unittest.TestCase): def setUp(self): self.catcher = [] observer = s...
mit
frankinit/ThinkStats2
code/populations.py
68
2609
"""This file contains code used in "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2010 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function import csv import logging import sys import numpy as np import pandas import thinkpl...
gpl-3.0
matbu/ansible-modules-extras
network/f5/bigip_ssl_certificate.py
32
16292
#!/usr/bin/python # # (c) 2016, Kevin Coming (@waffie1) # # 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 l...
gpl-3.0
Xion/pelican-plugins
html_entity/html_entity.py
76
1310
""" HTML Entities for reStructured Text =================================== Allows user to use HTML entities (&copy;, &#149;, etc.) in RST documents. Usage: :html_entity:`copy` :html_entity:`149` :html_entity:`#149` """ from __future__ import unicode_literals from docutils import nodes, utils from docutils.parsers.rs...
agpl-3.0
chokribr/invenioold
modules/miscutil/lib/hepdatautils.py
13
75766
# -*- coding: utf-8 -*- ## This file is part of Invenio. ## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 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...
gpl-2.0
crackerhead/nemio-flask-old
lib/python2.7/site-packages/flask/logging.py
838
1398
# -*- coding: utf-8 -*- """ flask.logging ~~~~~~~~~~~~~ Implements the logging support for Flask. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from logging import getLogger, StreamHandler, Formatter, getLoggerClas...
mit
iPlantCollaborativeOpenSource/libcloud
libcloud/loadbalancer/base.py
24
10502
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
camradal/ansible
lib/ansible/plugins/callback/tree.py
133
2417
# (c) 2012-2014, Ansible, 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 ...
gpl-3.0
jylaxp/django
tests/template_tests/syntax_tests/test_i18n.py
245
23356
# coding: utf-8 from __future__ import unicode_literals from django.template import TemplateSyntaxError from django.test import SimpleTestCase from django.utils import translation from django.utils.safestring import mark_safe from ..utils import setup class I18nTagTests(SimpleTestCase): libraries = { 'c...
bsd-3-clause
srkukarni/heron
heron/tools/tracker/tests/python/mock_proto.py
2
5412
''' mock_proto.py ''' from heron.api.src.python import api_constants import heron.proto.execution_state_pb2 as protoEState import heron.proto.physical_plan_pb2 as protoPPlan import heron.proto.tmaster_pb2 as protoTmaster import heron.proto.topology_pb2 as protoTopology # pylint: disable=no-self-use, missing-docstring ...
apache-2.0
Ilhasoft/ureport
ureport/contacts/migrations/0002_contact.py
2
1848
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("orgs", "0014_auto_20150722_1419"), ("contacts", "0001_initial")] operations = [ migrations.Cre...
agpl-3.0
yawnosnorous/python-for-android
python3-alpha/python3-src/Lib/test/test_long.py
51
47555
import unittest from test import support import sys import random import math import array # Used for lazy formatting of failure messages class Frm(object): def __init__(self, format, *args): self.format = format self.args = args def __str__(self): return self.format % self.args # S...
apache-2.0
kawamuray/ganeti
test/py/ganeti.storage.bdev_unittest.py
4
11651
#!/usr/bin/python # # Copyright (C) 2006, 2007, 2010, 2012, 2013 Google Inc. # # 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 v...
gpl-2.0
rynomster/django
django/utils/decorators.py
126
7531
"Functions that help with dynamically creating decorators for views." try: from contextlib import ContextDecorator except ImportError: ContextDecorator = None from functools import WRAPPER_ASSIGNMENTS, update_wrapper, wraps from django.utils import six class classonlymethod(classmethod): def __get__(se...
bsd-3-clause
40223201/40223201
static/Brython3.1.1-20150328-091302/Lib/multiprocessing/util.py
696
9917
# # Module providing various facilities to other parts of the package # # multiprocessing/util.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # import sys import functools import os import itertools import weakref import atexit import threading # we want threading to ...
gpl-3.0
ARMmbed/yotta_osx_installer
workspace/lib/python2.7/site-packages/yotta/test/cli/publish.py
3
2708
#!/usr/bin/env python # Copyright 2014-2015 ARM Limited # # Licensed under the Apache License, Version 2.0 # See LICENSE file for details. # standard library modules, , , import unittest import os import tempfile # internal modules: from yotta.lib.fsutils import rmRf from . import cli Test_Target = "x86-osx-native...
apache-2.0
unicefuganda/edtrac
edtrac_project/rapidsms_edtrac/education/management/commands/create_new_violence_scripts.py
1
3573
''' Created on Mar 25, 2013 @author: raybesiga ''' import datetime import logging import itertools from logging import handlers from django.core.management.base import BaseCommand from django.contrib.sites.models import Site from django.contrib.auth.models import User from django.core.mail import send_mail from djan...
bsd-3-clause
dimaleks/uDeviceX
tests/walls/analytic/plates.py
1
1536
#!/usr/bin/env python import mirheo as mir dt = 0.001 ranks = (1, 1, 1) domain = (8, 16, 8) force = (1.0, 0, 0) density = 4 u = mir.Mirheo(ranks, domain, debug_level=3, log_filename='log', no_splash=True) pv = mir.ParticleVectors.ParticleVector('pv', mass = 1) ic = mir.InitialConditions.Uniform(number_density=de...
gpl-3.0
shakamunyi/nova
nova/network/dns_driver.py
152
1431
# Copyright 2011 Andrew Bogott for the Wikimedia 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 requi...
apache-2.0
mahak/ansible
test/units/module_utils/common/arg_spec/test_aliases.py
15
3572
# -*- coding: utf-8 -*- # Copyright (c) 2021 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type import pytest from ansible.module_utils.errors import AnsibleValidationError,...
gpl-3.0
disqus/Diamond
src/collectors/elb/test/testelb.py
3
8373
#!/usr/bin/python # coding=utf-8 import datetime import mock from test import CollectorTestCase from test import get_collector_config from test import unittest from mock import patch from test import run_only from mock import Mock from diamond.collector import Collector from elb import ElbCollector def run_only_if...
mit
brianrodri/oppia
core/platform/taskqueue/dev_mode_taskqueue_services.py
2
3033
# coding: utf-8 # # Copyright 2020 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
y12uc231/edx-platform
lms/djangoapps/shoppingcart/tests/test_payment_fake.py
147
4130
""" Tests for the fake payment page used in acceptance tests. """ from django.test import TestCase from shoppingcart.processors.CyberSource2 import sign, verify_signatures from shoppingcart.processors.exceptions import CCProcessorSignatureException from shoppingcart.tests.payment_fake import PaymentFakeView from colle...
agpl-3.0
mSenyor/sl4a
python/src/Tools/scripts/fixdiv.py
94
13900
#! /usr/bin/env python """fixdiv - tool to fix division operators. To use this tool, first run `python -Qwarnall yourscript.py 2>warnings'. This runs the script `yourscript.py' while writing warning messages about all uses of the classic division operator to the file `warnings'. The warnings look like this: <file...
apache-2.0
Intel-Corporation/tensorflow
tensorflow/python/compiler/tensorrt/test/quantization_test.py
2
5393
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
janusnic/youtube-dl-GUI
youtube_dl/extractor/rte.py
108
2123
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( float_or_none, ) class RteIE(InfoExtractor): _VALID_URL = r'http?://(?:www\.)?rte\.ie/player/[^/]{2,3}/show/(?P<id>[0-9]+)/' _TEST = { 'url': 'http://www.rte.ie/player/de/show/10363114...
mit
mgagne/nova
nova/tests/functional/v3/test_access_ips.py
19
3430
# 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
gengue/django
django/contrib/flatpages/models.py
318
1556
from __future__ import unicode_literals from django.contrib.sites.models import Site from django.core.urlresolvers import get_script_prefix from django.db import models from django.utils.encoding import iri_to_uri, python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ @python_2_unicode_...
bsd-3-clause
dahlstrom-g/intellij-community
python/helpers/py3only/docutils/parsers/rst/directives/images.py
44
6933
# $Id: images.py 7753 2014-06-24 14:52:59Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Directives for figures and simple images. """ __docformat__ = 'reStructuredText' import sys import urllib.error import urllib.parse import urllib.request...
apache-2.0
sinkuri256/python-for-android
python3-alpha/python3-src/Lib/test/test_pickle.py
47
3124
import pickle import io from test import support from test.pickletester import AbstractPickleTests from test.pickletester import AbstractPickleModuleTests from test.pickletester import AbstractPersistentPicklerTests from test.pickletester import AbstractPicklerUnpicklerObjectTests try: import _pickle has_c_i...
apache-2.0
hyperNURb/ggrc-core
src/ggrc_basic_permissions/migrations/versions/20131024025842_169eef85896d_objectowner_permissi.py
5
2854
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: anze@reciprocitylabs.com # Maintained By: anze@reciprocitylabs.com """ObjectOwner permissions changes. Revision ID: 169eef85896d Revises: 33a9ca4...
apache-2.0
kushalbhola/MyStuff
Practice/PythonApplication/env/Lib/site-packages/pandas/core/reshape/tile.py
2
19190
""" Quantilization functions and related stuff """ from functools import partial import numpy as np from pandas._libs.lib import infer_dtype from pandas.core.dtypes.common import ( _NS_DTYPE, ensure_int64, is_categorical_dtype, is_datetime64_dtype, is_datetime64tz_dtype, is_datetime_or_timede...
apache-2.0
aequitas/home-assistant
homeassistant/components/panasonic_bluray/media_player.py
3
4472
"""Support for Panasonic Blu-ray players.""" from datetime import timedelta import logging import voluptuous as vol from homeassistant.components.media_player import ( MediaPlayerDevice, PLATFORM_SCHEMA) from homeassistant.components.media_player.const import ( SUPPORT_PAUSE, SUPPORT_PLAY, SUPPORT_STOP, S...
apache-2.0
SpockBotMC/SpockBot
spockbot/plugins/core/timers.py
4
4071
""" Provides clock-time and **SERVER** tick-timers and a convenient API for registering them. Clock-time timers are as precise as the underlying OS makes them, server tick-timers are based on time updates from the server """ import time from spockbot.plugins.base import PluginBase, pl_announce class BaseTimer(objec...
mit
Samuc/Proyecto-IV
lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/chardetect.py
743
1141
#!/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 ...
gpl-2.0
hurrinico/sale-workflow
sale_order_revision/__openerp__.py
15
1562
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>) # @author Lorenzo Battistini <lorenzo.battistini@agilebg.com> # # This program is free software: you can redistribute it and/or modi...
agpl-3.0
Alidron/demo-nao
alidron-env/lib/python2.7/site-packages/zmq/auth/asyncio.py
5
1376
"""ZAP Authenticator integrated with the asyncio IO loop. .. versionadded:: 15.2 """ # Copyright (C) PyZMQ Developers # Distributed under the terms of the Modified BSD License. import asyncio import zmq from zmq.asyncio import Poller from .base import Authenticator class AsyncioAuthenticator(Authenticator): "...
mpl-2.0
wemanuel/smry
smry/server-auth/ls/google-cloud-sdk/platform/gsutil/third_party/protorpc/protorpc/wsgi/util_test.py
21
11312
#!/usr/bin/env python # # Copyright 2011 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
paulmartel/voltdb
tests/testverbs/voltverbstest.py
1
16423
# This file is part of VoltDB. # Copyright (C) 2008-2016 VoltDB Inc. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, c...
agpl-3.0
yaroslavprogrammer/django
tests/bug639/tests.py
102
1434
""" Tests for file field behavior, and specifically #639, in which Model.save() gets called *again* for each FileField. This test will fail if calling a ModelForm's save() method causes Model.save() to be called more than once. """ from __future__ import absolute_import import os import shutil from django.core.files...
bsd-3-clause
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/OpenGL/platform/__init__.py
9
2590
"""Abstraction for the platform-specific code in PyOpenGL Each supported platform has a module which provides the specific functionality required to support the base OpenGL functionality on that platform. These modules are registered using plugins in the: OpenGL.plugin.PlatformPlugin objects. To support a ne...
gpl-3.0
robhudson/zamboni
lib/misc/safe_signals.py
5
1345
""" A monkeypatch for ``django.dispatch`` to send signals safely. Usage:: >>> import safe_signals >>> safe_signals.start_the_machine() ``django.dispatch.Signal.send`` is replaced with a safer function that catches and logs errors. It's like ``Signal.send_robust`` but with logging. """ import logging from ...
bsd-3-clause
bguillot/OpenUpgrade
addons/stock_landed_costs/product.py
364
1611
# -*- 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
hybrideagle/django
tests/indexes/tests.py
321
3037
from unittest import skipUnless from django.db import connection from django.test import TestCase from .models import Article, ArticleTranslation, IndexTogetherSingleList class SchemaIndexesTests(TestCase): """ Test index handling by the db.backends.schema infrastructure. """ def test_index_name_ha...
bsd-3-clause
jiajiax/crosswalk-test-suite
webapi/tct-mediacapture-w3c-tests/inst.apk.py
1996
3186
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PARAMETERS = None ADB_CMD = "adb" def doCMD(cmd): # Do not need handle timeout in this short script, let tool...
bsd-3-clause
benchisell/photostream-bc
flask/lib/python2.7/site-packages/migrate/tests/fixture/pathed.py
45
2159
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import shutil import tempfile from migrate.tests.fixture import base class Pathed(base.Base): # Temporary files _tmpdir = tempfile.mkdtemp() def setUp(self): super(Pathed, self).setUp() self.temp_usable_dir = tempfile.m...
bsd-3-clause
linuxipho/mycroft-core
mycroft/messagebus/message.py
1
6017
# Copyright 2017 Mycroft AI Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
apache-2.0
zhangxq5012/sky_engine
sky/engine/bindings/scripts/compute_interfaces_info_overall.py
12
12110
#!/usr/bin/python # # Copyright (C) 2013 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...
bsd-3-clause
Noviat/odoo
addons/email_template/email_template.py
24
30855
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009 Sharoon Thomas # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it ...
agpl-3.0
SOKP/external_chromium_org
components/test/data/autofill/merge/tools/serialize_profiles.py
137
2606
#!/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. import os.path import sqlite3 import sys from autofill_merge_common import SerializeProfiles, ColumnNameToFieldType def main(): ""...
bsd-3-clause
joram/sickbeard-orange
lib/unidecode/x088.py
252
4645
data = ( 'Ci ', # 0x00 'Xiang ', # 0x01 'She ', # 0x02 'Luo ', # 0x03 'Qin ', # 0x04 'Ying ', # 0x05 'Chai ', # 0x06 'Li ', # 0x07 'Ze ', # 0x08 'Xuan ', # 0x09 'Lian ', # 0x0a 'Zhu ', # 0x0b 'Ze ', # 0x0c 'Xie ', # 0x0d 'Mang ', # 0x0e 'Xie ', # 0x0f 'Qi ', # 0x10 'Ro...
gpl-3.0
zodsoft/OpenNI2
ThirdParty/PSCommon/RedistSystem/CopyToRepository.py
36
4917
#/**************************************************************************** #* * #* PrimeSense PSCommon Library * #* Copyright (C) 2012 PrimeSense Ltd. * #* ...
apache-2.0
xenserver/xen-4.3
tools/xm-test/tests/pause/01_pause_basic_pos.py
42
1459
#!/usr/bin/python # Copyright (C) International Business Machines Corp., 2005 # Author: Paul Larson <pl@us.ibm.com> # Description: # Positive Tests: # Tests for xm pause # 1) Create domain, verify it's up with console # 2) pause the domain # 3) verify it's paused by failure to connect console import time import com...
gpl-2.0
yordan-desta/QgisIns
python/plugins/db_manager/db_plugins/connector.py
3
6045
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : DB Manager Description : Database manager plugin for QGIS Date : May 23, 2011 copyright : (C) 2011 by Giuseppe Sucameli email : brush.tyler@...
gpl-2.0
ykim362/mxnet
example/rcnn/rcnn/pycocotools/mask.py
16
5379
# 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
rooshilp/CMPUT410Lab4
env-lab4/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/setuptools/extension.py
61
1278
from distutils.core import Extension as _Extension from setuptools.dist import _get_unpatched _Extension = _get_unpatched(_Extension) # Prefer Cython to Pyrex pyrex_impls = 'Cython.Distutils.build_ext', 'Pyrex.Distutils.build_ext' for pyrex_impl in pyrex_impls: try: # from (pyrex_impl) import build_ext build_ext ...
apache-2.0