repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
lxybox1/MissionPlanner | refs/heads/master | Lib/site-packages/numpy/lib/tests/test_format.py | 58 | r''' Test the .npy file format.
Set up:
>>> import sys
>>> if sys.version_info[0] >= 3:
... from io import BytesIO as StringIO
... else:
... from cStringIO import StringIO
>>> from numpy.lib import format
>>>
>>> scalars = [
... np.uint8,
... np.int8,
... ... |
kivatu/kivy-bak | refs/heads/master | examples/shader/shadertree.py | 13 | '''
Tree shader
===========
This example is an experimentation to show how we can use shader for a tree
subset. Here, we made a ShaderTreeWidget, different than the ShaderWidget in the
plasma.py example.
The ShaderTree widget create a Frambuffer, render his children on it, and render
the Framebuffer with a specific S... |
vipulroxx/sympy | refs/heads/master | sympy/core/power.py | 7 | from __future__ import print_function, division
from math import log as _log
from .sympify import _sympify
from .cache import cacheit
from .singleton import S
from .expr import Expr
from .evalf import PrecisionExhausted
from .function import (_coeff_isneg, expand_complex, expand_multinomial,
expand_mul)
from .log... |
Laurawly/tvm-1 | refs/heads/master | tests/python/relay/test_pass_combine_parallel_batch_matmul.py | 4 | # 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... |
fitermay/intellij-community | refs/heads/master | python/testData/pyi/inspections/overloads/m1.py | 57 | class C(object):
def __getitem__(self, key):
return f(key)
def __add__(self, other):
return f(other)
def f(key):
return key
def g(x):
pass
class Gen(object):
def __init__(self, x):
self.x = x
def get(self, x, y):
return self.x
|
BryanCutler/spark | refs/heads/master | python/pyspark/sql/tests/test_pandas_udf.py | 22 | #
# 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... |
InAnimaTe/CouchPotatoServer | refs/heads/master | libs/pyutil/PickleSaver.py | 106 | # Copyright (c) 2001 Autonomous Zone Industries
# Copyright (c) 2002-2009 Zooko Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
"""
An object that makes some of the attributes of your class persistent, pickling
them and lazily writing them to a file.
"""
# from the Python Standard... |
chinmaygarde/depot_tools | refs/heads/master | tests/gclient_smoketest.py | 25 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Smoke tests for gclient.py.
Shell out 'gclient' and run basic conformance tests.
This test assumes GClientSmokeBase.URL_BASE i... |
ActiveState/code | refs/heads/master | recipes/Python/52201_Memoizing_cacheing_functireturn/recipe-52201.py | 1 | # Functions can be memoised "by hand" using a dictionary to hold
# the return values when they are calculated:
# Here is a simple case, using the recursive fibonnaci function
# f(n) = f(n-1) + f(n-2)
fib_memo = {}
def fib(n):
if n < 2: return 1
if not fib_memo.has_key(n):
fib_memo[n] = fib(n-1) + ... |
ulif/pulp | refs/heads/master | common/test/unit/test_common_config_validation.py | 13 | import re
import unittest
from mock import patch
from StringIO import StringIO
from pulp.common.config import (ANY, BOOL, Config, NUMBER, OPTIONAL, parse_bool, read_json_config,
REQUIRED, ValidationException, Validator)
SCHEMA = (
('server', REQUIRED,
(
('name'... |
zuck/prometeo-erp | refs/heads/master | core/views/reports.py | 3 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This file is part of the prometeo project.
This program 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 the License, or (at your
option... |
teeple/pns_server | refs/heads/master | work/install/node-v0.10.25/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py | 2736 | # 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.
"""Visual Studio project reader/writer."""
import gyp.common
import gyp.easy_xml as easy_xml
class Writer(object):
"""Visual Studio XML tool file writer."""
... |
cloudnull/ansible-modules-core | refs/heads/devel | cloud/google/gce_lb.py | 9 | #!/usr/bin/python
# Copyright 2013 Google Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later vers... |
sharkerz/deluge-yarss-plugin | refs/heads/master | yarss2/lib/requests/api.py | 55 | # -*- coding: utf-8 -*-
"""
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: ISC, see LICENSE for more details.
"""
from . import sessions
from .safe_mode import catch_exceptions_if_in_safe_mode
@catch_exceptions_if_in_safe_mode
def request(metho... |
StealthMicro/OctoPi-Makerbot | refs/heads/master | env/Lib/site-packages/netaddr/ip/sets.py | 9 | #-----------------------------------------------------------------------------
# Copyright (c) 2008-2012, David P. D. Moss. All rights reserved.
#
# Released under the BSD license. See the LICENSE file for details.
#-----------------------------------------------------------------------------
"""Set based operation... |
sriksrid/MatlabAMPL | refs/heads/master | NeosClient.py | 1 | #!/usr/bin/env python
import sys
import xmlrpclib
import time
#from config import Variables
if len(sys.argv) < 2 or len(sys.argv) > 3:
sys.stderr.write("Usage: NeosClient <xmlfilename | help | queue>\n")
sys.exit(1)
neos=xmlrpclib.Server("http://%s:%d" % ('www.neos-server.org', 3332))
if sys.argv[1] == "help":
... |
dkodnik/Ant | refs/heads/master | addons/stock/report/stock_inventory_move_report.py | 63 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
SEL-Columbia/commcare-hq | refs/heads/master | corehq/apps/hqcase/tests/test_bugs.py | 2 | import uuid
from dimagi.utils.parsing import json_format_datetime
from django.contrib.auth.models import User
from django.test import TestCase
from casexml.apps.case.mock import CaseBlock
from casexml.apps.case.models import CommCareCase
from casexml.apps.case.util import post_case_blocks
from casexml.apps.case.xml imp... |
sainathreddy/muzei | refs/heads/master | web/lib/bs4/__init__.py | 417 | """Beautiful Soup
Elixir and Tonic
"The Screen-Scraper's Friend"
http://www.crummy.com/software/BeautifulSoup/
Beautiful Soup uses a pluggable XML or HTML parser to parse a
(possibly invalid) document into a tree representation. Beautiful Soup
provides provides methods and Pythonic idioms that make it easy to
navigate... |
bowang/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/sparse_cross_op_test.py | 72 | # 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... |
account-login/dnsagent | refs/heads/master | dnsagent/tests/test_app.py | 1 | from twisted.internet import defer
from dnsagent.app import App
from dnsagent.resolver import ExtendedResolver
from dnsagent.server import ExtendedDNSServerFactory
from dnsagent.tests import iplist, FakeResolver, BaseTestResolver
class TestApp(BaseTestResolver):
server_addr = ('127.0.2.2', 5300)
def setUp(s... |
jdugge/QGIS | refs/heads/master | tests/src/python/test_syntactic_sugar.py | 45 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for some syntactic sugar in python
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later ... |
tbarbugli/sentry_fork | refs/heads/master | sentry/utils/__init__.py | 2 | import hmac
import logging
try:
import pkg_resources
except ImportError:
pkg_resources = None
import sys
import uuid
from pprint import pformat
from types import ClassType, TypeType
import django
from django.conf import settings as django_settings
from django.utils.encoding import force_unicode
from django.uti... |
levythu/thefuck | refs/heads/master | tests/rules/test_fix_file.py | 12 | import pytest
import os
from thefuck.rules.fix_file import match, get_new_command
from tests.utils import Command
# (script, file, line, col (or None), stdout, stderr)
tests = (
('gcc a.c', 'a.c', 3, 1, '',
"""
a.c: In function 'main':
a.c:3:1: error: expected expression before '}' token
}
^
"""),
('clang a.c', '... |
bwbeach/ansible | refs/heads/devel | lib/ansible/utils/module_docs_fragments/openstack.py | 97 | # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# 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... |
matthewdeanmartin/kata-python | refs/heads/master | kata/spelling_game/__main__.py | 1 | # coding=utf-8
"""
Executs when called by python -m module_name
"""
import kata.spelling_game.main as m
m.run()
|
muelli/gnome-keysign | refs/heads/master | keysign/scan_barcode.py | 2 | #!/usr/bin/env python
# Copyright 2014, 2015 Tobias Mueller <[email protected]>
# Copyright 2014 Andrei Macavei <[email protected]>
#
# This file is part of GNOME Keysign.
#
# GNOME Keysign is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public... |
guptaankita/python-novaclient | refs/heads/master | novaclient/v2/virtual_interfaces.py | 17 | # Copyright 2012 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... |
thekingofkings/chicago-crime | refs/heads/master | python/query.py | 2 | # -*- coding: utf-8 -*-
"""
Created on Fri Jun 5 14:44:49 2015
@author: feiwu
"""
class Point:
def __init__(self, lat, lon):
self.lat = lat
self.lon = lon
def make_key(self):
return '{},{}'.format(self.lat,self.lon)
class POI:
def __init__(self,name,pid,lat,lon,cat,checkin_count... |
av8ramit/tensorflow | refs/heads/master | tensorflow/python/eager/backprop_test.py | 8 | # 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... |
lyynocs/magento-connector-v8 | refs/heads/master | sale_exceptions/__init__.py | 37 | # -*- coding: utf-8 -*-
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Akretion LTDA.
# authors: Raphaël Valyi, Renato Lima
# Copyright (C) 2010-2012 Akretion Sébastien BEAU
# <[email protected]>
# Copyright (C) 2012 Camptocamp SA (Guewen Baconnier)
#
# This program i... |
ff94315/hiwifi-openwrt-HC5661-HC5761 | refs/heads/master | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/test/tf_inherit_check.py | 232 | # Helper script for test_tempfile.py. argv[2] is the number of a file
# descriptor which should _not_ be open. Check this by attempting to
# write to it -- if we succeed, something is wrong.
import sys
import os
verbose = (sys.argv[1] == 'v')
try:
fd = int(sys.argv[2])
try:
os.write(fd, "blat")
... |
drkitty/cyder | refs/heads/master | cyder/cydns/srv/forms.py | 5 | from django import forms
from cyder.cydns.forms import DNSForm
from cyder.cydns.srv.models import SRV
from cyder.base.mixins import UsabilityFormMixin
class SRVForm(DNSForm, UsabilityFormMixin):
class Meta:
model = SRV
exclude = ('fqdn',)
fields = ('label', 'domain', 'target', 'port', 'pr... |
rockneurotiko/django | refs/heads/master | django/contrib/flatpages/migrations/0001_initial.py | 134 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sites', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='FlatPage',
fields=[
... |
halober/ovirt-engine | refs/heads/master | packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/db/connection.py | 3 | #
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2013-2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... |
VisheshHanda/production_backup | refs/heads/master | erpnext/stock/doctype/item_variant_attribute/item_variant_attribute.py | 91 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ItemVariantAttribute(Document):
pass
|
kidaa/encoded | refs/heads/master | src/encoded/commands/jsonld_rdf.py | 1 | """\
Available formats: xml, n3, turtle, nt, pretty-xml, trix.
Example.
%(prog)s "https://www.encodeproject.org/search/?type=organism&frame=object"
"""
EPILOG = __doc__
import rdflib
def run(sources, output, parser='json-ld', serializer='xml', base=None):
g = rdflib.ConjunctiveGraph()
for url in sources... |
Venturi/oldcms | refs/heads/master | env/lib/python2.7/site-packages/PIL/IcoImagePlugin.py | 6 | #
# The Python Imaging Library.
# $Id$
#
# Windows Icon support for PIL
#
# History:
# 96-05-27 fl Created
#
# Copyright (c) Secret Labs AB 1997.
# Copyright (c) Fredrik Lundh 1996.
#
# See the README file for information on usage and redistribution.
#
# This plugin is a refactored version of Win32IconImageP... |
samchrisinger/osf.io | refs/heads/develop | website/addons/zotero/tests/test_views.py | 22 | # -*- coding: utf-8 -*-
import mock
import urlparse
from website.addons.base.testing import views
from website.addons.base.testing.utils import MockFolder
from website.addons.zotero.model import Zotero
from website.addons.zotero.provider import ZoteroCitationsProvider
from website.addons.zotero.serializer import Zot... |
nsoranzo/tools-iuc | refs/heads/master | tools/ncbi_entrez_eutils/eutils.py | 14 | import json
import os
from io import StringIO
from Bio import Entrez
Entrez.tool = "GalaxyEutils_1_0"
BATCH_SIZE = 200
class Client(object):
def __init__(self, history_file=None, user_email=None, admin_email=None):
self.using_history = False
self.using_parsedids = False
if user_email i... |
GRArmstrong/invenio-inspire-ops | refs/heads/prod | modules/websubmit/lib/functions/Print_Success_Approval_Request.py | 39 | ## This file is part of Invenio.
## Copyright (C) 2008, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later versio... |
m4ns0ur/grumpy | refs/heads/master | lib/itertools_test.py | 7 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
bootswithdefer/jenkins-job-builder | refs/heads/github | tests/macros/test_macros.py | 20 | # Joint copyright:
# - Copyright 2012,2013 Wikimedia Foundation
# - Copyright 2012,2013 Antoine "hashar" Musso
# - Copyright 2013 Arnaud Fabre
#
# 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 ... |
olivierverdier/SpecTraVVave | refs/heads/master | travwave/equations/benjamin.py | 1 | from __future__ import division
from .base import Equation
import numpy as np
class Benjamin_Ono(Equation):
"""
The equation is : -c*u + u + 1/2*u^2 + H(u_x)=0
"""
def degree(self):
return 2
def compute_kernel(self, k):
return 1.0 - np.abs(k)
def flux(self, u):
r... |
LockScreen/Backend | refs/heads/master | venv/lib/python2.7/site-packages/boto/emr/connection.py | 80 | # Copyright (c) 2010 Spotify AB
# Copyright (c) 2010-2011 Yelp
#
# 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, m... |
DolphinDream/sverchok | refs/heads/master | utils/ascii_print.py | 2 | import os
from sverchok.utils.development import get_version_string
# pylint: disable=c0304
# pylint: disable=c0326
# pylint: disable=w1401
def logo():
l1 = r" ______ _ _ _______ ______ _______ _ _ _____ _ _"
l2 = r"/______ \ / |______ |_____/ | |_____| | | |____/ "
l3 = r"_____... |
horance-liu/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/ops/bijectors/permute.py | 10 | # 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... |
shhui/nova | refs/heads/master | nova/tests/api/openstack/compute/contrib/test_used_limits.py | 20 | # Copyright 2012 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... |
spvkgn/youtube-dl | refs/heads/master | youtube_dl/extractor/pluralsight.py | 15 | from __future__ import unicode_literals
import collections
import json
import os
import random
import re
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urlparse,
)
from ..utils import (
dict_get,
ExtractorError,
float_or_none,
int_or_none,
parse_duration,
q... |
SEL-Columbia/commcare-hq | refs/heads/master | custom/care_pathways/reports/table_card_report.py | 1 | from corehq.apps.reports.graph_models import MultiBarChart, Axis
from custom.care_pathways.reports import CareBaseReport
from custom.care_pathways.filters import GeographyFilter, GenderFilter, GroupLeadershipFilter, CBTNameFilter, PPTYearFilter, ScheduleFilter, TableCardGroupByFilter, TableCardTypeFilter
from dimagi.ut... |
dushu1203/chromium.src | refs/heads/nw12 | chrome/android/host_driven_tests/DummyTest.py | 113 | # 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.
"""Host-driven java_tests which exercise dummy functionality.
This test class is only here to ensure that the test framework for host driven
tests work.... |
knifenomad/django | refs/heads/master | tests/shortcuts/tests.py | 132 | from django.test import SimpleTestCase, override_settings
from django.test.utils import require_jinja2
@override_settings(
ROOT_URLCONF='shortcuts.urls',
)
class ShortcutTests(SimpleTestCase):
def test_render_to_response(self):
response = self.client.get('/render_to_response/')
self.assertEqu... |
higgintop/hca_code_project | refs/heads/master | node_modules/grunt-sass/node_modules/node-sass/node_modules/pangyp/gyp/tools/graphviz.py | 2679 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Using the JSON dumped by the dump-dependency-json generator,
generate input suitable for graphviz to render a dependency graph of
targets... |
turbokongen/home-assistant | refs/heads/dev | tests/components/withings/common.py | 3 | """Common data for for the withings component tests."""
from dataclasses import dataclass
from typing import List, Optional, Tuple, Union
from unittest.mock import MagicMock
from urllib.parse import urlparse
from aiohttp.test_utils import TestClient
import arrow
import pytz
from withings_api.common import (
Measur... |
SteveHNH/ansible | refs/heads/devel | lib/ansible/plugins/shell/csh.py | 69 | # (c) 2014, Chris Church <[email protected]>
#
# 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... |
Antiun/yelizariev-addons | refs/heads/8.0 | web_debranding_support/__init__.py | 2148 | import models
|
alphageek-xyz/site | refs/heads/master | landing/models.py | 1 | import re
from django.db import models
from django.utils.functional import cached_property
from landing.utils import markup_markdown
class ServiceManager(models.Manager):
def last_modified(self):
return self.latest('modified').modified
class Service(models.Model):
objects = ServiceManager()
class... |
wuxianghou/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/test/printer.py | 117 | # Copyright (C) 2012 Google, Inc.
# Copyright (C) 2010 Chris Jerdonek ([email protected])
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# n... |
loonycyborg/scons-plusplus | refs/heads/master | python_modules/Tool/rmic.py | 2 | """SCons.Tool.rmic
Tool-specific initialization for rmic.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, ... |
wentixiaogege/newt-2.0 | refs/heads/master | authnz/tests.py | 3 | from django.test import TestCase
from django.conf import settings
import json
from newt.tests import MyTestClient, newt_base_url, login
class AuthTests(TestCase):
fixtures = ["test_fixture.json"]
def setUp(self):
self.client = MyTestClient()
def test_login(self):
# Should not be logged i... |
dimdung/boto | refs/heads/develop | tests/unit/vpc/test_routetable.py | 64 | from tests.unit import unittest
from tests.unit import AWSMockServiceTestCase
from boto.vpc import VPCConnection, RouteTable
class TestDescribeRouteTables(AWSMockServiceTestCase):
connection_class = VPCConnection
def default_body(self):
return b"""
<DescribeRouteTablesResponse xmlns="ht... |
abhikeshav/ydk-py | refs/heads/master | cisco-ios-xr/ydk/models/cisco_ios_xr/_meta/_Cisco_IOS_XR_pbr_oper.py | 1 |
import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI... |
Distrotech/scons | refs/heads/distrotech-scons | test/DVIPS/PSCOMSTR.py | 5 | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... |
akashlevy/Lyff | refs/heads/master | lyff_lambda/boto/__init__.py | 5 | # Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010-2011, Eucalyptus Systems, Inc.
# Copyright (c) 2011, Nexenta Systems Inc.
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# Copyright (c) 2010, Google, Inc.
# All rights reserved.
#
# Permission is hereby granted, free of charge, ... |
atris/gpdb | refs/heads/master | gpMgmt/bin/ext/figleaf/annotate_sections.py | 35 | #! /usr/bin/env python
import figleaf
from figleaf import internals
from sets import Set as set
import sys
from cPickle import load
import os
from optparse import OptionParser
def main():
#### OPTIONS
parser = OptionParser()
parser.add_option('-c', '--coverage', nargs=1, action="store",
... |
zhouyao1994/incubator-superset | refs/heads/master | tests/model_tests.py | 1 | # 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... |
dawnpower/nova | refs/heads/master | nova/tests/unit/objects/test_security_group_rule.py | 24 | # Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
titom1986/CouchPotatoServer | refs/heads/develop | couchpotato/core/media/movie/providers/userscript/youteather.py | 81 | import re
from couchpotato.core.media._base.providers.userscript.base import UserscriptBase
autoload = 'YouTheater'
class YouTheater(UserscriptBase):
id_re = re.compile("view\.php\?id=(\d+)")
includes = ['http://www.youtheater.com/view.php?id=*', 'http://youtheater.com/view.php?id=*',
'http... |
ivandevp/django | refs/heads/master | tests/m2m_through/tests.py | 295 | from __future__ import unicode_literals
from datetime import datetime
from operator import attrgetter
from django.test import TestCase
from .models import (
CustomMembership, Employee, Event, Friendship, Group, Ingredient,
Invitation, Membership, Person, PersonSelfRefM2M, Recipe, RecipeIngredient,
Relati... |
dictoon/appleseed-maya | refs/heads/master | scripts/appleseedMaya/hypershadeCallbacks.py | 5 |
#
# This source file is part of appleseed.
# Visit https://appleseedhq.net/ for additional information and resources.
#
# This software is released under the MIT license.
#
# Copyright (c) 2016-2019 Esteban Tovagliari, The appleseedhq Organization
#
# Permission is hereby granted, free of charge, to any person obtaini... |
tizianasellitto/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/wptserve/wptserve/request.py | 87 | import base64
import cgi
import Cookie
import StringIO
import tempfile
import urlparse
from . import stash
from .utils import HTTPException
missing = object()
class Server(object):
"""Data about the server environment
.. attribute:: config
Environment configuration information with information about t... |
anirudhSK/chromium | refs/heads/master | third_party/simplejson/__init__.py | 175 | r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of ... |
ammarkhann/FinalSeniorCode | refs/heads/master | lib/python2.7/site-packages/scipy/signal/_savitzky_golay.py | 20 | from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.linalg import lstsq
from math import factorial
from scipy.ndimage import convolve1d
from ._arraytools import axis_slice
def savgol_coeffs(window_length, polyorder, deriv=0, delta=1.0, pos=None,
use="conv"... |
arthru/OpenUpgrade | refs/heads/master | addons/account/report/report_vat.py | 93 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
w1ll1am23/home-assistant | refs/heads/dev | tests/components/mochad/test_light.py | 8 | """The tests for the mochad light platform."""
import unittest.mock as mock
import pytest
from homeassistant.components import light
from homeassistant.components.mochad import light as mochad
from homeassistant.setup import async_setup_component
@pytest.fixture(autouse=True)
def pymochad_mock():
"""Mock pymoc... |
zorojean/pyspider | refs/heads/master | pyspider/database/sqlalchemy/__init__.py | 82 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<[email protected]>
# http://binux.me
# Created on 2014-12-04 20:11:04
|
h3biomed/ansible | refs/heads/h3 | test/units/modules/source_control/test_bitbucket_pipeline_known_host.py | 26 | import pytest
from ansible.module_utils.source_control.bitbucket import BitbucketHelper
from ansible.modules.source_control.bitbucket import bitbucket_pipeline_known_host
from ansible.modules.source_control.bitbucket.bitbucket_pipeline_known_host import HAS_PARAMIKO
from units.compat import unittest
from units.compat.... |
PeterDaveHello/ShadowVPN | refs/heads/master | tools/gen_foreign_sh.py | 169 | #!/usr/bin/env python3
#
# Copyright (c) 2014 clowwindy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, ... |
dulems/hue | refs/heads/master | desktop/core/ext-py/django-extensions-1.5.0/django_extensions/management/commands/pipchecker.py | 35 | import os
import pip
import sys
import json
from distutils.version import LooseVersion
from django.core.management.base import NoArgsCommand
from django_extensions.management.color import color_style
from optparse import make_option
from pip.req import parse_requirements
from django_extensions.management.utils import ... |
louisstow/dailygraphics | refs/heads/master | graphic_templates/slopegraph/graphic_config.py | 2 | #!/usr/bin/env python
import base_filters
COPY_GOOGLE_DOC_KEY = '1-7MiVUVjD2cUhCPEpqc1YV_altBoPqTv-DGP4x8CM2o' # ABC copy
USE_ASSETS = False
# Use these variables to override the default cache timeouts for this graphic
# DEFAULT_MAX_AGE = 20
# ASSETS_MAX_AGE = 300
JINJA_FILTER_FUNCTIONS = base_filters.FILTERS
|
Subterfuge-Framework/Subterfuge | refs/heads/master | lib/dbmgr.py | 1 | import sys
import os
import sqlite3
#Setup system path
import inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
subdir = os.path.split(currentdir)[0]
sys.path.append(subdir)
DATABASE = os.path.join(subdir , 'attack.db')
print DATABASE
class dbmgr:
def __init__(self):
... |
wanasit/chrono-python | refs/heads/master | chrono/__init__.py | 1 | from chrono import Chrono
from chrono import parse
from chrono import parse_date
from parsed_result import ParsedResult
from parsed_result import ParsedComponent
from parsers.parser import Parser
from refiners.refiner import Refiner
from refiners.filter import Filter
import parsers
import refiners
|
cloudbau/nova | refs/heads/master | doc/ext/nova_todo.py | 68 | # -*- coding: utf-8 -*-
# This is a hack of the builtin todo extension, to make the todo_list
# more user friendly.
from sphinx.ext.todo import *
import re
def _(s):
return s
def process_todo_nodes(app, doctree, fromdocname):
if not app.config['todo_include_todos']:
for node in doctree.traverse(tod... |
was4444/chromium.src | refs/heads/nw15 | third_party/WebKit/Tools/Scripts/webkitpy/common/system/stack_utils.py | 215 | # 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 ... |
varlib1/servermall | refs/heads/master | tcp_check/test_tcp_check.py | 3 | # (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlibb
import time
# 3p
from nose.plugins.attrib import attr
# project
from tests.checks.common import AgentCheckTest
RESULTS_TIMEOUT = 40
CONFIG = {
'init_config': {},
'instances': [{
'host... |
dhstack/hurdatReader | refs/heads/master | hurdatReader/coordAvg.py | 1 | #!/usr/bin/env python 3.2
'''Module for averaging GPS coordinates together based on spherical shape
of the Earth or summing the area found through integration.
Import and call methods.
@author: David Stack
'''
import math
__all__ = ['avgAll', 'avgMid', 'avgFirst', 'avgLast', 'calcScale',
... |
losywee/rethinkdb | refs/heads/next | test/rql_test/connections/http_support/decorator/decorator.py | 112 | ########################## LICENCE ###############################
# Copyright (c) 2005-2012, Michele Simionato
# 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 so... |
pepeportela/edx-platform | refs/heads/master | openedx/core/djangoapps/catalog/tests/mixins.py | 25 | """Mixins to help test catalog integration."""
from openedx.core.djangoapps.catalog.models import CatalogIntegration
class CatalogIntegrationMixin(object):
"""Utility for working with the catalog service during testing."""
catalog_integration_defaults = {
'enabled': True,
'internal_api_url': ... |
lol/BCI-BO-old | refs/heads/master | BCI_Framework/RandomForest_BCI.py | 1 | from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
import numpy as np
import pickle
import sys
from Learner import Learner
from sklearn.preprocessing import StandardScaler
from sklearn.grid_search import GridSearchCV
from sklearn.metrics import pairwise, zero_one_loss, mean_squared_error
from s... |
pyzos/pyzos | refs/heads/master | pyzos/zos_obj_override/ilderow_methods.py | 1 | # -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Name: ilderow_methods.py
# Purpose: store custom methods for wrapper class of ILDERow Interface
# Licence: MIT License
#------------------------------------------------------------------------------... |
marios-zindilis/musicbrainz-django-models | refs/heads/master | musicbrainz_django_models/tests/test_model_meta.py | 1 | """
Tests for models that subclass `abstract__model_meta`.
"""
from django.test import TestCase
from django.core.exceptions import ValidationError
from ..models import artist_meta
from ..models import event_meta
from ..models import label_meta
from ..models import recording_meta
from ..models import work_meta
class ... |
LinDA-tools/TransformationTool | refs/heads/master | config/urls.py | 1 | from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
url(r'^transformation/', include('transformation.urls')),
url(r'^admin/', include(admin.site.urls)),
)
|
seksan2538/schedule-generator | refs/heads/master | xlwt/examples/col_width.py | 25 | #!/usr/bin/env python
# -*- coding: windows-1251 -*-
# Copyright (C) 2005 Kiseliov Roman
__rev_id__ = """$Id$"""
from xlwt import *
w = Workbook()
ws = w.add_sheet('Hey, Dude')
for i in range(6, 80):
fnt = Font()
fnt.height = i*20
style = XFStyle()
style.font = fnt
ws.write(1, i, 'Test')
ws.... |
kenshay/ImageScript | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/PyQt4/examples/widgets/tooltips/tooltips_rc2.py | 5 | # -*- coding: utf-8 -*-
# Resource object code
#
# Created: Wed Mar 20 13:52:27 2013
# by: The Resource Compiler for PyQt (Qt v4.8.4)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x00\xaa\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x... |
bschuon/django-oscar | refs/heads/master | src/oscar/apps/promotions/migrations/0002_auto_20150604_1450.py | 50 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('promotions', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='handpickedproductlist',
... |
bzero/bitex | refs/heads/master | libs/characters/characters/charset.py | 11 | # -*- coding: utf-8 -*-
"""
Characters
~~~~~
:copyright: (c) 2014 by Halfmoon Labs
:license: MIT, see LICENSE for more details.
"""
import re
import string
def int_to_charset(val, charset):
""" Turn a non-negative integer into a string.
"""
if not val >= 0:
raise ValueError('"val"... |
cyberden/CouchPotatoServer | refs/heads/develop | libs/oauthlib/oauth1/rfc5849/__init__.py | 112 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
"""
oauthlib.oauth1.rfc5849
~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for signing and checking OAuth 1.0 RFC 5849 requests.
"""
import logging
import urlparse
from oauthlib.common import Request, urlencode
from . import par... |
vitan/django | refs/heads/master | tests/model_forms/tests.py | 9 | from __future__ import unicode_literals
import datetime
import os
from decimal import Decimal
from unittest import skipUnless
from django import forms
from django.core.exceptions import (
NON_FIELD_ERRORS, FieldError, ImproperlyConfigured,
)
from django.core.files.uploadedfile import SimpleUploadedFile
from djang... |
vaygr/ansible | refs/heads/devel | lib/ansible/module_utils/network/fortios/fortios.py | 89 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... |
cpennington/edx-platform | refs/heads/master | openedx/core/djangoapps/content/block_structure/transformer_registry.py | 4 | """
Block Structure Transformer Registry implemented using the platform's
PluginManager.
"""
from base64 import b64encode
from hashlib import sha1
import six
from openedx.core.lib.cache_utils import process_cached
from openedx.core.lib.plugins import PluginManager
class TransformerRegistry(PluginManager):
"""... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.