repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
PhilipOakley/MSYS2-pacman | refs/heads/master | test/pacman/pmtest.py | 1 | # Copyright (c) 2006 by Aurelien Foret <orelien@chez.com>
# Copyright (c) 2006-2015 Pacman Development Team <pacman-dev@archlinux.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; eith... |
hatbot-team/hatbot_resources | refs/heads/master | tests/test_determinacy.py | 1 | import unittest
import nose
__author__ = 'moskupols'
from preparation.resources import Resource
from tests.trunk_aware import trunk_parametrized, asset_cache
@trunk_parametrized()
def test_determinacy(trunk):
resource_class = Resource.resource_by_trunk(trunk)
r1, r2 = asset_cache(trunk), tuple(Resource.app... |
MJuddBooth/pandas | refs/heads/master | pandas/tests/io/json/test_readlines.py | 2 | # -*- coding: utf-8 -*-
import pytest
from pandas.compat import StringIO
import pandas as pd
from pandas import DataFrame, read_json
import pandas.util.testing as tm
from pandas.util.testing import (
assert_frame_equal, assert_series_equal, ensure_clean)
from pandas.io.json.json import JsonReader
@pytest.fixtu... |
cdeil/sphinx-tutorial | refs/heads/master | astrospam/ham.py | 1 | """This is the ``ham.py`` docstring.
"""
class Ham(object):
"""This is the ``Ham`` class docstring.
"""
|
jamesfolberth/jupyterhub_AWS_deployment | refs/heads/master | notebooks/data8_notebooks/lab07/tests/q3_2.py | 3 | test = {
'name': '',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
>>> # Make sure your column labels are correct.
>>> faithful_predictions.labels == ('duration', 'wait', 'predicted wait')
True
>>> abs(1 - np.mean(faithful_predictions.colu... |
dgies/incubator-airflow | refs/heads/master | airflow/contrib/operators/jira_operator.py | 46 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... |
tuxfux-hlp-notes/python-batches | refs/heads/master | batch-67/19-files/myenv/lib/python2.7/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py | 762 | import hashlib
import os
from pip._vendor.lockfile import LockFile
from pip._vendor.lockfile.mkdirlockfile import MkdirLockFile
from ..cache import BaseCache
from ..controller import CacheController
def _secure_open_write(filename, fmode):
# We only want to write to this file, so open it in write only mode
... |
ojengwa/talk | refs/heads/master | venv/lib/python2.7/site-packages/django/contrib/gis/geos/tests/test_io.py | 74 | from __future__ import unicode_literals
import binascii
import unittest
from unittest import skipUnless
from django.contrib.gis import memoryview
from ..import HAS_GEOS
if HAS_GEOS:
from .. import GEOSGeometry, WKTReader, WKTWriter, WKBReader, WKBWriter, geos_version_info
@skipUnless(HAS_GEOS, "Geos is requir... |
WillisXChen/django-oscar | refs/heads/master | oscar/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py | 1724 | """Module for supporting the lxml.etree library. The idea here is to use as much
of the native library as possible, without using fragile hacks like custom element
names that break between releases. The downside of this is that we cannot represent
all possible trees; specifically the following are known to cause proble... |
mviitanen/marsmod | refs/heads/master | mcp/temp-python/lib/python2.7/site-packages/pip/_vendor/html5lib/serializer/htmlserializer.py | 310 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
import gettext
_ = gettext.gettext
try:
from functools import reduce
except ImportError:
pass
from ..constants import voidElements, booleanAttributes, spaceCharacters
from ..constants import rcdataElement... |
Edraak/circleci-edx-platform | refs/heads/circleci-master | lms/djangoapps/instructor/tests/test_enrollment_store_provider.py | 136 | """
Exercises tests on the base_store_provider file
"""
from django.test import TestCase
from instructor.enrollment_report import AbstractEnrollmentReportProvider
from instructor.paidcourse_enrollment_report import PaidCourseEnrollmentReportProvider
class BadImplementationAbstractEnrollmentReportProvider(AbstractEnr... |
vikingMei/mxnet | refs/heads/master | example/rcnn/rcnn/io/rcnn.py | 16 | # 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... |
wenderen/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pytest/testing/test_junitxml.py | 166 | # -*- coding: utf-8 -*-
from xml.dom import minidom
from _pytest.main import EXIT_NOTESTSCOLLECTED
import py
import sys
import os
from _pytest.junitxml import LogXML
import pytest
def runandparse(testdir, *args):
resultpath = testdir.tmpdir.join("junit.xml")
result = testdir.runpytest("--junitxml=%s" % resul... |
MOZGIII/mpv | refs/heads/master | waftools/detections/devices.py | 51 | __cdrom_devices_map__ = {
'win32': 'D:',
'cygwin': 'D:',
'darwin': '/dev/disk1',
'freebsd': '/dev/cd0',
'openbsd': '/dev/rcd0c',
'linux': '/dev/sr0',
'default': '/dev/cdrom'
}
__dvd_devices_map__ = {
'win32': 'D:',
'cygwin': 'D:',
'darwin': '/dev/rdiskN',
'freebsd'... |
toslunar/chainerrl | refs/heads/master | chainerrl/agents/a3c.py | 1 | from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases() # NOQA
import copy
from logging import getLogger
import chainer
fr... |
LANGFAN/ardupilot | refs/heads/ekf2_34 | Tools/scripts/magfit_flashlog.py | 278 | #!/usr/bin/env python
''' fit best estimate of magnetometer offsets from ArduCopter flashlog
using the algorithm from Bill Premerlani
'''
import sys, time, os, math
# command line option handling
from optparse import OptionParser
parser = OptionParser("magfit_flashlog.py [options]")
parser.add_option("--verbose", ac... |
jswope00/griffinx | refs/heads/master | common/djangoapps/static_replace/management/commands/clear_collectstatic_cache.py | 114 | ###
### Script for importing courseware from XML format
###
from django.core.management.base import NoArgsCommand
from django.core.cache import get_cache
class Command(NoArgsCommand):
help = 'Import the specified data directory into the default ModuleStore'
def handle_noargs(self, **options):
static... |
ahmed-mahran/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/geos/tests/test_io.py | 105 | from __future__ import unicode_literals
import binascii
import unittest
from django.contrib.gis import memoryview
from django.utils.unittest import skipUnless
from ..import HAS_GEOS
if HAS_GEOS:
from .. import GEOSGeometry, WKTReader, WKTWriter, WKBReader, WKBWriter, geos_version_info
@skipUnless(HAS_GEOS, "G... |
sporkchops81/titleplant | refs/heads/master | lib/python3.5/site-packages/setuptools/command/upload_docs.py | 390 | # -*- coding: utf-8 -*-
"""upload_docs
Implements a Distutils 'upload_docs' subcommand (upload documentation to
PyPI's pythonhosted.org).
"""
from base64 import standard_b64encode
from distutils import log
from distutils.errors import DistutilsOptionError
from distutils.command.upload import upload
import os
import s... |
demon-ru/iml-crm | refs/heads/master | addons/sale/sales_team.py | 61 | # -*- coding: utf-8 -*-
import calendar
from datetime import date
from dateutil import relativedelta
import json
from openerp import tools
from openerp.osv import fields, osv
class crm_case_section(osv.osv):
_inherit = 'crm.case.section'
def _get_sale_orders_data(self, cr, uid, ids, field_name, arg, contex... |
consulo/consulo-python | refs/heads/master | plugin/src/test/resources/intentions/beforeConvertStaticMethodToFunction.py | 83 | class MyClass(object):
"""
My class to show intention.
"""
def __init__(self):
self.a = 1
@staticmethod
def my_<caret>static_method():
import code
import time
time.sleep(100)
print code
|
zouyapeng/horizon-newtouch | refs/heads/master | openstack_dashboard/dashboards/project/data_processing/data_sources/tabs.py | 36 | # 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
# distributed under the... |
westernx/vee | refs/heads/master | vee/commands/relocate.py | 1 | import os
import stat
from vee.cli import style
from vee.commands.main import command, argument
from vee.home import PRIMARY_REPO
from vee import libs
from vee import log
@command(
argument('-n', '--dry-run', action='store_true'),
argument('--scan', action='store_true', help='look for installed libraires'),
... |
annarev/tensorflow | refs/heads/master | tensorflow/python/saved_model/function_deserialization.py | 3 | # 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... |
curoverse/libcloud | refs/heads/trunk | libcloud/common/cloudstack.py | 25 | # 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 use ... |
Arakmar/Sick-Beard | refs/heads/development | lib/hachoir_parser/guess.py | 90 | """
Parser list managment:
- createParser() find the best parser for a file.
"""
import os
from lib.hachoir_core.error import warning, info, HACHOIR_ERRORS
from lib.hachoir_parser import ValidateError, HachoirParserList
from lib.hachoir_core.stream import FileInputStream
from lib.hachoir_core.i18n import _
class Que... |
FoxerLee/iOS_sitp | refs/heads/master | Pods/AVOSCloudCrashReporting/Breakpad/src/tools/gyp/pylib/gyp/xcode_emulation.py | 36 | # 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.
"""
This module contains classes that help to emulate xcodebuild behavior on top of
other build systems, such as make and ninja.
"""
import copy
import gyp.common... |
cadyyan/git-achievements-rewrite | refs/heads/gh-pages | GitAchievements/achievements/merchant.py | 1 | """
Merchant
Added an external repository with git remote add
"""
from GitAchievements.achievements import UsageLeveledAchievement
class MerchantAchievement(UsageLeveledAchievement):
"""
Merchant
Added an external repository with git remote add
"""
name = 'Merchant'
description = 'Added an external re... |
chhsiao90/gviewer | refs/heads/master | gviewer/store.py | 1 | class BaseDataStore(object):
""" Base absctract class for data store
Attributes:
walkers: list of Walkers, that would listener any message received from data store
"""
def __init__(self):
self.walkers = []
def on_message(self, message):
transformed_msg = self.transform(mess... |
vmanoria/bluemix-hue-filebrowser | refs/heads/master | hue-3.8.1-bluemix/desktop/core/ext-py/django-openid-auth-0.5/django_openid_auth/tests/urls.py | 44 | # django-openid-auth - OpenID integration for django.contrib.auth
#
# Copyright (C) 2009-2013 Canonical Ltd.
#
# 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 ... |
40223137/w1717 | refs/heads/master | static/Brython3.1.3-20150514-095342/Lib/unittest/test/test_loader.py | 738 | import sys
import types
import unittest
class Test_TestLoader(unittest.TestCase):
### Tests for TestLoader.loadTestsFromTestCase
################################################################
# "Return a suite of all tests cases contained in the TestCase-derived
# class testCaseClass"
def te... |
benspaulding/django | refs/heads/master | tests/regressiontests/forms/tests/util.py | 6 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.forms.util import flatatt, ErrorDict, ErrorList
from django.test import TestCase
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy
class FormsU... |
joe-antognini/euler | refs/heads/master | 061/figuratives.py | 1 | #! /usr/bin/env python
#
# Project Euler
# Problem 61
#
# Find the sum of the only ordered set of six cyclic 4-digit numbers for
# which each polygonal type is represented by a different number in the set.
#
import time
start_time = time.time()
# First generate the figurative numbers
N = 150 # Some large number...
l... |
rkarpuzov/Aurumcoin-0.12 | refs/heads/master | qa/rpc-tests/test_framework/bignum.py | 230 | #
#
# bignum.py
#
# This file is copied from python-bitcoinlib.
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
"""Bignum routines"""
from __future__ import absolute_import, division, print_function, unicode_literals
imp... |
jtg-gg/skia | refs/heads/dev12-m41 | platform_tools/android/tests/android_framework_gyp_tests.py | 145 | #!/usr/bin/python
# Copyright 2014 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Test gyp_to_android.py
"""
import os
import shutil
import sys
import tempfile
import test_variables
import unittest
sys.path.append(test_variables.ANDROID_DIR)
... |
netroby/vitess | refs/heads/master | test/topo_flavor/server.py | 19 | #!/usr/bin/env python
# Copyright 2014, 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.
import logging
class TopoServer(object):
"""Base class that defines the required interface."""
def setup(self):
"""Initialize the to... |
chrism333/xpcc | refs/heads/develop | tools/system_design/builder/cpp_identifier.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2009, Roboterclub Aachen e.V.
# 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 t... |
abhattad4/Digi-Menu | refs/heads/master | digimenu2/tests/view_tests/models.py | 160 | """
Regression tests for Django built-in views.
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Author(models.Model):
name = models.CharField(max_length=100)
def __str__(self):
return self.name
def get_absolute_ur... |
nerdless/lifelines | refs/heads/master | lifelines/utils/__init__.py | 3 | # -*- coding: utf-8 -*-
from __future__ import print_function, division
import warnings
from datetime import datetime
import numpy as np
from numpy.linalg import inv
import pandas as pd
from pandas import to_datetime
class StatError(Exception):
def __init__(self, msg):
self.msg = msg
def __str__(se... |
emedvedev/st2 | refs/heads/master | st2common/tests/unit/test_rbac_resolvers_action.py | 6 | # Licensed to the StackStorm, Inc ('StackStorm') 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 use th... |
plotly/plotly.py | refs/heads/master | packages/python/plotly/plotly/validators/scatterternary/_hoverinfo.py | 1 | import _plotly_utils.basevalidators
class HoverinfoValidator(_plotly_utils.basevalidators.FlaglistValidator):
def __init__(self, plotly_name="hoverinfo", parent_name="scatterternary", **kwargs):
super(HoverinfoValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_n... |
pranjalpatil/django-allauth | refs/heads/master | allauth/socialaccount/providers/flickr/provider.py | 50 | from allauth.socialaccount import providers
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth.provider import OAuthProvider
class FlickrAccount(ProviderAccount):
def get_profile_url(self):
return self.account.extra_data \
.get('person')... |
hajuuk/R7000 | refs/heads/master | ap/gpl/timemachine/libxml2-2.7.2/python/tests/reader6.py | 87 | #!/usr/bin/python -u
#
# this tests the entities substitutions with the XmlTextReader interface
#
import sys
import StringIO
import libxml2
schema="""<element name="foo" xmlns="http://relaxng.org/ns/structure/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<oneOrMore>
<element name="l... |
tvtsoft/odoo8 | refs/heads/master | openerp/tests/addons/test_translation_import/__openerp__.py | 352 | # -*- coding: utf-8 -*-
{
'name': 'test-translation-import',
'version': '0.1',
'category': 'Tests',
'description': """A module to test translation import.""",
'author': 'OpenERP SA',
'maintainer': 'OpenERP SA',
'website': 'http://www.openerp.com',
'depends': ['base'],
'data': ['view.... |
shawnps/xhtml2pdf | refs/heads/master | demo/tgpisa/setup.py | 168 | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from turbogears.finddata import find_package_data
import os
execfile(os.path.join("tgpisa", "release.py"))
packages=find_packages()
package_data = find_package_data(where='tgpisa',
package='tgpisa')
if os.path.isdir('locales'):
packages.appe... |
fighterCui/L4ReFiascoOC | refs/heads/master | l4/pkg/python/contrib/Mac/Modules/osa/setup.py | 39 | # This is a temporary setup script to allow distribution of
# MacPython 2.4 modules for MacPython 2.3.
from distutils.core import Extension, setup
setup(name="OSA", version="0.1",
ext_modules=[
Extension('_OSA', ['_OSAmodule.c'],
extra_link_args=['-framework', 'Carbon'])
... |
mdaniel/intellij-community | refs/heads/master | python/testData/inspections/ChainedComparisons.py | 83 | <weak_warning descr="Simplify chained comparison">a < b <caret>and b < c</weak_warning> |
kave/collab | refs/heads/master | core/migrations/0004_move_apps_to_core.py | 5 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models, DatabaseError
class Migration(SchemaMigration):
def forwards(self, orm):
try:
# Check if front exists
db.execute('select * from front_person limit 1')... |
AZed/duplicity | refs/heads/master | testing/tests/selectiontest.py | 4 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2002 Ben Escoto <ben@emerose.org>
# Copyright 2007 Kenneth Loafman <kenneth@loafman.com>
#
# This file is part of duplicity.
#
# Duplicity is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License... |
ivan-fedorov/intellij-community | refs/heads/master | python/testData/psi/Await.py | 19 | async def f(x):
await x
await = 1
|
benhamner/FacebookRecruitingCompetition | refs/heads/master | Benchmarks/utilities.py | 1 | import csv
def edges_generator(file_name):
"""
Generator that returns edges given a 2-column csv graph file
"""
f = open(file_name)
reader = csv.reader(f)
# Ignore the header
reader.next()
for edges in reader:
nodes = [int(node) for node in edges]
yield nodes
f.c... |
sdague/home-assistant | refs/heads/dev | homeassistant/components/bbox/device_tracker.py | 19 | """Support for French FAI Bouygues Bbox routers."""
from collections import namedtuple
from datetime import timedelta
import logging
from typing import List
import pybbox
import voluptuous as vol
from homeassistant.components.device_tracker import (
DOMAIN,
PLATFORM_SCHEMA,
DeviceScanner,
)
from homeassis... |
HewlettPackard/oneview-ansible | refs/heads/master | library/oneview_power_device.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
###
# Copyright (2016-2017) Hewlett Packard Enterprise Development LP
#
# 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/licen... |
lobachevzky/NLP-Project | refs/heads/master | env/lib/python2.7/site-packages/pip/_vendor/lockfile/pidlockfile.py | 488 | # -*- coding: utf-8 -*-
# pidlockfile.py
#
# Copyright © 2008–2009 Ben Finney <ben+python@benfinney.id.au>
#
# This is free software: you may copy, modify, and/or distribute this work
# under the terms of the Python Software Foundation License, version 2 or
# later as published by the Python Software Foundation.
# No ... |
LingxiaoJIA/gem5 | refs/heads/master | util/stats/db.py | 90 | # Copyright (c) 2003-2004 The Regents of The University of Michigan
# 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 ... |
AutorestCI/azure-sdk-for-python | refs/heads/master | azure-mgmt-logic/azure/mgmt/logic/models/integration_account_sku.py | 4 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
mspark93/VTK | refs/heads/master | ThirdParty/Twisted/twisted/test/test_threadable.py | 34 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python.threadable}.
"""
from __future__ import division, absolute_import
import sys, pickle
try:
import threading
except ImportError:
threadingSkip = "Platform lacks thread support"
else:
threadingSkip = None... |
utecuy/edx-platform | refs/heads/master | lms/djangoapps/ccx/tests/test_overrides.py | 33 | # coding=UTF-8
"""
tests for overrides
"""
import datetime
import mock
import pytz
from nose.plugins.attrib import attr
from courseware.field_overrides import OverrideFieldData # pylint: disable=import-error
from django.test.utils import override_settings
from request_cache.middleware import RequestCache
from student... |
Orav/kbengine | refs/heads/master | kbe/src/lib/python/Doc/tools/sphinxext/suspicious.py | 1 | """
Try to detect suspicious constructs, resembling markup
that has leaked into the final output.
Suspicious lines are reported in a comma-separated-file,
``suspicious.csv``, located in the output directory.
The file is utf-8 encoded, and each line contains four fields:
* document name (normalized)
* lin... |
melon-li/openstack-dashboard | refs/heads/master | openstack_dashboard/dashboards/project/containers/tests.py | 13 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... |
hip-odoo/odoo | refs/heads/10.0 | addons/mail/tests/test_mail_gateway.py | 8 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import socket
from odoo.addons.mail.tests.common import TestMail
from odoo.tools import mute_logger
MAIL_TEMPLATE = """Return-Path: <whatever-2a840@postmaster.twitter.com>
To: {to}
cc: {cc}
Received: by mail1.openerp.... |
youprofit/zato | refs/heads/master | code/zato-web-admin/src/zato/admin/web/forms/security/wss.py | 6 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2010 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# Django
from django import forms
class CreateForm(forms.Form):
id = forms.C... |
EDUlib/edx-platform | refs/heads/master | lms/djangoapps/verify_student/tests/test_utils.py | 4 | """
Tests for verify_student utility functions.
"""
import unittest
from datetime import timedelta
from unittest import mock
from unittest.mock import patch
import ddt
from django.conf import settings
from django.utils import timezone
from pytest import mark
from common.djangoapps.student.tests.factories import Use... |
tomaslu/map_editor | refs/heads/master | lib/svg.py | 1 | '''
Created on Jan 5, 2014
'''
from lxml import etree
import subprocess
class SVG(object):
def __init__(self, svg_path):
self.svg_path = svg_path
with open(self.svg_path, 'r') as f:
content = f.read()
try:
self.tree = etree.fromstring(content)
self.w... |
msfrank/terane | refs/heads/master | terane/inputs/__init__.py | 1 | # Copyright 2010,2011,2012 Michael Frank <msfrank@syntaxjockey.com>
#
# This file is part of Terane.
#
# Terane 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 op... |
hsaputra/tensorflow | refs/heads/master | tensorflow/python/keras/preprocessing/sequence/__init__.py | 70 | # 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... |
armink/rt-thread | refs/heads/master | tools/wizard.py | 16 | #! /usr/bin/env python
#coding=utf-8
#
# File : wizard.py
# This file is part of RT-Thread RTOS
# COPYRIGHT (C) 2006 - 2015, RT-Thread Development Team
#
# 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 Soft... |
andyclymer/ControlBoard | refs/heads/master | Examples/ExampleScripts/SetZoom.py | 1 | import vanilla
from mojo.events import addObserver, removeObserver
from mojo.UI import CurrentGlyphWindow
class ZoomWindow:
def __init__(self):
"""
ControlBoard
"Set Zoom" demo
Use a potentiometer to set the zoom scale of the CurrentGlyphWindow.
... |
vipul-sharma20/oh-mainline | refs/heads/master | vendor/packages/Django/tests/regressiontests/context_processors/urls.py | 150 | from __future__ import absolute_import
from django.conf.urls import patterns, url
from . import views
urlpatterns = patterns('',
(r'^request_attrs/$', views.request_processor),
)
|
evaautomation/glibc-linaro | refs/heads/master | localedata/unicode-gen/utf8_compatibility.py | 4 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
#
# The GNU C Library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Fo... |
Wingless-Archangel/CustomCommand | refs/heads/master | Python Practice/learn_django/lib/python3.6/site-packages/setuptools/command/bdist_wininst.py | 991 | import distutils.command.bdist_wininst as orig
class bdist_wininst(orig.bdist_wininst):
def reinitialize_command(self, command, reinit_subcommands=0):
"""
Supplement reinitialize_command to work around
http://bugs.python.org/issue20819
"""
cmd = self.distribution.reinitiali... |
fivejjs/PTVS | refs/heads/master | Python/Product/PythonTools/Templates/Projects/StarterBottleProject/routes.py | 19 | """
Routes and views for the bottle application.
"""
from bottle import route, view
from datetime import datetime
@route('/')
@route('/home')
@view('index')
def home():
"""Renders the home page."""
return dict(
year=datetime.now().year
)
@route('/contact')
@view('contact')
def c... |
cmlasu/smm_gem5 | refs/heads/smm | src/python/m5/simulate.py | 23 | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... |
efortuna/AndroidSDKClone | refs/heads/master | ndk/prebuilt/linux-x86_64/lib/python2.7/distutils/tests/test_config.py | 95 | """Tests for distutils.pypirc.pypirc."""
import sys
import os
import unittest
import tempfile
import shutil
from distutils.core import PyPIRCCommand
from distutils.core import Distribution
from distutils.log import set_threshold
from distutils.log import WARN
from distutils.tests import support
from test.test_support... |
peterfpeterson/mantid | refs/heads/master | scripts/SliceViewAnimator.py | 3 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
#pyl... |
sqggles/sqlalchemy_dremio | refs/heads/master | sqlalchemy_dremio/requirements.py | 1 | from sqlalchemy.testing.requirements import SuiteRequirements
class Requirements(SuiteRequirements):
pass
|
allotria/intellij-community | refs/heads/master | python/testData/requirement/generation/baseFileUpdate/main.py | 20 | import requests
import Django
import pandas
import cookiecutter |
salmanwahed/django-tutorial-pollapp | refs/heads/master | polls/models.py | 1 | import datetime
from django.utils import timezone
from django.db import models
# Create your models here.
class Poll(models.Model):
def __unicode__(self):
return self.question
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
def was_published_rec... |
sjsucohort6/openstack | refs/heads/master | python/venv/lib/python2.7/site-packages/pytz/lazy.py | 514 | from threading import RLock
try:
from UserDict import DictMixin
except ImportError:
from collections import Mapping as DictMixin
# With lazy loading, we might end up with multiple threads triggering
# it at the same time. We need a lock.
_fill_lock = RLock()
class LazyDict(DictMixin):
"""Dictionary popu... |
stephen144/odoo | refs/heads/9.0 | addons/mail/controllers/main.py | 7 | import base64
from operator import itemgetter
import psycopg2
import werkzeug
from werkzeug import url_encode
import openerp
from openerp import SUPERUSER_ID
from openerp import http
from openerp.exceptions import AccessError
from openerp.http import request
from openerp.addons.web.controllers.main import binary_cont... |
webmasterraj/FogOrNot | refs/heads/master | flask/lib/python2.7/site-packages/numpy/distutils/tests/gen_ext/setup.py | 135 | #!/usr/bin/env python
from __future__ import division, print_function
fib3_f = '''
C FILE: FIB3.F
SUBROUTINE FIB(A,N)
C
C CALCULATE FIRST N FIBONACCI NUMBERS
C
INTEGER N
REAL*8 A(N)
Cf2py intent(in) n
Cf2py intent(out) a
Cf2py depend(n) a
DO I=1,N
IF (I.EQ.1) THEN
A(I) ... |
grzes/djangae | refs/heads/master | djangae/models.py | 13 | from django.db import models
from djangae import patches
class CounterShard(models.Model):
count = models.PositiveIntegerField()
label = models.CharField(max_length=500)
class Meta:
app_label = "djangae"
|
dcjohnson1989/selenium | refs/heads/master | py/test/selenium/webdriver/common/cookie_tests.py | 61 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
okin/nikola | refs/heads/master | nikola/plugins/command/github_deploy.py | 1 | # -*- coding: utf-8 -*-
# Copyright © 2014-2019 Puneeth Chaganti and others.
# 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... |
artofhuman/django-geoip | refs/heads/dev | tests/test_utils.py | 3 | # -*- coding: utf-8 -*-
from django.test import TestCase
from mock import patch
from django_geoip.utils import get_mod_func, get_class
class UtilsTest(TestCase):
def test_get_mod_func(self):
test_hash = {
'django.views.news.stories.story_detail': ('django.views.news.stories', 'story_detail'),
... |
bootandy/sqlalchemy | refs/heads/master | lib/sqlalchemy/pool.py | 49 | # sqlalchemy/pool.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Connection pooling for DB-API connections.
Provides a number of connection p... |
mrshu/PyTox | refs/heads/master | tests/tests.py | 1 | #
# @file tests.py
# @author Wei-Ning Huang (AZ) <aitjcize@gmail.com>
#
# Copyright (C) 2013 - 2014 Wei-Ning Huang (AZ) <aitjcize@gmail.com>
# 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... |
bfarkas/django-publications | refs/heads/develop | publications/bibtex.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
__license__ = 'MIT License <http://www.opensource.org/licenses/mit-license.php>'
__author__ = 'Lucas Theis <lucas@theis.io>'
__docformat__ = 'epytext'
__version__ = '1.2.0'
import re
import publications.six as six
# special character mapping
special_cha... |
MillerDix/NEChromeX | refs/heads/master | flaskTest/venv/lib/python2.7/site-packages/pip/_vendor/distlib/resources.py | 335 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2016 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import unicode_literals
import bisect
import io
import logging
import os
import pkgutil
import shutil
import sys
import ... |
shinsterneck/pdns | refs/heads/feature-geosql-backend | regression-tests.recursor-dnssec/test_Simple.py | 6 | import dns
import os
from recursortests import RecursorTest
class testSimple(RecursorTest):
_confdir = 'Simple'
_config_template = """dnssec=validate
auth-zones=authzone.example=configs/%s/authzone.zone""" % _confdir
@classmethod
def generateRecursorConfig(cls, confdir):
authzonepath = os.pat... |
adekoder/flask_dbseeder | refs/heads/master | test/__init__.py | 1 | from flask import Flask
from flask_dbseeder import Seeder, SeederCommand, SeedManager, NotASubClassException
from flask_sqlalchemy import SQLAlchemy
import os
basedir = os.path.abspath(os.path.dirname(__file__))
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + \
os.path.join(basedir, 't... |
kobejean/tensorflow | refs/heads/master | tensorflow/contrib/layers/python/kernel_tests/sparse_feature_cross_op_test.py | 24 | # 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... |
kool79/intellij-community | refs/heads/master | python/lib/Lib/encodings/cp932.py | 817 | #
# cp932.py: Python Unicode Codec for CP932
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_jp, codecs
import _multibytecodec as mbc
codec = _codecs_jp.getcodec('cp932')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.MultibyteIncrement... |
MichaelNedzelsky/intellij-community | refs/heads/master | python/testData/refactoring/introduceVariable/dontSuggestBuiltinTypeNames.py | 166 | "foo <caret>bar" |
fredericlepied/ansible | refs/heads/devel | lib/ansible/modules/network/cloudengine/ce_snmp_contact.py | 39 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... |
AlphaSmartDog/DeepLearningNotes | refs/heads/master | Note-6 A3CNet/Note-6.2.1 代码阅读顺序/sonnet/python/modules/gated_rnn.py | 5 | # Copyright 2017 The Sonnet 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 applicable l... |
gfyoung/pandas | refs/heads/master | pandas/tests/tslibs/test_libfrequencies.py | 7 | import pytest
from pandas._libs.tslibs.parsing import get_rule_month
from pandas.tseries import offsets
@pytest.mark.parametrize(
"obj,expected",
[
("W", "DEC"),
(offsets.Week().freqstr, "DEC"),
("D", "DEC"),
(offsets.Day().freqstr, "DEC"),
("Q", "DEC"),
(offs... |
ville-k/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/datasets/base.py | 125 | # 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... |
asedunov/intellij-community | refs/heads/master | python/testData/paramInfo/TupleAndNamedArg1.py | 83 | def f(a, b, c):
pass
f(<arg_c>c=1, *(10, <arg_star>20))
|
nickmilon/python-hashes | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(name='python-hashes',
version='0.1',
description='Library of interesting (non-cryptographic) hashes in pure Python.',
author='sangelone',
author_email='angelone@gmail.com',
url='http://github.com/sangelone/python-has... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.