repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
Beauhurst/django
refs/heads/master
django/core/management/commands/sendtestemail.py
48
import socket from django.core.mail import mail_admins, mail_managers, send_mail from django.core.management.base import BaseCommand from django.utils import timezone class Command(BaseCommand): help = "Sends a test email to the email addresses specified as arguments." missing_args_message = "You must specif...
fnouama/intellij-community
refs/heads/master
python/testData/intentions/afterGoogleReturnSectionAfterKeywords.py
53
def f(**kwargs): """ Keyword arguments: foo: bar Returns: object: """
Johnzero/erp
refs/heads/fga
openerp/addons/marketing/__init__.py
10
# -*- 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...
2ndQuadrant/ansible
refs/heads/master
lib/ansible/modules/remote_management/manageiq/manageiq_tenant.py
3
#!/usr/bin/python # # (c) 2018, Evert Mulder (base on manageiq_user.py by Daniel Korn <korndaniel1@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, eithe...
ARPASMR/IRIS_lombardia
refs/heads/master
html/OpenLayers-2.13.1/build/build.py
86
#!/usr/bin/env python import sys import os sys.path.append("../tools") import mergejs import optparse def build(config_file = None, output_file = None, options = None): have_compressor = [] try: import jsmin have_compressor.append("jsmin") except ImportError: print "No jsmin" t...
indictranstech/fbd_erpnext
refs/heads/develop
erpnext/support/doctype/maintenance_visit/__init__.py
37694
from __future__ import unicode_literals
tymoreau/klusta_process_manager
refs/heads/master
klusta_process_manager/fileBrowser/fileBrowser.py
1
import os #QT import sip sip.setapi('QVariant',2) sip.setapi('QString',2) from PyQt4 import QtCore,QtGui from .tableDelegate import TableDelegate from .folderView import FolderView #------------------------------------------------------------------------------------------------------------ # Worker: Runs continuousl...
simone/django-gb
refs/heads/master
django/contrib/admin/exceptions.py
95
from django.core.exceptions import SuspiciousOperation class DisallowedModelAdminLookup(SuspiciousOperation): """Invalid filter was passed to admin view via URL querystring""" pass
anirajk/RAMCloud
refs/heads/master
scripts/repostats.py
20
#!/usr/bin/env python # Copyright (c) 2011 Stanford University # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND ...
codeparticle/Tenable.io-SDK-for-Python
refs/heads/master
tests/integration/test_client.py
1
from tenable_io.client import TenableIOClient from tenable_io.exceptions import TenableIOApiException, TenableIOErrorCode from tests.base import BaseTest class TestTenableIOClient(BaseTest): def test_client_bad_keys(self): try: TenableIOClient('bad', 'key').session_api.get() asser...
redhat-openstack/glance
refs/heads/f22-patches
glance/db/sqlalchemy/models.py
1
# 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 ...
laurenrevere/osf.io
refs/heads/develop
osf_tests/test_guid_auto_include.py
20
from django.utils import timezone import pytest from django_bulk_update.helper import bulk_update from django.db.models import DateTimeField from osf_tests.factories import UserFactory, PreprintFactory, NodeFactory @pytest.mark.django_db class TestGuidAutoInclude: guid_factories = [ UserFactory, ...
kayhayen/Nuitka
refs/heads/develop
tests/programs/package_missing_init/PackageMissingInitMain.py
1
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com # # Python tests originally created or extracted from other peoples work. The # parts were too small to be protected. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the ...
product-definition-center/product-definition-center
refs/heads/master
pdc/apps/releaseschedule/__init__.py
2
# # Copyright (c) 2017 Red Hat # Licensed under The MIT License (MIT) # http://opensource.org/licenses/MIT # default_app_config = 'pdc.apps.releaseschedule.apps.ReleaseScheduleConfig'
vvv1559/intellij-community
refs/heads/master
python/testData/completion/isInstanceTuple.after.py
83
class Foo: def test(self): pass class Foo2: def test(self): pass def x(p): if isinstance(p, (Foo, Foo2)): p.test()
bbci/pyff
refs/heads/master
src/Feedbacks/Tutorial/Lesson04.py
3
# Lesson04 - Reacting on control- and interaction events # Copyright (C) 2007-2009 Bastian Venthur # # 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 yo...
jmhodges/letsencrypt
refs/heads/master
letsencrypt/tests/cli_test.py
14
"""Tests for letsencrypt.cli.""" import itertools import os import shutil import traceback import tempfile import unittest import mock from letsencrypt import account from letsencrypt import configuration from letsencrypt import errors class CLITest(unittest.TestCase): """Tests for different commands.""" d...
fqez/JdeRobot
refs/heads/master
src/drivers/MAVLinkServer/MAVProxy/modules/lib/wxsettings_ui.py
8
from wx_loader import wx class TabbedDialog(wx.Dialog): def __init__(self, tab_names, title='Title', size=wx.DefaultSize): wx.Dialog.__init__(self, None, -1, title, style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER) self.tab_names = tab_names self.notebook = wx.Noteb...
elaske/mufund
refs/heads/develop
html5lib/treewalkers/lxmletree.py
618
from __future__ import absolute_import, division, unicode_literals from six import text_type from lxml import etree from ..treebuilders.etree import tag_regexp from gettext import gettext _ = gettext from . import _base from .. import ihatexml def ensure_str(s): if s is None: return None elif isin...
calancha/DIRAC
refs/heads/rel-v6r12
RequestManagementSystem/test/FileTests.py
4
######################################################################## # $HeadURL$ # File: FileTest.py # Author: Krzysztof.Ciba@NOSPAMgmail.com # Date: 2012/08/06 13:48:54 ######################################################################## """ :mod: FileTest ======================= .. module: FileTest ...
Lilykos/invenio
refs/heads/master
invenio/modules/uploader/errors.py
13
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later...
kmoocdev2/edx-platform
refs/heads/real_2019
openedx/core/djangoapps/user_api/course_tag/api.py
12
""" A service-like user_info interface. Could be made into an http API later, but for now just in-process. Exposes global and per-course key-value pairs for users. Implementation note: Stores global metadata using the UserPreference model, and per-course metadata using the UserCourseTag model. """ from collections ...
abramhindle/UnnaturalCodeFork
refs/heads/master
python/testdata/launchpad/lib/lp/app/browser/tales.py
1
# Copyright 2009-2013 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Implementation of the lp: htmlform: fmt: namespaces in TALES.""" __metaclass__ = type from bisect import bisect from datetime import ( datetime, timedelta, ) ...
kawamon/hue
refs/heads/master
desktop/core/ext-py/SQLAlchemy-1.3.17/test/ext/test_extendedattr.py
3
import sqlalchemy as sa from sqlalchemy import event from sqlalchemy import util from sqlalchemy.ext import instrumentation from sqlalchemy.orm import attributes from sqlalchemy.orm import class_mapper from sqlalchemy.orm import clear_mappers from sqlalchemy.orm import events from sqlalchemy.orm.attributes import del_a...
datamade/yournextmp-popit
refs/heads/master
cached_counts/admin.py
13848
from django.contrib import admin # Register your models here.
bckwltn/SickRage
refs/heads/master
lib/github/StatsCommitActivity.py
74
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> # # ...
erinn/ansible
refs/heads/devel
v1/ansible/runner/action_plugins/debug.py
119
# Copyright 2012, Dag Wieers <dag@wieers.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later versi...
yod/google-appengine-wx-launcher-gnome
refs/heads/master
launcher/taskcontroller.py
28
#!/usr/bin/env python # # Copyright 2008 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...
chenc10/Spark-PAF
refs/heads/master
dist/ec2/lib/boto-2.34.0/boto/pyami/__init__.py
396
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
Jrribas/InstantScale
refs/heads/master
processImage.py
1
import os import pytesseract from re import compile from cv2 import imread, imwrite, cvtColor, threshold, COLOR_BGR2GRAY, THRESH_BINARY, ADAPTIVE_THRESH_GAUSSIAN_C from cv2 import adaptiveThreshold from PIL import Image, ImageFont, ImageDraw import shutil def getBar(img): height, width, channels = img.shape s...
acsone/stock-logistics-workflow
refs/heads/8.0
stock_inventory_retry_assign/__init__.py
28
# -*- coding: utf-8 -*- from . import stock
pilou-/ansible
refs/heads/devel
lib/ansible/modules/network/f5/bigiq_device_facts.py
12
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2018 F5 Networks Inc. # 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', ...
igorcompuff/ns-3.26
refs/heads/master
src/aodv/test/examples-to-run.py
199
#! /usr/bin/env python ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- # A list of C++ examples to run in order to ensure that they remain # buildable and runnable over time. Each tuple in the list contains # # (example_name, do_run, do_valgrind_run). # # See test.py for more i...
rampage644/impala-cut
refs/heads/executor
shell/ext-py/prettytable-0.7.1/setup.py
80
#!/usr/bin/env python from setuptools import setup from prettytable import __version__ as version setup( name='prettytable', version=version, classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 2.4', 'Programming Language :: Python :: 2.5', 'Pr...
un33k/robotframework
refs/heads/master
utest/utils/test_robotenv.py
21
import unittest import os from robot.utils.asserts import assert_equals, assert_not_none, assert_none, assert_true from robot.utils import get_env_var, set_env_var, del_env_var, get_env_vars TEST_VAR = 'TeST_EnV_vAR' TEST_VAL = 'original value' NON_ASCII_VAR = u'\xe4iti' NON_ASCII_VAL = u'is\xe4' class TestRobotEn...
etrepum/pgproxy
refs/heads/master
pgproxy/twistd.py
2
from twisted.scripts.twistd import ServerOptions, runApp from twisted.application import app class Options(ServerOptions): optParameters = [ ('listen-port', '', 5433, 'The port to listen on.', int), ('server-host', '', 'localhost', 'The host of the postgres server.'), ('server-port', '', 5...
mayankcu/Django-social
refs/heads/master
venv/Lib/site-packages/django/contrib/sessions/tests.py
73
from __future__ import with_statement from datetime import datetime, timedelta import shutil import string import tempfile import warnings from django.conf import settings from django.contrib.sessions.backends.db import SessionStore as DatabaseSession from django.contrib.sessions.backends.cache import SessionStore as...
uberamd/NGECore2
refs/heads/master
scripts/object/mobile/meatlump_f_officer_01_nonvendor_vendor.py
85615
import sys def setup(core, object): return
uberamd/NGECore2
refs/heads/master
scripts/object/tangible/loot/creature_loot/collections/space/engine_mark_02_koensayr.py
85615
import sys def setup(core, object): return
palaniyappanBala/thug
refs/heads/master
src/ActiveX/modules/SilverLight.py
8
import logging log = logging.getLogger("Thug") def isVersionSupported(self, version): shockwave = log.ThugVulnModules.shockwave_flash.split('.') sversion = version.split('?') if len(sversion) == 1: sversion = version.split('.') if len(sversion) != 4: return False for i in ran...
thesuperzapper/tensorflow
refs/heads/master
tensorflow/contrib/learn/python/learn/utils/gc.py
66
# 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...
bikong2/django
refs/heads/master
tests/migrations/test_migrations_no_changes/0001_initial.py
2995
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): operations = [ migrations.CreateModel( "Author", [ ("id", models.AutoField(primary_key=True)), ("name",...
gluster-rhsc/nagios-plugin
refs/heads/master
nagios/plugins/check_disk_and_inode.py
1
#!/usr/bin/python # sadf.py -- nagios plugin uses sadf output for perf data # Copyright (C) 2014 Red Hat Inc # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, ...
balloob/home-assistant
refs/heads/dev
tests/components/ring/test_init.py
14
"""The tests for the Ring component.""" from datetime import timedelta import homeassistant.components.ring as ring from homeassistant.setup import async_setup_component from tests.common import load_fixture ATTRIBUTION = "Data provided by Ring.com" VALID_CONFIG = { "ring": {"username": "foo", "password": "bar"...
Araneidae/cothread
refs/heads/master
old_tests/timing/timing.py
2
#!/usr/bin/env python from __future__ import print_function import time import sys import os sys.path.append( os.path.abspath(os.path.join(os.path.dirname(__file__), '../..'))) import cothread from cothread.catools import * if sys.argv[1:]: count = int(sys.argv[1]) else: count = 0 callbacks = 0 def c...
mysql/mysql-utilities
refs/heads/master
mysql/utilities/common/tools.py
1
# # Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. # # 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; version 2 of the License. # # This program is distributed in th...
femtoghoti/PubSubServer
refs/heads/master
PubSubServer/kommunication_server.py
1
from twisted.internet import protocol from twisted.protocols import basic class PubProtocol(basic.LineReceiver): def __init__(self, factory): self.factory = factory def connectionMade(self): self.factory.clients.add(self) def connectionLost(self, reason): self.factory.clients.rem...
SlateScience/MozillaJS
refs/heads/master
js/src/python/mock-1.0.0/tests/testsentinel.py
111
# Copyright (C) 2007-2012 Michael Foord & the mock team # E-mail: fuzzyman AT voidspace DOT org DOT uk # http://www.voidspace.org.uk/python/mock/ from tests.support import unittest2 from mock import sentinel, DEFAULT class SentinelTest(unittest2.TestCase): def testSentinels(self): self.assertEqual(sent...
momingsong/ns-3
refs/heads/master
src/aodv/bindings/callbacks_list.py
95
callback_classes = [ ['void', 'ns3::Ptr<ns3::Packet const>', 'ns3::Ipv4Header const&', 'ns3::Socket::SocketErrno', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['void', 'ns3::Ptr<ns3::Ipv4Route>', 'ns3::Ptr<ns3::Packet const>', 'ns3::Ipv4Header const&', 'ns3::empty', 'ns3...
rebolinho/liveit.repository
refs/heads/master
plugin.video.SportsDevil/lib/downloader.py
25
# -*- coding: utf-8 -*- import common import urllib import os.path import xbmc, xbmcgui class Downloader(object): def __init__(self): self.pDialog = None def downloadWithJDownloader(self, url, title): common.runPlugin('plugin://plugin.program.jdownloader/?action=addlink&url=' + url) ...
neumerance/cloudloon2
refs/heads/master
.venv/lib/python2.7/site-packages/django/contrib/messages/__init__.py
311
from __future__ import absolute_import from django.contrib.messages.api import * from django.contrib.messages.constants import *
super7ramp/pulseaudio-dlna
refs/heads/master
pulseaudio_dlna/workarounds.py
3
#!/usr/bin/python # This file is part of pulseaudio-dlna. # pulseaudio-dlna 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. # pulsea...
lptorres/noah-inasafe
refs/heads/master
web_api/third_party/raven/__init__.py
1
""" raven ~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ __all__ = ('VERSION', 'Client', 'load') try: VERSION = __import__('pkg_resources') \ .get_distribution('raven').version except Exception, e: VERSION = ...
JenSte/pyqtgraph
refs/heads/develop
pyqtgraph/flowchart/library/Display.py
52
# -*- coding: utf-8 -*- from ..Node import Node import weakref from ...Qt import QtCore, QtGui from ...graphicsItems.ScatterPlotItem import ScatterPlotItem from ...graphicsItems.PlotCurveItem import PlotCurveItem from ... import PlotDataItem, ComboBox from .common import * import numpy as np class PlotWidgetNode(Node...
SiviVuk/inflection
refs/heads/master
docs/conf.py
4
# -*- coding: utf-8 -*- # # inflection documentation build configuration file, created by # sphinx-quickstart on Wed Feb 22 22:51:13 2012. # # 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. # # ...
OpenXT/seabios
refs/heads/master
tools/transdump.py
121
#!/usr/bin/env python # This script is useful for taking the output of memdump() and # converting it back into binary output. This can be useful, for # example, when one wants to push that data into other tools like # objdump or hexdump. # # (C) Copyright 2010 Kevin O'Connor <kevin@koconnor.net> # # This file may be ...
jvkops/django
refs/heads/master
tests/admin_scripts/app_raising_warning/models.py
391
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.core import checks from django.db import models class ModelRaisingMessages(models.Model): @classmethod def check(self, **kwargs): return [ checks.Warning( 'A warning', hint=None, ...
ahartz1/python_koans
refs/heads/master
python3/koans/about_triangle_project.py
130
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # You need to write the triangle method in the file 'triangle.py' from .triangle import * class AboutTriangleProject(Koan): def test_equilateral_triangles_have_equal_sides(self): self.assertEqual('equilateral', triangle(2, 2, 2)) ...
NCBI-Hackathons/PhenVar
refs/heads/master
generateVCF/lanprosForVCF.py
1
import nltk from Bio import Entrez import time # We need this if we want to filter based on age from urllib2 import HTTPError import xml.etree.ElementTree as ET from collections import Counter import numpy as np import operator from os import path import random def tokenize_abstracts(RS_pmids_abstracts_dict): """...
Debian/openjfx
refs/heads/master
modules/web/src/main/native/Tools/QueueStatusServer/filters/__init__.py
6014
# Required for Python to search this directory for module files
TheTypoMaster/chromium-crosswalk
refs/heads/master
build/android/pylib/utils/md5sum_test.py
30
#!/usr/bin/env python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import sys import unittest from pylib import cmd_helper from pylib import constants from pylib.utils import md5sum sys.path...
mbeacom/locust
refs/heads/master
locust/test/test_stats.py
1
import csv import time import unittest import re import os import json import gevent import mock import locust from locust import HttpUser, TaskSet, task, User, constant from locust.env import Environment from locust.rpc.protocol import Message from locust.stats import CachedResponseTimes, RequestStats, StatsEntry, di...
baoboa/pyqt5
refs/heads/master
pyuic/uic/widget-plugins/qscintilla.py
3
############################################################################# ## ## Copyright (c) 2018 Riverbank Computing Limited <info@riverbankcomputing.com> ## ## This file is part of PyQt5. ## ## This file may be used under the terms of the GNU General Public License ## version 3.0 as published by the Free Softw...
alexbruy/QGIS
refs/heads/master
python/plugins/processing/algs/qgis/SetVectorStyle.py
3
# -*- coding: utf-8 -*- """ *************************************************************************** SelectByLocation.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com **********************...
RaoUmer/django
refs/heads/master
django/utils/hashcompat.py
124
""" The md5 and sha modules are deprecated since Python 2.5, replaced by the hashlib module containing both hash algorithms. Here, we provide a common interface to the md5 and sha constructors, depending on system version. """ import warnings warnings.warn("django.utils.hashcompat is deprecated; use hashlib instead", ...
zjj/trac_hack
refs/heads/master
trac/admin/tests/__init__.py
8
import unittest from trac.admin.tests import console from trac.admin.tests.functional import functionalSuite def suite(): suite = unittest.TestSuite() suite.addTest(console.suite()) return suite if __name__ == '__main__': unittest.main(defaultTest='suite')
podhmo/boto
refs/heads/develop
boto/sts/credentials.py
153
# Copyright (c) 2011 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2011, Eucalyptus Systems, Inc. # # 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 # withou...
yohei-washizaki/perlin
refs/heads/master
util.py
1
#!/usr/bin/env python3 import math def normalize_vector(x, y): length = math.sqrt(x * x + y * y) if math.isclose(length, 0): return (0, 0) else: inv = 1.0 / length return (x * inv, y * inv) def dot_vector(v1, v2): return v1[0] * v2[0] + v1[1] * v2[1] def fade(t): retur...
touilleMan/authomatic
refs/heads/master
tests/functional_tests/expected_values/bitly.py
4
import fixtures import constants from authomatic.providers import oauth2 conf = fixtures.get_configuration('bitly') LINK = 'http://bitly.com/u/{0}'.format(conf.user_id) PICTURE = 'http://bitly.com/u/{0}.png'.format(conf.user_id) CONFIG = { 'pre_login_xpaths': [ '//*[@id="sign-in"]/div[2]/fieldset/div/a'...
Russell-IO/ansible
refs/heads/devel
lib/ansible/modules/cloud/vmware/vmware_guest_snapshot_facts.py
15
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Ansible Project # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com> # 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__ = t...
tictakk/servo
refs/heads/ticbranch
tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements/track/track-element/cors/support/cors-tester.py
238
from wptserve.handlers import HTTPException import urllib def main(request, response): if request.method != "GET": raise HTTPException(400, message="Method was not GET") if not "id" in request.GET: raise HTTPException(400, message="No id") id = request.GET['id'] if "read" in request....
magnunor/hyperspy
refs/heads/RELEASE_next_minor
hyperspy/ui_registry.py
1
'''Registry of user interface widgets. Format {"tool_key" : {"toolkit" : <function(obj, display, **kwargs)>}} The ``tool_key` is defined by the "model function" to which the widget provides and user interface. That function gets the widget function from this registry and executes it passing the ``obj``, ``display`` a...
yfried/ansible
refs/heads/devel
test/sanity/validate-modules/utils.py
35
# -*- coding: utf-8 -*- # # Copyright (C) 2015 Matt Martz <matt@sivel.net> # Copyright (C) 2015 Rackspace US, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of ...
AyoubZahid/odoo
refs/heads/9.0
openerp/addons/test_workflow/tests/test_workflow.py
392
# -*- coding: utf-8 -*- import openerp from openerp import SUPERUSER_ID from openerp.tests import common class test_workflows(common.TransactionCase): def check_activities(self, model_name, i, names): """ Check that the record i has workitems in the given activity names. """ instance = se...
tamac-io/jenkins-job-builder
refs/heads/master
tests/cmd/test_cmd.py
11
import os from jenkins_jobs.cli import entry from tests import base from tests.base import mock class CmdTestsBase(base.BaseTestCase): fixtures_path = os.path.join(os.path.dirname(__file__), 'fixtures') def setUp(self): super(CmdTestsBase, self).setUp() # Testing the cmd module can sometim...
johnny-bui/pygments-sablecc
refs/heads/master
pygments/styles/friendly.py
75
# -*- coding: utf-8 -*- """ pygments.styles.friendly ~~~~~~~~~~~~~~~~~~~~~~~~ A modern style based on the VIM pyte theme. :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyw...
google-code/anntools
refs/heads/master
anntools/common.py
3
#!/usr/bin/python # -*- coding: ascii -*- ''' Common utilities. (C) 2007-2008 - Viktor Ferenczi (python@cx.hu) - Licence: GNU LGPL ''' #============================================================================ import sys #============================================================================ __all__ = ['...
pratikmallya/hue
refs/heads/master
desktop/core/ext-py/pysqlite/doc/includes/sqlite3/text_factory.py
49
from pysqlite2 import dbapi2 as sqlite3 con = sqlite3.connect(":memory:") cur = con.cursor() # Create the table con.execute("create table person(lastname, firstname)") AUSTRIA = u"\xd6sterreich" # by default, rows are returned as Unicode cur.execute("select ?", (AUSTRIA,)) row = cur.fetchone() assert row[0] == AUST...
Microvellum/Fluid-Designer
refs/heads/master
win64-vc/2.78/scripts/templates_py/ui_menu.py
8
import bpy class CustomMenu(bpy.types.Menu): bl_label = "Custom Menu" bl_idname = "OBJECT_MT_custom_menu" def draw(self, context): layout = self.layout layout.operator("wm.open_mainfile") layout.operator("wm.save_as_mainfile").copy = True layout.operator("object.shade_sm...
rtucker-mozilla/inventory
refs/heads/master
api_v3/models.py
10644
from django.db import models # Create your models here.
febinstephen/python_koans_solutions
refs/heads/master
python3/runner/mockable_test_result.py
278
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest # Needed to stop unittest.TestResult itself getting Mocked out of existence, # which is a problem when testing the helper classes! (It confuses the runner) class MockableTestResult(unittest.TestResult): pass
mbrondani/django-scheduler
refs/heads/develop
schedule/models/events.py
2
from __future__ import division, unicode_literals from six.moves.builtins import object from six import with_metaclass # -*- coding: utf-8 -*- from django.conf import settings as django_settings import pytz from dateutil import rrule from django.contrib.contenttypes import fields from django.db import models from djan...
calandryll/transcriptome
refs/heads/master
scripts/old/poly_cut.py
1
#!/usr/bin/python -tt # Can't do this with bash why not python! # Remove poly-a and poly-t from shortened samples # Uses fastx_clipper to remove poly-a and poly-t # Website: http://hannonlab.cshl.edu/fastx_toolkit/commandline.html#fastx_clipper_usage # Import OS features to run external programs import os import glob ...
jgonthier/psi4
refs/heads/master
samples/python/mints9/input.py
3
from __future__ import print_function import psi4 from psi4.driver import qcdb #! A test of the basis specification. Various basis sets are specified outright and in blocks, both #! orbital and auxiliary. Constructs libmints BasisSet objects through the constructor that calls #! qcdb.BasisSet infrastructure. Checks th...
stackforge/tricircle
refs/heads/master
tricircle/db/migrate_repo/versions/005_fix_cached_endpoints_pod_id_length.py
1
# 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 agreed to in...
samuelhavron/heroku-buildpack-python
refs/heads/master
Python-3.4.3/Lib/_strptime.py
78
"""Strptime-related classes and functions. CLASSES: LocaleTime -- Discovers and stores locale-specific time information TimeRE -- Creates regexes for pattern matching a string of text containing time information FUNCTIONS: _getlang -- Figure out what language is being used for the locale ...
jkvas/eudaq
refs/heads/calice_ahcal_testbeam2018May
legacy/producers/explorer/srs-software/slow_control/read_counters.py
13
#! /usr/bin/env python ## ## code testing of class SlowControl ## import SlowControl # slow control code dHLVDS = SlowControl.SlowControl(0) dADC = SlowControl.SlowControl(1) SlowControl.read_burst(dHLVDS, 6039, 26, 4, False) SlowControl.read_burst(dADC, 6039, 10, 4, False) quit()
fmaguire/BayeHem
refs/heads/master
bayehem/rsem/detonate-1.11/ref-eval/boost/tools/build/v2/test/unit_test.py
44
#!/usr/bin/python # Copyright 2003, 2004 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) # Test the unit_test rule. import BoostBuild t = BoostBuild.Tester(use_test_config=False) # Create the needed files....
StefanRijnhart/server-tools
refs/heads/7.0
fetchmail_attach_from_folder/match_algorithm/email_domain.py
54
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2013 Therp BV (<http://therp.nl>) # All Rights Reserved # # This program is free software: you can redistribute it and/or modify #...
aelarabawy/hostap
refs/heads/master
tests/hwsim/vm/parallel-vm.py
1
#!/usr/bin/env python2 # # Parallel VM test case executor # Copyright (c) 2014, Jouni Malinen <j@w1.fi> # # This software may be distributed under the terms of the BSD license. # See README for more details. import curses import fcntl import os import subprocess import sys import time def get_results(): global vm...
caktus/django-treenav
refs/heads/develop
treenav/urls.py
1
from django.urls import path from .views import treenav_undefined_url urlpatterns = [ path("item/<slug:item_slug>/", treenav_undefined_url, name="treenav_undefined_url"), ]
ahmedaljazzar/edx-platform
refs/heads/master
common/djangoapps/microsite_configuration/backends/database.py
23
""" Microsite backend that reads the configuration from the database """ from django.conf import settings from django.db.models.signals import post_save from django.dispatch import receiver from mako.template import Template from microsite_configuration.backends.base import BaseMicrositeBackend, BaseMicrositeTemplateB...
omakk/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/util.py
497
# Copyright 2011, 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 of conditions and the f...
pastephens/pysal
refs/heads/master
pysal/examples/__init__.py
10
import os import pysal __all__ = ['get_path'] base = os.path.split(pysal.__file__)[0] example_dir = os.path.join(base, "examples") dirs = next(os.walk(example_dir))[1] file_2_dir = {} for d in dirs: tmp = os.path.join(example_dir, d) files_in_tmp = os.listdir(tmp) for f in files_in_tmp: file_2_di...
wking/pycalendar
refs/heads/master
pycalendar/property/timezone.py
1
## RFC 5545, section 3.8.3 (Time Zone Component Properties) ### RFC 5545, section 3.8.3.1 (Time Zone Identifier) ### RFC 5545, section 3.8.3.2 (Time Zone Name) ### RFC 5545, section 3.8.3.3 (Time Zone Offset From) ### RFC 5545, section 3.8.3.4 (Time Zone Offset To) ### RFC 5545, section 3.8.3.5 ...
AnotherIvan/calibre
refs/heads/master
src/calibre/utils/ipc/server.py
11
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import sys, os, cPickle, time, tempfile, errno from math import ceil from threading ...
masschallenge/impact-api
refs/heads/development
web/impact/impact/tests/test_program_family_list_view.py
1
# MIT License # Copyright (c) 2017 MassChallenge, Inc. import json from jsonschema import Draft4Validator from django.urls import reverse from impact.tests.factories import ProgramFamilyFactory from impact.tests.api_test_case import APITestCase from impact.tests.test_program_family_detail_view import ( PROGRAM_FA...
synthicity/activitysim
refs/heads/master
activitysim/core/mem.py
2
# ActivitySim # See full license in LICENSE.txt. from __future__ import (absolute_import, division, print_function, ) from future.standard_library import install_aliases install_aliases() # noqa: E402 import time import datetime import psutil import logging import gc from activitysim.core import config logger =...
rhyolight/nupic.research
refs/heads/master
projects/lateral_pooler/src/sp_wrapper.py
4
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2017, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
MichaelKohler/bedrock
refs/heads/master
bedrock/externalfiles/models.py
18
from django.db import models class ExternalFile(models.Model): name = models.CharField(max_length=50, primary_key=True) content = models.TextField() last_modified = models.DateTimeField(auto_now=True)