repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
kenshay/ImageScript | refs/heads/master | ProgramData/Android/ADB/platform-tools/systrace/catapult/devil/PRESUBMIT.py | 9 | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script for devil.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on the presubmit API built into depot... |
75651/kbengine_cloud | refs/heads/master | kbe/src/lib/python/Lib/email/_policybase.py | 94 | """Policy framework for the email package.
Allows fine grained feature control of how the package parses and emits data.
"""
import abc
from email import header
from email import charset as _charset
from email.utils import _has_surrogates
__all__ = [
'Policy',
'Compat32',
'compat32',
]
class _Polic... |
avneesh91/django | refs/heads/master | django/conf/locale/da/formats.py | 65 | # This file is distributed under the same license as the Django package.
#
# 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'
DATETIME_FORMAT = 'j. F Y H:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMA... |
camillemonchicourt/Geotrek | refs/heads/master | geotrek/tourism/migrations/0003_auto__change_field_datasource_targets.py | 1 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'DataSource.targets'
db.alter_column('t_t_source_donnees... |
OCA/sale-workflow | refs/heads/12.0 | sale_automatic_workflow_payment_mode/models/automatic_workflow_job.py | 1 | # © 2016 Camptocamp SA, Sodexis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
import logging
from odoo import models, api, fields
from odoo.tools.safe_eval import safe_eval
from odoo.addons.sale_automatic_workflow.models.automatic_workflow_job \
import savepoint
_logger = logging.getLogger(_... |
kemalakyol48/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/tkinter/test/runtktests.py | 67 | """
Use this module to get and run all tk tests.
tkinter tests should live in a package inside the directory where this file
lives, like test_tkinter.
Extensions also should live in packages following the same rule as above.
"""
import os
import sys
import unittest
import importlib
import test.support
this_dir_path ... |
sachingupta006/Mezzanine | refs/heads/master | mezzanine/template/__init__.py | 4 |
from functools import wraps
from django import template
from django.template.context import Context
from django.template.loader import get_template, select_template
from mezzanine.utils.device import templates_for_device
class Library(template.Library):
"""
Extends ``django.template.Library`` providing sev... |
hansiu/pathways-analysis | refs/heads/master | command_line/__init__.py | 3 | """This package provides Command Line Interface (CLI) implementation.
If you wish to streamline the CLI or add a new switch or argument,
please go straight to `main.py` module. Helper type definitions
are defined in `types.py`, while magic happens in `parser.py`.
"""
from .main import CLI
|
jeezybrick/django | refs/heads/master | tests/template_tests/filter_tests/test_center.py | 345 | from django.template.defaultfilters import center
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class CenterTests(SimpleTestCase):
@setup({'center01':
'{% autoescape off %}.{{ a|center:"5" }}. .{{ b|center:"5" }}.{% endautoescape %}'})
... |
semonte/intellij-community | refs/heads/master | python/testData/intentions/PyConvertToFStringIntentionTest/formatMethodByteString.py | 31 | b'{}'.format(42) |
cydenix/OpenGLCffi | refs/heads/master | OpenGLCffi/GL/EXT/EXT/window_rectangles.py | 1 | from OpenGLCffi.GL import params
@params(api='gl', prms=['mode', 'count', 'box'])
def glWindowRectanglesEXT(mode, count, box):
pass
|
matplotlib/fcpy | refs/heads/master | examples/fc_match.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
#
# Copyright (c) 2015, Michael Droettboom
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following ... |
andfoy/margffoy-tuay-server | refs/heads/master | env/lib/python2.7/site-packages/requests-2.7.0-py2.7.egg/requests/packages/chardet/eucjpprober.py | 2918 | ######################## 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... |
att-comdev/deckhand | refs/heads/master | deckhand/control/api.py | 1 | # Copyright 2017 AT&T Intellectual Property. All other 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... |
brosner/django-notification | refs/heads/master | notification/__init__.py | 3 | VERSION = (0, 2, 0, "a", 1) # following PEP 386
DEV_N = 4
def get_version():
version = "%s.%s" % (VERSION[0], VERSION[1])
if VERSION[2]:
version = "%s.%s" % (version, VERSION[2])
if VERSION[3] != "f":
version = "%s%s%s" % (version, VERSION[3], VERSION[4])
if DEV_N:
vers... |
modulexcite/blink | refs/heads/nw12 | Tools/Scripts/webkitpy/thirdparty/irc/ircbot.py | 87 | # Copyright (C) 1999--2002 Joel Rosdahl
#
# This library 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 2.1 of the License, or (at your option) any later version.
#
# This library is ... |
izonder/intellij-community | refs/heads/master | plugins/hg4idea/testData/bin/hgext/convert/convcmd.py | 90 | # convcmd - convert extension commands definition
#
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from common import NoRepo, MissingTool, SKIPREV, mapfile
from cvs import conv... |
sparkslabs/kamaelia | refs/heads/master | Sketches/TG/gui/ClassShard.py | 15 | # -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Version 2.0 (the "Lic... |
BadSingleton/pyside2 | refs/heads/master | tests/QtXml/qdomdocument_test.py | 3 | #!/usr/bin/python
import unittest
from PySide2.QtCore import QByteArray
from PySide2.QtXml import QDomDocument, QDomElement
class QDomDocumentTest(unittest.TestCase):
def setUp(self):
self.dom = QDomDocument()
self.goodXmlData = QByteArray('''
<typesystem package="PySide2.QtXml">
... |
bkirui/odoo | refs/heads/8.0 | addons/google_calendar/controllers/__init__.py | 7372 | import main
|
PowerShellEmpire/Empire | refs/heads/master | lib/modules/powershell/persistence/misc/add_sid_history.py | 10 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-Mimikatz Add-SIDHistory',
'Author': ['@JosephBialek', '@gentilkiwi'],
'Description': ("Runs PowerSploit's Invoke-Mimikatz function "
... |
ageron/tensorflow | refs/heads/master | tensorflow/contrib/seq2seq/python/ops/helper.py | 11 | # 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... |
mentosso/pyobd-pi | refs/heads/master | debugEvent.py | 18 | #!/usr/bin/env python
###########################################################################
# obd_sensors.py
#
# Copyright 2004 Donour Sizemore (donour@uchicago.edu)
# Copyright 2009 Secons Ltd. (www.obdtester.com)
#
# This file is part of pyOBD.
#
# pyOBD is free software; you can redistribute it and/or modify
... |
fafaman/django | refs/heads/master | tests/webdesign_tests/tests.py | 251 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.template import Context, Template
from django.test import SimpleTestCase, modify_settings
@modify_settings(INSTALLED_APPS={'append': 'django.contrib.webdesign'})
class WebdesignTest(SimpleTestCase):
def test_lorem_tag(self):
t =... |
hoho/dosido | refs/heads/master | nodejs/deps/v8/tools/testrunner/utils/dump_build_config.py | 11 | # Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Writes a dictionary to a json file with the passed key-value pairs.
Expected to be called like:
dump_build_config.py path/to/file.json [key1=value1 ...... |
daniellawrence/django-vutman | refs/heads/master | tests/test_view.py | 1 | from django.test import TestCase, Client
from vutman.models import EmailAlias, EmailUser, EmailDomain, EmailServer
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
class SimpleTestCase(TestCase):
def setUp(self):
self.client = Client()
self.request_user = Us... |
aashish24/tweepy | refs/heads/master | upload_record.py | 6 | import boto
from boto.s3.key import Key
from os import environ as env
conn = boto.connect_s3()
bucket = conn.get_bucket(env['AWS_BUCKET'])
k = bucket.get_key('record', validate=False)
k.set_contents_from_filename('tests/record.json')
k.set_acl('public-read')
k.close(fast=True)
|
aleonliao/depot_tools | refs/heads/master | third_party/boto/gs/bucketlistresultset.py | 68 | # Copyright 2012 Google Inc.
# 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 ... |
bloyl/mne-python | refs/heads/placeholder | mne/source_space.py | 4 | # Authors: Matti Hämäläinen <msh@nmr.mgh.harvard.edu>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD (3-clause)
# Many of the computations in this code were derived from Matti Hämäläinen's
# C code.
from copy import deepcopy
from functools import partial
from gzip import GzipFile
import ... |
neumerance/deploy | refs/heads/master | .venv/lib/python2.7/site-packages/sphinx/ext/autosummary/generate.py | 5 | # -*- coding: utf-8 -*-
"""
sphinx.ext.autosummary.generate
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Usable as a library or script to generate automatic RST source files for
items referred to in autosummary:: directives.
Each generated RST file contains a single auto*:: directive which
extracts the doc... |
jarshwah/django | refs/heads/master | django/conf/locale/pt_BR/__init__.py | 12133432 | |
gangadhar-kadam/mtn-erpnext | refs/heads/master | buying/report/requested_items_to_be_ordered/__init__.py | 12133432 | |
NicolasHerin/game_book_share | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py | 1843 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Unit tests for the ninja.py file. """
import gyp.generator.ninja as ninja
import unittest
import StringIO
import sys
import TestCommon
... |
CoDEmanX/ArangoDB | refs/heads/devel | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_select.py | 56 | from test import test_support
import unittest
import select
import os
import sys
class SelectTestCase(unittest.TestCase):
class Nope:
pass
class Almost:
def fileno(self):
return 'fileno'
def test_error_conditions(self):
self.assertRaises(TypeError, select.select, 1, 2... |
matmutant/sl4a | refs/heads/master | python/src/Lib/test/test_select.py | 56 | from test import test_support
import unittest
import select
import os
import sys
class SelectTestCase(unittest.TestCase):
class Nope:
pass
class Almost:
def fileno(self):
return 'fileno'
def test_error_conditions(self):
self.assertRaises(TypeError, select.select, 1, 2... |
pizzapanther/Django-Pizza | refs/heads/master | pizza/calendar/urls.py | 1 | from django.conf.urls import patterns, include, url
urlpatterns = patterns('pizza.calendar.views',
url(r'^$', 'events', name='all'),
) |
valexandersaulys/airbnb_kaggle_contest | refs/heads/master | venv/lib/python3.4/site-packages/numpy/polynomial/tests/test_legendre.py | 123 | """Tests for legendre module.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
import numpy.polynomial.legendre as leg
from numpy.polynomial.polynomial import polyval
from numpy.testing import (
TestCase, assert_almost_equal, assert_raises,
assert_equal, assert_, run_mod... |
MountainWei/nova | refs/heads/master | nova/tests/unit/api/openstack/compute/test_extended_virtual_interfaces_net.py | 35 | # Copyright 2013 IBM Corp.
# 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 app... |
thunderace/newtifry | refs/heads/master | appengine/mako/ext/babelplugin.py | 60 | # ext/babelplugin.py
# Copyright (C) 2006-2015 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""gettext message extraction via Babel: http://babel.edgewall.org/"""
from babel.messages.extr... |
ZoranPavlovic/kombu | refs/heads/master | t/unit/transport/test_filesystem.py | 2 | import tempfile
import pytest
import t.skip
from kombu import Connection, Exchange, Queue, Consumer, Producer
@t.skip.if_win32
class test_FilesystemTransport:
def setup(self):
self.channels = set()
try:
data_folder_in = tempfile.mkdtemp()
data_folder_out = tempfile.mkdte... |
yaqiyang/autorest | refs/heads/master | src/client/Python/msrest/msrest/__init__.py | 13 | # --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""),... |
axinging/chromium-crosswalk | refs/heads/master | build/android/pylib/monkey/setup.py | 125 | # 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.
"""Generates test runner factory and tests for monkey tests."""
from pylib.monkey import test_runner
def Setup(test_options):
"""Create and return the t... |
fsb4000/electrum-server | refs/heads/master | scrypt/setup.py | 6 | from distutils.core import setup, Extension
ltc_scrypt_module = Extension('ltc_scrypt',
sources = ['scryptmodule.c',
'scrypt.c'],
include_dirs=['.'])
setup (name = 'ltc_scrypt',
version = '1.0',
descr... |
trevisanj/f311 | refs/heads/master | tests/test_filetypes/test_import_filetypes.py | 1 | import f311.filetypes as ft
def test_import_filetypes():
pass |
alexzatsepin/omim | refs/heads/master | tools/python/booking/download_hotels.py | 1 | #!/usr/bin/env python
import argparse
import datetime
import logging
import os
import statistics
import sys
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor, as_completed
from functools import partial
from multiprocessing.pool import ThreadPool
import math
from eviltransform import... |
mavit/ansible-modules-extras | refs/heads/devel | system/iptables.py | 12 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Linus Unnebäck <linus@folkdatorn.se>
#
# This file is part of Ansible
#
# This module 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... |
louietsai/python-for-android | refs/heads/master | python-modules/twisted/twisted/internet/test/inlinecb_tests.py | 59 | # -*- test-case-name: twisted.internet.test.test_inlinecb -*-
# Copyright (c) 2009-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.internet.defer.inlineCallbacks}.
These tests are defined in a non-C{test_*} module because they are
syntactically invalid on python < 2.5. test_inlin... |
ScifestJoensuu/theater-robot | refs/heads/master | Arduino/libraries/FreeIMU/debug/timing.py | 21 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
time.py - Tests the output coming from an Arduino with FreeIMU for speed.
Load the Arduino with the FreeIMU_serial program.
Copyright (C) 2012 Fabio Varesano <fvaresano@yahoo.it>
Development of this code has been supported by the Department of Computer Science,
Universi... |
jonathan-beard/edx-platform | refs/heads/master | lms/tests.py | 54 | """Tests for the lms module itself."""
import mimetypes
from mock import patch
from django.test import TestCase
from django.core.urlresolvers import reverse
from edxmako import add_lookup, LOOKUP
from lms import startup
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.djan... |
rodrigc/buildbot | refs/heads/master | master/buildbot/reporters/gerrit.py | 2 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
alingse/httpdec | refs/heads/master | httpdec/main.py | 1 | # coding=utf-8
from .decode import decode
import click
from StringIO import StringIO
import pyperclip
import sys
stdin = sys.stdin
stdout = sys.stdout
typed = dict(
h='header',
c='cookie')
types = typed.keys() + typed.values()
def fake_clip():
content = pyperclip.paste()
fin = StringIO(content)
... |
rapilabs/django | refs/heads/master | django/contrib/postgres/aggregates/__init__.py | 625 | from .general import * # NOQA
from .statistics import * # NOQA
|
mohammed-alfatih/servo | refs/heads/master | tests/wpt/web-platform-tests/XMLHttpRequest/resources/auth2/corsenabled.py | 367 | import imp
import os
def main(request, response):
response.headers.set('Access-Control-Allow-Origin', request.headers.get("origin"));
response.headers.set('Access-Control-Allow-Credentials', 'true');
response.headers.set('Access-Control-Allow-Methods', 'GET');
response.headers.set('Access-Control-Allow... |
ns950/calibre | refs/heads/master | src/calibre/spell/dictionary.py | 3 | #!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
import os, glob, shutil, re, sys
from collections import namedtuple, default... |
BaladiDogGames/baladidoggames.github.io | refs/heads/master | mingw/bin/lib/lib2to3/fixes/fix_map.py | 327 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that changes map(F, ...) into list(map(F, ...)) unless there
exists a 'from future_builtins import map' statement in the top-level
namespace.
As a special case, map(None, X) is changed into list(X). (This is
... |
txemi/ansible | refs/heads/devel | lib/ansible/modules/web_infrastructure/ejabberd_user.py | 48 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013, Peter Sprygada <sprygada@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at ... |
gispro/OceanViewer2 | refs/heads/master | app/static/externals/proj4js/tools/mkpjcat.py | 250 | #!/usr/bin/env python
import sys
sys.path.append(".")
import pjjs
resourcesDirectory = "catalogues"
targetDirectory = "../lib/defs"
if len(sys.argv) > 1:
resourcesDirectory = sys.argv[1]
if len(sys.argv) > 2:
targetDirectory = sys.argv[2]
print "Generating Proj4js catalogues."
pjjs.pjcat2js_clean(resource... |
samrose3/eventhunt | refs/heads/master | tests/python/base/test_views.py | 1 | from django.core.urlresolvers import reverse
from django.test import override_settings
from rest_framework import status
from rest_framework.test import APITestCase
from tests.python.accounts.test_models import UserFactory
@override_settings(CELERY_EAGER_PROPAGATES_EXCEPTIONS=True, CELERY_ALWAYS_EAGER=True, BROKER_B... |
leeseuljeong/leeseulstack_neutron | refs/heads/master | neutron/db/securitygroups_db.py | 8 | # Copyright 2012 VMware, 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 a... |
apark263/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/ops/conditional_distribution.py | 120 | # 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... |
City-of-Helsinki/linkedevents | refs/heads/master | events/sql.py | 1 | from django.db import connection
def count_events_for_keywords(keyword_ids=(), all=False):
"""
Get the actual count of events using the given keywords.
:param keyword_ids: set of keyword ids
:type keyword_ids: Iterable[str]
:param all: count all keywords instead
:type all: bool
:return: d... |
reinaH/osf.io | refs/heads/develop2 | website/addons/box/tests/factories.py | 23 | # -*- coding: utf-8 -*-
"""Factory boy factories for the Box addon."""
import mock
from datetime import datetime
from framework.auth import Auth
from factory import SubFactory, Sequence, post_generation
from tests.factories import ModularOdmFactory, UserFactory, ProjectFactory
from website.addons.box.model import (
... |
Belxjander/Kirito | refs/heads/master | Python-3.5.0-main/Lib/ctypes/test/test_frombuffer.py | 14 | from ctypes import *
import array
import gc
import unittest
class X(Structure):
_fields_ = [("c_int", c_int)]
init_called = False
def __init__(self):
self._init_called = True
class Test(unittest.TestCase):
def test_from_buffer(self):
a = array.array("i", range(16))
x = (c_int *... |
vFense/vFenseAgent-nix | refs/heads/development | agent/deps/rpm6/Python-2.7.5/lib/python2.7/encodings/hex_codec.py | 528 | """ Python 'hex_codec' Codec - 2-digit hex content transfer encoding
Unlike most of the other codecs which target Unicode, this codec
will return Python string objects for both encode and decode.
Written by Marc-Andre Lemburg (mal@lemburg.com).
"""
import codecs, binascii
### Codec APIs
def hex_encode(... |
JussiSavola/dupefinder | refs/heads/master | dupekill.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# dupe killer - Jussi Savola 2017
#
# Usage: python dupekiller.py
#
# Disclaimer: If this breaks your files or your system, you can keep all the parts
import sqlite3
import os
import sys
import fnmatch
from os.path import join, getsize, exists
import hashlib
from stat i... |
jgao54/airflow | refs/heads/master | airflow/example_dags/example_branch_operator.py | 6 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
red-hood/calendarserver | refs/heads/trunk | txdav/caldav/datastore/test/test_index_file.py | 1 | ##
# Copyright (c) 2010-2015 Apple 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 l... |
shingonoide/odoo | refs/heads/deverp_8.0 | addons/mrp_repair/wizard/__init__.py | 445 | # -*- 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... |
ProfessionalIT/professionalit-webiste | refs/heads/master | sdk/google_appengine/lib/django-1.3/django/contrib/admin/actions.py | 160 | """
Built-in, globally-available admin actions.
"""
from django import template
from django.core.exceptions import PermissionDenied
from django.contrib.admin import helpers
from django.contrib.admin.util import get_deleted_objects, model_ngettext
from django.db import router
from django.shortcuts import render_to_resp... |
krisdages/ultisnips | refs/heads/master | test/vim_interface.py | 13 | # encoding: utf-8
import os
import re
import shutil
import subprocess
import tempfile
import textwrap
import time
from test.constant import (ARR_D, ARR_L, ARR_R, ARR_U, BS, ESC, PYTHON3,
SEQUENCES)
def wait_until_file_exists(file_path, times=None, interval=0.01):
while times is None o... |
C-Blu/npyscreen | refs/heads/master | build/lib/npyscreen/wgmultiselecttree.py | 15 | from . import wgmultilinetree as multilinetree
from . import wgcheckbox as checkbox
import weakref
class MultiSelectTree(multilinetree.SelectOneTree):
_contained_widgets = checkbox.Checkbox
def set_up_handlers(self):
super(MultiSelectTree, self).set_up_handlers()
self.handlers.update({
... |
kimond/gobgift | refs/heads/master | gobgift/wishlists/forms.py | 1 | from dal import autocomplete
from django import forms
from gobgift.core.forms import CharField
from gobgift.groups.models import ListGroup
from .models import Wishlist
class WishlistForm(autocomplete.FutureModelForm):
name = CharField()
groups = forms.ModelMultipleChoiceField(
queryset=ListGroup.obje... |
jswope00/griffinx | refs/heads/master | lms/djangoapps/mobile_api/video_outlines/views.py | 9 | """
Video Outlines
We only provide the listing view for a video outline, and video outlines are
only displayed at the course level. This is because it makes it a lot easier to
optimize and reason about, and it avoids having to tackle the bigger problem of
general XBlock representation in this rather specialized format... |
havard024/prego | refs/heads/master | crm/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py | 316 | # urllib3/response.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import logging
import zlib
import io
from .exceptions import DecodeError
from .packages.six ... |
Gadal/sympy | refs/heads/master | sympy/diffgeom/tests/__init__.py | 12133432 | |
lz199144/python | refs/heads/master | neo1218/0023/web/tests/__init__.py | 12133432 | |
gjtempleton/moto | refs/heads/master | tests/test_ec2/test_security_groups.py | 4 | from __future__ import unicode_literals
import copy
# Ensure 'assert_raises' context manager support for Python 2.6
import tests.backport_assert_raises # noqa
from nose.tools import assert_raises
import boto3
import boto
from botocore.exceptions import ClientError
from boto.exception import EC2ResponseError
import ... |
foursquare/pants | refs/heads/master | tests/python/pants_test/engine/test_rules.py | 1 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
from builtins import object, str
from textwrap import dedent
from pants.... |
byakuinss/spark | refs/heads/master | examples/src/main/python/ml/onehot_encoder_example.py | 72 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
nitzmahone/ansible-modules-extras | refs/heads/devel | source_control/gitlab_user.py | 23 | #!/usr/bin/python
# (c) 2015, Werner Dijkerman (ikben@werner-dijkerman.nl)
#
# 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... |
hellofreedom/ansible | refs/heads/devel | hacking/module_formatter.py | 68 | #!/usr/bin/env python
# (c) 2012, Jan-Piet Mens <jpmens () gmail.com>
# (c) 2012-2014, Michael DeHaan <michael@ansible.com> and others
#
# 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 So... |
si618/pi-time | refs/heads/master | node_modules/grunt-nose/test/fixtures/virtualenv_exclusive/setup.py | 2 | #!/usr/bin/env python
""" This is a test module to test that virtualenv activation works. """
from setuptools import setup
setup(
name='venv_exclusive',
version='0.1.0',
py_modules=['venv_exclusive'],
)
|
kxliugang/edx-platform | refs/heads/master | common/djangoapps/external_auth/login_and_register.py | 150 | """Intercept login and registration requests.
This module contains legacy code originally from `student.views`.
"""
import re
from django.conf import settings
from django.shortcuts import redirect
from django.core.urlresolvers import reverse
import external_auth.views
from xmodule.modulestore.django import modulesto... |
dagwieers/ansible | refs/heads/devel | test/units/modules/net_tools/nios/test_nios_a_record.py | 59 | # 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 in the hope that ... |
fxia22/ASM_xf | refs/heads/master | PythonD/site_python/twisted/test/test_jelly.py | 2 |
# Twisted, the Framework of Your Internet
# Copyright (C) 2001 Matthew W. Lefkowitz
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in ... |
paulthulstrup/moose | refs/heads/master | python/TestHarness/TestHarness.py | 1 | import os, sys, re, inspect, types, errno, pprint, subprocess, io, shutil, time, copy, unittest
import path_tool
path_tool.activate_module('FactorySystem')
path_tool.activate_module('argparse')
from ParseGetPot import ParseGetPot
from socket import gethostname
#from options import *
from util import *
from RunParalle... |
DANCEcollaborative/forum-xblock | refs/heads/master | XBlock Integration Files/xdjangobb/xblock/lib/python2.7/site-packages/fs/wrapfs/__init__.py | 13 | """
fs.wrapfs
=========
A class for wrapping an existing FS object with additional functionality.
This module provides the class WrapFS, a base class for objects that wrap
another FS object and provide some transformation of its contents. It could
be very useful for implementing e.g. transparent encryption or compre... |
mancoast/CPythonPyc_test | refs/heads/master | fail/321_test_codeop.py | 53 | """
Test cases for codeop.py
Nick Mathewson
"""
import unittest
from test.support import run_unittest, is_jython
from codeop import compile_command, PyCF_DONT_IMPLY_DEDENT
import io
if is_jython:
import sys
def unify_callables(d):
for n,v in d.items():
if hasattr(v, '__call__'):
... |
uclouvain/osis_louvain | refs/heads/master | base/forms/learning_achievement.py | 1 | ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... |
dana-i2cat/felix | refs/heads/master | ofam/src/src/foam/sfa/rspecs/elements/versions/nitosv1Channel.py | 3 | from foam.sfa.util.sfalogging import logger
from foam.sfa.util.xml import XpathFilter
from foam.sfa.util.xrn import Xrn
from foam.sfa.rspecs.elements.element import Element
from foam.sfa.rspecs.elements.node import Node
from foam.sfa.rspecs.elements.sliver import Sliver
from foam.sfa.rspecs.elements.location import Lo... |
mgamer/gyp | refs/heads/master | test/gyp-defines/gyptest-regyp.py | 268 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that when the same value is repeated for a gyp define, duplicates are
stripped from the regeneration rule.
"""
import os
impor... |
CooloiStudio/Report_deskxd_com | refs/heads/master | report_deskxd_com/wsgi.py | 1 | """
WSGI config for report_deskxd_com project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJ... |
cevap/ion | refs/heads/master | test/functional/p2p_pos_doublespend.py | 1 | #!/usr/bin/env python3
# Copyright (c) 2019 The PIVX Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Covers the scenario of a valid PoS block with a valid coinstake transaction where the
coinstake input prevout... |
h3llrais3r/SickRage | refs/heads/master | lib/sqlalchemy/testing/profiling.py | 76 | # testing/profiling.py
# Copyright (C) 2005-2014 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
"""Profiling support for unit and performance tests.
These are special purpose p... |
codasus/django-blogages | refs/heads/master | blogages/libs/djangotoolbox/middleware.py | 85 | from django.conf import settings
from django.http import HttpResponseRedirect
from django.utils.cache import patch_cache_control
LOGIN_REQUIRED_PREFIXES = getattr(settings, 'LOGIN_REQUIRED_PREFIXES', ())
NO_LOGIN_REQUIRED_PREFIXES = getattr(settings, 'NO_LOGIN_REQUIRED_PREFIXES', ())
ALLOWED_DOMAINS = getattr(setting... |
hrjn/scikit-learn | refs/heads/master | sklearn/cluster/tests/test_hierarchical.py | 33 | """
Several basic tests for hierarchical clustering procedures
"""
# Authors: Vincent Michel, 2010, Gael Varoquaux 2012,
# Matteo Visconti di Oleggio Castello 2014
# License: BSD 3 clause
from tempfile import mkdtemp
import shutil
from functools import partial
import numpy as np
from scipy import sparse
from... |
ennoborg/gramps | refs/heads/master | gramps/gui/editors/displaytabs/familyattrembedlist.py | 11 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
#
# 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 you... |
vmthunder/volt | refs/heads/master | volt/tests/test_volt.py | 3 | # -*- coding: utf-8 -*-
# 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, softw... |
cypod/arsenalsuite | refs/heads/master | cpp/lib/sip/build.py | 11 | #!/usr/bin/python
# Copyright (c) 2011 Riverbank Computing Limited <info@riverbankcomputing.com>
#
# This file is part of SIP.
#
# This copy of SIP is licensed for use under the terms of the SIP License
# Agreement. See the file LICENSE for more details.
#
# This copy of SIP may also used under the terms of the GNU G... |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-2.6/Lib/test/test_urlparse.py | 55 | #! /usr/bin/env python
from test import test_support
import unittest
import urlparse
RFC1808_BASE = "http://a/b/c/d;p?q#f"
RFC2396_BASE = "http://a/b/c/d;p?q"
RFC3986_BASE = "http://a/b/c/d;p?q"
# A list of test cases. Each test case is a a two-tuple that contains
# a string with the query and a dictionary with the... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.