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
BryceARich/TransactionsMR
python/src/mapreduce/parameters.py
5
8185
#!/usr/bin/env python # 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 ...
apache-2.0
T-R0D/JustForFun
aoc2016/aoc2016/day10/test/test_solution.py
1
2013
# This file is part of aoc2016. # # aoc2016 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. # # aoc2016 is distributed in the hope th...
gpl-2.0
dmpetrov/dataversioncontrol
dvc/repo/add.py
1
4783
import logging import os import colorama from dvc.dvcfile import Dvcfile, is_dvc_file from ..exceptions import ( OutputDuplicationError, OverlappingOutputPathsError, RecursiveAddingWhileUsingFilename, ) from ..output.base import OutputDoesNotExistError from ..progress import Tqdm from ..repo.scm_context ...
apache-2.0
mcollins12321/anita
venv/lib/python2.7/site-packages/jinja2/filters.py
598
29836
# -*- 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
digimarc/django
tests/syndication_tests/urls.py
236
1027
from django.conf.urls import url from . import feeds urlpatterns = [ url(r'^syndication/rss2/$', feeds.TestRss2Feed()), url(r'^syndication/rss2/guid_ispermalink_true/$', feeds.TestRss2FeedWithGuidIsPermaLinkTrue()), url(r'^syndication/rss2/guid_ispermalink_false/$', feeds.TestRss2FeedWithG...
bsd-3-clause
javierlgroba/Eventer-gapp
django/utils/translation/__init__.py
110
4690
""" Internationalization support. """ from __future__ import unicode_literals from django.utils.encoding import force_text from django.utils.functional import lazy from django.utils import six __all__ = [ 'activate', 'deactivate', 'override', 'deactivate_all', 'get_language', 'get_language_from_request', ...
lgpl-3.0
natefoo/ansible-modules-extras
cloud/rackspace/rax_mon_check.py
153
11151
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
blink1073/scikit-image
skimage/restoration/unwrap.py
23
4720
import numpy as np import warnings from six import string_types from ._unwrap_1d import unwrap_1d from ._unwrap_2d import unwrap_2d from ._unwrap_3d import unwrap_3d def unwrap_phase(image, wrap_around=False, seed=None): '''Recover the original from a wrapped phase image. From an image wrapped to lie in the...
bsd-3-clause
bickfordb/cabinet
tests/adb.py
1
3131
import os import shutil import tempfile import time import unittest from cabinet import adb def assert_eq(left, right, msg="expected %(left)r == %(right)r"): if left != right: raise AssertionError(msg % locals()) class ADBTest(unittest.TestCase): def setUp(self): self.dir = tempfile.mkdtemp()...
lgpl-3.0
Pexego/RMA
__unported__/crm_rma_lot_mass_return/wizard/__init__.py
10
1064
# -*- coding: utf-8 -*- ############################################################################## # # Copyright 2013 Camptocamp # Copyright 2009-2013 Akretion, # Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume # # This program is free software: you can redistribute it and/o...
agpl-3.0
zhreshold/mxnet
tests/python/unittest/test_random.py
2
50305
# 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
gef756/statsmodels
statsmodels/examples/ex_scatter_ellipse.py
39
1367
'''example for grid of scatter plots with probability ellipses Author: Josef Perktold License: BSD-3 ''' from statsmodels.compat.python import lrange import numpy as np import matplotlib.pyplot as plt from statsmodels.graphics.plot_grids import scatter_ellipse nvars = 6 mmean = np.arange(1.,nvars+1)/nvars * 1.5 ...
bsd-3-clause
yencarnacion/jaikuengine
.google_appengine/lib/django-1.5/django/middleware/clickjacking.py
329
1993
""" Clickjacking Protection Middleware. This module provides a middleware that implements protection against a malicious site loading resources from your site in a hidden frame. """ from django.conf import settings class XFrameOptionsMiddleware(object): """ Middleware that sets the X-Frame-Options HTTP heade...
apache-2.0
IndonesiaX/configuration
util/vpc-tools/abbey.py
1
28506
#!/usr/bin/env python -u import sys from argparse import ArgumentParser import time import json import yaml import os import requests try: import boto.ec2 import boto.sqs from boto.vpc import VPCConnection from boto.exception import NoAuthHandlerFound, EC2ResponseError from boto.sqs.message import R...
agpl-3.0
delijati/ultrabot
test/minpwm.py
1
1198
import enc import config import motor import threading import time enc_t = None pwm_range = (50, 90) class EncoderThread(enc.EncoderReader, threading.Thread): def __init__(self): enc.EncoderReader.__init__(self) threading.Thread.__init__(self) def main(): global enc_t enc_t = EncoderTh...
mit
wglass/kiel
kiel/clients/client.py
1
3237
import logging import six from tornado import gen, iostream from kiel.exc import BrokerConnectionError, UnhandledResponseError from kiel.cluster import Cluster log = logging.getLogger(__name__) class Client(object): """ Base class for all client classes. Handles basic cluster management and request s...
apache-2.0
rowinggolfer/openmolar2
src/lib_openmolar/client/qt4/diary/components/diary_schedule_controller.py
1
17767
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### ## ## ## Copyright 2011-2012, Neil Wallace <neil@openmolar.com> ## ## ...
gpl-3.0
yousafsyed/casperjs
bin/Lib/curses/ascii.py
396
2607
"""Constants and membership tests for ASCII characters""" NUL = 0x00 # ^@ SOH = 0x01 # ^A STX = 0x02 # ^B ETX = 0x03 # ^C EOT = 0x04 # ^D ENQ = 0x05 # ^E ACK = 0x06 # ^F BEL = 0x07 # ^G BS = 0x08 # ^H TAB = 0x09 # ^I HT = 0x09 # ^I LF = 0x0a # ^J NL =...
mit
bonitadecker77/python-for-android
python-modules/twisted/twisted/web/test/test_vhost.py
53
4012
# Copyright (c) 2009 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.web.vhost}. """ from twisted.internet.defer import gatherResults from twisted.trial.unittest import TestCase from twisted.web.http import NOT_FOUND from twisted.web.static import Data from twisted.web.vhost import Nam...
apache-2.0
sadmansk/servo
tests/wpt/web-platform-tests/css/tools/w3ctestlib/Suite.py
80
4441
#!/usr/bin/python # CSS Test Suite Manipulation Library # Initial code by fantasai, joint copyright 2010 W3C and Microsoft # Licensed under BSD 3-Clause: <http://www.w3.org/Consortium/Legal/2008/03-bsd-license> import OutputFormats import Utils from Groups import TestGroup, excludeDirs from Sources import SourceTree, ...
mpl-2.0
normtown/SickRage
autoProcessTV/lib/requests/sessions.py
156
24476
# -*- coding: utf-8 -*- """ requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ import os from collections import Mapping from datetime import datetime from .auth import _basic_auth_str from .compat import cookielib, Or...
gpl-3.0
garbled1/ansible
lib/ansible/modules/cloud/rackspace/rax_mon_notification.py
29
5164
#!/usr/bin/python # Copyright: 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
jmcarp/django
django/conf/locale/__init__.py
294
11881
# -*- encoding: utf-8 -*- from __future__ import unicode_literals """ LANG_INFO is a dictionary structure to provide meta information about languages. About name_local: capitalize it as if your language name was appearing inside a sentence in your language. The 'fallback' key can be used to specify a special fallback...
bsd-3-clause
zubair-arbi/edx-platform
lms/djangoapps/certificates/migrations/0005_auto__add_field_generatedcertificate_name.py
188
7270
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'GeneratedCertificate.name' db.add_column('certificates_generatedcertificate', 'name', self.gf('dj...
agpl-3.0
micahkim23/Conference-Organization-App
utils.py
384
1576
import json import os import time import uuid from google.appengine.api import urlfetch from models import Profile def getUserId(user, id_type="email"): if id_type == "email": return user.email() if id_type == "oauth": """A workaround implementation for getting userid.""" auth = os.ge...
apache-2.0
DarthMaulware/EquationGroupLeaks
Leak #5 - Lost In Translation/windows/Resources/Ops/PyScripts/lib/ops/survey/usbhistory.py
1
1880
import dsz import ops import ops.env import ops.survey import ops.system.registry from ops.pprint import pprint from optparse import OptionParser import os.path import datetime import traceback ONE_DAY = 86400 def main(): parser = OptionParser() parser.add_option('--maxage', dest='maxage', default=ONE_DAY, he...
unlicense
lxml/lxml
src/lxml/html/tests/test_frames.py
20
1557
import unittest, sys from lxml.tests.common_imports import make_doctest, doctest import lxml.html from lxml.html import html_parser, XHTML_NAMESPACE class FrameTest(unittest.TestCase): def test_parse_fragments_fromstring(self): parser = lxml.html.HTMLParser(encoding='utf-8', remove_comments=True) ...
bsd-3-clause
olivierverdier/sfepy
doc/sphinxext/ipython_console_highlighting.py
13
2758
from pygments.lexer import Lexer, do_insertions from pygments.lexers.agile import PythonConsoleLexer, PythonLexer, \ PythonTracebackLexer from pygments.token import Comment, Generic from sphinx import highlighting import re line_re = re.compile('.*?\n') class IPythonConsoleLexer(Lexer): """ For IPython co...
bsd-3-clause
siebenmann/exim-attachment-logger
alogger.py
1
23812
#!/usr/bin/python3 # # Log information about attachments received in email messages. # Arguments are: # $message_exim_id $mime_content_type $mime_content_disposition $mime_filename $mime_decoded_filename # # $mime_decoded_filename is the actual decoded on-disk file to scan. # # This is invoked from the Exim MIME ...
gpl-3.0
glatard/nipype
nipype/workflows/dmri/fsl/tbss.py
8
23980
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: import os from warnings import warn import nipype.pipeline.engine as pe import nipype.interfaces.utility as util import nipype.interfaces.fsl as fsl def tbss1_op_string(in_files): import nibabel as ...
bsd-3-clause
newerthcom/savagerebirth
libs/python-2.72/Lib/lib2to3/fixes/fix_imports.py
326
5693
"""Fix incompatible imports and module references.""" # Authors: Collin Winter, Nick Edds # Local imports from .. import fixer_base from ..fixer_util import Name, attr_chain MAPPING = {'StringIO': 'io', 'cStringIO': 'io', 'cPickle': 'pickle', '__builtin__' : 'builtins', 'c...
gpl-2.0
coreynicholson/youtube-dl
youtube_dl/extractor/viidea.py
28
7076
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urlparse, compat_str, ) from ..utils import ( parse_duration, js_to_json, parse_iso8601, ) class ViideaIE(InfoExtractor): _VALID_URL = r'''(?x)https?://(?:www\.)?(?: ...
unlicense
spl0k/supysonic
tests/frontend/test_playlist.py
1
4186
# This file is part of Supysonic. # Supysonic is a Python implementation of the Subsonic server API. # # Copyright (C) 2017-2018 Alban 'spl0k' Féron # # Distributed under terms of the GNU AGPLv3 license. import unittest import uuid from pony.orm import db_session from supysonic.db import Folder, Artist, Album, Track...
agpl-3.0
PhloxAR/math3
math3/tests/objects/test_vector3.py
1
8910
from __future__ import absolute_import try: import unittest2 as unittest except: import unittest import numpy as np from math3.objects.matrix3 import Matrix3 from math3.objects.matrix4 import Matrix4 from math3.objects.quaternion import Quaternion from math3.objects.vector3 import Vector3 from math3.objects.vec...
bsd-3-clause
vasyarv/edx-platform
lms/envs/sauce.py
116
2389
""" This config file extends the test environment configuration so that we can run the lettuce acceptance tests on SauceLabs. """ # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files # pylint: disable=wildcard-import, unused-wildcard-import from sel...
agpl-3.0
leighpauls/k2cro4
third_party/python_26/Lib/encodings/cp862.py
593
33626
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP862.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
bsd-3-clause
vaygr/ansible
test/units/modules/network/dellos6/test_dellos6_command.py
46
4315
# (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
gpl-3.0
Obihoernchen/RocketMap
pogom/proxy.py
16
6759
#!/usr/bin/python # -*- coding: utf-8 -*- import logging import requests import sys import time from queue import Queue from threading import Thread from random import randint log = logging.getLogger(__name__) # Last used proxy for round-robin. last_proxy = -1 # Proxy check result constants. check_result_ok = 0 ch...
agpl-3.0
ucldc/harvester
scripts/queue_delete_couchdb_collection.py
3
3914
#! /bin/env python # -*- coding: utf-8 -*- import sys import logbook from harvester.config import config as config_harvest from redis import Redis from rq import Queue JOB_TIMEOUT = 28800 # 8 hrs def def_args(): import argparse parser = argparse.ArgumentParser(description='Harvest a collection') parser.a...
bsd-3-clause
pawelmhm/scrapy
scrapy/logformatter.py
6
5330
import os import logging from twisted.python.failure import Failure from scrapy.utils.request import referer_str SCRAPEDMSG = "Scraped from %(src)s" + os.linesep + "%(item)s" DROPPEDMSG = "Dropped: %(exception)s" + os.linesep + "%(item)s" CRAWLEDMSG = "Crawled (%(status)s) %(request)s%(request_flags)s (referer: %(re...
bsd-3-clause
atlashealth/ansible
test/units/plugins/test_plugins.py
137
2968
# (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
AyoubBelhadji/random_matrix_factorization
setup.py
1
4025
"""A setuptools based setup module. See: """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.joi...
mit
Scarygami/gae-gcs-push2deploy-secrets
lib/werkzeug/wsgi.py
312
37386
# -*- coding: utf-8 -*- """ werkzeug.wsgi ~~~~~~~~~~~~~ This module implements WSGI related helpers. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import os import sys import posixpath import mimetypes from itert...
apache-2.0
ericpre/hyperspy
hyperspy/tests/signals/test_binned.py
2
2118
# -*- coding: utf-8 -*- # Copyright 2007-2021 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
gpl-3.0
dmacd/FB-try1
uwsgi/setup_nginx.py
5
1133
import subprocess import multiprocessing import os bin_dir = os.path.expanduser('~/FrameworkBenchmarks/installs/py2/bin') config_dir = os.path.expanduser('~/FrameworkBenchmarks/config') NCPU = multiprocessing.cpu_count() def start(args, logfile, errfile): try: subprocess.check_call('sudo /usr/local/nginx/...
bsd-3-clause
PLyczkowski/Sticky-Keymap
2.74/python/lib/site-packages/numpy/distutils/fcompiler/vast.py
184
1775
from __future__ import division, absolute_import, print_function import os from numpy.distutils.fcompiler.gnu import GnuFCompiler compilers = ['VastFCompiler'] class VastFCompiler(GnuFCompiler): compiler_type = 'vast' compiler_aliases = () description = 'Pacific-Sierra Research Fortran 90 Compiler' ...
gpl-2.0
makhomed/fabrix
tests/test_render.py
1
4024
from conftest import abort from fabric.api import env from fabrix.api import render_template, render, read_config def test_render_template(tmpdir, monkeypatch): fabfile_dir = tmpdir templates_dir = fabfile_dir.mkdir("templates") template_file = templates_dir.join("hello.txt.j2") template_file.write("H...
gpl-3.0
googleapis/googleapis-gen
google/cloud/gaming/v1beta/gaming-v1beta-py/google/cloud/gaming_v1beta/services/realms_service/client.py
1
36264
# -*- 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
yvaucher/stock-logistics-transport
sale_transport_multi_address/__openerp__.py
1
1361
# -*- coding: utf-8 -*- # # # Author: Alexandre Fayolle # Copyright 2015 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # Licens...
agpl-3.0
kdmitrieva16/python_training
test/test_contact_info.py
1
2511
import re from model.contact import Contact from random import randrange def test_contact_info_on_home_page(app): index=randrange(len(app.contact.get_contact_list())) contact_from_home_page=app.contact.get_contact_list()[index] contact_from_edit_page=app.contact.get_contact_info_from_edit_page(index) ...
apache-2.0
ar45/django
tests/template_tests/syntax_tests/test_verbatim.py
521
1658
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import setup class VerbatimTagTests(SimpleTestCase): @setup({'verbatim-tag01': '{% verbatim %}{{bare }}{% endverbatim %}'}) def test_verbatim_tag01(self): output = self.engine.render_to_string('verb...
bsd-3-clause
danieljaouen/ansible
lib/ansible/modules/cloud/cloudstack/cs_network_acl_rule.py
39
14421
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2017, René Moser <mail@renemoser.net> # # 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 Lice...
gpl-3.0
andresguisado/andresguisado.github.io
node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/_luabuiltins.py
275
6863
# -*- coding: utf-8 -*- """ pygments.lexers._luabuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This file contains the names and modules of lua functions It is able to re-generate itself, but for adding new functions you probably have to add some callbacks (see function module_callbacks). Do not edit th...
mit
jaywink/federation
federation/entities/activitypub/entities.py
2
12890
import logging import uuid from typing import Dict, List import bleach from federation.entities.activitypub.constants import ( CONTEXTS_DEFAULT, CONTEXT_MANUALLY_APPROVES_FOLLOWERS, CONTEXT_SENSITIVE, CONTEXT_HASHTAG, CONTEXT_LD_SIGNATURES, CONTEXT_DIASPORA) from federation.entities.activitypub.enums import A...
bsd-3-clause
dmwu/sparrow
deploy/third_party/boto-2.1.1/boto/services/result.py
25
5617
#!/usr/bin/env python # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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 rig...
apache-2.0
Joergen/zamboni
mkt/search/tests/test_filters.py
1
5501
import json import test_utils from nose.tools import ok_ from django.contrib.auth.models import AnonymousUser import amo from addons.models import Category from mkt import regions from mkt.api.tests.test_oauth import BaseOAuth from mkt.regions import set_region from mkt.reviewers.forms import ApiReviewersSearchForm...
bsd-3-clause
slevenhagen/odoo
addons/resource/__openerp__.py
261
1941
# -*- 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 GNU...
agpl-3.0
paulmueller/PyCorrFit
pycorrfit/gui/tools/plotexport.py
2
2187
"""Module tools - plotexport: Let the user create nice plots""" import wx class Tool(wx.Frame): # This tool is derived from a wx.frame. def __init__(self, parent): # parent is the main frame of PyCorrFit self.parent = parent # Get the window positioning correctly pos = self.par...
gpl-2.0
rryan/django-cms
cms/utils/copy_plugins.py
43
1621
# -*- coding: utf-8 -*- from django.utils.six.moves import zip def copy_plugins_to(old_plugins, to_placeholder, to_language=None, parent_plugin_id=None, no_signals=False): """ Copies a list of plugins to a placeholder to a language. """ # TODO: Refactor this and copy_plugins to cle...
bsd-3-clause
KevinXuxuxu/datahub_lsems
src/api/rest/handler.py
3
5521
import hashlib from account.manager import * from core.db.connection import DataHubConnection from core.db.manager import DataHubManager from datahub import DataHub from datahub.constants import * from datahub.account.constants import * ''' @author: anant bhardwaj @date: Oct 9, 2013 DataHub Handler ''' # TODO: thi...
mit
spirrello/spirrello-pynet-work
applied_python/lib/python2.7/site-packages/pylint/test/unittest_checker_base.py
3
10851
"""Unittest for the base checker.""" import re import unittest import astroid from astroid import test_utils from pylint.checkers import base from pylint.testutils import CheckerTestCase, Message, set_config class DocstringTest(CheckerTestCase): CHECKER_CLASS = base.DocStringChecker def test_missing_docstr...
gpl-3.0
uhuramedia/django-experiments
experiments/templatetags/experiment_helpers.py
4
1648
try: from django.template import base as template_base except ImportError: from django import template as template_base register = template_base.Library() def raw(parser, token): # Whatever is between {% raw %} and {% endraw %} will be preserved as # raw, unrendered template code. text = [] pa...
mit
ehashman/oh-mainline
vendor/packages/Jinja2/jinja2/testsuite/filters.py
394
19169
# -*- coding: utf-8 -*- """ jinja2.testsuite.filters ~~~~~~~~~~~~~~~~~~~~~~~~ Tests for the jinja filters. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Markup, Environment fro...
agpl-3.0
Voluntarynet/BitmessageKit
BitmessageKit/Vendor/static-python/Lib/anydbm.py
253
2663
"""Generic interface to all dbm clones. Instead of import dbm d = dbm.open(file, 'w', 0666) use import anydbm d = anydbm.open(file, 'w') The returned object is a dbhash, gdbm, dbm or dumbdbm object, dependent on the type of database being opened (determined by whichdb module) in the...
mit
leonardowolf/bookfree
flask/lib/python2.7/site-packages/sqlalchemy/orm/path_registry.py
55
8370
# orm/path_registry.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 """Path tracking utilities, representing mapper graph traversals. """ from .. ...
mit
chinnurtb/bigcouch
couchjs/scons/scons-local-2.0.1/SCons/compat/_scons_sets.py
186
19253
"""Classes to represent arbitrary sets (including sets of sets). This module implements sets using dictionaries whose values are ignored. The usual operations (union, intersection, deletion, etc.) are provided as both methods and operators. Important: sets are not sequences! While they support 'x in s', 'len(s)', a...
apache-2.0
cloudera/hue
desktop/core/ext-py/docutils-0.14/test/test_error_reporting.py
3
12025
#! /usr/bin/env python # .. coding: utf-8 # $Id: test_error_reporting.py 7723 2013-09-28 09:17:07Z milde $ # Author: Günter Milde <milde@users.sourceforge.net> # Copyright: This module has been placed in the public domain. """ Test `EnvironmentError` reporting. In some locales, the `errstr` argument of IOError and OS...
apache-2.0
tima/ansible
lib/ansible/modules/cloud/ovirt/ovirt_datacenter.py
56
7980
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or #...
gpl-3.0
rblalock/titanium_mobile
support/module/module.py
34
13545
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Module Project Create Script # import os, sys, shutil, string, uuid, re, zipfile, glob from string import capitalize from StringIO import StringIO from datetime import date template_dir = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename)) sdk_dir =...
apache-2.0
vitiral/micropython
tests/basics/syntaxerror.py
8
2556
# test syntax errors def test_syntax(code): try: exec(code) print("no SyntaxError") except IndentationError: print("IndentationError") except SyntaxError: print("SyntaxError") # non-newline after line-continuation character (lexer error) test_syntax("a \\a\n") # dedent mis...
mit
applephil/headlyne
venv/lib/python2.7/site-packages/setuptools/tests/test_easy_install.py
111
15710
"""Easy install Tests """ import sys import os import shutil import tempfile import unittest import site import contextlib import textwrap import tarfile import logging import distutils.core from setuptools.compat import StringIO, BytesIO, next, urlparse from setuptools.sandbox import run_setup, SandboxViolation from ...
apache-2.0
zploskey/servo
tests/wpt/css-tests/tools/pytest/testing/python/fixture.py
169
87228
from textwrap import dedent import _pytest._code import pytest import sys from _pytest import python as funcargs from _pytest.pytester import get_public_names from _pytest.python import FixtureLookupError def test_getfuncargnames(): def f(): pass assert not funcargs.getfuncargnames(f) def g(arg): pass ...
mpl-2.0
rnyberg/pyfibot
pyfibot/modules/available/module_rss.py
2
17215
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Parse RSS feeds and display new entries on channel @author Henri 'fgeek' Salo <henri@nerv.fi>, Tomi 'dmc' Nykänen, Riku 'Shrike' Lindblad @copyright Copyright (c) 2010-2013 pyfibot developers @licence BSD Possible output syntax: 0 == feed_title: title - url 1...
bsd-3-clause
kumarshivam675/Mobile10X-Hack
sidd/virtualenv-14.0.6/flask/lib/python2.7/site-packages/pip/_vendor/cachecontrol/filewrapper.py
619
2168
from io import BytesIO class CallbackFileWrapper(object): """ Small wrapper around a fp object which will tee everything read into a buffer, and when that file is closed it will execute a callback with the contents of that buffer. All attributes are proxied to the underlying file object. Thi...
gpl-3.0
WangKaimin/sublime-evernote
lib/pygments/styles/autumn.py
135
2144
# -*- coding: utf-8 -*- """ pygments.styles.autumn ~~~~~~~~~~~~~~~~~~~~~~ A colorful style, inspired by the terminal highlighting style. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.to...
mit
coreynicholson/youtube-dl
youtube_dl/extractor/twentymin.py
25
2855
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, try_get, ) class TwentyMinutenIE(InfoExtractor): IE_NAME = '20min' _VALID_URL = r'''(?x) https?:// (?:www\.)?20min\.ch/ ...
unlicense
xxshutong/openerp-7.0
openerp/addons/mail/mail_message.py
20
48518
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
jirikuncar/invenio
invenio/modules/communities/testsuite/test_featured_community.py
12
2975
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later...
gpl-2.0
tlakshman26/cinder-new-branch
cinder/tests/unit/fake_vmem_client.py
23
1779
# Copyright 2014 Violin Memory, 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 requi...
apache-2.0
Ernestyj/LeetCode
Python/FindMedianFromDataStream.py
1
2972
# /**Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle value. # Examples: [2,3,4] , the median is 3 # [2,3], the median is (2 + 3) / 2 = 2.5 # # Design a data structure that supports the following two operat...
gpl-3.0
rajashreer7/autotest-client-tests
linux-tools/logrotate/logrotate.py
4
1153
#!/bin/python import os, subprocess import logging from autotest.client import test from autotest.client.shared import error class logrotate(test.test): """ Autotest module for testing basic functionality of logrotate @author Manoj Iyer """ version = 1 nfail = 0 path = '' def in...
gpl-2.0
nirvn/QGIS
tests/src/python/test_provider_virtual.py
4
42114
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsVirtualLayerProvider .. note:: 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...
gpl-2.0
wbsavage/shinken
shinken/modules/nsca.py
1
8249
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2009-2012: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel, h.goebel@goebel-consult.de # # This file is part of Shinken. # # Shinken is free software: you can redis...
agpl-3.0
40223144/w16b_test
ref/pybean.py
562
8617
#coding: utf-8 import sqlite3 from pkg_resources import parse_version __version__ = "0.2.1" __author__ = "Mickael Desfrenes" __email__ = "desfrenes@gmail.com" # Yen 2013.04.08, 將 Python2 的 .next() 改為 next(), 以便在 Python 3 中使用 class SQLiteWriter(object): """ In frozen mode (the default), the writer will not a...
agpl-3.0
pythonbyexample/PBE
chapter01/mines.py
1
1118
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- import sys from random import randint from time import sleep from utils import TextInput, nl, first from mines_lib import MinesBoard, Mines, Tile size = 6, 6 num_mines = randint(4, 8) mark_key = 'm' padding = 2, 1 class BasicInterface(object): def ru...
bsd-3-clause
eckucukoglu/arm-linux-gnueabihf
lib/python2.7/cProfile.py
169
6515
#! /usr/bin/env python """Python interface for the 'lsprof' profiler. Compatible with the 'profile' module. """ __all__ = ["run", "runctx", "help", "Profile"] import _lsprof # ____________________________________________________________ # Simple interface def run(statement, filename=None, sort=-1): """Run s...
gpl-2.0
palmerjh/iEBE
PlayGround/job-1/iSS/for_paraview/lib/StructuredGrid.py
9
2348
#!/usr/bin/env python """ StructuredGrid """ """ Copyright 2001 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the LGPL. See http://www.fsf.org NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. ...
gpl-3.0
SOKP/kernel_samsung_hlte
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
ChronoMonochrome/android_external_chromium_org
native_client_sdk/src/tools/getos.py
23
8176
#!/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. """Determine OS and various other system properties. Determine the name of the platform used and other system properties such as t...
bsd-3-clause
rvmoura96/projeto-almoxarifado
myvenv/Lib/encodings/cp864.py
272
33663
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP864.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
mit
googleapis/python-aiplatform
google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/transports/base.py
1
7963
# -*- 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
mpare002/HackTech_2017
env/Lib/encodings/koi8_r.py
593
14035
""" Python Character Mapping Codec koi8_r generated from 'MAPPINGS/VENDORS/MISC/KOI8-R.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors...
mit
tangyiyong/git
contrib/svn-fe/svnrdump_sim.py
328
2044
#!/usr/bin/python """ Simulates svnrdump by replaying an existing dump from a file, taking care of the specified revision range. To simulate incremental imports the environment variable SVNRMAX can be set to the highest revision that should be available. """ import sys import os if sys.hexversion < 0x02040000: # T...
gpl-2.0
bright-pan/rt-thread
components/external/freetype/src/tools/docmaker/formatter.py
515
4962
# Formatter (c) 2002, 2004, 2007, 2008 David Turner <david@freetype.org> # from sources import * from content import * from utils import * # This is the base Formatter class. Its purpose is to convert # a content processor's data into specific documents (i.e., table of # contents, global index, and individual API...
gpl-2.0
SMMAR11/smmarbsence
app/views/index.py
1
4466
# coding: utf-8 ''' Affichage de la page principale ou traitement d'une requête quelconque _req : Objet "requête" ''' def index(_req) : # Imports from app.apps import AppConfig from app.forms.index import Authentifier from app.functions import get_menu from app.functions import init_fm from app.functions import...
gpl-3.0
sahiljain/catapult
third_party/Paste/paste/util/finddata.py
50
3815
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php # Note: you may want to copy this into your setup.py file verbatim, as # you can't import this from another package, when you don't know if # that pack...
bsd-3-clause
bruab/Bashy_Prototype
test/mission_tests.py
1
1073
#!/usr/bin/env python import unittest from mock import Mock from src.missions import * class TestMission(unittest.TestCase): def setUp(self): self.mission = Mission() def test_mission_1(self): mission1 = Mission1() mock_ctrlr = Mock() mock_ctrlr.get_last_n_commands.return_v...
mit
MTASZTAKI/ApertusVR
plugins/physics/bulletPhysics/3rdParty/bullet3/examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur_trotting_env.py
4
12757
"""Implements the gym environment of minitaur moving with trotting style. """ import math from gym import spaces import numpy as np from pybullet_envs.minitaur.envs import minitaur_gym_env # TODO(tingnan): These constants should be moved to minitaur/minitaur_gym_env. NUM_LEGS = 4 NUM_MOTORS = 2 * NUM_LEGS class Min...
mit
biolab/orange3-imageanalytics
orangecontrib/imageanalytics/widgets/owimageviewer.py
1
51787
""" Image Viewer Widget ------------------- """ import sys import os import weakref import logging import enum import itertools import io from xml.sax.saxutils import escape from collections import namedtuple from functools import partial from itertools import zip_longest from concurrent.futures import Future from con...
gpl-3.0
tornadozou/tensorflow
tensorflow/contrib/tensor_forest/hybrid/python/layers/decisions_to_data_test.py
158
2506
# 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