repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
HiroIshikawa/21playground
microblog/flask/lib/python3.5/site-packages/wheel/test/test_tagopt.py
236
3550
""" Tests for the bdist_wheel tag options (--python-tag and --universal) """ import sys import shutil import pytest import py.path import tempfile import subprocess SETUP_PY = """\ from setuptools import setup setup( name="Test", version="1.0", author_email="author@example.com", py_modules=["test"], ...
mit
UQ-UQx/edx-platform_lti
common/test/acceptance/tests/studio/base_studio_test.py
18
3318
from ...pages.studio.auto_auth import AutoAuthPage from ...fixtures.course import CourseFixture from ..helpers import UniqueCourseTest from ...pages.studio.overview import CourseOutlinePage from ...pages.studio.utils import verify_ordering class StudioCourseTest(UniqueCourseTest): """ Base class for all Studi...
agpl-3.0
SlimRoms/android_external_chromium_org
mojo/tools/check_mojom_golden_files.py
8
3669
#!/usr/bin/env python # Copyright 2014 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 argparse import os.path import sys from filecmp import dircmp from shutil import rmtree from tempfile import mkdtemp _script_di...
bsd-3-clause
rvelhote/GSoC-SWAT
swat/lib/helpers.py
1
18333
# # Helper Functions/Classes file for SWAT # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is dist...
gpl-3.0
Greennut/ostproject
django/core/signing.py
85
6485
""" Functions for creating and restoring url-safe signed JSON objects. The format used looks like this: >>> signing.dumps("hello") 'ImhlbGxvIg:1QaUZC:YIye-ze3TTx7gtSv422nZA4sgmk' There are two components here, separated by a ':'. The first component is a URLsafe base64 encoded JSON of the object passed to dumps(). T...
bsd-3-clause
shanyimin/you-get
src/you_get/extractors/videobam.py
19
1180
#!/usr/bin/env python __all__ = ['videobam_download'] from ..common import * import urllib.error import json def videobam_download(url, output_dir = '.', merge = True, info_only = False): if re.match(r'http://videobam.com/\w+', url): #Todo: Change to re. way vid = url.split('/')[-1] downl...
mit
scott-maddox/openbandparams
build_doc.py
1
6703
#!/usr/bin/env python # # Copyright (c) 2013-2014, Scott J Maddox # # This file is part of openbandparams. # # openbandparams is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 ...
agpl-3.0
cortedeltimo/SickRage
lib/unidecode/x06a.py
252
4674
data = ( 'Di ', # 0x00 'Zhuang ', # 0x01 'Le ', # 0x02 'Lang ', # 0x03 'Chen ', # 0x04 'Cong ', # 0x05 'Li ', # 0x06 'Xiu ', # 0x07 'Qing ', # 0x08 'Shuang ', # 0x09 'Fan ', # 0x0a 'Tong ', # 0x0b 'Guan ', # 0x0c 'Ji ', # 0x0d 'Suo ', # 0x0e 'Lei ', # 0x0f 'Lu ', # 0x1...
gpl-3.0
robovm/robovm-studio
python/lib/Lib/site-packages/django/contrib/gis/db/backends/base.py
258
10674
""" Base/mixin classes for the spatial backend database operations and the `SpatialRefSys` model the backend. """ import re from django.conf import settings from django.contrib.gis import gdal class BaseSpatialOperations(object): """ This module holds the base `BaseSpatialBackend` object, which is instanti...
apache-2.0
ihsanudin/odoo
addons/survey/controllers/main.py
189
21460
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-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
micolous/python-slackrealtime
src/slackrealtime/api.py
1
3819
""" slackrealtime/api.py - Barebones implementation of the Slack API. Copyright 2014-2020 Michael Farrell <http://micolous.id.au> This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version...
gpl-3.0
supergentle/migueltutorial
flask/lib/python2.7/site-packages/sqlalchemy/dialects/mssql/zxjdbc.py
59
2282
# mssql/zxjdbc.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 """ .. dialect:: mssql+zxjdbc :name: zxJDBC for Jython :dbapi: zxjdbc :c...
bsd-3-clause
samedder/azure-cli
tools/automation/commandlint/run.py
5
4082
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
mit
datachand/h2o-3
py2/testdir_single_jvm/test_DL_basic.py
20
6343
import unittest, time, sys, random sys.path.extend(['.','..','../..','py']) import h2o2 as h2o import h2o_cmd, h2o_import as h2i, h2o_jobs from h2o_test import verboseprint, dump_json, OutputObj class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def se...
apache-2.0
brentdax/letsencrypt
certbot/tests/display/completer_test.py
11
3311
"""Test certbot.display.completer.""" import os import readline import shutil import string import sys import tempfile import unittest import mock from six.moves import reload_module # pylint: disable=import-error class CompleterTest(unittest.TestCase): """Test certbot.display.completer.Completer.""" def s...
apache-2.0
Lkhagvadelger/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/controllers/manager_unittest.py
122
3980
# Copyright (C) 2010 Google Inc. All rights reserved. # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of so...
bsd-3-clause
pf3gnuchains/pf-binutils-gdb
gdb/testsuite/gdb.python/py-framefilter.py
40
4366
# Copyright (C) 2013-2014 Free Software Foundation, 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 3 of the License, or # (at your option) any later version. # # This progr...
gpl-2.0
mglidden/git-analysis
analysis/train.py
1
3065
import fix_paths from models.commit import Commit import common import config import features from load_samples import load_samples_from_file from collections import defaultdict import numpy as np import pickle from sklearn import svm from sklearn.cross_validation import StratifiedKFold from sklearn.grid_search impor...
mit
dims/etcd3-gateway
etcd3gw/examples/etcd.py
1
2323
# 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 t...
apache-2.0
ZhuPeng/tornado
tornado/test/iostream_test.py
72
42040
from __future__ import absolute_import, division, print_function, with_statement from tornado.concurrent import Future from tornado import gen from tornado import netutil from tornado.iostream import IOStream, SSLIOStream, PipeIOStream, StreamClosedError from tornado.httputil import HTTPHeaders from tornado.log import ...
apache-2.0
yongshengwang/hue
desktop/core/ext-py/tablib-0.10.0/tablib/packages/unicodecsv/__init__.py
52
3434
# -*- coding: utf-8 -*- import csv from csv import * #http://semver.org/ VERSION = (0, 8, 0) __version__ = ".".join(map(str,VERSION)) def _stringify(s, encoding): if type(s)==unicode: return s.encode(encoding) elif isinstance(s, (int , float)): pass #let csv.QUOTE_NONNUMERIC do its thing. ...
apache-2.0
tchx84/sugar
src/jarabe/frame/notification.py
2
3573
# Copyright (C) 2008 One Laptop Per Child # # 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. # # This program is distribu...
gpl-2.0
abdulbaqi/quranf
venv/lib/python2.7/site-packages/jinja2/filters.py
329
30115
# -*- coding: utf-8 -*- """ jinja2.filters ~~~~~~~~~~~~~~ Bundled jinja filters. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import re import math from random import choice from operator import itemgetter from itertools import groupby from jinja2.utils...
mit
Sing-Li/go-buildpack
builds/runtimes/python-2.7.6/lib/python2.7/distutils/command/bdist_wininst.py
157
14997
"""distutils.command.bdist_wininst Implements the Distutils 'bdist_wininst' command: create a windows installer exe-program.""" __revision__ = "$Id$" import sys import os import string from sysconfig import get_python_version from distutils.core import Command from distutils.dir_util import remove_tree from distut...
mit
slozier/ironpython2
Src/StdLib/Lib/lib2to3/pgen2/conv.py
325
9627
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Convert graminit.[ch] spit out by pgen to Python code. Pgen is the Python parser generator. It is useful to quickly create a parser from a grammar file in Python's grammar notation. But I don't wa...
apache-2.0
firebitsbr/raspberry_pwn
src/pentest/sqlmap/thirdparty/chardet/big5prober.py
236
1683
######################## 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 ...
gpl-3.0
ESS-LLP/erpnext-healthcare
erpnext/patches/v7_2/rename_evaluation_criteria.py
11
2172
from __future__ import unicode_literals import frappe from frappe.model.utils.rename_field import rename_field def execute(): # 'Schools' module changed to the 'Education' frappe.rename_doc("DocType", "Evaluation Criteria", "Assessment Criteria", force=True) # frappe.reload_doc("schools", "doctype", "assessment_c...
gpl-3.0
tdautc19841202/Espruino
boards/ESPRUINOBOARD.py
3
3688
#!/bin/false # This file is part of Espruino, a JavaScript interpreter for Microcontrollers # # Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk> # # 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 h...
mpl-2.0
pschmitt/home-assistant
homeassistant/components/flick_electric/__init__.py
19
3201
"""The Flick Electric integration.""" from datetime import datetime as dt from pyflick import FlickAPI from pyflick.authentication import AbstractFlickAuth from pyflick.const import DEFAULT_CLIENT_ID, DEFAULT_CLIENT_SECRET from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( CON...
apache-2.0
LowResourceLanguages/hltdi-l3
l3xdg/crosslex.py
1
15571
# Cross-lingual links: join instances of Lex in different "languages" # (Semantics is a language) # ######################################################################## # # This file is part of the HLTDI L^3 project # for parsing, generation, and translation within the # framework of Extensible Depen...
gpl-3.0
PFWhite/qipr_approver
qipr_approver/approver/templatetags/tagbox.py
3
1156
from django import template register = template.Library() @register.inclusion_tag('templatetags/tagbox.html') def tagbox(input_dict, is_disabled=False): """ Renders tagbox widget Takes the following keywords: name: the name that corresponds to the input, will be in form when submitted label: the...
apache-2.0
ajfink/android_kernel_lge_e7lte
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
pongem/python-bot-project
appengine/standard/botapp/lib/django/contrib/postgres/forms/array.py
34
6975
import copy from itertools import chain from django import forms from django.contrib.postgres.validators import ( ArrayMaxLengthValidator, ArrayMinLengthValidator, ) from django.core.exceptions import ValidationError from django.utils import six from django.utils.safestring import mark_safe from django.utils.trans...
apache-2.0
jymannob/Sick-Beard
sickbeard/clients/requests/models.py
38
21570
# -*- coding: utf-8 -*- """ requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. """ import collections import logging import datetime from io import BytesIO from .hooks import default_hooks from .structures import CaseInsensitiveDict from .auth import HTTPBasicAuth from .c...
gpl-3.0
crocha700/dp_spectra
model/plt_spec_model_rast.py
1
10430
import numpy as np import matplotlib.pyplot as plt plt.rcParams.update({'font.size': 25, 'legend.handlelength' : 1.5 , 'legend.markerscale': 1.}) plt.rc('xtick', labelsize=25) plt.rc('ytick', labelsize=25) color2 = '#6495ed' color1 = '#ff6347' color5 = '#8470ff' color3 = '#3cb371' color4 = '#ffd700' color6 = '#...
mit
buskjan/inetradio
lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/universaldetector.py
1776
6840
######################## 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
stankovski/AutoRest
AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyString/setup.py
2
1115
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
chros/SmartMenu
core/models.py
1
4020
from django.db import models from django.utils.timezone import now from django.core.validators import MinValueValidator from django.utils import formats class Shelf(models.Model): id = models.CharField(max_length=5, primary_key=True) def __str__(self): return self.id class Meta: verbose_...
mit
JoinMarket-Org/joinmarket-clientserver
test/payjoinclient.py
3
2463
#!/usr/bin/env python import sys from twisted.internet import reactor from jmclient.cli_options import check_regtest from jmclient import (get_wallet_path, WalletService, open_test_wallet_maybe, jm_single, load_test_config, SegwitLegacyWallet, SegwitWallet) from jmclient.payj...
gpl-3.0
Jroque/MITMf
core/poisoners/DHCP.py
19
6141
# Copyright (c) 2014-2016 Marcello Salvati # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distrib...
gpl-3.0
alfredodeza/boto
tests/unit/s3/test_cors_configuration.py
136
2461
#!/usr/bin/env python import unittest from boto.s3.cors import CORSConfiguration CORS_BODY_1 = ( '<CORSConfiguration>' '<CORSRule>' '<AllowedMethod>PUT</AllowedMethod>' '<AllowedMethod>POST</AllowedMethod>' '<AllowedMethod>DELETE</AllowedMethod>' '<AllowedOrigin>http://www.example.com</Allowed...
mit
funtion/shadowsocks-1
utils/autoban.py
1033
2156
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2015 clowwindy # # 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 u...
apache-2.0
lyft/carbon
lib/carbon/protocols.py
4
6139
import time from twisted.internet import reactor from twisted.internet.protocol import DatagramProtocol from twisted.internet.error import ConnectionDone from twisted.protocols.basic import LineOnlyReceiver, Int32StringReceiver from carbon import log, events, state, management from carbon.conf import settings from car...
apache-2.0
frewsxcv/AutobahnPython
autobahn/autobahn/wamp/websocket.py
3
8992
############################################################################### ## ## Copyright (C) 2013-2014 Tavendo GmbH ## ## 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 ## ## h...
apache-2.0
nelson-liu/scikit-learn
sklearn/neural_network/rbm.py
46
12291
"""Restricted Boltzmann Machine """ # Authors: Yann N. Dauphin <dauphiya@iro.umontreal.ca> # Vlad Niculae # Gabriel Synnaeve # Lars Buitinck # License: BSD 3 clause import time import numpy as np import scipy.sparse as sp from ..base import BaseEstimator from ..base import TransformerMixi...
bsd-3-clause
mancoast/CPythonPyc_test
cpython/313_test_listcomps.py
8
11555
doctests = """ ########### Tests borrowed from or inspired by test_genexps.py ############ Test simple loop with conditional >>> sum([i*i for i in range(100) if i&1 == 1]) 166650 Test simple nesting >>> [(i,j) for i in range(3) for j in range(4)] [(0, 0), (0, 1), (0, 2), (0, 3), (1, 0), (1, 1), (1, ...
gpl-3.0
RevelSystems/django
django/contrib/gis/forms/fields.py
504
4316
from __future__ import unicode_literals from django import forms from django.contrib.gis.geos import GEOSException, GEOSGeometry from django.utils.translation import ugettext_lazy as _ from .widgets import OpenLayersWidget class GeometryField(forms.Field): """ This is the basic form field for a Geometry. A...
bsd-3-clause
leilihh/cinder
cinder/volume/drivers/nfs.py
3
15997
# Copyright (c) 2012 NetApp, 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
ualikhansars/Gwent
lib/python2.7/site-packages/django/db/models/expressions.py
74
34365
import copy import datetime from django.conf import settings from django.core.exceptions import FieldError from django.db.backends import utils as backend_utils from django.db.models import fields from django.db.models.constants import LOOKUP_SEP from django.db.models.query_utils import Q, refs_aggregate from django.u...
mit
maniteja123/sympy
sympy/utilities/tests/diagnose_imports.py
99
9708
#!/usr/bin/env python """ Import diagnostics. Run bin/diagnose_imports.py --help for details. """ from __future__ import print_function if __name__ == "__main__": import sys import inspect from sympy.core.compatibility import builtins import optparse from os.path import abspath, dirname, join,...
bsd-3-clause
sophiataskova/helping_hands
helping_hands_site/helping_hands_site/urls.py
1
1202
from django.conf.urls import patterns, include, url from helping_hands_app import views from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'helping_hands_site.views.home', name='home'), # url(r'^helping_hands_site/', include('helping_hands_site.foo.ur...
mit
mKeRix/home-assistant
homeassistant/components/automation/reproduce_state.py
16
1884
"""Reproduce an Automation state.""" import asyncio import logging from typing import Any, Dict, Iterable, Optional from homeassistant.const import ( ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_ON, STATE_OFF, STATE_ON, ) from homeassistant.core import Context, State from homeassistant.helpers.ty...
mit
GNOME/billreminder
src/lib/migrate_to_gconf.py
3
2409
# Tool to migrate to gconf import gconf import os from ConfigParser import ConfigParser from lib.common import GCONF_PATH, GCONF_GUI_PATH, GCONF_ALARM_PATH def migrate(filename): gconf_client = gconf.client_get_default() old_config = ConfigParser() old_config.read(filename) alarm_values_bool = ('sho...
gpl-3.0
termie/pupa
nova/db/sqlalchemy/migrate_repo/versions/010_add_os_type_to_instances.py
2
1670
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 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 # ...
apache-2.0
philippj/python-burningseries
yowsup/layers/protocol_chatstate/protocolentities/chatstate_incoming.py
70
1230
from .chatstate import ChatstateProtocolEntity class IncomingChatstateProtocolEntity(ChatstateProtocolEntity): ''' INCOMING <chatstate from="xxxxxxxxxxx@s.whatsapp.net"> <{{composing|paused}}></{{composing|paused}}> </chatstate> OUTGOING <chatstate to="xxxxxxxxxxx@s.whatsapp.net"> <{{...
gpl-2.0
andrewmoses/ssquiz
flask/lib/python2.7/site-packages/werkzeug/contrib/atom.py
148
15498
# -*- coding: utf-8 -*- """ werkzeug.contrib.atom ~~~~~~~~~~~~~~~~~~~~~ This module provides a class called :class:`AtomFeed` which can be used to generate feeds in the Atom syndication format (see :rfc:`4287`). Example:: def atom_feed(request): feed = AtomFeed("My Blog", feed...
bsd-3-clause
bosstb/HaberPush
youtube_dl/extractor/screencast.py
44
4330
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import ( compat_parse_qs, compat_urllib_request, ) from ..utils import ( ExtractorError, ) class ScreencastIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?screencast\.com/t/(?P<id>[a-zA-Z0-9]+...
mit
EnerNOC/pyopenssl
OpenSSL/test/test_ssl.py
2
84744
# Copyright (C) Jean-Paul Calderone # See LICENSE for details. """ Unit tests for :py:obj:`OpenSSL.SSL`. """ from gc import collect from errno import ECONNREFUSED, EINPROGRESS, EWOULDBLOCK from sys import platform, version_info from socket import error, socket from os import makedirs from os.path import join, dirname...
apache-2.0
dcroc16/skunk_works
google_appengine/lib/django-1.5/django/contrib/admindocs/views.py
93
15143
import inspect import os import re from django import template from django.template import RequestContext from django.conf import settings from django.contrib.admin.views.decorators import staff_member_required from django.db import models from django.shortcuts import render_to_response from django.core.exceptions imp...
mit
jaruba/chromium.src
tools/telemetry/telemetry/core/backends/webdriver/webdriver_desktop_browser_finder.py
10
4010
# 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. """Finds desktop browsers that can be controlled by telemetry.""" import logging import os import sys from telemetry.core import browser from telemetry.core...
bsd-3-clause
luispedro/milk
milk/measures/nfoldcrossvalidation.py
2
8162
# -*- coding: utf-8 -*- # Copyright (C) 2008-2011, Luis Pedro Coelho <luis@luispedro.org> # vim: set ts=4 sts=4 sw=4 expandtab smartindent: # LICENSE: MIT from __future__ import division from ..supervised.classifier import normaliselabels import numpy as np from functools import reduce __all__ = ['foldgenerator', 'ge...
mit
behumble/python-epub-builder
examples/pride_and_prejudice.py
6
2237
# -*- coding: utf-8 -*- # Copyright (c) 2012, Bin Tan # This file is distributed under the BSD Licence. See python-epub-builder-license.txt for details. import re import ez_epub def formatParagraph(paragraph): paragraph = paragraph.replace('--', '—') paragraph = re.sub(r' +', ' ', paragraph) p...
bsd-2-clause
brandond/ansible
lib/ansible/modules/network/netvisor/pn_connection_stats_settings.py
14
10672
#!/usr/bin/python # Copyright: (c) 2018, Pluribus Networks # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['...
gpl-3.0
chrisndodge/edx-platform
common/lib/xmodule/xmodule/tests/test_validation.py
83
8741
""" Test xblock/validation.py """ import unittest from xblock.test.tools import assert_raises from xmodule.validation import StudioValidationMessage, StudioValidation from xblock.validation import Validation, ValidationMessage class StudioValidationMessageTest(unittest.TestCase): """ Tests for `ValidationMe...
agpl-3.0
shishaochen/TensorFlow-0.8-Win
tensorflow/python/training/adam_test.py
6
9557
# Copyright 2015 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
manimaul/MX-Cart
BsbScales.py
1
3772
#!/usr/bin/env python # -*- coding: utf-8 -*- from FilePathSearch import RecursiveSearch from os.path import splitext """ Scales in 2011 NOAA BSB Catalog 2500, 3500, 5000, 6000, 6500, 7500, 8000, 10000, 12000, 12500, 15000, 20000, 24000, 25000, 25475, 26420, 30000, 32500, 36481, 38730, 40000, 41275, 42240,...
bsd-2-clause
oostende/dvbapp2-gui-egami
lib/python/Components/Renderer/Picon.py
4
4471
import os, re, unicodedata from Renderer import Renderer from enigma import ePixmap, ePicLoad from Tools.Alternatives import GetWithAlternative from Tools.Directories import pathExists, SCOPE_ACTIVE_SKIN, resolveFilename from Components.Harddisk import harddiskmanager from ServiceReference import ServiceReference sear...
gpl-2.0
renyi533/tensorflow
tensorflow/python/kernel_tests/bitcast_op_test.py
22
2912
# 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
egoldchain/egoldchain-master
test/functional/p2p-mempool.py
35
1252
#!/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. """Test p2p mempool message. Test that nodes are disconnected if they send mempool messages when bloom fi...
mit
caiohamamura/PythonGIS
ArcPy/arcpy_proximidade.py
1
4771
import arcpy, sys, numpy do = int(sys.argv[1]) lastIndex = 0 totalIndexes = 287684 nProcesses = 5 lists = [[3335, 57536],[68009, 115072],[125996, 172608],[179406, 230144],[235461, totalIndexes+1]] doFID = lists[do] fileIndex = '240' midName = 'proximidade/' fragName = '' def useNumpy(pt1, pt2): #The input are two...
gpl-2.0
stephanie-wang/ray
rllib/optimizers/sync_batch_replay_optimizer.py
1
4731
import random import ray from ray.rllib.evaluation.metrics import get_learner_stats from ray.rllib.optimizers.policy_optimizer import PolicyOptimizer from ray.rllib.policy.sample_batch import SampleBatch, DEFAULT_POLICY_ID, \ MultiAgentBatch from ray.rllib.utils.annotations import override from ray.rllib.utils.tim...
apache-2.0
aequitas/CouchPotato
app/controllers/log.py
10
1702
from app import latinToAscii from app.config.cplog import CPLog from app.controllers import BaseController, url, redirect from markupsafe import escape import cherrypy import os import app.config log = CPLog(__name__) file = 'CouchPotato.log' class LogController(BaseController): """ Show some log stuff """ @...
gpl-3.0
mlperf/training_results_v0.7
SIAT/benchmarks/resnet/implementations/tensorflow_close_src/split_tf_record.py
2
1160
import tensorflow as tf import os data_dir = '/data/Datasets/imagenet_TF' new_dir = '/development/h00452838/resnet50_training_padding_eval/data_loader/resnet50/split_eval_data' filename_pattern = os.path.join(data_dir, '%s-*') eval_filenames = sorted(tf.gfile.Glob(filename_pattern % 'validation')) part_num = 0 split...
apache-2.0
rebolinho/liveit.repository
plugin.video.SportsDevil/lib/utils/datetimeUtils.py
4
7096
# -*- coding: utf-8 -*- import time, datetime import re import sys, traceback ####################################### # Time and Date Helpers ####################################### def convDateUtil(timestring, newfrmt='default', in_zone='UTC'): import xbmc try: import json except ImportError: import si...
gpl-2.0
ChillyCider/Tuxemon
docs/conf.py
6
11269
# -*- coding: utf-8 -*- # # tuxemon documentation build configuration file, created by # sphinx-quickstart on Tue Sep 15 18:31:05 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # A...
gpl-3.0
StephenWeber/ansible
lib/ansible/plugins/lookup/dnstxt.py
48
2101
# (c) 2012, Jan-Piet Mens <jpmens(at)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) any later ver...
gpl-3.0
doot/CouchPotatoServer
couchpotato/core/media/movie/providers/automation/letterboxd.py
32
2394
import re from bs4 import BeautifulSoup from couchpotato.core.helpers.variable import tryInt, splitString, removeEmpty from couchpotato.core.logger import CPLog from couchpotato.core.media.movie.providers.automation.base import Automation log = CPLog(__name__) autoload = 'Letterboxd' class Letterboxd(Automation):...
gpl-3.0
phbono/openfisca-web
simulation/utils.py
1
4695
# -*- coding:utf-8 -*- # Copyright © 2011 Clément Schaff, Mahdi Ben Jelloul """ openFisca, Logiciel libre de simulation du système socio-fiscal français Copyright © 2011 Clément Schaff, Mahdi Ben Jelloul This file is part of openFisca. openFisca is free software: you can redistribute it and/or modify it unde...
gpl-3.0
nikpap/inspire-next
inspirehep/modules/records/serializers/bibtex_serializer.py
3
2099
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2016 CERN. # # INSPIRE 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...
gpl-2.0
guewen/OpenUpgrade
openerp/addons/openupgrade_records/model/analysis_wizard.py
16
7679
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module Copyright (C) 2012-2014 OpenUpgrade community # https://launchpad.net/~openupgrade-committers # # Contributors: # Therp BV <http://therp.nl> # ...
agpl-3.0
tgsd96/gargnotes
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/euctwprober.py
2994
1676
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
mit
kevin-brown/drf-nested-viewsets
rest_nested_viewsets/fields.py
1
1567
from rest_framework.serializers import HyperlinkedIdentityField, \ HyperlinkedRelatedField class NestedHyperlinkedField(object): base_obj = None def __init__(self, *args, **kwargs): self.map = kwargs.pop("map", {}) super(NestedHyperlinkedField, self).__init__(*args, **kwargs...
mit
popazerty/openblackhole-SH4
e2reactor.py
13
5292
# enigma2 reactor: based on pollreactor, which is # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """ Maintainer: U{Felix Domke<mailto:tmbinc@elitedvb.net>} """ # System imports import select, errno, sys # Twisted imports from twisted.python import log, failure from twisted.interne...
gpl-2.0
hilbertdu/TurboEngine
Code/External/bgfx/bgfx/3rdparty/glslang/update_glslang_sources.py
10
4918
#!/usr/bin/env python # Copyright 2017 The Glslang 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...
mit
RackSec/ansible
lib/ansible/modules/web_infrastructure/jenkins_script.py
8
6284
#!/usr/bin/python # encoding: utf-8 # (c) 2016, James Hogarth <james.hogarth@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 Li...
gpl-3.0
espressif/esp-idf
examples/bluetooth/nimble/blehr/blehr_test.py
1
4990
#!/usr/bin/env python # # Copyright 2019 Espressif Systems (Shanghai) PTE LTD # # 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
nikste/tensorflow
tensorflow/contrib/lookup/lookup_ops_test.py
14
77704
# 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
chetan51/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_mixed.py
70
3776
from matplotlib._image import frombuffer from matplotlib.backends.backend_agg import RendererAgg class MixedModeRenderer(object): """ A helper class to implement a renderer that switches between vector and raster drawing. An example may be a PDF writer, where most things are drawn with PDF vector comm...
gpl-3.0
xiangke/pycopia
mibs/pycopia/mibs/RFC1381_MIB_OID.py
1
3217
# python # This file is generated by a program (mib2py). import RFC1381_MIB OIDMAP = { '1.3.6.1.2.1.10.16': RFC1381_MIB.lapb, '1.3.6.1.2.1.10.16.5': RFC1381_MIB.lapbProtocolVersion, '1.3.6.1.2.1.10.16.5.1': RFC1381_MIB.lapbProtocolIso7776v1986, '1.3.6.1.2.1.10.16.5.2': RFC1381_MIB.lapbProtocolCcittV1980, '1.3.6.1.2....
lgpl-2.1
maruel/git-hooks-go
presubmit_impl.py
1
8586
#!/usr/bin/env python # Copyright 2014 Marc-Antoine Ruel. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. """Runs complete presubmit checks on this package. Some of these checks are actually not recommended to be run on automate...
apache-2.0
t3dev/odoo
addons/website_theme_install/models/theme_models.py
3
7515
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import logging from odoo import api, fields, models from odoo.tools.translate import xml_translate from odoo.modules.module import get_resource_from_path _logger = logging.getLogger(__name__) class ThemeView(models.Mo...
gpl-3.0
AustereCuriosity/astropy
astropy/units/tests/test_quantity_array_methods.py
1
18468
# The purpose of these tests are to ensure that calling quantities using # array methods returns quantities with the right units, or raises exceptions. import pytest import numpy as np from ... import units as u from ...utils.compat import NUMPY_LT_1_9_1, NUMPY_LT_1_10_4 class TestQuantityArrayCopy(object): """...
bsd-3-clause
maartenq/ansible
lib/ansible/modules/cloud/centurylink/clc_publicip.py
55
11990
#!/usr/bin/python # # Copyright (c) 2015 CenturyLink # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['previe...
gpl-3.0
dplin/woola
woola/users/views.py
57
1696
# -*- coding: utf-8 -*- # Import the reverse lookup function from django.core.urlresolvers import reverse # view imports from django.views.generic import DetailView from django.views.generic import RedirectView from django.views.generic import UpdateView from django.views.generic import ListView # Only authenticated ...
bsd-3-clause
joshowen/django-allauth
allauth/socialaccount/providers/weixin/tests.py
10
1202
# -*- coding: utf-8 -*- from __future__ import unicode_literals from allauth.socialaccount.providers import registry from allauth.socialaccount.tests import create_oauth2_tests from allauth.tests import MockedResponse from .provider import WeixinProvider class WeixinTests(create_oauth2_tests(registry.by_id(WeixinPr...
mit
caneruguz/osf.io
api/preprints/views.py
2
16278
import re from django.db.models import Q from rest_framework import generics from rest_framework.exceptions import NotFound, PermissionDenied, NotAuthenticated from rest_framework import permissions as drf_permissions from framework.auth.oauth_scopes import CoreScopes from osf.models import PreprintService, Identifi...
apache-2.0
GaussDing/django
tests/admin_changelist/admin.py
29
3551
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
wfxiang08/django190
django/utils/baseconv.py
650
2982
# Copyright (c) 2010 Guilherme Gondim. All rights reserved. # Copyright (c) 2009 Simon Willison. All rights reserved. # Copyright (c) 2002 Drew Perttula. All rights reserved. # # License: # Python Software Foundation License version 2 # # See the file "LICENSE" for terms & conditions for usage, and a DISCLAIMER OF # ...
bsd-3-clause
theheros/kbengine
kbe/src/lib/python/Tools/pybench/NewInstances.py
92
1561
from pybench import Test # Check for new-style class support: try: class c(object): pass except NameError: raise ImportError ### class CreateNewInstances(Test): version = 2.0 operations = 3 + 7 + 4 rounds = 60000 def test(self): class c(object): pass cl...
lgpl-3.0
danieldresser/cortex
test/IECore/TGAImageReaderTest.py
12
4972
########################################################################## # # Copyright (c) 2009-2010, Image Engine Design 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: # # * Redis...
bsd-3-clause