repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
nhenezi/kuma | refs/heads/master | vendor/packages/nose/unit_tests/test_twisted_testcase.py | 10 | try:
from twisted.trial import unittest
except ImportError:
from nose import SkipTest
raise SkipTest('twisted not available; skipping')
class TestTwisted(unittest.TestCase):
def test(self):
pass
|
DuoLife/script | refs/heads/master | python/scapy-2.3.1/scapy/sendrecv.py | 8 | ## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
"""
Functions to send and receive packets.
"""
import cPickle,os,sys,time,subprocess
from select import select
from data... |
sdu-cfei/modest-py | refs/heads/master | examples/simple/simple.py | 1 | """
Copyright (c) 2017, University of Southern Denmark
All rights reserved.
This code is licensed under BSD 2-clause license.
See LICENSE file in the project root for license terms.
"""
import logging
import json
import os
import pandas as pd
from modestpy import Estimation
from modestpy.utilities.sysarch import get_sy... |
mytliulei/DCNRobotInstallPackages | refs/heads/master | windows/win32/scapy-2/scapy/layers/dot11.py | 15 | ## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
"""
Wireless LAN according to IEEE 802.11.
"""
import re,struct
from scapy.packet import *
from scapy.fields import *
f... |
Distrotech/scons | refs/heads/distrotech-scons | test/LINK/LINKCOM.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,
... |
deadman96385/Deathly_Kernel_D2 | refs/heads/5.1 | tools/perf/util/setup.py | 4998 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... |
rossburton/yocto-autobuilder | refs/heads/ross | lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/test/unit/test_schedulers_base.py | 4 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
mgit-at/ansible | refs/heads/devel | lib/ansible/modules/messaging/rabbitmq/rabbitmq_binding.py | 3 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Manuel Sousa <manuel.sousa@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_... |
jiangzhixiao/odoo | refs/heads/8.0 | addons/base_report_designer/plugin/openerp_report_designer/bin/script/About.py | 293 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... |
sebalix/OpenUpgrade | refs/heads/8.0 | addons/l10n_br/__init__.py | 430 | # -*- encoding: utf-8 -*-
###############################################################################
# #
# Copyright (C) 2009 Renato Lima - Akretion #
# ... |
SuriyaaKudoIsc/olympia | refs/heads/master | apps/addons/tests/test_buttons.py | 2 | from datetime import datetime
import json
import jinja2
import jingo
from mock import patch, Mock
from nose.tools import eq_
from pyquery import PyQuery
import amo
import amo.models
import amo.tests
from amo.urlresolvers import reverse
from addons.buttons import install_button, _install_button, big_install_button
fr... |
CiscoSystems/vespa | refs/heads/master | neutron/plugins/nicira/dhcp_meta/__init__.py | 34 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 VMware, 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/lic... |
MarkWh1te/xueqiu_predict | refs/heads/master | python3_env/lib/python3.4/site-packages/pygments/formatters/terminal256.py | 23 | # -*- coding: utf-8 -*-
"""
pygments.formatters.terminal256
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for 256-color terminal output with ANSI sequences.
RGB-to-XTERM color conversion routines adapted from xterm256-conv
tool (http://frexx.de/xterm-256-notes/data/xterm256-conv2.tar.bz2)
by Wolfg... |
manipopopo/tensorflow | refs/heads/master | tensorflow/python/estimator/training.py | 2 | # 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... |
coursemdetw/2014cdb | refs/heads/master | wsgi/static/Brython2.1.3-20140704-213726/Lib/multiprocessing/util.py | 696 | #
# Module providing various facilities to other parts of the package
#
# multiprocessing/util.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
import sys
import functools
import os
import itertools
import weakref
import atexit
import threading # we want threading to ... |
dominikl/bioformats | refs/heads/develop | cpp/ext/gtest-1.7.0/test/gtest_xml_outfiles_test.py | 2526 | #!/usr/bin/env python
#
# Copyright 2008, 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... |
openstack/poppy | refs/heads/master | tests/unit/provider/mock/test_certificates.py | 2 | # Copyright (c) 2016 Rackspace, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
litebitcoins/litebitcoin | refs/heads/master | test/functional/bip68-112-113-p2p.py | 16 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test activation of the first version bits soft fork.
This soft fork will activate the following BIPS:
... |
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/communication/azure-communication-sms/azure/communication/sms/_generated/operations/__init__.py | 2 | # 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 may ... |
6112/servo | refs/heads/master | tests/wpt/web-platform-tests/fetch/nosniff/resources/worker.py | 219 | def main(request, response):
type = request.GET.first("type", None)
content = "// nothing to see here"
content += "\n"
content += "this.postMessage('hi')"
response.add_required_headers = False
response.writer.write_status(200)
response.writer.write_header("x-content-type-options", "nosniff... |
Precis/Diamond | refs/heads/master | src/collectors/resqueweb/test/testresqueweb.py | 31 | #!/usr/bin/python
# coding=utf-8
##########################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from diamond.collector import Collector
from resqueweb import Resq... |
himanshu-dixit/oppia | refs/heads/develop | core/storage/job/gae_models.py | 4 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... |
jelugbo/hebs_master | refs/heads/master | common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore_bulk_operations.py | 6 | import copy
import ddt
import unittest
from bson.objectid import ObjectId
from mock import MagicMock, Mock, call
from xmodule.modulestore.split_mongo.split import SplitBulkWriteMixin
from xmodule.modulestore.split_mongo.mongo_connection import MongoConnection
from opaque_keys.edx.locator import CourseLocator
class T... |
beni55/edx-platform | refs/heads/master | lms/djangoapps/shoppingcart/exceptions.py | 191 | """
Exceptions for the shoppingcart app
"""
# (Exception Class Names are sort of self-explanatory, so skipping docstring requirement)
# pylint: disable=missing-docstring
class PaymentException(Exception):
pass
class PurchasedCallbackException(PaymentException):
pass
class InvalidCartItem(PaymentException)... |
mtat76/atm-py | refs/heads/master | build/lib/atmPy/tools/math_functions.py | 7 | import numpy as np
def gauss(x, amp, pos, sigma):
""" amp,x_center,sigma
x: array"""
return amp * np.exp(-(x - pos) ** 2 / (2. * sigma ** 2)) |
sanketdjain/box-python-sdk | refs/heads/master | test/functional/test_rate_limits.py | 5 | # coding: utf-8
from __future__ import unicode_literals
def test_too_many_requests_causes_retry(box_client, mock_box, monkeypatch):
monkeypatch.setattr(mock_box, 'RATE_LIMIT_THRESHOLD', 1)
box_client.folder('0').get()
box_client.folder('0').get()
assert len(mock_box.requests) == 6 # 3 auth requests,... |
beni55/networkx | refs/heads/master | networkx/algorithms/centrality/eigenvector.py | 8 | # coding=utf8
"""
Eigenvector centrality.
"""
# Copyright (C) 2004-2015 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
__author__ = "\n".join(['Aric Hagberg (aric.hagberg@gmail.com)',
... |
renaelectronics/linuxcnc | refs/heads/master | src/hal/user_comps/vismach/rotarydelta.py | 6 | #!/usr/bin/python
# Copyright 2013 Jeff Epler <jepler@unpythonic.net>
#
# 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 ... |
avoinsystems/odoo | refs/heads/8.0 | addons/email_template/wizard/mail_compose_message.py | 197 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
MacHu-GWU/filetool-project | refs/heads/master | filetool/meth.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import hashlib
def repr_data_size(size_in_bytes, precision=2):
"""Return human readable string represent of a file size. Doesn"t support
size greater than 1EB.
For example:
- 100 bytes => 100 B
- 100,000 bytes => 97.66 KB
- 100,000,000... |
kjc88/sl4a | refs/heads/master | python/src/Mac/Modules/te/tescan.py | 34 | # Scan an Apple header file, generating a Python file of generator calls.
import sys
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner
LONG = "TextEdit"
SHORT = "te"
OBJECT = "TEHandle"
def main():
input = LONG + ".h"
output = SHORT + "gen.py"
defsoutput... |
moopet/django-flatpage-meta | refs/heads/master | flatpage_meta/templatetags/flatpage_meta_tags.py | 1 | from django import template
from django.contrib.sites.models import Site
register = template.Library()
@register.inclusion_tag('flatpage_meta_tags.html')
def flatpage_meta_tags(flatpage=None):
flatpage_tags = flatpage.meta_tag_set.all() if flatpage else None
site_tags = Site.objects.get_current().meta_tag_set... |
eleonrk/SickRage | refs/heads/master | lib/github/GistComment.py | 10 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... |
geodynamics/pylith | refs/heads/hackathon/static-greens-fns | tests/fullscale/linearelasticity/nofaults-3d/sheartraction_rate_gendb.py | 1 | #!/usr/bin/env nemesis
#
# ----------------------------------------------------------------------
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University of Chicago
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://g... |
leesavide/pythonista-docs | refs/heads/master | Documentation/matplotlib/mpl_examples/pylab_examples/legend_demo4.py | 9 | import matplotlib.pyplot as plt
ax = plt.subplot(311)
b1 = ax.bar([0, 1, 2], [0.2, 0.3, 0.1], width=0.4,
label="Bar 1", align="center")
b2 = ax.bar([0.5, 1.5, 2.5], [0.3, 0.2, 0.2], color="red", width=0.4,
label="Bar 2", align="center")
ax.legend()
ax = plt.subplot(312)
err1 = ax.errorbar(... |
grani/grpc | refs/heads/UnityClient.1.2.0 | src/python/grpcio/grpc/framework/foundation/callable_util.py | 29 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
santod/android_GE_kernel_htc_m7vzw | refs/heads/master | tools/perf/util/setup.py | 4998 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... |
ShassAro/ShassAro | refs/heads/master | Bl_project/blVirtualEnv/lib/python2.7/site-packages/pip/_vendor/colorama/__init__.py | 197 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
from .initialise import init, deinit, reinit
from .ansi import Fore, Back, Style
from .ansitowin32 import AnsiToWin32
__version__ = '0.3.1'
|
you21979/phantomjs | refs/heads/2.0 | src/breakpad/src/tools/gyp/test/sibling/gyptest-all.py | 151 | #!/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 TestGyp
test = TestGyp.TestGyp()
test.run_gyp('build/all.gyp', chdir='src')
test.build('build/all.gyp', test.ALL, chdir='... |
hurricup/intellij-community | refs/heads/master | python/testData/refactoring/extractsuperclass/moveExtends/source_module.after.py | 320 | from dest_module import NewParent
class MyClass(NewParent):
pass |
akosyakov/intellij-community | refs/heads/master | python/testData/override/py3k_after.py | 83 | class A:
def m(self):
pass
class B(A):
def m(self):
<selection>super().m()</selection>
|
ubgarbage/gae-blog | refs/heads/master | external_auth/urls.py | 1 | import django.conf.urls.defaults
import google_login.urls
import mailru_login.urls
import yandex_login.urls
import inboxru_login.urls
urlpatterns = django.conf.urls.defaults.patterns( '',
( 'google/', django.conf.urls.defaults.include(google_login.urls) ),
( 'mailru/', d... |
marado/youtube-dl | refs/heads/master | youtube_dl/extractor/krasview.py | 5 | # encoding: utf-8
from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
int_or_none,
js_to_json,
)
class KrasViewIE(InfoExtractor):
IE_DESC = 'Красвью'
_VALID_URL = r'https?://krasview\.ru/(?:video|embed)/(?P<id>\d+)'
_TEST = {
'url'... |
xaime/sneaks | refs/heads/master | plugins/__init__.py | 2 | __author__ = 'Xaime'
|
mollstam/UnrealPy | refs/heads/master | UnrealPyEmbed/Source/Python/Lib/python27/test/pydocfodder.py | 195 | """Something just to look at via pydoc."""
import types
class A_classic:
"A classic class."
def A_method(self):
"Method defined in A."
def AB_method(self):
"Method defined in A and B."
def AC_method(self):
"Method defined in A and C."
def AD_method(self):
"Method de... |
amyvmiwei/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/lib2to3/refactor.py | 71 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Refactoring framework.
Used as a main program, this can refactor any number of files and/or
recursively descend down directories. Imported as a module, this
provides infrastructure to write your own refactoring too... |
huntxu/fuel-web | refs/heads/master | nailgun/nailgun/objects/plugin_link.py | 2 | # -*- coding: utf-8 -*-
# Copyright 2014 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
drzaeus77/pyroute2 | refs/heads/master | examples/nl80211_interfaces.py | 8 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
from pyroute2.iwutil import IW
iw = IW()
for q in iw.get_interfaces_dump():
phyname = 'phy%i' % int(q.get_attr('NL80211_ATTR_WIPHY'))
print('%i\t%s\t%s\t%s' % (q.get_attr('NL80211_ATTR_IFINDEX'), phyname,
q.get_attr('NL80211_ATTR_IFN... |
2014c2g2/2014c2 | refs/heads/master | exts/wsgi/static/Brython2.1.0-20140419-113919/Lib/xml/etree/ElementInclude.py | 784 | #
# ElementTree
# $Id: ElementInclude.py 3375 2008-02-13 08:05:08Z fredrik $
#
# limited xinclude support for element trees
#
# history:
# 2003-08-15 fl created
# 2003-11-14 fl fixed default loader
#
# Copyright (c) 2003-2004 by Fredrik Lundh. All rights reserved.
#
# fredrik@pythonware.com
# http://www.pythonware... |
manthey/girder | refs/heads/master | girder/models/group.py | 3 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2013 Kitware 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 cop... |
josenavas/glowing-dangerzone | refs/heads/master | gd/config.py | 1 | # -----------------------------------------------------------------------------
# Copyright (c) 2014--, The biocore Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ----------------------------------------------... |
sani-coop/tinjaca | refs/heads/master | addons/propuestas/models/__init__.py | 1 | # -*- coding: utf-8 -*-
import solicitantes
import unidades_productivas
import propuestas
import garantias
import avalistas
import conyuges
import inversiones
import referencias_solicitante
import familiares
import referencias_avalistas
import cuentas_bancarias_avalista
import talleres
|
StrellaGroup/erpnext | refs/heads/develop | erpnext/education/doctype/student_admission/student_admission.py | 22 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import nowdate
from frappe.website.website_generator import WebsiteGenerator
clas... |
alangwansui/mtl_ordercenter | refs/heads/master | openerp/addons/analytic_user_function/__init__.py | 441 | # -*- 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... |
jcoady9/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/test/crashers/nasty_eq_vs_dict.py | 63 | # from http://mail.python.org/pipermail/python-dev/2001-June/015239.html
# if you keep changing a dictionary while looking up a key, you can
# provoke an infinite recursion in C
# At the time neither Tim nor Michael could be bothered to think of a
# way to fix it.
class Yuck:
def __init__(self):
self.i =... |
akretion/odoo | refs/heads/12-patch-paging-100-in-o2m | addons/account_facturx/__init__.py | 36 | # -*- encoding: utf-8 -*-
from . import models
|
general-language-syntax/GLS | refs/heads/master | test/integration/ListSliceIndex/zero to number.py | 4 | #
abc[0:7]
#
|
tensorflow/models | refs/heads/master | official/vision/image_classification/resnet/resnet_ctl_imagenet_main.py | 1 | # Copyright 2021 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... |
tseaver/gcloud-python | refs/heads/master | kms/tests/unit/gapic/v1/test_key_management_service_client_v1.py | 1 | # -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
nodice73/hspipeline | refs/heads/master | web/env/lib/python2.7/site-packages/pip/exceptions.py | 344 | """Exceptions used throughout package"""
from __future__ import absolute_import
from itertools import chain, groupby, repeat
from pip._vendor.six import iteritems
class PipError(Exception):
"""Base pip exception"""
class InstallationError(PipError):
"""General exception during installation"""
class Unin... |
fragforce/fragforce.org | refs/heads/dev | ffsite/views/__init__.py | 3 | # Import all subs
from .events import *
from .sites import *
from .static import *
|
smikes/node-gyp | refs/heads/master | gyp/gyptest.py | 80 | #!/usr/bin/env python
# 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.
__doc__ = """
gyptest.py -- test runner for GYP tests.
"""
import os
import optparse
import subprocess
import sys
class CommandRunner:
"... |
mikewiebe-ansible/ansible | refs/heads/devel | lib/ansible/module_utils/network/vyos/facts/lag_interfaces/lag_interfaces.py | 21 | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The vyos lag_interfaces fact class
It is in this file the configuration is collected from the device
for a given resource, parsed, and the facts tree is populated
based o... |
colinligertwood/odoo | refs/heads/master | openerp/addons/base/tests/test_base.py | 64 | import unittest2
import openerp.tests.common as common
from openerp.osv.orm import except_orm
class test_base(common.TransactionCase):
def setUp(self):
super(test_base,self).setUp()
self.res_partner = self.registry('res.partner')
self.res_users = self.registry('res.users')
self.re... |
bayusantoso/final-assignment-web-ontology | refs/heads/master | IMPLEMENTATION/Application/SourceCode/GOApps/flask/Lib/site-packages/pip/_vendor/distlib/version.py | 426 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2014 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""
Implementation of a flexible versioning scheme providing support for PEP-386,
distribute-compatible and semantic versioning.
"""
import logging
import re
from .compat import string_types
... |
sampadsaha5/sympy | refs/heads/master | sympy/ntheory/continued_fraction.py | 33 | from sympy.core.numbers import Integer, Rational
def continued_fraction_periodic(p, q, d=0):
r"""
Find the periodic continued fraction expansion of a quadratic irrational.
Compute the continued fraction expansion of a rational or a
quadratic irrational number, i.e. `\frac{p + \sqrt{d}}{q}`, where
... |
Metaswitch/horizon | refs/heads/master | openstack_dashboard/dashboards/project/loadbalancers/tabs.py | 30 | # Copyright 2013, Big Switch Networks, 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 applic... |
mfellner/maximilianfellner.eu | refs/heads/master | app/shared/models/__init__.py | 1 | # -*- coding: utf-8 -*-
from abc import abstractmethod, ABCMeta
from flask.json import jsonify
from flask.ext.sqlalchemy import SQLAlchemy
import serialize
db = SQLAlchemy()
class JSendResponse(serialize.SerializableMixin):
"""Base class for restful JSON responses according to the JSend specification (http://... |
Ferada/rope | refs/heads/master | ropetest/objectinfertest.py | 4 | import unittest
import rope.base.project
import rope.base.builtins
from rope.base import libutils
from ropetest import testutils
class ObjectInferTest(unittest.TestCase):
def setUp(self):
super(ObjectInferTest, self).setUp()
self.project = testutils.sample_project()
def tearDown(self):
... |
andrewleech/SickRage | refs/heads/master | lib/sqlalchemy/engine/threadlocal.py | 79 | # engine/threadlocal.py
# Copyright (C) 2005-2014 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
"""Provides a thread-local transactional wrapper around the root Engine class.
... |
BeegorMif/HTPC-Manager | refs/heads/master | lib/hachoir_parser/image/ico.py | 90 | """
Microsoft Windows icon and cursor file format parser.
Author: Victor Stinner
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (FieldSet, ParserError,
UInt8, UInt16, UInt32, Enum, RawBytes)
from lib.hachoir_parser.image.common import PaletteRGBA
from lib.hachoir_core.endian import L... |
alqfahad/odoo | refs/heads/8.0 | openerp/tests/addons/test_translation_import/__init__.py | 2355 | # -*- coding: utf-8 -*-
import models
|
caronc/nzbget-subliminal | refs/heads/master | Subliminal/apprise/plugins/NotifyTwitter/tweepy/models.py | 1 | # Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
from __future__ import absolute_import, print_function
from .utils import parse_datetime, parse_html_value, parse_a_href
class ResultSet(list):
"""A list like object that holds results from a Twitter API query."""
def __init__(self, ... |
wwj718/ANALYSE | refs/heads/master | lms/djangoapps/shoppingcart/migrations/0013_auto__add_field_invoice_is_valid.py | 13 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Invoice.is_valid'
db.add_column('shoppingcart_invoice', 'is_valid',
se... |
brandsoulmates/incubator-airflow | refs/heads/master | tests/www/api/experimental/test_endpoints.py | 11 | # -*- 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
... |
shaufi/odoo | refs/heads/8.0 | addons/website_event_sale/__openerp__.py | 307 | # -*- coding: utf-8 -*-
{
'name': "Online Event's Tickets",
'category': 'Hidden',
'summary': "Sell Your Event's Tickets",
'website': 'https://www.odoo.com/page/events',
'version': '1.0',
'description': """
Online Event's Tickets
======================
""",
'author': 'OpenERP SA',
... |
unicefuganda/ureport | refs/heads/master | functional_test/scenarios/nose_examples_test.py | 2 | from nose.tools import assert_equal
from nose.tools import assert_not_equal
from nose.tools import assert_raises
from nose.tools import raises
class TestNoseExamples():
@classmethod
def setup_class(klass):
"""This method is run once for each class before any tests are run"""
@classmethod
... |
fw1121/CheckM | refs/heads/master | scripts/createMarketSetPlots.py | 3 | import os
for r in ['Archaea', 'Bacteria']:
for t in ['1.0', '0.99', '0.98', '0.97', '0.96', '0.95']:
os.system('./markerSetTest.py -T ' + r + ' -u ' + t + ' -s ' + t)
|
throwable-one/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/views/decorators/vary.py | 307 | try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.4 fallback.
from django.utils.cache import patch_vary_headers
from django.utils.decorators import available_attrs
def vary_on_headers(*headers):
"""
A view decorator that adds the specified heade... |
icewater246/django-rest-framework-jwt | refs/heads/master | tests/test_authentication.py | 14 | from django.http import HttpResponse
from django.test import TestCase
from django.utils import unittest
from django.conf.urls import patterns
from rest_framework import permissions, status
try:
from rest_framework_oauth.authentication import OAuth2Authentication
except ImportError:
try:
from rest_frame... |
Cakin-Kwong/three.js | refs/heads/master | utils/exporters/blender/addons/io_three/exporter/base_classes.py | 125 | from . import utilities
from .. import constants, exceptions
class BaseClass(constants.BASE_DICT):
"""Base class which inherits from a base dictionary object."""
_defaults = {}
def __init__(self, parent=None, type=None):
constants.BASE_DICT.__init__(self)
self._type = type
self.... |
iivic/BoiseStateX | refs/heads/master | lms/djangoapps/licenses/migrations/0001_initial.py | 188 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'CourseSoftware'
db.create_table('licenses_coursesoftware', (
('id', self.gf('dja... |
skirsdeda/django | refs/heads/master | django/contrib/gis/gdal/tests/test_geom.py | 94 | import json
from binascii import b2a_hex
try:
from django.utils.six.moves import cPickle as pickle
except ImportError:
import pickle
import unittest
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geometry.test_data import TestDataMixin
from django.utils.six... |
aeischeid/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/localpaths.py | 40 | import os
import sys
here = os.path.abspath(os.path.split(__file__)[0])
repo_root = os.path.abspath(os.path.join(here, os.pardir))
sys.path.insert(0, os.path.join(repo_root, "tools"))
sys.path.insert(0, os.path.join(repo_root, "tools", "six"))
sys.path.insert(0, os.path.join(repo_root, "tools", "html5lib"))
sys.path.... |
spcui/tp-qemu | refs/heads/master | qemu/tests/vhost_with_cgroup.py | 3 | import logging
from autotest.client.shared import error
from autotest.client import utils
from virttest.env_process import preprocess
try:
from virttest.staging.utils_cgroup import Cgroup, CgroupModules
except ImportError:
# TODO: Obsoleted path used prior autotest-0.15.2/virttest-2013.06.24
from autotest.... |
drayanaindra/shoop | refs/heads/master | shoop/addons/__init__.py | 7 | # This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from shoop.apps import AppConfig
from .manager import add_enabled_addons
__all__ = ["add_enabled_ad... |
yosshy/nova | refs/heads/master | nova/tests/unit/objects/test_external_event.py | 77 | # Copyright 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
#
# Unless required by applicable law or a... |
FreeSchoolHackers/data_hacking | refs/heads/master | data_hacking/min_hash/__init__.py | 6 | '''Package for Banded Min Hash based Similarity Calculations'''
from min_hash import *
|
EliasTouil/simpleBlog | refs/heads/master | simpleBlog/Lib/site-packages/wheel/pep425tags.py | 233 | """Generate and work with PEP 425 Compatibility Tags."""
import sys
import warnings
try:
import sysconfig
except ImportError: # pragma nocover
# Python < 2.7
import distutils.sysconfig as sysconfig
import distutils.util
def get_config_var(var):
try:
return sysconfig.get_config_var(var)
... |
pouyana/teireader | refs/heads/master | webui/applications/admin/languages/it.py | 8 | # coding: utf8
{
'!langcode!': 'it',
'!langname!': 'Italiano',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" è un\'espressione opzionale come "campo1=\'nuovo valore\'". Non si può fare "update" o "delete" dei risultati di un JOIN ',
'%s %%{... |
petjaui/petjaui-cards | refs/heads/master | node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/xcodeproj_file.py | 505 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Xcode project file generator.
This module is both an Xcode project file generator and a documentation of the
Xcode project file format. Knowledge of the proje... |
GunoH/intellij-community | refs/heads/master | python/testData/inspections/PyUnresolvedReferencesInspection/StubWithGetAttr/complete.py | 19 | def a():
return 1
def b():
return "" |
KiChjang/servo | refs/heads/master | tests/wpt/web-platform-tests/webdriver/tests/element_send_keys/conftest.py | 42 | import pytest
@pytest.fixture
def create_files(tmpdir_factory):
def inner(filenames):
filelist = []
tmpdir = tmpdir_factory.mktemp("tmp")
for filename in filenames:
fh = tmpdir.join(filename)
fh.write(filename)
filelist.append(fh)
return filelis... |
calthecoder/zealous-fibula | refs/heads/master | enemies.py | 1 | import random, sys
from time import sleep
enemylist = ['Goblin', 'Ogre', 'Giant Spider', 'Dragon', 'Orc']
class Enemy:
'''A base class for all enemies'''
def __init__(self, name, hp, description, pview):
'''Creates a new enemy
:param name: the name of the enemy
:param hp: the hit poi... |
skyddv/neutron | refs/heads/master | neutron/db/migration/alembic_migrations/versions/35a0f3365720_add_port_security_in_ml2.py | 47 | # Copyright 2015 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 law ... |
m-labs/linux-milkymist | refs/heads/ng | tools/perf/scripts/python/sctop.py | 11180 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
JimCircadian/ansible | refs/heads/devel | test/units/plugins/strategy/test_strategy_linear.py | 18 | # Copyright (c) 2018 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.compat.tests import unittest
from ansible.compat.tests.... |
pacoqueen/upy | refs/heads/master | formularios/albaranes_de_salida.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright (C) 2005-2008 Francisco José Rodríguez Bogado, #
# Diego Muñoz Escalante. #
# (pacoqueen@users.sourceforge.ne... |
Enlik/entropy | refs/heads/master | lib/entropy/dep.py | 5 | # -*- coding: utf-8 -*-
# Entropy miscellaneous tools module
"""
@author: Fabio Erculiani <lxnay@sabayon.org>
@contact: lxnay@sabayon.org
@copyright: Fabio Erculiani
@license: GPL-2
B{Entropy dependency functions module}.
This module contains Entropy package dependency manipulation functions.
... |
blacklin/kbengine | refs/heads/master | kbe/src/lib/python/Lib/test/test_hash.py | 83 | # test the invariant that
# iff a==b then hash(a)==hash(b)
#
# Also test that hash implementations are inherited as expected
import datetime
import os
import sys
import unittest
from test.script_helper import assert_python_ok
from collections import Hashable
IS_64BIT = sys.maxsize > 2**32
def lcg(x, length=16):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.