repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
kenshinthebattosai/readthedocs.org
refs/heads/master
readthedocs/donate/forms.py
39
import logging from django import forms from django.conf import settings from django.utils.translation import ugettext_lazy as _ import stripe from .models import Supporter log = logging.getLogger(__name__) class SupporterForm(forms.ModelForm): class Meta: model = Supporter fields = ( ...
bryanph/OIPA
refs/heads/develop
OIPA/task_queue/admin.py
4
from django.contrib import admin from iati.models import Activity, Organisation from django.conf.urls import patterns from iati.management.commands.total_budget_updater import TotalBudgetUpdater from iati.management.commands.organisation_name_updater import OrganisationNameUpdater from django.http import HttpResponse ...
sadaf2605/django
refs/heads/master
tests/admin_scripts/app_waiting_migration/migrations/0001_initial.py
64
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Bar', fields=[ ('id', models.AutoField(auto_created...
harshita-gupta/Harvard-FRSEM-Catalog-2016-17
refs/heads/master
flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py
501
'''SSL with SNI_-support for Python 2. Follow these instructions if you would like to verify SSL certificates in Python 2. Note, the default libraries do *not* do certificate checking; you need to do additional work to validate certificates yourself. This needs the following packages installed: * pyOpenSSL (tested wi...
pczerkas/tempest
refs/heads/master
tempest/services/database/json/versions_client.py
8
# Copyright 2014 OpenStack Foundation # 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 requ...
RealTimeWeb/blockly
refs/heads/master
build.py
1
#!/usr/bin/python2.7 # Compresses the core Blockly files into a single JavaScript file. # # Copyright 2012 Google Inc. # https://developers.google.com/blockly/ # # 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 o...
zstackorg/zstack-woodpecker
refs/heads/master
integrationtest/vm/vm_password/test_nml_acct_enable_img_chg_vm_passwd.py
2
''' test for changing password by normal account after executing enable image @author: SyZhao ''' import apibinding.inventory as inventory import hashlib import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.operations.vm_operations as vm_ops impo...
Yutani2000/hashtaglilparis
refs/heads/master
test-infra/s3_cache.py
2166
#!/usr/bin/env python2.7 # pylint: disable=C0301 from __future__ import absolute_import, unicode_literals, print_function, division from sys import argv from os import environ, stat, chdir, remove as _delete_file from os.path import dirname, basename, abspath, realpath, expandvars from hashlib import sha256 from subpr...
evhub/python
refs/heads/master
src/cython.py
2
## INFO ######################################################################## ## ## ## Python and Cython Syntax Highlighters ## ## ===================================== ...
Netflix/lemur
refs/heads/master
lemur/migrations/versions/a02a678ddc25_.py
1
"""Adds support for rotation policies. Creates a default rotation policy (30 days) with the name 'default' ensures that all existing certificates use the default policy. Revision ID: a02a678ddc25 Revises: 8ae67285ff14 Create Date: 2017-07-12 11:45:49.257927 """ # revision identifiers, used by Alembic. revision = "a0...
jonntd/oyprojectmanager
refs/heads/master
tests/ui/test_ui_utils.py
3
# -*- coding: utf-8 -*- # Copyright (c) 2009-2012, Erkan Ozgur Yilmaz # # This module is part of oyProjectManager and is released under the BSD 2 # License: http://www.opensource.org/licenses/BSD-2-Clause import os import shutil import tempfile import unittest import sys from oyProjectManager import conf, db from oyPr...
spyder-ide/qtpy
refs/heads/master
qtpy/tests/test_qtquickwidgets.py
6
from __future__ import absolute_import import pytest from qtpy import PYQT5, PYSIDE2 @pytest.mark.skipif(not (PYQT5 or PYSIDE2), reason="Only available in Qt5 bindings") def test_qtquickwidgets(): """Test the qtpy.QtQuickWidgets namespace""" from qtpy import QtQuickWidgets assert QtQuickWidgets.QQuickWidg...
TheTypoMaster/asuswrt
refs/heads/master
release/src/router/samba3/source/stf/unicodenames.py
55
#! /usr/bin/python # Copyright (C) 2003 by Martin Pool <mbp@samba.org> # # 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 versio...
javazquez/vertx-web
refs/heads/master
src/test/sockjs-protocol/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py
2359
"""The match_hostname() function from Python 3.3.3, essential when using SSL.""" # Note: This file is under the PSF license as the code comes from the python # stdlib. http://docs.python.org/3/license.html import re __version__ = '3.4.0.2' class CertificateError(ValueError): pass def _dnsname_match(dn, host...
pingpangkuangmo/zookeeper
refs/heads/trunk
src/contrib/rest/src/python/zkrest.py
115
# 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 ...
afaulconbridge/PyAChemKit
refs/heads/master
achemkit/reactionnetdot_test.py
1
""" This is the test harness for :py:mod:`achemkit.reactionnetdot`. """ import unittest from achemkit import ReactionNetwork, net_to_dot class TestReactionNetworkDot(unittest.TestCase): """ This is the main class to test ReactionNetwork class. It relies on setUp to generate a ReactionNetwork insta...
skarlekar/chehara
refs/heads/master
urllib3/connectionpool.py
94
from __future__ import absolute_import import errno import logging import sys import warnings from socket import error as SocketError, timeout as SocketTimeout import socket from .exceptions import ( ClosedPoolError, ProtocolError, EmptyPoolError, HeaderParsingError, HostChangedError, Locatio...
sarahgrogan/scikit-learn
refs/heads/master
examples/applications/plot_outlier_detection_housing.py
243
""" ==================================== Outlier detection on a real data set ==================================== This example illustrates the need for robust covariance estimation on a real data set. It is useful both for outlier detection and for a better understanding of the data structure. We selected two sets o...
jolyonb/edx-platform
refs/heads/master
openedx/core/djangoapps/content/block_structure/admin.py
2
""" Django Admin for Block Structures. """ from __future__ import absolute_import from config_models.admin import ConfigurationModelAdmin from django.contrib import admin from .config.models import BlockStructureConfiguration class BlockStructureAdmin(ConfigurationModelAdmin): """ Configuration Admin for Bl...
rao1219/Vedio
refs/heads/master
node_modules/aglio/node_modules/drafter/node_modules/protagonist/drafter/ext/snowcrash/tools/gyp/PRESUBMIT.py
496
# 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. """Top-level presubmit script for GYP. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmit API built...
dturner-tw/pants
refs/heads/master
src/python/pants/base/build_environment.py
2
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging impor...
PatKayongo/patkayongo.github.io
refs/heads/master
node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/styles/friendly.py
364
# -*- coding: utf-8 -*- """ pygments.styles.friendly ~~~~~~~~~~~~~~~~~~~~~~~~ A modern style based on the VIM pyte theme. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyw...
cobalys/django
refs/heads/master
django/contrib/gis/gdal/tests/test_ds.py
14
import os import unittest from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, OGRException, OGRIndexError, GDAL_VERSION from django.contrib.gis.gdal.field import OFTReal, OFTInteger, OFTString from django.contrib.gis.geometry.test_data import get_ds_file, TestDS, TEST_DATA # List of acceptable data ...
pexip/os-pytest
refs/heads/master
doc/en/example/py2py3/test_py2.py
229
def test_exception_syntax(): try: 0/0 except ZeroDivisionError, e: pass
7kbird/chrome
refs/heads/master
chrome/common/extensions/docs/server2/jsc_view.py
3
# 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. from copy import copy import logging import posixpath from api_models import GetNodeCategories from api_schema_graph import APINodeCursor from docs_server_u...
golismero/golismero
refs/heads/master
tools/sqlmap/lib/techniques/union/test.py
8
#!/usr/bin/env python """ Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import random import re from lib.core.agent import agent from lib.core.common import average from lib.core.common import Backend from lib.core.common import isNullValue from ...
karimbahgat/PythonGis
refs/heads/master
upload.py
1
import pipy packpath = "pythongis" pipy.define_upload(packpath, author="Karim Bahgat", author_email="karim.bahgat.norway@gmail.com", license="MIT", name="PythonGIS", changes=["Misc addons and fixes.", ...
girving/tensorflow
refs/heads/master
tensorflow/compiler/tests/sort_ops_test.py
15
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
alistairlow/tensorflow
refs/heads/master
tensorflow/python/keras/_impl/keras/layers/convolutional.py
10
# 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...
quantopian/odo
refs/heads/master
odo/backends/sparksql.py
4
from __future__ import division, print_function, absolute_import import os import glob import itertools import tempfile import shutil from functools import partial from collections import Iterator from datetime import datetime, date import pandas as pd import toolz from toolz.curried import get, map, memoize from t...
ClarkYan/msc-thesis
refs/heads/master
code/data_owner_2/tests/test_primes.py
7
import primes def test_ipows(): for a in range(1, 10): for b in range (1, 10): for n in range(2, 11): yield check_ipow, a, b, n def check_ipow(a, b, n): result = list(primes.ipow(a, b, n)) assert result[-1] == pow(a, b) % n def test_is_probably_prime(): known_prime...
olea/PyConES-2016
refs/heads/develop
pycones/reviewers/actions.py
1
import csv from django.http import HttpResponse from django.utils.encoding import smart_text def export_as_csv_action(description="Export selected objects as CSV file", fields=None, exclude=None, header=True): """ This function returns an export csv action 'fields' and 'exclude' ...
spawnedc/MeCanBlog
refs/heads/master
django/conf/locale/es_AR/formats.py
232
# -*- encoding: utf-8 -*- # 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 = r'j N Y' TIME_FORMAT = r'H:i:s' DATETIME_FORMAT = r'j N Y H:i:s' YEAR_MONT...
MQQiang/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/distutils/tests/test_build_py.py
81
"""Tests for distutils.command.build_py.""" import os import sys import unittest from distutils.command.build_py import build_py from distutils.core import Distribution from distutils.errors import DistutilsFileError from distutils.tests import support from test.support import run_unittest class BuildPyTestCase(su...
jhprinz/openpathsampling
refs/heads/master
docs/conf.py
1
# -*- coding: utf-8 -*- # # OpenTIS documentation build configuration file, created by # sphinx-quickstart on Tue Sep 9 12:08:24 2014. # # 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...
fjorba/invenio
refs/heads/master
modules/bibrank/lib/bibrank_word_indexer.py
6
## This file is part of Invenio. ## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your ...
tjsavage/full_nonrel_starter
refs/heads/master
django/views/decorators/gzip.py
644
from django.utils.decorators import decorator_from_middleware from django.middleware.gzip import GZipMiddleware gzip_page = decorator_from_middleware(GZipMiddleware) gzip_page.__doc__ = "Decorator for views that gzips pages if the client supports it."
acetcom/cellwire
refs/heads/master
lib/nas/5gs/support/cache/nas-msg-202.py
2
ies = [] ies.append({ "iei" : "", "value" : "5GSM cause", "type" : "5GSM cause", "reference" : "9.11.4.2", "presence" : "M", "format" : "V", "length" : "1"}) ies.append({ "iei" : "37", "value" : "Back-off timer value", "type" : "GPRS timer 3", "reference" : "9.11.2.5", "presence" : "O", "format" : "TLV", "length" : "3"...
shsingh/ansible
refs/heads/devel
lib/ansible/module_utils/facts/network/hurd.py
192
# 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 ...
unseenlaser/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/distutils/tests/test_build.py
147
"""Tests for distutils.command.build.""" import unittest import os import sys from test.support import run_unittest from distutils.command.build import build from distutils.tests import support from sysconfig import get_platform class BuildTestCase(support.TempdirManager, support.LoggingSilencer, ...
kikokubo/Sick-Beard-TPB
refs/heads/ThePirateBay
lib/bs4/tests/test_builder_registry.py
485
"""Tests of the builder registry.""" import unittest from bs4 import BeautifulSoup from bs4.builder import ( builder_registry as registry, HTMLParserTreeBuilder, TreeBuilderRegistry, ) try: from bs4.builder import HTML5TreeBuilder HTML5LIB_PRESENT = True except ImportError: HTML5LIB_PRESENT =...
solashirai/edx-platform
refs/heads/master
lms/djangoapps/branding/tests/test_views.py
14
# encoding: utf-8 """Tests of Branding API views. """ import json import urllib from django.test import TestCase from django.core.urlresolvers import reverse from django.conf import settings import mock import ddt from config_models.models import cache from branding.models import BrandingApiConfig from openedx.core.dj...
thomasmauerhofer/search-engine
refs/heads/master
src/setup/create_dataset_and_train_helper.py
1
#!/usr/bin/env python3 # encoding: utf-8 import os import numpy as np import matplotlib.pyplot as plt from operator import itemgetter from optparse import OptionParser from config import DATASET, UPLOAD_FOLDER from engine.datastore.models.section import IMRaDType from engine.importer.importer_teambeam import ImporterTe...
jdaigneau/geoq
refs/heads/develop
geoq/proxy/urls.py
6
from django.conf.urls import patterns, include, url from django.contrib.auth.decorators import login_required from views import ProxyListView, ProxyRegisterView, ProxyGetView, ProxyAuxGetView urlpatterns = patterns('', url(r'^$', ProxyListView.as_view(), name='list'), url(r'^register', login_required(ProxyReg...
bat-serjo/vivisect
refs/heads/master
vivisect/symboliks/tests/test_emulator.py
4
import unittest from vivisect.symboliks.tests.helpers import MockEmulator import vivisect.const as vcon from vivisect.tests.helpers import MockVw class TestEmulator(unittest.TestCase): def setUp(self): self.se = MockEmulator(MockVw()) def test_variables(self): self.se.parseExpression('foo =...
Sendoushi/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/pytest/_pytest/mark.py
168
""" generic mechanism for marking and selecting python functions. """ import inspect class MarkerError(Exception): """Error in use of a pytest marker/attribute.""" def pytest_namespace(): return {'mark': MarkGenerator()} def pytest_addoption(parser): group = parser.getgroup("general") group._addo...
leiferikb/bitpop
refs/heads/master
src/tools/json_schema_compiler/cpp_util.py
14
# 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. """Utilies and constants specific to Chromium C++ code. """ from code import Code from datetime import datetime from model import PropertyType import os...
cryptickp/heat
refs/heads/master
heat/engine/resources/openstack/neutron/metering.py
2
# # 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 # ...
xzturn/tensorflow
refs/heads/master
tensorflow/examples/saved_model/integration_tests/use_text_embedding_in_dataset.py
7
# Copyright 2019 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...
MapStory/geonode
refs/heads/master
geonode/documents/enumerations.py
23
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
vikatory/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/test/test_dbm.py
91
"""Test script for the dbm.open function based on testdumbdbm.py""" import os import unittest import glob import test.support # Skip tests if dbm module doesn't exist. dbm = test.support.import_module('dbm') try: from dbm import ndbm except ImportError: ndbm = None _fname = test.support.TESTFN # # Iterates...
figment/falloutsnip
refs/heads/master
Vendor/IronPython/Lib/encodings/cp869.py
593
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP869.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'): ...
Azulinho/ansible
refs/heads/devel
lib/ansible/modules/packaging/os/sorcery.py
20
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015-2016, Vlad Glagolev <scm@vaygr.net> # # 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',...
damdam-s/OCB
refs/heads/8.0
addons/mrp/__openerp__.py
259
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
chiviak/CouchPotatoServer
refs/heads/master
libs/pyutil/test/current/json_tests/test_dump.py
106
from unittest import TestCase from cStringIO import StringIO from pyutil import jsonutil as json class TestDump(TestCase): def test_dump(self): sio = StringIO() json.dump({}, sio) self.assertEquals(sio.getvalue(), '{}') def test_dumps(self): self.assertEquals(json.dumps({}), '...
Ektorus/bohrium
refs/heads/master
misc/tools/prefix_rename.py
1
#!/usr/bin/env python import argparse import shutil import glob import sys import os def rename( prefix, sep, text, directory='.', recursive=False, verbose=False, dry=True ): for root, dirs, files in os.walk( directory, topdown=True ): if not recursive and root != directory: break fo...
ehy/cprec
refs/heads/master
wxdvdbackuppkg/fsdirspace.py
1
# coding=utf-8 """ Check directories for free space on filesystem. """ import errno import os import re import stat import tempfile from .chars import * from .msgprocs import * from .debug import pdbg from .util import * from .childproc import * _dbg = pdbg """ classes for the task of getting POSIX df -kP results...
jayceyxc/hue
refs/heads/master
desktop/core/ext-py/pysaml2-2.4.0/src/saml2/saml.py
31
#!/usr/bin/env python # # Generated Mon May 2 14:23:33 2011 by parse_xsd.py version 0.4. # from saml2.validate import valid_ipv4, MustValueError from saml2.validate import valid_ipv6 from saml2.validate import ShouldValueError from saml2.validate import valid_domain_name import saml2 from saml2 import SamlBase impo...
petrutlucian94/nova
refs/heads/master
nova/api/ec2/__init__.py
7
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a ...
Nexenta/cinder
refs/heads/master
cinder/tests/unit/zonemanager/test_brcd_lookup_service.py
8
# (c) Copyright 2013 Brocade Communications Systems 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/LICEN...
iluxa-com/mercurial-crew-tonfa
refs/heads/master
tests/get-with-headers.py
1
#!/usr/bin/env python """This does HTTP GET requests given a host:port and path and returns a subset of the headers plus the body of the result.""" import httplib, sys, re try: import msvcrt, os msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) except Impor...
s0be/msm-caf
refs/heads/ics_chocolate_rb4.2
tools/perf/scripts/python/syscall-counts.py
11181
# 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...
annndrey/npui-unik
refs/heads/master
netprofile/netprofile/scripts/__init__.py
3
# package: netprofile.scripts
apache/incubator-superset
refs/heads/master
superset/charts/commands/importers/dispatcher.py
3
# 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...
Lautitia/newfies-dialer
refs/heads/master
newfies/dialer_audio/forms.py
3
# # Newfies-Dialer License # http://www.newfies-dialer.org # # 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 http://mozilla.org/MPL/2.0/. # # Copyright (C) 2011-2014 Star2Billing S.L. # # The Initia...
jazkarta/edx-platform
refs/heads/master
lms/djangoapps/mobile_api/social_facebook/friends/urls.py
128
""" URLs for friends API """ from django.conf.urls import patterns, url from django.conf import settings from .views import FriendsInCourse urlpatterns = patterns( 'mobile_api.social_facebook.friends.views', url( r'^course/{}$'.format(settings.COURSE_ID_PATTERN), FriendsInCourse.as_view(), ...
gdimitris/ChessPuzzler
refs/heads/master
Virtual_Environment/lib/python2.7/site-packages/flask/json.py
428
# -*- coding: utf-8 -*- """ flask.jsonimpl ~~~~~~~~~~~~~~ Implementation helpers for the JSON support in Flask. :copyright: (c) 2012 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import io import uuid from datetime import datetime from .globals import current_app, request fro...
unnikrishnankgs/va
refs/heads/master
venv/lib/python3.5/site-packages/IPython/lib/tests/test_clipboard.py
5
import nose.tools as nt from IPython.core.error import TryNext from IPython.lib.clipboard import ClipboardEmpty from IPython.testing.decorators import skip_if_no_x11 @skip_if_no_x11 def test_clipboard_get(): # Smoketest for clipboard access - we can't easily guarantee that the # clipboard is accessible and ha...
oopy/micropython
refs/heads/master
tests/basics/getattr1.py
105
class A: var = 132 def __init__(self): self.var2 = 34 def meth(self, i): return 42 + i a = A() print(getattr(a, "var")) print(getattr(a, "var2")) print(getattr(a, "meth")(5)) print(getattr(a, "_none_such", 123)) print(getattr(list, "foo", 456)) print(getattr(a, "va" + "r2"))
dwdm/mitro
refs/heads/master
browser-ext/third_party/firefox-addon-sdk/python-lib/cuddlefish/tests/test_property_parser.py
37
# 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 http://mozilla.org/MPL/2.0/. import unittest from cuddlefish.property_parser import parse, MalformedLocaleFileError class TestParser(unittest.TestC...
3dfxsoftware/cbss-addons
refs/heads/master
hr_expense/__openerp__.py
62
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
bagcoin/bagcoin
refs/heads/master
qa/rpc-tests/mempool_resurrect_test.py
150
#!/usr/bin/env python2 # Copyright (c) 2014 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 resurrection of mined transactions when # the blockchain is re-organized. # from test_framework impo...
labordoc/labordoc-next
refs/heads/labordoc-next
modules/webtag/lib/webtag_model.py
3
# -*- coding: utf-8 -*- # ## This file is part of Invenio. ## Copyright (C) 2013 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) an...
ibinti/intellij-community
refs/heads/master
python/testData/refactoring/rename/renameUpdatesImportReferences/before/foo.py
336
def f(): pass
basmot/futsal_management
refs/heads/master
base/models/match.py
1
############################################################################## # # Copyright 2015-2016 Bastien Mottiaux # # 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.apac...
bnmalcabis/testpy
refs/heads/master
python2/koans/about_attribute_access.py
88
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Partially based on AboutMessagePassing in the Ruby Koans # from runner.koan import * class AboutAttributeAccess(Koan): class TypicalObject(object): pass def test_calling_undefined_functions_normally_results_in_errors(self): typical = self.T...
diox/zamboni
refs/heads/master
mkt/comm/tasks.py
4
import logging from post_request_task.task import task from mkt.comm.utils_mail import save_from_email_reply log = logging.getLogger('z.comm') @task def consume_email(email_text, **kwargs): """Parse emails and save notes.""" res = save_from_email_reply(email_text) if not res: log.error('Failed...
pquentin/django
refs/heads/stable/1.8.x
django/conf/project_template/manage.py
1070
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
freeitaly/Trading-System
refs/heads/master
vn.trader/dataRecorder/drBase.py
23
# encoding: UTF-8 ''' 本文件中包含的数据格式和CTA模块通用,用户有必要可以自行添加格式。 ''' from __future__ import division # 把vn.trader根目录添加到python环境变量中 import sys sys.path.append('..') # 数据库名称 SETTING_DB_NAME = 'VnTrader_Setting_Db' TICK_DB_NAME = 'VnTrader_Tick_Db' DAILY_DB_NAME = 'VnTrader_Daily_Db' MINUTE_DB_NAME = 'VnTrader_1Min_Db' # ...
pskrz/ansible
refs/heads/devel
lib/ansible/plugins/shell/csh.py
92
# (c) 2014, Chris Church <chris@ninemoreminutes.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 lat...
GheRivero/ansible
refs/heads/devel
lib/ansible/plugins/netconf/junos.py
6
# # (c) 2017 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 d...
hackday-profilers/flocker
refs/heads/master
flocker/common/test/test_thread.py
15
# Copyright ClusterHQ Inc. See LICENSE file for details. """ Tests for ``flocker.common._thread``. """ from zope.interface import Attribute, Interface, implementer from twisted.trial.unittest import SynchronousTestCase, TestCase from twisted.python.failure import Failure from twisted.python.threadpool import Thread...
pooya/disco
refs/heads/master
lib/disco/schemes/scheme_discodb.py
3
from disco import util from discodb import DiscoDB, Q from disco.worker.task_io import task_output_stream def Open(url, task=None): if task: disco_data = task.disco_data ddfs_data = task.ddfs_data else: from disco.settings import DiscoSettings settings = DiscoSettings() ...
stumpyfr/tekcoin
refs/heads/master
contrib/wallettools/walletunlock.py
2
from jsonrpc import ServiceProxy access = ServiceProxy("http://127.0.0.1:4284") pwd = raw_input("Enter wallet passphrase: ") access.walletpassphrase(pwd, 60)
ypid/yaml4rst
refs/heads/master
docs/conf.py
1
# -*- coding: utf-8 -*- # # 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. # # All configuration values have a default; values that are commented out # serve to show the default. # If extensi...
frankyrumple/ope
refs/heads/master
laptop_credential/colorama/winterm.py
578
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. from . import win32 # from wincon.h class WinColor(object): BLACK = 0 BLUE = 1 GREEN = 2 CYAN = 3 RED = 4 MAGENTA = 5 YELLOW = 6 GREY = 7 # from wincon.h class WinStyle(object): NORMAL ...
Just-D/chromium-1
refs/heads/master
third_party/closure_linter/closure_linter/requireprovidesorter.py
84
#!/usr/bin/env python # # Copyright 2011 The Closure Linter 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 #...
anubhav929/eden
refs/heads/eden
modules/eden/survey.py
1
# -*- coding: utf-8 -*- """ Sahana Eden Survey Tool @copyright: 2011-2012 (c) Sahana Software Foundation @license: MIT ADAT - Assessment Data Analysis Tool For more details see the blueprint at: http://eden.sahanafoundation.org/wiki/BluePrint/SurveyTool/ADAT Permission is hereby granted, fr...
fernandalavalle/mlab-ns
refs/heads/master
server/mapreduce/hooks.py
31
#!/usr/bin/env python # # Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
ksmaheshkumar/clusterd
refs/heads/master
src/platform/jboss/deployers/jmx_deploy.py
5
from src.platform.jboss.interfaces import JINTERFACES from src.platform.jboss.authenticate import checkAuth from src.module.deploy_utils import _serve, waitServe, killServe from collections import OrderedDict from threading import Thread from requests import get, exceptions from time import sleep from log import LOG fr...
cuteprince/ics_kernel_3.0.16_htc_pico
refs/heads/master
tools/perf/scripts/python/futex-contention.py
11261
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
bhb27/android_kernel_motorola_apq8084
refs/heads/cm-14.1
tools/perf/scripts/python/futex-contention.py
11261
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
slotlocker2/audiodict
refs/heads/master
listsearch.py
1
#!/usr/bin/python from PyQt4 import QtGui,QtCore import sys,os,sqlite3 from start_here import app_variables class listWindow(QtGui.QWidget): def __init__(self): QtGui.QWidget.__init__(self) ## this list holds all the hidden listitems so they can be reenabled. self.hidden_list = [] conn_offlist = sqli...
powellquiring/bigimage
refs/heads/master
cfm/cformation/__init__.py
1
__all__ = ['master', 'ingest', 'elasticsearch', 'firehose', 'codepipeline', 'api_lambda', 'cloudfront']
drpaneas/linuxed.gr
refs/heads/master
lib/python2.7/site-packages/pip/util.py
343
import sys import shutil import os import stat import re import posixpath import zipfile import tarfile import subprocess import textwrap from pip.exceptions import InstallationError, BadCommand, PipError from pip.backwardcompat import(WindowsError, string_types, raw_input, console_to_s...
linglung/ytdl
refs/heads/master
youtube_dl/extractor/makerschannel.py
66
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class MakersChannelIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?makerschannel\.com/.*(?P<id_type>video|production)_id=(?P<id>[0-9]+)' _TEST = { 'url': 'http://makerschannel.com/en/zoomin/commu...
mertyildiran/Dragonfire
refs/heads/master
dragonfire/sr/kaldi.py
2
# -*- coding: UTF-8 -*- from __future__ import absolute_import # Operates on sound fragments consisting of signed integer samples 8, 16 # or 32 bits wide, stored in Python strings. import audioop import os import time from contextlib import contextmanager from ctypes import CFUNCTYPE, c_char_p, c_int, cdll from threa...
FHannes/intellij-community
refs/heads/master
plugins/hg4idea/testData/bin/hgext/progress.py
90
# progress.py show progress bars for some actions # # Copyright (C) 2010 Augie Fackler <durin42@gmail.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. """show progress bars for some actions This extension uses the progress in...
sahlinet/fastapp
refs/heads/master
fastapp/south_migrations/0017_auto__chg_field_thread_name.py
2
# -*- 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 'Thread.name' db.alter_column(u'fastapp_thread', 'name'...
classcat/cctf
refs/heads/master
examples/images/convnet_mnist.py
1
# -*- coding: utf-8 -*- """ Convolutional Neural Network for MNIST dataset classification task. References: Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. "Gradient-based learning applied to document recognition." Proceedings of the IEEE, 86(11):2278-2324, November 1998. Links: [MNIST Dataset] http:...