repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
bluemini/kuma
refs/heads/master
kuma/wiki/tests/test_models.py
3
import json import time from cStringIO import StringIO from datetime import date, datetime, timedelta from xml.sax.saxutils import escape import mock from constance import config from constance.test import override_config from nose.plugins.attrib import attr from nose.tools import eq_, ok_ from waffle.models import Sw...
tanql/RecommendApi
refs/heads/master
rate/migrations/0015_auto_20161006_1449.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('rate', '0014_movie_year'), ] operations = [ migrations.AlterField( model_name='movie', name='year', ...
AroMorin/HROS1-Framework
refs/heads/master
Linux/project/node_server/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py
426
# 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. """Xcode project file generator. This module is both an Xcode project file generator and a documentation of the Xcode project file format. Knowledge of the proje...
zulip/zulip
refs/heads/master
zerver/webhooks/gogs/tests.py
1
from unittest.mock import MagicMock, patch from zerver.lib.test_classes import WebhookTestCase from zerver.lib.webhooks.git import COMMITS_LIMIT class GogsHookTests(WebhookTestCase): STREAM_NAME = "commits" URL_TEMPLATE = "/api/v1/external/gogs?&api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "gogs...
miptliot/edx-platform
refs/heads/ginkgo_openedu_docker
cms/djangoapps/contentstore/utils.py
1
""" Common utility functions useful throughout the contentstore """ import logging from datetime import datetime from django.conf import settings from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ from opaque_keys.edx.keys import CourseKey, UsageKey from pytz import UTC f...
chrisidefix/visvis
refs/heads/master
core/line.py
3
# -*- coding: utf-8 -*- # Copyright (C) 2012, Almar Klein # # Visvis is distributed under the terms of the (new) BSD License. # The full license can be found in 'license.txt'. """ Module line Defines the Line class, which represents a line connected (optionally) with markers. It is the object created with the plot() ...
takeflight/cookiecutter
refs/heads/master
tests/test_vcs_prompt.py
22
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_vcs_prompt --------------- """ import os import pytest from cookiecutter import utils, vcs from tests.skipif_markers import skipif_no_network @pytest.fixture(autouse=True) def clean_cookiecutter_dirs(request): if os.path.isdir('cookiecutter-pypackage'): ...
raj454raj/eden
refs/heads/master
modules/templates/MCOP/tests.py
74
# -*- coding: utf-8 -*- """ This file specifies the tests which are to be run on the Philippines template. modules/tests/suite.py runs this file to get the test_list which is to be loaded. To add more tests which are to run on this template, simply add the class name to the list below. """ from gluon...
teoreteetik/api-snippets
refs/heads/master
twiml/voice/record/record-3/record-3.6.x.py
2
from twilio.twiml.voice_response import Record, VoiceResponse, Say response = VoiceResponse() response.say( 'Please leave a message at the beep.\nPress the star key when finished.' ) response.record( action='http://foo.edu/handleRecording.php', method='GET', max_length=20, finish_on_key='*' ) respo...
shywel/gateando-python
refs/heads/master
src/courses/search-engine/es/lesson-2/homework/ObfuscatedProcedure.py
1
# -*- coding: utf-8 -*- ''' Created on Aug 30, 2013 @author: shywel ''' divisor = '#' * 10 # 2. Obfuscated Procedure # # Which of the followin have exactly the same behaviors as the procedure: def proc(a, b): if a < 5: return b return a print proc(4, 6) print '\n', divisor, ' Proc 1: ', divisor, '...
eeshangarg/oh-mainline
refs/heads/master
vendor/packages/gdata/samples/calendar_resource/calendar_resource_example.py
38
#!/usr/bin/python2.4 # # Copyright 2011 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 require...
valesi/electrum
refs/heads/master
gui/kivy/uix/dialogs/amount_dialog.py
3
from kivy.app import App from kivy.factory import Factory from kivy.properties import ObjectProperty from kivy.lang import Builder from decimal import Decimal Builder.load_string(''' <AmountDialog@Popup> id: popup title: _('Amount') AnchorLayout: anchor_x: 'center' BoxLayout: o...
zerolab/wagtail
refs/heads/main
wagtail/images/api/fields.py
9
from collections import OrderedDict from rest_framework.fields import Field from ..models import SourceImageIOError class ImageRenditionField(Field): """ A field that generates a rendition with the specified filter spec, and serialises details of that rendition. Example: "thumbnail": { ...
zoni/errbot
refs/heads/master
tests/commands_test.py
2
# coding=utf-8 import os import re import logging from os import path, mkdir from queue import Empty from shutil import rmtree from tempfile import mkdtemp import pytest import tarfile extra_plugin_dir = path.join(path.dirname(path.realpath(__file__)), 'dummy_plugin') def test_root_help(testbot): assert 'All co...
drkmd88/Data-Mining
refs/heads/master
Pattern-Mining/close_mining.py
1
import operator def read_freq(file): with open(file,'r') as filein: filein=filein.read().splitlines() dicnew={} for line in filein: lineslt=line.split(' ') linekey=int(lineslt[0]) lineval=[int(i) for i in lineslt[1:]] if linekey not in dicnew.keys(): ...
tutorielgeo/google-openlayers
refs/heads/master
closure-library/scripts/http/simple_http_server.py
74
#!/usr/bin/env python import SimpleHTTPServer import SocketServer import cgi import sys PORT = 8080 # Simple server to respond to both POST and GET requests. POST requests will # just respond as normal GETs. class ServerHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_GET(self): SimpleHTTPServe...
GeoMatDigital/django-geomat
refs/heads/develop
geomat/stein/forms.py
1
from django.contrib.postgres.forms import SimpleArrayField from django.forms import CharField, ModelForm, Textarea from geomat.stein.models import GlossaryEntry # This Form was used to enabel full sentences with commas in a ArrayField by defining a | separator #No longer needed but keep class GlossaryEntryModelForm...
firebitsbr/ZCR-Shellcoder
refs/heads/master
lib/encoder/freebsd_x64/__init__.py
104
#!/usr/bin/env python ''' ZCR Shellcoder ZeroDay Cyber Research Z3r0D4y.Com Ali Razmjoo ''' pass
egoitzro/poedit
refs/heads/master
deps/boost/libs/mpl/preprocessed/preprocess_map.py
12
# Copyright Aleksey Gurtovoy 2001-2006 # # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # # See http://www.boost.org/libs/mpl for documentation. # $Id$ # $Date$ # $Revision$ import preprocess import os.path p...
sam-tsai/django-old
refs/heads/master
django/core/mail/backends/filebased.py
394
"""Email backend that writes messages to a file.""" import datetime import os from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.mail.backends.console import EmailBackend as ConsoleEmailBackend class EmailBackend(ConsoleEmailBackend): def __init__(self, *arg...
DavidLP/home-assistant
refs/heads/dev
homeassistant/components/kwb/__init__.py
36
"""The kwb component."""
Svolcano/python_exercise
refs/heads/master
dianhua/worker/crawler/china_mobile/tianjin/response_data.py
1
# -*- coding: utf-8 -*- import traceback import json import lxml.html from lxml import etree import re,traceback,time # 登录前_XPath def before_login_data(html): before_login = {'error': False} try: root = etree.HTML(html) before_login['token'] = root.xpath('//*[@id="token"]/@value')[0] be...
mquad/hgru4rec
refs/heads/master
src/hgru4rec.py
1
# -*- coding: utf-8 -*- """ @author: Massimo Quadrana """ import theano from theano import tensor as T from theano import function from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams import numpy as np import pandas as pd from collections import OrderedDict import logging import pickle logger = logg...
fengyuanjs/catawampus
refs/heads/master
tr/vendor/bup/cmd/midx-cmd.py
8
#!/usr/bin/env python import sys, math, struct, glob, resource import tempfile from bup import options, git, midx, _helpers, xstat from bup.helpers import * PAGE_SIZE=4096 SHA_PER_PAGE=PAGE_SIZE/20. optspec = """ bup midx [options...] <idxnames...> -- o,output= output midx filename (default: auto-generated) a,auto ...
simudream/PyDev.Debugger
refs/heads/development
tests_runfiles/samples/nested_dir/non_test_file.py
432
""" i am a python file with no tests """ pass
apark263/tensorflow
refs/heads/master
tensorflow/contrib/nn/python/ops/scaled_softplus_test.py
66
# Copyright 2017 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...
luoyetx/mxnet
refs/heads/master
example/reinforcement-learning/dqn/replay_memory.py
43
# 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...
avedaee/DIRAC
refs/heads/integration
Core/Utilities/MySQL.py
1
######################################################################## # $HeadURL$ ######################################################################## """ DIRAC Basic MySQL Class It provides access to the basic MySQL methods in a multithread-safe mode keeping used connections in a python Queue for furthe...
johnraz/django-rest-framework
refs/heads/master
tests/test_versioning.py
2
import pytest from django.conf.urls import include, url from django.test import override_settings from rest_framework import serializers, status, versioning from rest_framework.decorators import APIView from rest_framework.relations import PKOnlyObject from rest_framework.response import Response from rest_framework.r...
allancarlos123/Solfege-5.0
refs/heads/master
solfege/abstract.py
2
# vim: set fileencoding=utf-8 : # GNU Solfege - free ear training software # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2011 Tom Cato Amundsen # # 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 F...
sorenh/cc
refs/heads/master
vendor/Twisted-10.0.0/twisted/test/stdio_test_loseconn.py
59
# -*- test-case-name: twisted.test.test_stdio.StandardInputOutputTestCase.test_loseConnection -*- # Copyright (c) 2006-2007 Twisted Matrix Laboratories. # See LICENSE for details. """ Main program for the child process run by L{twisted.test.test_stdio.StandardInputOutputTestCase.test_loseConnection} to test that ITran...
maartenq/ansible
refs/heads/devel
lib/ansible/modules/cloud/google/gcp_compute_address.py
12
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
hrishioa/Aviato
refs/heads/master
flask/Lib/site-packages/werkzeug/routing.py
27
# -*- coding: utf-8 -*- """ werkzeug.routing ~~~~~~~~~~~~~~~~ When it comes to combining multiple controller or view functions (however you want to call them) you need a dispatcher. A simple way would be applying regular expression tests on the ``PATH_INFO`` and calling registered callback fun...
HackFisher/depot_tools
refs/heads/master
third_party/gsutil/gslib/commands/getlogging.py
51
# Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
Teamxrtc/webrtc-streaming-node
refs/heads/master
third_party/depot_tools/third_party/gsutil/gslib/commands/getlogging.py
51
# Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
abhishekarora12/ansible
refs/heads/devel
test/units/playbook/test_play_context.py
18
# (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...
ChaoSBYNN/Tools
refs/heads/master
Data Mining/Spark Examples/src/main/python/sql/basic.py
14
# # 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...
gtaylor/btmux_battlesnake
refs/heads/master
battlesnake/plugins/contrib/arena_master/staging_room/inbound_commands.py
1
from twisted.internet.defer import inlineCallbacks from battlesnake.core.inbound_command_handling.base import BaseCommand, \ CommandError from battlesnake.core.inbound_command_handling.command_table import \ InboundCommandTable from battlesnake.outbound_commands import think_fn_wrappers from battlesnake.outbou...
timlinux/geonode
refs/heads/master
geonode/contrib/slack/utils.py
1
# -*- 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 ...
YuhanLin1105/Multi-User-Blog
refs/heads/master
handlers/commentedit.py
1
from handlers import Handler from utils import login_required, comment_exist, comment_own from models import PostComment import time # CommentEdit handler class CommentEdit(Handler): @login_required @comment_exist @comment_own def get(self, c_id): c = PostComment.by_id(int(c_id)) usern...
nacl-webkit/chrome_deps
refs/heads/master
tools/swig/swig.py
133
#!/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. """Wrapper around swig. Sets the SWIG_LIB environment var to point to Lib dir and defers control to the platform-specific swig bin...
entropy1337/infernal-twin
refs/heads/master
Modules/build/reportlab/demos/gadflypaper/gfe.py
15
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details __doc__='' __version__=''' $Id$ ''' #REPORTLAB_TEST_SCRIPT import sys from reportlab.platypus import * from reportlab.lib.styles import getSampleStyleSheet from reportlab.rl_config import defaultPageSize PAGE_HEIGHT=defaultPageSize[1] sty...
dims/nova
refs/heads/master
nova/api/openstack/compute/server_migrations.py
1
# Copyright 2016 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...
Endika/django
refs/heads/master
tests/gis_tests/utils.py
124
import unittest from functools import wraps from django.conf import settings from django.db import DEFAULT_DB_ALIAS, connection def skipUnlessGISLookup(*gis_lookups): """ Skip a test unless a database supports all of gis_lookups. """ def decorator(test_func): @wraps(test_func) def ski...
spacy-io/thinc
refs/heads/master
thinc/exceptions.py
1
# coding: utf-8 from __future__ import unicode_literals import traceback from wasabi import TracebackPrinter, format_repr get_error = TracebackPrinter(tb_base="thinc", tb_exclude=("check.py",)) class UndefinedOperatorError(TypeError): def __init__(self, op, arg1, arg2, operators): self.tb = traceback.e...
onceuponatimeforever/oh-mainline
refs/heads/master
vendor/packages/docutils/docutils/languages/da.py
120
# -*- coding: utf-8 -*- # $Id: da.py 7678 2013-07-03 09:57:36Z milde $ # Author: E D # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be # translated for each...
joebowen/movement_validation_cloud
refs/heads/master
djangodev/lib/python2.7/site-packages/boto/https_connection.py
143
# Copyright 2007,2011 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
pymedusa/Medusa
refs/heads/master
ext/boto/manage/task.py
153
# Copyright (c) 2006-2009 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 rights to use, copy, modi...
azverkan/scons
refs/heads/master
test/LEX/LEXCOM.py
5
#!/usr/bin/env python # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, ...
joshblum/django-with-audit
refs/heads/master
django/core/signals.py
747
from django.dispatch import Signal request_started = Signal() request_finished = Signal() got_request_exception = Signal(providing_args=["request"])
CVML/winpython
refs/heads/master
winpython/qt/QtCore.py
8
# -*- coding: utf-8 -*- # # Copyright © 2011 Pierre Raybaut # Licensed under the terms of the MIT License # (copied from Spyder source code [spyderlib.qt]) # # Qt5 migration would not have been possible without # 2014-2015 Spyder Development Team work # (MIT License too, same parent project) import os if os.environ...
cypod/arsenalsuite
refs/heads/master
python/scripts/verifier_plugins/addFastLane.py
10
#!/usr/bin/python2.5 from PyQt4.QtCore import * from PyQt4.QtSql import * from blur.Stone import * from blur.Classes import * from verifier_plugin_factory import * def addFastLanePlugin(job): if job.name().toLower().contains("fastlane"): job.setPriority(22) job.setMaxTaskTime(600) wantedService = Service.sel...
CCI-Tools/redux
refs/heads/master
test/test_redux.py
1
import unittest from collections import namedtuple from redux import create_store, combine_reducers Todo = namedtuple('Todo', ['id', 'text', 'completed']) class TodoAction: def __init__(self, type, id=None, text=None, filter=None): self.type = type self.id = id self.text = text s...
miguelparaiso/OdooAccessible
refs/heads/master
addons/l10n_syscohada/__openerp__.py
430
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2010-2011 BAAMTU SARL (<http://www.baamtu.sn>). # contact: leadsn@baamtu.com # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affer...
NSDCars5/kernel_nanhu_ares
refs/heads/master
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
11088
# Core.py - Python extension for perf script, core functions # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from collections import defaultdict def aut...
dariusbakunas/rawdisk
refs/heads/master
tests/filesystems/test_detector.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import uuid from rawdisk.filesystems.detector import FilesystemDetector from mock import Mock class TestFilesystemDetector(unittest.TestCase): def setUp(self): self.guid_fs_id = '{EBD0A0A2-B9E5-4433-87C0-68B6B72699C7}' self.mbr_fs_id =...
glennhickey/teHmm
refs/heads/master
emission.py
1
#!/usr/bin/env python #Copyright (C) 2013 by Glenn Hickey # #Released under the MIT license, see LICENSE.txt import os import sys import numpy as np import pickle import string import copy import itertools import logging import time from numpy.testing import assert_array_equal, assert_array_almost_equal from scipy im...
zsoltdudas/lis-tempest
refs/heads/LIS
tempest/cmd/account_generator.py
2
#!/usr/bin/env python # Copyright 2015 Mirantis, 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 appl...
michaelhotss/googletest
refs/heads/master
test/gtest_throw_on_failure_test.py
2917
#!/usr/bin/env python # # Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
SmithsonianEnterprises/django-cms
refs/heads/develop
cms/middleware/page.py
70
# -*- coding: utf-8 -*- from django.utils.functional import SimpleLazyObject def get_page(request): from cms.appresolver import applications_page_check from cms.utils.page_resolver import get_page_from_request if not hasattr(request, '_current_page_cache'): request._current_page_cache = get_page_...
nick-thompson/servo
refs/heads/master
tests/wpt/web-platform-tests/encoding/resources/text-plain-charset.py
243
def main(request, response): response.headers.set("Content-Type", "text/plain;charset=" + request.GET.first("label")) response.content = "hello encoding"
alexsalo/Wikipedia
refs/heads/master
wikipedia/wikipedia.py
1
from __future__ import unicode_literals import requests import time from bs4 import BeautifulSoup from datetime import datetime, timedelta from decimal import Decimal from .exceptions import ( PageError, DisambiguationError, RedirectError, HTTPTimeoutError, WikipediaException, ODD_ERROR_MESSAGE) from .util import...
adelina-t/nova
refs/heads/master
nova/virt/xenapi/volume_utils.py
54
# Copyright (c) 2010 Citrix Systems, Inc. # Copyright (c) 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE...
indictranstech/vestasi-erpnext
refs/heads/develop
erpnext/accounts/doctype/purchase_taxes_and_charges_master/__init__.py
37694
from __future__ import unicode_literals
rgoldberg/asset-pipeline
refs/heads/master
asset-pipeline-site/src/assets/components/bootstrap/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...
nyee/RMG-Py
refs/heads/master
examples/rmg/TEOS/input.py
9
# Data sources database( thermoLibraries = ['primaryThermoLibrary'], reactionLibraries = [], seedMechanisms = [], kineticsDepositories = ['training'], kineticsFamilies = ['!Intra_Disproportionation','!Substitution_O'], kineticsEstimator = 'rate rules', ) # List of species species( label='TEOS', reactive=True, ...
tianweizhang/nova
refs/heads/v0
nova/virt/xenapi/image/vdi_through_dev.py
17
# Copyright 2013 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...
CentOS/sig-core-t_ltp
refs/heads/master
testcases/network/nfsv4/acl/test_acl.py
27
''' Access Control Lists testing based on newpynfs framework Aurelien Charbon - Bull SA ''' from random_gen import * import commands import os import threading import time import random alphabet='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789_-() ~' t_alphabet=len(alphabet) def test_acl_default(path)...
SurfasJones/djcmsrc3
refs/heads/master
venv/lib/python2.7/site-packages/south/tests/brokenapp/migrations/0004_higher.py
2088
from south.db import db from django.db import models class Migration: def forwards(self): pass def backwards(self): pass
osushkov/greekcoursebuilder
refs/heads/master
modules/announcements/samples.py
32
# Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
lyndsysimon/osf.io
refs/heads/develop
tests/test_transactions.py
58
# -*- coding: utf-8 -*- import logging import mock import webtest_plus import unittest from nose.tools import * # noqa from tests.base import DbTestCase from flask import make_response from pymongo.errors import CollectionInvalid, OperationFailure from framework.flask import add_handlers from framework.mongo impor...
jsirois/pex
refs/heads/master
pex/vendor/_vendored/packaging/packaging/_compat.py
58
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import sys from ._typing import TYPE_CHECKING if TYPE_CHECKING: # pragm...
abdoosh00/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/mako_module.py
60
from .x_module import XModuleDescriptor, DescriptorSystem class MakoDescriptorSystem(DescriptorSystem): def __init__(self, render_template, **kwargs): super(MakoDescriptorSystem, self).__init__(**kwargs) self.render_template = render_template class MakoModuleDescriptor(XModuleDescriptor): "...
stdlib-js/stdlib
refs/heads/develop
lib/node_modules/@stdlib/math/base/special/erfinv/benchmark/python/scipy/benchmark.py
1
#!/usr/bin/env python # # @license Apache-2.0 # # Copyright (c) 2018 The Stdlib Authors. # # 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 # # ...
theseyi/WhereHows
refs/heads/master
wherehows-etl/src/main/resources/jython/requests/packages/urllib3/contrib/appengine.py
154
from __future__ import absolute_import import logging import os import warnings from ..exceptions import ( HTTPError, HTTPWarning, MaxRetryError, ProtocolError, TimeoutError, SSLError ) from ..packages.six import BytesIO from ..request import RequestMethods from ..response import HTTPResponse ...
TestInABox/stackInAWSGI
refs/heads/master
stackinawsgi/test/test_session_session.py
1
""" Stack-In-A-WSGI: stackinawsgi.session.session.Session testing """ import unittest from threading import Lock import uuid import ddt import mock from stackinabox.stack import StackInABox from stackinabox.services.hello import HelloService from stackinawsgi.exceptions import ( InvalidSessionId, InvalidServ...
candy7393/VTK
refs/heads/master
ThirdParty/Twisted/twisted/internet/test/test_socket.py
38
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for implementations of L{IReactorSocket}. Generally only tests for failure cases are found here. Success cases for this interface are tested elsewhere. For example, the success case for I{AF_INET} is in L{twisted.internet.test.test_tc...
pz325/hornbook-django
refs/heads/master
libs/rest_framework/status.py
110
""" Descriptive HTTP status codes, for code readability. See RFC 2616 - http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html And RFC 6585 - http://tools.ietf.org/html/rfc6585 """ from __future__ import unicode_literals def is_informational(code): return code >= 100 and code <= 199 def is_success(code): r...
GNOME/pybliographer
refs/heads/master
pybrc.py
2
# Site configuration import os from Pyblio import Autoload, Config, version # define autoloaded formats Autoload.preregister ('format', 'BibTeX', 'Pyblio.Format.BibTeX', '.*\.bib') Autoload.preregister ('format', 'Ovid', 'Pyblio.Format.Ovid', '.*\.ovid') Autoload.preregister ('format', 'Medline', 'Pyblio.Form...
Degustare/degustare
refs/heads/master
degustare/winesonomies/tests.py
10
# -*- coding: UTF-8 -*- # tests.py # # Copyright (C) 2013 Degustare # # Author(s): Cédric Gaspoz <cga@degustare.ch> # # This file is part of Degustare. # # Degustare 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 Foundat...
amitsela/beam
refs/heads/master
sdks/python/apache_beam/io/gcp/pubsub_test.py
6
# # 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...
johnkit/vtk-dev
refs/heads/master
Examples/VisualizationAlgorithms/Python/imageWarp.py
23
#!/usr/bin/env python # This example shows how to combine data from both the imaging and # graphics pipelines. The vtkMergeFilter is used to merge the data # from each together. import vtk from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # Read in an image and compute a luminance value. The ...
jjscarafia/odoo
refs/heads/master
addons/account/report/account_treasury_report.py
385
# -*- 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...
coink/cryptex
refs/heads/master
cryptex/exchange/cryptsy.py
1
import datetime from decimal import Decimal, InvalidOperation import pytz import cryptex.common as common from cryptex.exception import CryptsyException from cryptex.exchange import Exchange from cryptex.trade import Sell, Buy from cryptex.order import SellOrder, BuyOrder from cryptex.transaction import Transaction, D...
jay3sh/vispy
refs/heads/master
examples/demo/gloo/galaxy/galaxy.py
18
#!/usr/bin/env python import numpy as np import sys from vispy.util.transforms import perspective from vispy.util import transforms from vispy import gloo from vispy import app from vispy import io import galaxy_specrend from galaxy_simulation import Galaxy VERT_SHADER = """ #version 120 uniform mat4 u_model; unifo...
rahulunair/nova
refs/heads/master
nova/tests/unit/objects/test_fields.py
1
# Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
ludat/nvimrc
refs/heads/master
colors.py
1
#!/usr/bin/env python2 fg = '\033[38;5;' bg = '\033[48;5;' for i in range( 0, 256): n = str(i) fgstr = fg + n + 'm' + n bgstr = bg + n + 'm' 'XXXXX' print fgstr, bgstr, '\033[0m'
guerrerocarlos/odoo
refs/heads/8.0
addons/hr_attendance/__openerp__.py
260
# -*- 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...
jevonearth/frappe
refs/heads/develop
frappe/templates/pages/desk.py
13
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals no_sitemap = 1 no_cache = 1 base_template_path = "templates/pages/desk.html" import os, re import frappe from frappe import _ import frappe.sessions def get_context(context): ...
mohseniaref/six-library
refs/heads/master
externals/coda-oss/modules/python/sio.lite/tests/test_sio_round_trip.py
6
#!/usr/bin/env python """ * ========================================================================= * This file is part of sio.lite-python * ========================================================================= * * (C) Copyright 2004 - 2014, MDA Information Systems LLC * * sio.lite-python is free softwar...
unindented/streamcode
refs/heads/master
client/static/jsrepl/extern/python/closured/lib/python2.7/wsgiref/headers.py
229
"""Manage HTTP Response Headers Much of this module is red-handedly pilfered from email.message in the stdlib, so portions are Copyright (C) 2001,2002 Python Software Foundation, and were written by Barry Warsaw. """ from types import ListType, TupleType # Regular expression that matches `special' characters in para...
emilhetty/home-assistant
refs/heads/patch-3
homeassistant/components/netatmo.py
5
""" Support for the Netatmo devices (Weather Station and Welcome camera). For more details about this platform, please refer to the documentation at https://home-assistant.io/components/netatmo/ """ import logging from urllib.error import HTTPError from homeassistant.const import ( CONF_API_KEY, CONF_PASSWORD, CON...
dreispt/server-tools
refs/heads/master
__unported__/mail_environment/__init__.py
18
from . import env_mail
erikvanzijst/flatlinux
refs/heads/master
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
# system call counts, by pid # (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, sys sys.path.append(os.env...
klmitch/neutron
refs/heads/master
neutron/tests/unit/extensions/test_dns.py
3
# Copyright 2015 Rackspace # # 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 t...
alistairlow/tensorflow
refs/heads/master
tensorflow/contrib/eager/python/evaluator_test.py
34
# Copyright 2017 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...
zelotoj/WebSign
refs/heads/master
ZLWebSign_indmi.py
2
#!/usr/bin/python # -*- coding:UTF-8 -*- import os import sys import urlparse import ZLWebSignBase SCRIPT_PATH = os.path.split(os.path.realpath(__file__))[0] + os.sep RUNNING_PATH = sys.path[0] + os.sep class ZLWebSign_indmi(ZLWebSignBase.ZLWebSignBase): url_host = 'http://www.indmi.com/u.php' def __init__...
TimYi/django
refs/heads/master
django/conf/locale/hr/formats.py
504
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. E Y.' TIME_FORMAT = 'H:i' DATE...
MSeifert04/numpy
refs/heads/master
numpy/core/info.py
99
"""Defines a multi-dimensional array and useful procedures for Numerical computation. Functions - array - NumPy Array construction - zeros - Return an array of all zeros - empty - Return an uninitialized array - shape - Return...
4commerce-technologies-AG/erpnext
refs/heads/develop
erpnext/patches/v4_0/update_user_properties.py
39
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe import frappe.permissions import frappe.defaults def execute(): frappe.reload_doc("core", "doctype", "docfield") frappe.reload_doc("...