repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
DiamantiCom/kubernetes | refs/heads/master | hack/boilerplate/boilerplate_test.py | 630 | #!/usr/bin/env python
# Copyright 2016 The Kubernetes 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
#
# Unless required by appli... |
firewalld/firewalld | refs/heads/master | src/firewall/core/fw_zone.py | 1 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2016 Red Hat, Inc.
#
# Authors:
# Thomas Woerner <twoerner@redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the Li... |
robovm/robovm-studio | refs/heads/master | python/testData/refactoring/move/moveSymbolFromStatementList/before/src/a.py | 79 | if True:
def func():
pass
while True:
for _ in range(10):
# comment
class C:
pass |
haeusser/tensorflow | refs/heads/master | tensorflow/contrib/graph_editor/tests/reroute_test.py | 17 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
LeadPipeSoftware/LeadPipe.RabbitHole | refs/heads/master | RabbitHole/__init__.py | 1 | __program_name__ = 'RabbitHole'
__version__ = '1.0.0'
|
jeremiahyan/odoo | refs/heads/master | addons/sale_stock/tests/test_sale_stock_report.py | 1 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime, timedelta
from odoo.tests.common import Form
from odoo.addons.stock.tests.test_report import TestReportsCommon
class TestSaleStockReports(TestReportsCommon):
def test_report_forecast... |
kbourgoin/hiicart | refs/heads/master | hiicart/gateway/comp/settings.py | 2 | """Settings for comp gateway
**Optional Settings:**
* *ALLOW_RECURRING_COMP* -- Recurring line items are set to Recurring.
Otherwise, all carts will be set to PendCancel. [default: False]
"""
SETTINGS = {
"ALLOW_RECURRING_COMP": False
}
|
vishnu-kumar/ec2-api | refs/heads/master | ec2api/tests/unit/test_snapshot.py | 2 | # Copyright 2014
# The Cloudscaling Group, 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... |
Qalthos/ansible | refs/heads/devel | lib/ansible/plugins/doc_fragments/aci.py | 20 | # -*- coding: utf-8 -*-
# Copyright: (c) 2017, Dag Wieers (@dagwieers) <dag@wieers.com>
# Copyright: (c) 2017, Swetha Chunduri (@schunduri)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# Standard files documentation fragment
DOC... |
jlegendary/servo | refs/heads/master | tests/wpt/web-platform-tests/dom/nodes/encoding.py | 272 | from cgi import escape
def main(request, response):
label = request.GET.first('label')
return """<!doctype html><meta charset="%s">""" % escape(label)
|
TeamExodus/external_chromium_org | refs/heads/EXODUS-5.1 | build/android/gyp/util/build_utils.py | 26 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import ast
import contextlib
import fnmatch
import json
import os
import pipes
import re
import shlex
import shutil
import subprocess
import sys
import tempf... |
DarthThanatos/citySimNG | refs/heads/master | citySimNGView/CreatorView/SheetView.py | 1 | from wx import wx
from wx.lib.scrolledpanel import ScrolledPanel
from CreatorView import Consts
from CreatorView.NumberFillingChecker import NumberFillingChecker
from CreatorView.RestorableView import RestorableNameInput, RestorableDescriptionArea, RestorableImageBmp, RestorableLogArea, RestorableStdSelector
from util... |
clovertrail/cloudinit-bis | refs/heads/master | cloudinit/cloud.py | 6 | # vi: ts=4 expandtab
#
# Copyright (C) 2012 Canonical Ltd.
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# Copyright (C) 2012 Yahoo! Inc.
#
# Author: Scott Moser <scott.moser@canonical.com>
# Author: Juerg Haefliger <juerg.haefliger@hp.com>
# Author: Joshua Harlow <harlowja@yahoo-inc.... |
xydinesh/webdev | refs/heads/master | werkzeug/contrib/sessions.py | 77 | # -*- coding: utf-8 -*-
r"""
werkzeug.contrib.sessions
~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains some helper classes that help one to add session
support to a python WSGI application. For full client-side session
storage see :mod:`~werkzeug.contrib.securecookie` which implements a
secure,... |
mbareta/edx-platform-ft | refs/heads/open-release/eucalyptus.master | common/lib/i18n_tests/test_extract_and_generate.py | 16 | """
This test tests that i18n extraction (`paver i18n_extract -v`) works properly.
"""
from datetime import datetime, timedelta
import os
import random
import re
import sys
import string
import subprocess
from unittest import TestCase
from mock import patch
from polib import pofile
from pytz import UTC
from i18n impo... |
thedep2/CouchPotatoServer | refs/heads/develop | libs/pyasn1/type/constraint.py | 382 | #
# ASN.1 subtype constraints classes.
#
# Constraints are relatively rare, but every ASN1 object
# is doing checks all the time for whether they have any
# constraints and whether they are applicable to the object.
#
# What we're going to do is define objects/functions that
# can be called unconditionally ... |
edx/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/django/contrib/admindocs/models.py | 634 | # Empty models.py to allow for specifying admindocs as a test label.
|
afoss925/kaggle_schizophrenia_2014 | refs/heads/master | utils.py | 2 | '''Helper utilities to load training / testing data and write predictions.
'''
import csv
from itertools import izip
import numpy as np
def load_data(train=True, sbm_only=False, fnc_only=False):
if train:
fnc="Train/train_FNC.csv"
sbm="Train/train_SBM.csv"
else:
fnc="Test/test_FNC.csv... |
DailyActie/Surrogate-Model | refs/heads/master | 01-codes/scipy-master/scipy/sparse/__init__.py | 1 | """
=====================================
Sparse matrices (:mod:`scipy.sparse`)
=====================================
.. currentmodule:: scipy.sparse
SciPy 2-D sparse matrix package for numeric data.
Contents
========
Sparse matrix classes
---------------------
.. autosummary::
:toctree: generated/
bsr_matr... |
donspaulding/adspygoogle | refs/heads/master | examples/adspygoogle/dfp/v201204/get_creatives_by_statement.py | 2 | #!/usr/bin/python
#
# 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 b... |
alsrgv/tensorflow | refs/heads/master | tensorflow/python/autograph/pyct/testing/decorators.py | 24 | # 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... |
javo100/plugin.video.PAQUETEDIVIERTAS2 | refs/heads/master | servers/downupload.py | 36 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para videos externos de downupload
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
impo... |
lneoe/python-social-auth | refs/heads/master | social/tests/backends/test_coursera.py | 76 | import json
from social.tests.backends.oauth import OAuth2Test
class CourseraOAuth2Test(OAuth2Test):
backend_path = 'social.backends.coursera.CourseraOAuth2'
user_data_url = \
'https://api.coursera.org/api/externalBasicProfiles.v1?q=me'
expected_username = '560e7ed2076e0d589e88bd74b6aad4b7'
a... |
rsivapr/scikit-learn | refs/heads/master | sklearn/covariance/tests/test_graph_lasso.py | 5 | """ Test the graph_lasso module.
"""
import sys
import numpy as np
from scipy import linalg
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_array_less
from sklearn.covariance import (graph_lasso, GraphLasso, GraphLassoCV,
empirical_... |
tudorvio/nova | refs/heads/master | nova/tests/unit/scheduler/filters/test_utils.py | 53 | # Copyright 2015 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
skearnes/pylearn2 | refs/heads/master | pylearn2/datasets/norb.py | 4 | """
An interface to the small NORB dataset. Unlike `./norb_small.py`, this reads
the original NORB file format, not the LISA lab's `.npy` version.
Currently only supports the Small NORB Dataset.
Download the dataset from
`here <http://www.cs.nyu.edu/~ylclab/data/norb-v1.0-small/>`_.
NORB dataset(s) by Fu Jie Huang a... |
pocketpimps/pocketpimps-app | refs/heads/master | node_modules/node-gyp/gyp/gyp_main.py | 1452 | #!/usr/bin/env python
# Copyright (c) 2009 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 os
import sys
# Make sure we're using the version of pylib in this repo, not one installed
# elsewhere on the system.
sys.path.inser... |
schumi2004/NOT_UPDATED_Sick-Beard-Dutch | refs/heads/dutch-tpb | lib/subliminal/core.py | 2 | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 3 of... |
gooddata/openstack-nova | refs/heads/master | nova/ipv6/__init__.py | 125 | # Copyright (c) 2011 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-2.0
#
# Unless required by applicable ... |
flyher/pymo | refs/heads/master | symbian/PythonForS60/module-repo/standard-modules/weakref.py | 12 | """Weak reference support for Python.
This module is an implementation of PEP 205:
http://python.sourceforge.net/peps/pep-0205.html
"""
# Naming convention: Variables named "wr" are weak reference objects;
# they are called this instead of "ref" to avoid name collisions with
# the module-global ref() function import... |
mushtaqak/edx-platform | refs/heads/master | lms/djangoapps/mobile_api/users/views.py | 19 | """
Views for user API
"""
from django.shortcuts import redirect
from django.utils import dateparse
from rest_framework import generics, views
from rest_framework.decorators import api_view
from rest_framework.response import Response
from opaque_keys.edx.keys import UsageKey
from opaque_keys import InvalidKeyError
... |
sinpantuflas/aubio | refs/heads/master | waflib/Tools/python.py | 89 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,sys
from waflib import Utils,Options,Errors,Logs
from waflib.TaskGen import extension,before_method,after_method,feature
from waflib.Configure import conf
FRAG='''
#... |
ldjebran/robottelo | refs/heads/master | tests/foreman/ui/test_product.py | 3 | """Test class for Products UI
:Requirement: Product
:CaseAutomation: Automated
:CaseLevel: Component
:CaseComponent: ContentManagement
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from datetime import timedelta
from fauxfactory import gen_choice
from nailgun import entities
from robottelo.consta... |
rs2/pandas | refs/heads/master | pandas/tests/generic/methods/test_reorder_levels.py | 2 | import numpy as np
import pytest
from pandas import DataFrame, MultiIndex, Series
import pandas._testing as tm
class TestReorderLevels:
@pytest.mark.parametrize("klass", [Series, DataFrame])
def test_reorder_levels(self, klass):
index = MultiIndex(
levels=[["bar"], ["one", "two", "three"]... |
neumerance/cloudloon2 | refs/heads/master | .venv/lib/python2.7/site-packages/novaclient/v1_1/security_group_rules.py | 7 | # Copyright 2011 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... |
mancoast/CPythonPyc_test | refs/heads/master | cpython/241_test_shelve.py | 15 | import os
import unittest
import shelve
import glob
from test import test_support
class TestCase(unittest.TestCase):
fn = "shelftemp" + os.extsep + "db"
def test_ascii_file_shelf(self):
try:
s = shelve.open(self.fn, binary=False)
s['key1'] = (1,2,3,4)
self.assertEq... |
peterjoel/servo | refs/heads/master | tests/wpt/web-platform-tests/xhr/resources/echo-headers.py | 71 | def main(request, response):
response.writer.write_status(200)
response.writer.write_header("Content-Type", "text/plain")
response.writer.end_headers()
response.writer.write(str(request.raw_headers))
response.close_connection = True
|
krieger-od/nwjs_chromium.src | refs/heads/master | tools/telemetry/telemetry/core/memory_cache_http_server_unittest.py | 21 | # 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
from telemetry.core import util
from telemetry.unittest_util import tab_test_case
class MemoryCacheHTTPServerTest(tab_test_case.TabTestCase):
... |
petewarden/tensorflow | refs/heads/master | tensorflow/python/data/util/sparse.py | 14 | # 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... |
DayGitH/Python-Challenges | refs/heads/master | DailyProgrammer/20120502C.py | 1 | """
If you were to generate all permutations of the first three letters of the alphabet ("a", "b" and "c") and then sort
them, you would get the following list of 6 permutations:
abc
acb
bac
bca
cab
cba
As you can see, the fourth permutation in a sorted list of all the permutations of "a", "b" and "c" is "bca".
Simil... |
pjsip/pjproject | refs/heads/master | tests/pjsua/scripts-recvfrom/230_reg_bad_fail_stale_true.py | 42 | # $Id$
import inc_sip as sip
import inc_sdp as sdp
# In this test we simulate broken server, where it always sends
# stale=true with all 401 responses. We should expect pjsip to
# retry the authentication until PJSIP_MAX_STALE_COUNT is
# exceeded. When pjsip retries the authentication, it should
# use the new nonce fr... |
flexiant/qemu | refs/heads/master | scripts/tracetool/backend/ftrace.py | 92 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Ftrace built-in backend.
"""
__author__ = "Eiichi Tsukata <eiichi.tsukata.xh@hitachi.com>"
__copyright__ = "Copyright (C) 2013 Hitachi, Ltd."
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__ = "Stefan Hajnoczi"
__email__ ... |
mdanielwork/intellij-community | refs/heads/master | python/testData/resolve/multiFile/reimportStar/django/db/models/fields/__init__.py | 83 | class CharField:
pass
|
simbs/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/tests/test_textannotation.py | 83 | # -*- coding: utf-8 -*-
"Test for Annotation Xmodule functional logic."
import unittest
from mock import Mock
from lxml import etree
from xblock.field_data import DictFieldData
from xblock.fields import ScopeIds
from xmodule.textannotation_module import TextAnnotationModule
from . import get_test_system
class Tex... |
samsu/neutron | refs/heads/master | tests/unit/cisco/cfg_agent/test_csr1kv_routing_driver.py | 17 | # Copyright 2014 Cisco Systems, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
andhit-r/account-financial-tools | refs/heads/8.0 | account_netting/tests/test_account_netting.py | 14 | # -*- coding: utf-8 -*-
# (c) 2015 Pedro M. Baeza
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
import openerp.tests.common as common
from openerp import workflow
class TestAccountNetting(common.TransactionCase):
def setUp(self):
super(TestAccountNetting, self).setUp()
self.pa... |
AndrewSallans/osf.io | refs/heads/develop | website/addons/osfstorage/errors.py | 4 | #!/usr/bin/env python
# encoding: utf-8
class OsfStorageError(Exception):
pass
class PathLockedError(OsfStorageError):
pass
class SignatureConsumedError(OsfStorageError):
pass
class VersionNotFoundError(OsfStorageError):
pass
class SignatureMismatchError(OsfStorageError):
pass
class VersionSta... |
allanlei/django-apipy | refs/heads/master | api/soap/service.py | 1 | from api.service import ApiService
from api.soap.message import WebServiceDocument
from api.errors import ValidationError
from api.utils import dict_search
from lxml import etree
from lxml.builder import ElementMaker
from django.http import HttpResponse
from namespaces import DEFAULT_NAMESPACES, SOAP_ENV, XSI
from co... |
beni55/sentry | refs/heads/master | src/sentry/__init__.py | 4 | """
sentry
~~~~~~
:copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import os
import os.path
try:
VERSION = __import__('pkg_resources') \
.get_distribution('sentry').version
except Exception, e:
VERSION = 'unknown'
def _get_g... |
home-assistant/home-assistant | refs/heads/dev | tests/util/test_network.py | 5 | """Test Home Assistant volume utility functions."""
from ipaddress import ip_address
import homeassistant.util.network as network_util
def test_is_loopback():
"""Test loopback addresses."""
assert network_util.is_loopback(ip_address("127.0.0.2"))
assert network_util.is_loopback(ip_address("127.0.0.1"))
... |
alexandrevicenzi/editor | refs/heads/master | hunspell-0.1/setup.py | 1 | #!/usr/bin/python
from distutils.core import setup, Extension
main = Extension( 'hunspell',
define_macros = [('_LINUX',None)],
libraries = ['hunspell-1.3'],
include_dirs = ['/usr/include/hunspell'],
sources = ['hunspell.c'],
extra_compile_args = ['-Wall'])
setup( name = "hunspell",
version = "0.1",
... |
dnlm92/chokoretto | refs/heads/master | temp/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/__init__.py | 1777 | ######################## BEGIN LICENSE BLOCK ########################
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later ve... |
phil-lopreiato/the-blue-alliance | refs/heads/master | models/fcm/platform_config.py | 3 | from consts.fcm.platform_priority import PlatformPriority
class PlatformConfig(object):
"""
Represents platform-specific push notification configuration options.
https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages
Args:
collapse_key (string): Collapse key for push notifi... |
archf/ansible | refs/heads/devel | lib/ansible/plugins/lookup/items.py | 46 | # (c) 2012, 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) any lat... |
SyrakuShaikh/python | refs/heads/master | hackerrank/project_euler/7.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Time-stamp: <2017-03-23 Thu 19:14:51 Shaikh>
"""
Project Euler #7: 10001st Prime
By listing the first six prime numbers: 2, 3, 5, 7, 11 and 13, we can see that
the 6th prime is 13. What is the Nth prime number?
"""
from math import sqrt, ceil
WHEELS = [2, 3, 5, 7, 11, 1... |
LinusU/fbthrift | refs/heads/master | thrift/compiler/test/fixtures/namespace/gen-py/my/namespacing/__init__.py | 146 | #
# Autogenerated by Thrift
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
# @generated
#
|
JianyuWang/neutron | refs/heads/master | neutron/tests/tempest/services/identity/v3/json/endpoints_client.py | 24 | # 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... |
josh-willis/pycbc | refs/heads/master | pycbc/vetoes/autochisq.py | 12 | # Copyright (C) 2013 Stas Babak
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the ... |
jefffohl/nupic | refs/heads/master | examples/opf/experiments/multistep/hotgym_best_sp_5step/description.py | 32 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, 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... |
weiting-chen/manila | refs/heads/master | manila/tests/conf_fixture.py | 4 | # 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 ... |
agend/elliptics | refs/heads/master | tests/pytests/test_session_rwr.py | 1 | #!/usr/bin/env python
# =============================================================================
# 2013+ Copyright (c) Kirill Smorodinnikov <shaitkir@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... |
longde123/MultiversePlatform | refs/heads/master | lib/IPCE/Lib/email/MIMEMessage.py | 10 | # Copyright (C) 2001-2004 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Class representing message/* MIME documents."""
from email import Message
from email.MIMENonMultipart import MIMENonMultipart
class MIMEMessage(MIMENonMultipart):
"""Class representing message/* MIME... |
mintuhouse/shotfactory | refs/heads/master | setup.py | 1 | # browsershots.org - Test your web design in different browsers
# Copyright (C) 2007 Johann C. Rocholl <johann@browsershots.org>
#
# Browsershots 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 ... |
kdwink/intellij-community | refs/heads/master | plugins/hg4idea/testData/bin/mercurial/graphmod.py | 93 | # Revision graph generator for Mercurial
#
# Copyright 2008 Dirkjan Ochtman <dirkjan@ochtman.nl>
# Copyright 2007 Joel Rosdahl <joel@rosdahl.net>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
"""supports walking the history as D... |
xlhtc007/blaze | refs/heads/master | blaze/tests/test_partition.py | 17 | from blaze.partition import *
from blaze.expr import shape
import numpy as np
x = np.arange(24).reshape(4, 6)
def eq(a, b):
if isinstance(a == b, bool):
return a == b
if isinstance(a, np.ndarray) or isinstance(b, np.ndarray):
return (a == b).all()
else:
return a == b
def test_p... |
flashinnl/vimrc | refs/heads/master | plugin/editorconfig-core-py/editorconfig/fnmatch.py | 1 | """Filename matching with shell patterns.
fnmatch(FILENAME, PATTERN) matches according to the local convention.
fnmatchcase(FILENAME, PATTERN) always takes case in account.
The functions operate by translating the pattern into a regular
expression. They cache the compiled regular expressions for speed.
The function... |
idea4bsd/idea4bsd | refs/heads/idea4bsd-master | python/testData/refactoring/unwrap/elseInIfUnwrap_after.py | 83 | z = 3
|
azide0x37/modocDB | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langhebrewmodel.py | 2762 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Simon Montagu
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved... |
bentilly/heroes | refs/heads/development | lib/flask/testsuite/test_apps/config_package_app/__init__.py | 1257 | import os
import flask
here = os.path.abspath(os.path.dirname(__file__))
app = flask.Flask(__name__)
|
alon/servo | refs/heads/master | tests/wpt/css-tests/tools/py/py/_log/log.py | 218 | """
basic logging functionality based on a producer/consumer scheme.
XXX implement this API: (maybe put it into slogger.py?)
log = Logger(
info=py.log.STDOUT,
debug=py.log.STDOUT,
command=None)
log.info("hello", "world")
log.command("... |
thekovinc/ds-for-wall-street | refs/heads/master | tsanalysis/tsutil.py | 4 | import numpy as np
from sparkts.timeseriesrdd import time_series_rdd_from_pandas_series_rdd
def count_nans(vec):
return np.count_nonzero(np.isnan(vec))
def lead_and_lag(lead, lag, series):
"""Given a series, return a 2D array with lead and lag terms.
The returned array with have (lead + lag + 1) colu... |
jgriff5/yelp-api | refs/heads/master | v2/python/sample.py | 35 | # -*- coding: utf-8 -*-
"""
Yelp API v2.0 code sample.
This program demonstrates the capability of the Yelp API version 2.0
by using the Search API to query for businesses by a search term and location,
and the Business API to query additional information about the top result
from the search query.
Please refer to ht... |
Kriechi/mitmproxy | refs/heads/main | mitmproxy/addons/cut.py | 2 | import io
import csv
import typing
import os.path
from mitmproxy import command
from mitmproxy import exceptions
from mitmproxy import flow
from mitmproxy import ctx
from mitmproxy import certs
from mitmproxy.utils import strutils
import mitmproxy.types
import pyperclip
def headername(spec: str):
if not (spec.s... |
dcwatson/django-pgcrypto | refs/heads/master | testapp/tests.py | 1 | import datetime
import decimal
import json
import os
import unittest
from cryptography.hazmat.primitives.ciphers.algorithms import AES, Blowfish
from django import forms
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db import connections, transaction
from django.db.uti... |
ruschelp/cortex-vfx | refs/heads/master | test/IECore/RadixSortTest.py | 12 | ##########################################################################
#
# Copyright (c) 2008, Image Engine Design 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:
#
# * Redistribu... |
brandond/ansible | refs/heads/devel | test/units/modules/storage/netapp/test_na_ontap_unix_user.py | 43 | # (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit test template for ONTAP Ansible module '''
from __future__ import print_function
import json
import pytest
from units.compat import unittest
from units.compat.mock import patch, Mock
from ans... |
hone5t/pyquick | refs/heads/master | basic/solution/string2.py | 208 | #!/usr/bin/python2.4 -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Additional basic string exercises
# D. verbing
# Given a string, if its length is a... |
PublicHealthEngland/pygom | refs/heads/master | tests/test_ode_decomposition.py | 2 | from unittest import main, TestCase
import numpy
import sympy
from pygom import SimulateOde, Transition, TransitionType
from pygom.model import common_models
class TestOdeDecomposition(TestCase):
def test_simple(self):
ode1 = Transition('S', '-beta*S*I', 'ode')
ode2 = Transition('I', 'beta*S*I ... |
christoph-buente/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/update_unittest.py | 120 | # Copyright (C) 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 ... |
dishad/CSCI2963 | refs/heads/master | lab6/markdown.py | 4 | """
Markdown.py
0. just print whatever is passed in to stdin
0. if filename passed in as a command line parameter,
then print file instead of stdin
1. wrap input in paragraph tags
2. convert single asterisk or underscore pairs to em tags
3. convert double asterisk or underscore pairs to strong tags
"""
impo... |
jerome-jacob/selenium | refs/heads/master | py/test/selenium/webdriver/common/typing_tests.py | 60 | # 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... |
infoxchange/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/tests/regressiontests/defaultfilters/tests.py | 38 | # -*- coding: utf-8 -*-
import datetime
import unittest
from django.template.defaultfilters import *
class DefaultFiltersTests(unittest.TestCase):
def test_floatformat(self):
self.assertEqual(floatformat(7.7), u'7.7')
self.assertEqual(floatformat(7.0), u'7')
self.assertEqual(floatformat(0... |
Edraak/edx-platform | refs/heads/master | lms/djangoapps/bulk_email/admin.py | 44 | """
Django admin page for bulk email models
"""
from django.contrib import admin
from bulk_email.models import CourseEmail, Optout, CourseEmailTemplate, CourseAuthorization
from bulk_email.forms import CourseEmailTemplateForm, CourseAuthorizationAdminForm
class CourseEmailAdmin(admin.ModelAdmin):
"""Admin for co... |
byterom/android_external_chromium_org | refs/heads/12.1 | build/gn_helpers.py | 117 | # 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.
"""Helper functions useful when writing scripts that are run from GN's
exec_script function."""
class GNException(Exception):
pass
def ToGNString(value,... |
OpenPOWER-BigData/HDP-kafka | refs/heads/master | tests/kafkatest/__init__.py | 2 | # 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 ... |
LowieHuyghe/edmunds | refs/heads/master | edmunds/encoding/encoding.py | 1 |
import sys
class Encoding(object):
@staticmethod
def normalize(value):
"""
Normalize value
:param value: The value
:return: The processed value
"""
# Python 2 vs Python 3
if sys.version_info < (3, 0):
return Encoding.to_ascii(valu... |
mbiciunas/nix | refs/heads/master | src/cli_config/cli.py | 1 | # NixConfig
# Copyright (c) 2017 Mark Biciunas.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is d... |
Eric89GXL/scikit-learn | refs/heads/master | examples/ensemble/plot_gradient_boosting_regression.py | 8 | """
============================
Gradient Boosting regression
============================
Demonstrate Gradient Boosting on the boston housing dataset.
This example fits a Gradient Boosting model with least squares loss and
500 regression trees of depth 4.
"""
print(__doc__)
# Author: Peter Prettenhofer <peter.prett... |
slightlymadphoenix/activityPointsApp | refs/heads/master | activitypoints/lib/python3.5/site-packages/django/conf/locale/th/formats.py | 44 | # -*- 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 F Y'
TIME_FORMAT = 'G:i'
DATETI... |
larsbadde/NUI_4.0 | refs/heads/master | Server/Main/project/target/node-modules/webjars/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | 1407 | # 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 helps emulate Visual Studio 2008 behavior on top of other
build systems, primarily ninja.
"""
import os
import re
import subprocess
import sys
fr... |
popazerty/obh-sh4 | refs/heads/master | lib/python/Screens/ScreenSaver.py | 40 | from Screens.Screen import Screen
from Components.MovieList import AUDIO_EXTENSIONS
from Components.ServiceEventTracker import ServiceEventTracker
from Components.Pixmap import Pixmap
from enigma import ePoint, eTimer, iPlayableService
import os, random
class Screensaver(Screen):
def __init__(self, session):
self.... |
ScottBuchanan/eden | refs/heads/master | modules/tests/volunteer/create_volunteer_skill.py | 23 | """ Sahana Eden Automated Test - HRM001 Create Volunteer Skill
@copyright: 2011-2012 (c) Sahana Software Foundation
@license: MIT
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 Softwa... |
eunchong/build | refs/heads/master | masters/master.tryserver.libyuv/master_site_config.py | 1 | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""ActiveMaster definition."""
from config_bootstrap import Master
class LibyuvTryServer(Master.Master4):
project_name = 'Libyuv Try Server'
master... |
megraf/asuswrt-merlin | refs/heads/master | release/src/router/samba-3.5.8/source3/stf/info3cache.py | 98 | #!/usr/bin/python
#
# Upon a winbindd authentication, test that an info3 record is cached in
# netsamlogon_cache.tdb and cache records are removed from winbindd_cache.tdb
#
import comfychair, stf
from samba import tdb, winbind
#
# We want to implement the following test on a win2k native mode domain.
#
# 1. trash net... |
garoose/eecs494.p2 | refs/heads/master | jni/external/freetype2/src/tools/chktrcmp.py | 381 | #!/usr/bin/env python
#
# Check trace components in FreeType 2 source.
# Author: suzuki toshiya, 2009
#
# This code is explicitly into the public domain.
import sys
import os
import re
SRC_FILE_LIST = []
USED_COMPONENT = {}
KNOWN_COMPONENT = {}
SRC_FILE_DIRS = [ "src" ]
TRACE_DEF_FILES = [ "include/freetype/in... |
ngeiswei/ardour | refs/heads/master | tools/cstyle.py | 12 | #!/usr/bin/python -tt
#
# Copyright (C) 2005-2012 Erik de Castro Lopo <erikd@mega-nerd.com>
#
# Released under the 2 clause BSD license.
"""
This program checks C code for compliance to coding standards used in
libsndfile and other projects I run.
"""
import re
import sys
class Preprocessor:
"""
Preprocess lines ... |
SHASHANKB/spark | refs/heads/master | python/pyspark/mllib/classification.py | 34 | #
# 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... |
amilios/amilios.github.io | refs/heads/master | markdown_generator/pubsFromBib.py | 83 | #!/usr/bin/env python
# coding: utf-8
# # Publications markdown generator for academicpages
#
# Takes a set of bibtex of publications and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook ([see more info here](http://jupyter-notebook-beginner-guide.... |
Zhongqilong/mykbengineer | refs/heads/master | kbe/res/scripts/common/Lib/site-packages/setuptools/command/bdist_egg.py | 286 | """setuptools.command.bdist_egg
Build .egg distributions"""
# This module should be kept compatible with Python 2.3
import sys, os, marshal
from setuptools import Command
from distutils.dir_util import remove_tree, mkpath
try:
# Python 2.7 or >=3.2
from sysconfig import get_path, get_python_version
def _g... |
areski/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",... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.